doc updates
This commit is contained in:
parent
93c1295aa9
commit
786a73138e
|
@ -81,4 +81,7 @@ https://github.com/olikraus/u8g2 ChangeLog
|
|||
2016-1-xx v2.11.x olikraus@gmail.com
|
||||
* Support for LC7981 (issue 134)
|
||||
* Support for PCF8812 (issue 135)
|
||||
* Support for ST7567, Pax Instruments GLCD Shield (issue 138)
|
||||
* Fixed wrong half-move notation in Little Rook Chess (issue 137)
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
|
||||
Command comparison between ST7565, NT7534 and UC1701 display controller
|
||||
|
||||
use monospaced font for this txt file
|
||||
|
||||
ST7565 NT7534 UC1701
|
||||
|
||||
0x000 00000000 Lo Col Lo Col Lo Col
|
||||
...
|
||||
0x00f 00001111 Lo Col Lo Col Lo Col
|
||||
0x010 00010000 Hi Col Hi Col Hi Col
|
||||
...
|
||||
0x01f 00011111 Hi Col Hi Col Hi Col
|
||||
0x020 00100000 Res Ratio Res Ratio Res Ratio
|
||||
...
|
||||
0x027 00100111 Res Ratio Res Ratio Res Ratio
|
||||
0x028 00101000 Pwr Ctrl Pwr Ctrl Pwr Ctrl
|
||||
...
|
||||
0x02f 00101111 Pwr Ctrl Pwr Ctrl Pwr Ctrl
|
||||
0x030 00110000 - PM Duty
|
||||
...
|
||||
0x037 00110111 - PM Duty
|
||||
0x038 00111000 - PM Bias
|
||||
...
|
||||
0x03f 00111111 - PM Bias
|
||||
0x040 01000000 Start Line Start Line Scroll Line?
|
||||
...
|
||||
0x07f 01111111 Start Line Start Line Scroll Line?
|
||||
0x080 10000000 - -
|
||||
0x081 10000001 Contrast Contrast Contrast
|
||||
0x082 10000010 - Part. Mode
|
||||
0x083 10000011 - Part. Mode
|
||||
0x084 10000100 - Stop NL Inv
|
||||
0x085 10000101 - Start NL Inv
|
||||
0x086 10000110 - -
|
||||
...
|
||||
0x08f 10001111 - -
|
||||
0x090 10010000 - -
|
||||
...
|
||||
0x09f 10011111 - -
|
||||
0x0a0 10100000 Seg Normal Seg Normal Seg Normal
|
||||
0x0a1 10100001 Seg Reverse Seg Reverse Seg Reverse
|
||||
0x0a2 10100010 1/9 bias 1/9 bias 1/9 bias
|
||||
0x0a3 10100011 1/7 bias 1/7 bias 1/7 bias
|
||||
0x0a4 10100100 Normal Op Normal Op Normal Op
|
||||
0x0a5 10100101 All pt on All pt on All pt on
|
||||
0x0a6 10100110 Normal Op Normal Op Normal Op
|
||||
0x0a7 10100111 Inverse Inverse Inverse
|
||||
0x0a8 10101000 - - -
|
||||
0x0a9 10101001 - - -
|
||||
0x0aa 10101010 - - -
|
||||
0x0ab 10101011 - - -
|
||||
0x0ac 10101100 Indic. On Indic. On Indic. On
|
||||
0x0ad 10101101 Indic. Off Indic. Off Indic. Off
|
||||
0x0ae 10101110 Disp Off Disp Off Disp Off
|
||||
0x0af 10101111 Disp On Disp On Disp On
|
||||
0x0b0 10110000 Page Adr Page Adr Page Adr
|
||||
...
|
||||
0x0b7 10111111 Page Adr Page Adr Page Adr
|
||||
0x0c0 11000xxx Com Normal Com Normal Com Normal
|
||||
...
|
||||
0x0c7 11000xxx Com Normal Com Normal Com Normal
|
||||
0x0c8 11001xxx Com Reverse Com Reverse Com Reverse
|
||||
...
|
||||
0x0cf 11001xxx Com Reverse Com Reverse Com Reverse
|
||||
0x0d0 11010000 - - -
|
||||
0x0d1 11010001 - - -
|
||||
0x0d2 11010010 - - -
|
||||
0x0d3 11010011 - PM Line -
|
||||
0x0d4 11010100 - - -
|
||||
...
|
||||
0x0df 11011111 - - -
|
||||
0x0e0 11100000 Start R-M-W Start R-M-W Start R-M-W
|
||||
0x0e1 11100001 - - -
|
||||
0x0e2 11100010 Reset Reset Reset
|
||||
0x0e3 11100011 NOP NOP NOP
|
||||
0x0e4 11100100 - OSC Freq -
|
||||
0x0e5 11100101 - OSC Freq -
|
||||
0x0e6 11100110 - DC/DC Freq -
|
||||
0x0e7 11100111 - - -
|
||||
...
|
||||
0x0ef 11101111 - - -
|
||||
0x0ee 11101110 Stop R-M-W Stop R-M-W Stop R-M-W
|
||||
0x0f0 11110000 Test Mode Test Mode -
|
||||
0x0f1 11110001 Test Mode Test Mode -
|
||||
0x0f2 11110010 Test Mode Test Mode -
|
||||
0x0f3 11110011 Test Mode Test Mode -
|
||||
0x0f4 11110100 Test Mode Test Mode -
|
||||
0x0f5 11110101 Test Mode Test Mode -
|
||||
0x0f6 11110110 Test Mode Test Mode -
|
||||
0x0f7 11110111 Test Mode Test Mode -
|
||||
0x0f8 11111000 Test Mode Test Mode -
|
||||
0x0f9 11111001 Test Mode Test Mode -
|
||||
0x0fa 11111010 Test Mode Test Mode Adv Ctrl0
|
||||
0x0fb 11111011 Test Mode Test Mode Adv Ctrl1
|
||||
0x0fc 11111100 Test Mode Test Mode Test Mode
|
||||
0x0fd 11111101 Test Mode Test Mode Test Mode
|
||||
0x0fe 11111110 Test Mode Test Mode Test Mode
|
||||
0x0ff 11111111 Test Mode Test Mode Test Mode
|
||||
|
||||
|
||||
Conclusion (only from Datasheet documentation perspective)
|
||||
* Command set of the ST7565 is fully included in NT7534 and UC1701
|
||||
* Compared to ST7565, the UC1701 has an extra temperature control and
|
||||
wrap around option (both in Adv Ctrl0)
|
||||
* Compared to ST7565, the NT7534 has a partion mode (PM) option and
|
||||
allows setting of several frequencies.
|
||||
|
19
doc/faq.txt
19
doc/faq.txt
|
@ -13,3 +13,22 @@ https://github.com/olikraus/u8g2/wiki/u8g2setupcpp#wiring
|
|||
Q: My controller/interface combination is not listed in the examples.
|
||||
A: Yes, the complete list is here:
|
||||
https://github.com/olikraus/u8g2/wiki/u8g2setupcpp
|
||||
|
||||
Q: A T6963 misses columns on the display/has garbled output.
|
||||
A: Ensure that the T6963 operates in 8x8 mode:
|
||||
If the display module has two font select (FSx) pins, connect both to GND
|
||||
If the display module has one font select (FS) pin, connect it to GND
|
||||
|
||||
Q: My controller is not listed, What can I do?
|
||||
A: First check whether this controller is compatible to one of the supported
|
||||
controller:
|
||||
Supported: ST7565, Compatible: NT7534, SED1565, S1D15605, S6B0723
|
||||
Supported: SED1330, Compatible: SED1335, RA8835, S1D3305
|
||||
Supported: LC7981, Compatible: NT7086, (maybe also: HD61830)
|
||||
This table just reflects my current knowleds. It is not tested and my not be true at all.
|
||||
If your controller for a monochrome display is not listed,
|
||||
you could raise an issue in the u8g2 issue tracker.
|
||||
|
||||
Q: My display controller is listed, but the display dimension is not supported.
|
||||
A: Raise an issue in the u8g2 tracker "https://github.com/olikraus/u8g2/issues"
|
||||
|
||||
|
|
|
@ -0,0 +1,175 @@
|
|||
/*
|
||||
|
||||
HelloWorld.ino
|
||||
|
||||
Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
|
||||
|
||||
Copyright (c) 2016, olikraus@gmail.com
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list
|
||||
of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <U8g2lib.h>
|
||||
|
||||
#ifdef U8X8_HAVE_HW_SPI
|
||||
#include <SPI.h>
|
||||
#endif
|
||||
#ifdef U8X8_HAVE_HW_I2C
|
||||
#include <Wire.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
U8glib Example Overview:
|
||||
Frame Buffer Examples: clearBuffer/sendBuffer. Fast, but may not work with all Arduino boards because of RAM consumption
|
||||
Page Buffer Examples: firstPage/nextPage. Less RAM usage, should work with all Arduino boards.
|
||||
U8x8 Text Only Example: No RAM usage, direct communication with display controller. No graphics, 8x8 Text only.
|
||||
|
||||
This is a page buffer example.
|
||||
*/
|
||||
|
||||
// Please UNCOMMENT one of the contructor lines below
|
||||
// U8g2 Contructor List (Picture Loop Page Buffer)
|
||||
// The complete list is available here: https://github.com/olikraus/u8g2/wiki/u8g2setupcpp
|
||||
// Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected
|
||||
//U8G2_SSD1306_128X64_NONAME_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 12, /* dc=*/ 4, /* reset=*/ 6); // Arduboy (Production, Kickstarter Edition)
|
||||
//U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_SSD1306_128X64_NONAME_1_3W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8);
|
||||
//U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* reset=*/ 8);
|
||||
//U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // All Boards without Reset of the Display
|
||||
//U8G2_SSD1306_128X64_NONAME_1_6800 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8);
|
||||
//U8G2_SSD1306_128X64_NONAME_1_8080 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8);
|
||||
//U8G2_SSD1306_128X64_VCOMH0_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range
|
||||
//U8G2_SH1106_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_SH1106_128X64_VCOMH0_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range
|
||||
//U8G2_SSD1306_128X32_UNIVISION_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 21, /* data=*/ 20, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather M0 Basic Proto + FeatherWing OLED
|
||||
//U8G2_SSD1306_128X32_UNIVISION_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather ESP8266/32u4 Boards + FeatherWing OLED
|
||||
//U8G2_SSD1306_128X32_UNIVISION_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // Adafruit ESP8266/32u4/ARM Boards + FeatherWing OLED
|
||||
//U8G2_SSD1306_64X48_ER_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // EastRising 0.66" OLED breakout board, Uno: A4=SDA, A5=SCL, 5V powered
|
||||
//U8G2_SSD1322_NHD_256X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h
|
||||
//U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h
|
||||
//U8G2_SSD1325_NHD_128X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_SSD1325_NHD_128X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_LD7032_60X32_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* cs=*/ 9, /* dc=*/ 10, /* reset=*/ 8); // SW SPI Nano Board
|
||||
//U8G2_LD7032_60X32_1_4W_SW_I2C u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* reset=*/ U8X8_PIN_NONE); // NOT TESTED!
|
||||
//U8G2_UC1701_EA_DOGS102_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_UC1701_EA_DOGS102_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_PCD8544_84X48_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display
|
||||
//U8G2_PCD8544_84X48_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display
|
||||
//U8G2_PCF8812_96X65_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814
|
||||
//U8G2_PCF8812_96X65_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814
|
||||
//U8G2_KS0108_128X64_1 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ U8X8_PIN_NONE, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low!
|
||||
//U8G2_KS0108_ERM19264_1 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ 16, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low!
|
||||
//U8G2_ST7920_192X32_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ U8X8_PIN_NONE, /*dc=*/ 17, /*reset=*/ U8X8_PIN_NONE);
|
||||
//U8G2_ST7920_192X32_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 18 /* A4 */ , /* data=*/ 16 /* A2 */, /* CS=*/ 17 /* A3 */, /* reset=*/ U8X8_PIN_NONE);
|
||||
//U8G2_ST7920_128X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18 /* A4 */, /*cs=*/ U8X8_PIN_NONE, /*dc/rs=*/ 17 /* A3 */, /*reset=*/ 15 /* A1 */); // Remember to set R/W to 0
|
||||
//U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 18 /* A4 */ , /* data=*/ 16 /* A2 */, /* CS=*/ 17 /* A3 */, /* reset=*/ U8X8_PIN_NONE);
|
||||
//U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* CS=*/ 10, /* reset=*/ 8);
|
||||
//U8G2_ST7920_128X64_1_HW_SPI u8g2(U8G2_R0, /* CS=*/ 10, /* reset=*/ 8);
|
||||
//U8G2_ST7565_EA_DOGM128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_ST7565_EA_DOGM128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_ST7565_ZOLEN_128X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
U8G2_ST7565_ZOLEN_128X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_ST7565_LM6059_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_ST7565_LM6059_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_ST7565_NHD_C12832_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_ST7565_NHD_C12832_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_ST7567_PI_132X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6
|
||||
//U8G2_ST7567_PI_132X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6
|
||||
//U8G2_LC7981_160X80_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND
|
||||
//U8G2_T6963_240X128_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND
|
||||
//U8G2_T6963_256X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND
|
||||
//U8G2_SED1330_240X128_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect /RD = E with +5V, enable is /WR = RW, FG with GND, 14=Uno Pin A0
|
||||
//U8G2_SED1330_240X128_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // A0 is dc pin, /WR = RW = GND, enable is /RD = E
|
||||
//U8G2_RA8835_NHD_240X128_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect /RD = E with +5V, enable is /WR = RW, FG with GND, 14=Uno Pin A0
|
||||
//U8G2_RA8835_NHD_240X128_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // A0 is dc pin, /WR = RW = GND, enable is /RD = E
|
||||
//U8G2_UC1604_JLX19264_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_UC1604_JLX19264_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_UC1608_ERC24064_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due ERC24064-1 Test Setup
|
||||
//U8G2_UC1608_240X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due ERC24064-1 Test Setup
|
||||
//U8G2_UC1610_EA_DOGXL160_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE);
|
||||
//U8G2_UC1610_EA_DOGXL160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE);
|
||||
//U8G2_UC1611_EA_DOGM240_1_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, DOGM240 Test Board
|
||||
//U8G2_UC1611_EA_DOGM240_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board
|
||||
//U8G2_UC1611_EA_DOGXL240_1_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, DOGXL240 Test Board
|
||||
//U8G2_UC1611_EA_DOGXL240_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board
|
||||
//U8G2_SSD1606_172X72_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// End of constructor list
|
||||
|
||||
void setup(void) {
|
||||
|
||||
/* U8g2 Project: SSD1306 Test Board */
|
||||
//pinMode(10, OUTPUT);
|
||||
//pinMode(9, OUTPUT);
|
||||
//digitalWrite(10, 0);
|
||||
//digitalWrite(9, 0);
|
||||
|
||||
/* U8g2 Project: T6963 Test Board */
|
||||
//pinMode(18, OUTPUT);
|
||||
//digitalWrite(18, 1);
|
||||
|
||||
/* U8g2 Project: KS0108 Test Board */
|
||||
//pinMode(16, OUTPUT);
|
||||
//digitalWrite(16, 0);
|
||||
|
||||
/* U8g2 Project: LC7981 Test Board, connect RW to GND */
|
||||
//pinMode(17, OUTPUT);
|
||||
//digitalWrite(17, 0);
|
||||
|
||||
/* U8g2 Project: Pax Instruments Shield: Enable Backlight */
|
||||
//pinMode(6, OUTPUT);
|
||||
//digitalWrite(6, 0);
|
||||
|
||||
u8g2.begin();
|
||||
}
|
||||
|
||||
uint8_t m = 24;
|
||||
|
||||
void loop(void) {
|
||||
char m_str[3];
|
||||
strcpy(m_str, u8x8_u8toa(m, 2));
|
||||
u8g2.firstPage();
|
||||
do {
|
||||
u8g2.setFont(u8g2_font_logisoso62_tn);
|
||||
u8g2.drawStr(0,63,"9");
|
||||
u8g2.drawStr(33,63,":");
|
||||
u8g2.drawStr(50,63,m_str);
|
||||
} while ( u8g2.nextPage() );
|
||||
delay(1000);
|
||||
m++;
|
||||
if ( m == 60 )
|
||||
m = 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
#
|
||||
# Makefile.180 for Arduino/AVR
|
||||
#
|
||||
# Note:
|
||||
# Display list make database: make -p -f/dev/null | less
|
||||
|
||||
|
||||
# Install path of the arduino software. Requires a '/' at the end.
|
||||
ARDUINO_PATH:=/home/kraus/prg/arduino-1.8.0/
|
||||
|
||||
# Board (and prozessor) information: see $(ARDUINO_PATH)hardware/arduino/avr/boards.txt
|
||||
# Some examples:
|
||||
# BOARD DESCRIPTION
|
||||
# uno Arduino Uno
|
||||
# atmega328 Arduino Duemilanove or Nano w/ ATmega328
|
||||
# diecimila Arduino Diecimila, Duemilanove, or Nano w/ ATmega168
|
||||
# mega Arduino Mega
|
||||
# mega2560 Arduino Mega2560
|
||||
# mini Arduino Mini
|
||||
# lilypad328 LilyPad Arduino w/ ATmega328
|
||||
BOARD:=uno
|
||||
|
||||
# The unix device where we can reach the arduino board
|
||||
# Uno: /dev/ttyACM0
|
||||
# Duemilanove: /dev/ttyUSB0
|
||||
AVRDUDE_PORT:=/dev/ttyACM0
|
||||
|
||||
|
||||
|
||||
SRC_DIRS=$(ARDUINO_PATH)hardware/arduino/avr/cores/arduino/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/SPI/src/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/SPI/src/utility/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/Wire/src/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/Wire/src/utility/
|
||||
SRC_DIRS+=../../../../csrc/
|
||||
SRC_DIRS+=../../../../cppsrc/
|
||||
|
||||
#=== suffixes ===
|
||||
.SUFFIXES: .elf .hex .ino
|
||||
|
||||
#=== identify user files ===
|
||||
INOSRC:=$(shell ls *.ino)
|
||||
TARGETNAME=$(basename $(INOSRC))
|
||||
|
||||
#=== internal names ===
|
||||
LIBNAME:=$(TARGETNAME).a
|
||||
ELFNAME:=$(TARGETNAME).elf
|
||||
HEXNAME:=$(TARGETNAME).hex
|
||||
BINNAME:=$(TARGETNAME).bin
|
||||
DISNAME:=$(TARGETNAME).dis
|
||||
MAPNAME:=$(TARGETNAME).map
|
||||
|
||||
#=== replace standard tools ===
|
||||
CC:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-gcc
|
||||
CXX:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-g++
|
||||
AR:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-gcc-ar
|
||||
OBJCOPY:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-objcopy
|
||||
OBJDUMP:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-objdump
|
||||
SIZE:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-size
|
||||
|
||||
AVRDUDE = $(ARDUINO_PATH)hardware/tools/avr/bin/avrdude
|
||||
|
||||
|
||||
#=== get values from boards.txt ===
|
||||
BOARDS_TXT:=$(ARDUINO_PATH)hardware/arduino/avr/boards.txt
|
||||
|
||||
# get the MCU value from the $(BOARD).build.mcu variable. For the atmega328 board this is atmega328p
|
||||
MCU:=$(shell sed -n -e "s/$(BOARD).build.mcu=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# get the F_CPU value from the $(BOARD).build.f_cpu variable. For the atmega328 board this is 16000000
|
||||
F_CPU:=$(shell sed -n -e "s/$(BOARD).build.f_cpu=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# get variant subfolder
|
||||
VARIANT:=$(shell sed -n -e "s/$(BOARD).build.variant=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
UPLOAD_SPEED:=$(shell sed -n -e "s/$(BOARD).upload.speed=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# get the AVRDUDE_PROGRAMMER value from the $(BOARD).upload.protocol variable. For the atmega328 board this is stk500
|
||||
UPLOAD_PROTOCOL:=$(shell sed -n -e "s/$(BOARD).upload.protocol=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# use stk500v1, because stk500 will default to stk500v2
|
||||
#UPLOAD_PROTOCOL:=stk500v1
|
||||
|
||||
AVRDUDE_FLAGS = -V -F
|
||||
AVRDUDE_FLAGS += -C $(ARDUINO_PATH)/hardware/tools/avr/etc/avrdude.conf
|
||||
AVRDUDE_FLAGS += -p $(MCU)
|
||||
AVRDUDE_FLAGS += -P $(AVRDUDE_PORT)
|
||||
AVRDUDE_FLAGS += -c $(UPLOAD_PROTOCOL)
|
||||
AVRDUDE_FLAGS += -b $(UPLOAD_SPEED)
|
||||
AVRDUDE_FLAGS += -U flash:w:$(HEXNAME)
|
||||
|
||||
#=== get all include dirs ===
|
||||
INC_DIRS:=. $(SRC_DIRS) $(ARDUINO_PATH)hardware/arduino/avr/variants/$(VARIANT)
|
||||
INC_OPTS:=$(addprefix -I,$(INC_DIRS))
|
||||
|
||||
#=== get all source files ===
|
||||
CSRC:=$(shell ls $(addsuffix *.c,$(SRC_DIRS)) 2>/dev/null)
|
||||
CPPSRC:=$(shell ls $(addsuffix *.cpp,$(SRC_DIRS)) 2>/dev/null)
|
||||
|
||||
#=== get all obj files ===
|
||||
COBJ:=$(CSRC:.c=.o)
|
||||
CPPOBJ:=$(CPPSRC:.cpp=.o)
|
||||
OBJ:=$(COBJ) $(CPPOBJ) $(TARGETNAME).o
|
||||
|
||||
|
||||
#=== options ===
|
||||
|
||||
COMMON_FLAGS = -g -Os -DF_CPU=$(F_CPU) -mmcu=$(MCU)
|
||||
COMMON_FLAGS +=-DARDUINO=10800 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR
|
||||
COMMON_FLAGS +=-ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects
|
||||
COMMON_FLAGS +=$(INC_OPTS)
|
||||
CFLAGS:=$(COMMON_FLAGS) -std=gnu99 -Wstrict-prototypes -Wall -Wextra
|
||||
CXXFLAGS:=$(COMMON_FLAGS) -std=gnu++11 -fpermissive -fno-exceptions
|
||||
LDFLAGS:=-g -Os -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=$(MCU)
|
||||
LDLIBS:=-lm
|
||||
|
||||
all: $(HEXNAME) $(DISNAME)
|
||||
$(SIZE) $(ELFNAME)
|
||||
|
||||
.PHONY: debug
|
||||
debug:
|
||||
@echo $(MCU) $(F_CPU) $(VARIANT) $(UPLOAD_SPEED) $(UPLOAD_PROTOCOL)
|
||||
@echo $(SRC_DIRS)
|
||||
@echo $(CSRC)
|
||||
@echo $(CPPSRC)
|
||||
@echo $(INC_OPTS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) $(OBJ) $(HEXNAME) $(ELFNAME) $(LIBNAME) $(DISNAME) $(MAPNAME) $(BINNAME)
|
||||
|
||||
.PHONY: upload
|
||||
upload: $(HEXNAME)
|
||||
stty -F $(AVRDUDE_PORT) hupcl
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS)
|
||||
|
||||
# implicit rules
|
||||
.ino.cpp:
|
||||
@cp $< $@
|
||||
|
||||
.elf.hex:
|
||||
@$(OBJCOPY) -O ihex -R .eeprom $< $@
|
||||
|
||||
# explicit rules
|
||||
$(ELFNAME): $(LIBNAME)($(OBJ))
|
||||
$(LINK.o) $(LFLAGS) $(LIBNAME) $(LDLIBS) -o $@
|
||||
|
||||
$(DISNAME): $(ELFNAME)
|
||||
$(OBJDUMP) -D -S $< > $@
|
||||
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
//U8G2_SSD1322_NHD_256X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h
|
||||
//U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h
|
||||
//U8G2_SSD1325_NHD_128X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_SSD1325_NHD_128X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_SSD1325_NHD_128X64_1_4W_HW_SPI u8g2(U8G2_R2, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8G2_LD7032_60X32_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* cs=*/ 9, /* dc=*/ 10, /* reset=*/ 8); // SW SPI Nano Board
|
||||
//U8G2_LD7032_60X32_1_4W_SW_I2C u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* reset=*/ U8X8_PIN_NONE); // NOT TESTED!
|
||||
//U8G2_UC1701_EA_DOGS102_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
|
@ -271,6 +271,7 @@ void setup(void) {
|
|||
//digitalWrite(16, 0);
|
||||
|
||||
u8g2.begin();
|
||||
u8g2.setFlipMode(0);
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
|
|
|
@ -120,8 +120,8 @@
|
|||
|
||||
void chess_Init(u8g2_t *u8g, uint8_t body_color);
|
||||
|
||||
//#define ARDUBOY
|
||||
#define PI_SHIELD
|
||||
#define ARDUBOY
|
||||
//#define PI_SHIELD
|
||||
|
||||
#ifdef ARDUBOY
|
||||
/*=== ARDUBOY Production, Kickstarter Edition ===*/
|
||||
|
@ -2305,6 +2305,7 @@ void chess_Step(uint8_t keycode)
|
|||
chess_state = CHESS_STATE_GAME_END;
|
||||
else
|
||||
chess_state = CHESS_STATE_SELECT_START;
|
||||
//chess_state = CHESS_STATE_THINKING
|
||||
break;
|
||||
case CHESS_STATE_GAME_END:
|
||||
if ( chess_key_cmd != CHESS_KEY_NONE )
|
||||
|
|
|
@ -0,0 +1,146 @@
|
|||
#
|
||||
# Makefile.180 for Arduino/AVR
|
||||
#
|
||||
# Note:
|
||||
# Display list make database: make -p -f/dev/null | less
|
||||
|
||||
|
||||
# Install path of the arduino software. Requires a '/' at the end.
|
||||
ARDUINO_PATH:=/home/kraus/prg/arduino-1.8.0/
|
||||
|
||||
# Board (and prozessor) information: see $(ARDUINO_PATH)hardware/arduino/avr/boards.txt
|
||||
# Some examples:
|
||||
# BOARD DESCRIPTION
|
||||
# uno Arduino Uno
|
||||
# atmega328 Arduino Duemilanove or Nano w/ ATmega328
|
||||
# diecimila Arduino Diecimila, Duemilanove, or Nano w/ ATmega168
|
||||
# mega Arduino Mega
|
||||
# mega2560 Arduino Mega2560
|
||||
# mini Arduino Mini
|
||||
# lilypad328 LilyPad Arduino w/ ATmega328
|
||||
BOARD:=uno
|
||||
|
||||
# The unix device where we can reach the arduino board
|
||||
# Uno: /dev/ttyACM0
|
||||
# Duemilanove: /dev/ttyUSB0
|
||||
AVRDUDE_PORT:=/dev/ttyACM0
|
||||
|
||||
|
||||
|
||||
SRC_DIRS=$(ARDUINO_PATH)hardware/arduino/avr/cores/arduino/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/SPI/src/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/SPI/src/utility/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/Wire/src/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/Wire/src/utility/
|
||||
SRC_DIRS+=../../../../csrc/
|
||||
SRC_DIRS+=../../../../cppsrc/
|
||||
|
||||
#=== suffixes ===
|
||||
.SUFFIXES: .elf .hex .ino
|
||||
|
||||
#=== identify user files ===
|
||||
INOSRC:=$(shell ls *.ino)
|
||||
TARGETNAME=$(basename $(INOSRC))
|
||||
|
||||
#=== internal names ===
|
||||
LIBNAME:=$(TARGETNAME).a
|
||||
ELFNAME:=$(TARGETNAME).elf
|
||||
HEXNAME:=$(TARGETNAME).hex
|
||||
BINNAME:=$(TARGETNAME).bin
|
||||
DISNAME:=$(TARGETNAME).dis
|
||||
MAPNAME:=$(TARGETNAME).map
|
||||
|
||||
#=== replace standard tools ===
|
||||
CC:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-gcc
|
||||
CXX:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-g++
|
||||
AR:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-gcc-ar
|
||||
OBJCOPY:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-objcopy
|
||||
OBJDUMP:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-objdump
|
||||
SIZE:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-size
|
||||
|
||||
AVRDUDE = $(ARDUINO_PATH)hardware/tools/avr/bin/avrdude
|
||||
|
||||
|
||||
#=== get values from boards.txt ===
|
||||
BOARDS_TXT:=$(ARDUINO_PATH)hardware/arduino/avr/boards.txt
|
||||
|
||||
# get the MCU value from the $(BOARD).build.mcu variable. For the atmega328 board this is atmega328p
|
||||
MCU:=$(shell sed -n -e "s/$(BOARD).build.mcu=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# get the F_CPU value from the $(BOARD).build.f_cpu variable. For the atmega328 board this is 16000000
|
||||
F_CPU:=$(shell sed -n -e "s/$(BOARD).build.f_cpu=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# get variant subfolder
|
||||
VARIANT:=$(shell sed -n -e "s/$(BOARD).build.variant=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
UPLOAD_SPEED:=$(shell sed -n -e "s/$(BOARD).upload.speed=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# get the AVRDUDE_PROGRAMMER value from the $(BOARD).upload.protocol variable. For the atmega328 board this is stk500
|
||||
UPLOAD_PROTOCOL:=$(shell sed -n -e "s/$(BOARD).upload.protocol=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# use stk500v1, because stk500 will default to stk500v2
|
||||
#UPLOAD_PROTOCOL:=stk500v1
|
||||
|
||||
AVRDUDE_FLAGS = -V -F
|
||||
AVRDUDE_FLAGS += -C $(ARDUINO_PATH)/hardware/tools/avr/etc/avrdude.conf
|
||||
AVRDUDE_FLAGS += -p $(MCU)
|
||||
AVRDUDE_FLAGS += -P $(AVRDUDE_PORT)
|
||||
AVRDUDE_FLAGS += -c $(UPLOAD_PROTOCOL)
|
||||
AVRDUDE_FLAGS += -b $(UPLOAD_SPEED)
|
||||
AVRDUDE_FLAGS += -U flash:w:$(HEXNAME)
|
||||
|
||||
#=== get all include dirs ===
|
||||
INC_DIRS:=. $(SRC_DIRS) $(ARDUINO_PATH)hardware/arduino/avr/variants/$(VARIANT)
|
||||
INC_OPTS:=$(addprefix -I,$(INC_DIRS))
|
||||
|
||||
#=== get all source files ===
|
||||
CSRC:=$(shell ls $(addsuffix *.c,$(SRC_DIRS)) 2>/dev/null)
|
||||
CPPSRC:=$(shell ls $(addsuffix *.cpp,$(SRC_DIRS)) 2>/dev/null)
|
||||
|
||||
#=== get all obj files ===
|
||||
COBJ:=$(CSRC:.c=.o)
|
||||
CPPOBJ:=$(CPPSRC:.cpp=.o)
|
||||
OBJ:=$(COBJ) $(CPPOBJ) $(TARGETNAME).o
|
||||
|
||||
|
||||
#=== options ===
|
||||
|
||||
COMMON_FLAGS = -g -Os -DF_CPU=$(F_CPU) -mmcu=$(MCU)
|
||||
COMMON_FLAGS +=-DARDUINO=10800 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR
|
||||
COMMON_FLAGS +=-ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects
|
||||
COMMON_FLAGS +=$(INC_OPTS)
|
||||
CFLAGS:=$(COMMON_FLAGS) -std=gnu99 -Wstrict-prototypes -Wall -Wextra
|
||||
CXXFLAGS:=$(COMMON_FLAGS) -std=gnu++11 -fpermissive -fno-exceptions
|
||||
LDFLAGS:=-g -Os -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=$(MCU)
|
||||
LDLIBS:=-lm
|
||||
|
||||
all: $(HEXNAME) $(DISNAME)
|
||||
$(SIZE) $(ELFNAME)
|
||||
|
||||
.PHONY: debug
|
||||
debug:
|
||||
@echo $(MCU) $(F_CPU) $(VARIANT) $(UPLOAD_SPEED) $(UPLOAD_PROTOCOL)
|
||||
@echo $(SRC_DIRS)
|
||||
@echo $(CSRC)
|
||||
@echo $(CPPSRC)
|
||||
@echo $(INC_OPTS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) $(OBJ) $(HEXNAME) $(ELFNAME) $(LIBNAME) $(DISNAME) $(MAPNAME) $(BINNAME)
|
||||
|
||||
.PHONY: upload
|
||||
upload: $(HEXNAME)
|
||||
stty -F $(AVRDUDE_PORT) hupcl
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS)
|
||||
|
||||
# implicit rules
|
||||
.ino.cpp:
|
||||
@cp $< $@
|
||||
|
||||
.elf.hex:
|
||||
@$(OBJCOPY) -O ihex -R .eeprom $< $@
|
||||
|
||||
# explicit rules
|
||||
$(ELFNAME): $(LIBNAME)($(OBJ))
|
||||
$(LINK.o) $(LFLAGS) $(LIBNAME) $(LDLIBS) -o $@
|
||||
|
||||
$(DISNAME): $(ELFNAME)
|
||||
$(OBJDUMP) -D -S $< > $@
|
||||
|
||||
|
|
@ -148,6 +148,11 @@ void setup(void) {
|
|||
//pinMode(17, OUTPUT);
|
||||
//digitalWrite(17, 0);
|
||||
|
||||
/* U8g2 Project: Pax Instruments Shield: Enable Backlight */
|
||||
//pinMode(6, OUTPUT);
|
||||
//digitalWrite(6, 0);
|
||||
|
||||
|
||||
u8g2.begin();
|
||||
u8g2.setFlipMode(0);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
//U8X8_ST7565_NHD_C12832_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8X8_ST7565_NHD_C12832_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8X8_ST7567_PI_132X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6
|
||||
U8X8_ST7567_PI_132X64_4W_HW_SPI u8x8(/* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6
|
||||
//U8X8_ST7567_PI_132X64_4W_HW_SPI u8x8(/* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6
|
||||
//U8X8_UC1604_JLX19264_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8X8_UC1604_JLX19264_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
||||
//U8X8_UC1608_ERC24064_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Due, SW SPI, ERC24064-1 Test Board
|
||||
|
@ -103,8 +103,8 @@ U8X8_ST7567_PI_132X64_4W_HW_SPI u8x8(/* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //
|
|||
void setup(void)
|
||||
{
|
||||
/* U8g2 Project: Pax Instruments Shield: Enable Backlight */
|
||||
pinMode(6, OUTPUT);
|
||||
digitalWrite(6, 0);
|
||||
//pinMode(6, OUTPUT);
|
||||
//digitalWrite(6, 0);
|
||||
|
||||
u8x8.begin();
|
||||
}
|
||||
|
|
|
@ -111,10 +111,15 @@
|
|||
void setup(void)
|
||||
{
|
||||
/* U8g2 Project: KS0108 Test Board */
|
||||
pinMode(16, OUTPUT);
|
||||
digitalWrite(16, 0);
|
||||
//pinMode(16, OUTPUT);
|
||||
//digitalWrite(16, 0);
|
||||
|
||||
/* U8g2 Project: Pax Instruments Shield: Enable Backlight */
|
||||
//pinMode(6, OUTPUT);
|
||||
//digitalWrite(6, 0);
|
||||
|
||||
u8x8.begin();
|
||||
//u8x8.setFlipMode(1);
|
||||
}
|
||||
|
||||
void pre(void)
|
||||
|
|
|
@ -0,0 +1,146 @@
|
|||
#
|
||||
# Makefile.180 for Arduino/AVR
|
||||
#
|
||||
# Note:
|
||||
# Display list make database: make -p -f/dev/null | less
|
||||
|
||||
|
||||
# Install path of the arduino software. Requires a '/' at the end.
|
||||
ARDUINO_PATH:=/home/kraus/prg/arduino-1.8.0/
|
||||
|
||||
# Board (and prozessor) information: see $(ARDUINO_PATH)hardware/arduino/avr/boards.txt
|
||||
# Some examples:
|
||||
# BOARD DESCRIPTION
|
||||
# uno Arduino Uno
|
||||
# atmega328 Arduino Duemilanove or Nano w/ ATmega328
|
||||
# diecimila Arduino Diecimila, Duemilanove, or Nano w/ ATmega168
|
||||
# mega Arduino Mega
|
||||
# mega2560 Arduino Mega2560
|
||||
# mini Arduino Mini
|
||||
# lilypad328 LilyPad Arduino w/ ATmega328
|
||||
BOARD:=uno
|
||||
|
||||
# The unix device where we can reach the arduino board
|
||||
# Uno: /dev/ttyACM0
|
||||
# Duemilanove: /dev/ttyUSB0
|
||||
AVRDUDE_PORT:=/dev/ttyACM0
|
||||
|
||||
|
||||
|
||||
SRC_DIRS=$(ARDUINO_PATH)hardware/arduino/avr/cores/arduino/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/SPI/src/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/SPI/src/utility/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/Wire/src/
|
||||
SRC_DIRS+=$(ARDUINO_PATH)hardware/arduino/avr/libraries/Wire/src/utility/
|
||||
SRC_DIRS+=../../../../csrc/
|
||||
SRC_DIRS+=../../../../cppsrc/
|
||||
|
||||
#=== suffixes ===
|
||||
.SUFFIXES: .elf .hex .ino
|
||||
|
||||
#=== identify user files ===
|
||||
INOSRC:=$(shell ls *.ino)
|
||||
TARGETNAME=$(basename $(INOSRC))
|
||||
|
||||
#=== internal names ===
|
||||
LIBNAME:=$(TARGETNAME).a
|
||||
ELFNAME:=$(TARGETNAME).elf
|
||||
HEXNAME:=$(TARGETNAME).hex
|
||||
BINNAME:=$(TARGETNAME).bin
|
||||
DISNAME:=$(TARGETNAME).dis
|
||||
MAPNAME:=$(TARGETNAME).map
|
||||
|
||||
#=== replace standard tools ===
|
||||
CC:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-gcc
|
||||
CXX:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-g++
|
||||
AR:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-gcc-ar
|
||||
OBJCOPY:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-objcopy
|
||||
OBJDUMP:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-objdump
|
||||
SIZE:=$(ARDUINO_PATH)hardware/tools/avr/bin/avr-size
|
||||
|
||||
AVRDUDE = $(ARDUINO_PATH)hardware/tools/avr/bin/avrdude
|
||||
|
||||
|
||||
#=== get values from boards.txt ===
|
||||
BOARDS_TXT:=$(ARDUINO_PATH)hardware/arduino/avr/boards.txt
|
||||
|
||||
# get the MCU value from the $(BOARD).build.mcu variable. For the atmega328 board this is atmega328p
|
||||
MCU:=$(shell sed -n -e "s/$(BOARD).build.mcu=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# get the F_CPU value from the $(BOARD).build.f_cpu variable. For the atmega328 board this is 16000000
|
||||
F_CPU:=$(shell sed -n -e "s/$(BOARD).build.f_cpu=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# get variant subfolder
|
||||
VARIANT:=$(shell sed -n -e "s/$(BOARD).build.variant=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
UPLOAD_SPEED:=$(shell sed -n -e "s/$(BOARD).upload.speed=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# get the AVRDUDE_PROGRAMMER value from the $(BOARD).upload.protocol variable. For the atmega328 board this is stk500
|
||||
UPLOAD_PROTOCOL:=$(shell sed -n -e "s/$(BOARD).upload.protocol=\(.*\)/\1/p" $(BOARDS_TXT))
|
||||
# use stk500v1, because stk500 will default to stk500v2
|
||||
#UPLOAD_PROTOCOL:=stk500v1
|
||||
|
||||
AVRDUDE_FLAGS = -V -F
|
||||
AVRDUDE_FLAGS += -C $(ARDUINO_PATH)/hardware/tools/avr/etc/avrdude.conf
|
||||
AVRDUDE_FLAGS += -p $(MCU)
|
||||
AVRDUDE_FLAGS += -P $(AVRDUDE_PORT)
|
||||
AVRDUDE_FLAGS += -c $(UPLOAD_PROTOCOL)
|
||||
AVRDUDE_FLAGS += -b $(UPLOAD_SPEED)
|
||||
AVRDUDE_FLAGS += -U flash:w:$(HEXNAME)
|
||||
|
||||
#=== get all include dirs ===
|
||||
INC_DIRS:=. $(SRC_DIRS) $(ARDUINO_PATH)hardware/arduino/avr/variants/$(VARIANT)
|
||||
INC_OPTS:=$(addprefix -I,$(INC_DIRS))
|
||||
|
||||
#=== get all source files ===
|
||||
CSRC:=$(shell ls $(addsuffix *.c,$(SRC_DIRS)) 2>/dev/null)
|
||||
CPPSRC:=$(shell ls $(addsuffix *.cpp,$(SRC_DIRS)) 2>/dev/null)
|
||||
|
||||
#=== get all obj files ===
|
||||
COBJ:=$(CSRC:.c=.o)
|
||||
CPPOBJ:=$(CPPSRC:.cpp=.o)
|
||||
OBJ:=$(COBJ) $(CPPOBJ) $(TARGETNAME).o
|
||||
|
||||
|
||||
#=== options ===
|
||||
|
||||
COMMON_FLAGS = -g -Os -DF_CPU=$(F_CPU) -mmcu=$(MCU)
|
||||
COMMON_FLAGS +=-DARDUINO=10800 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR
|
||||
COMMON_FLAGS +=-ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects
|
||||
COMMON_FLAGS +=$(INC_OPTS)
|
||||
CFLAGS:=$(COMMON_FLAGS) -std=gnu99 -Wstrict-prototypes -Wall -Wextra
|
||||
CXXFLAGS:=$(COMMON_FLAGS) -std=gnu++11 -fpermissive -fno-exceptions
|
||||
LDFLAGS:=-g -Os -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=$(MCU)
|
||||
LDLIBS:=-lm
|
||||
|
||||
all: $(HEXNAME) $(DISNAME)
|
||||
$(SIZE) $(ELFNAME)
|
||||
|
||||
.PHONY: debug
|
||||
debug:
|
||||
@echo $(MCU) $(F_CPU) $(VARIANT) $(UPLOAD_SPEED) $(UPLOAD_PROTOCOL)
|
||||
@echo $(SRC_DIRS)
|
||||
@echo $(CSRC)
|
||||
@echo $(CPPSRC)
|
||||
@echo $(INC_OPTS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) $(OBJ) $(HEXNAME) $(ELFNAME) $(LIBNAME) $(DISNAME) $(MAPNAME) $(BINNAME)
|
||||
|
||||
.PHONY: upload
|
||||
upload: $(HEXNAME)
|
||||
stty -F $(AVRDUDE_PORT) hupcl
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS)
|
||||
|
||||
# implicit rules
|
||||
.ino.cpp:
|
||||
@cp $< $@
|
||||
|
||||
.elf.hex:
|
||||
@$(OBJCOPY) -O ihex -R .eeprom $< $@
|
||||
|
||||
# explicit rules
|
||||
$(ELFNAME): $(LIBNAME)($(OBJ))
|
||||
$(LINK.o) $(LFLAGS) $(LIBNAME) $(LDLIBS) -o $@
|
||||
|
||||
$(DISNAME): $(ELFNAME)
|
||||
$(OBJDUMP) -D -S $< > $@
|
||||
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
# without 'v' prefix
|
||||
echo -n "2.10.1"
|
||||
echo -n "2.11.0"
|
||||
|
|
Loading…
Reference in New Issue