This commit is contained in:
kraus
2021-09-02 14:50:41 +02:00
parent 19afa41b84
commit 5b19019018
70 changed files with 4014 additions and 33 deletions
+1 -1
View File
@@ -8,5 +8,5 @@ Description: https://github.com/olikraus/u8g2/wiki
Issue Tracker: https://github.com/olikraus/u8g2/issues
Download (2.29.9): https://github.com/olikraus/U8g2_Arduino/archive/master.zip
Download (2.29.10): https://github.com/olikraus/U8g2_Arduino/archive/master.zip
+2
View File
@@ -339,6 +339,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -244,6 +244,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -210,6 +210,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -209,6 +209,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -212,6 +212,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -212,6 +212,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -209,6 +209,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -209,6 +209,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -253,6 +253,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -210,6 +210,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -211,6 +211,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -218,6 +218,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -201,6 +201,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -212,6 +212,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -211,6 +211,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -214,6 +214,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -211,6 +211,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -220,6 +220,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -215,6 +215,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -213,6 +213,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -211,6 +211,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -435,6 +435,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -206,6 +206,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -211,6 +211,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -229,6 +229,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -212,6 +212,8 @@
//U8G2_ST7567_HEM6432_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -212,6 +212,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -212,6 +212,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -221,6 +221,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -205,6 +205,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -212,6 +212,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -215,6 +215,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -212,6 +212,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -215,6 +215,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -201,6 +201,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -297,13 +299,13 @@ void setup(void) {
//u8g2.begin(/* menu_select_pin= */ 2, /* menu_next_pin= */ 4, /* menu_prev_pin= */ 7, /* menu_up_pin= */ 6, /* menu_down_pin= */ 5, /* menu_home_pin= */ 3);
// DOGS102 Shield (http://shieldlist.org/controlconnection/dogs102)
// u8g2.begin(/* menu_select_pin= */ 5, /* menu_next_pin= */ 4, /* menu_prev_pin= */ 2, /* menu_up_pin= */ U8X8_PIN_NONE, /* menu_down_pin= */ U8X8_PIN_NONE, /* menu_home_pin= */ 3);
u8g2.begin(/* menu_select_pin= */ 5, /* menu_next_pin= */ 4, /* menu_prev_pin= */ 2, /* menu_up_pin= */ U8X8_PIN_NONE, /* menu_down_pin= */ U8X8_PIN_NONE, /* menu_home_pin= */ 3);
// DOGM128 Shield (http://shieldlist.org/schmelle2/dogm128) + DOGXL160 Shield
//u8g2.begin(/* menu_select_pin= */ 2, /* menu_next_pin= */ 3, /* menu_prev_pin= */ 7, /* menu_up_pin= */ U8X8_PIN_NONE, /* menu_down_pin= */ U8X8_PIN_NONE, /* menu_home_pin= */ 8);
// MKR Zero Test Board
u8g2.begin(/*Select=*/ 0, /*Right/Next=*/ 1, /*Left/Prev=*/ 2, /*Up=*/ 4, /*Down=*/ 3, /*Home/Cancel=*/ A6);
// u8g2.begin(/*Select=*/ 0, /*Right/Next=*/ 1, /*Left/Prev=*/ 2, /*Up=*/ 4, /*Down=*/ 3, /*Home/Cancel=*/ A6);
// Arduboy
//u8g2.begin(/*Select=*/ A0, /*Right/Next=*/ 5, /*Left/Prev=*/ 9, /*Up=*/ 8, /*Down=*/ 10, /*Home/Cancel=*/ A1); // Arduboy DevKit
+2
View File
@@ -213,6 +213,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -253,6 +253,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -218,6 +218,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -213,6 +213,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -210,6 +210,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -217,6 +217,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -215,6 +215,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -215,6 +215,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -215,6 +215,8 @@
//U8G2_ST7567_HEM6432_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7571_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7571_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_ERC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7586S_YMC240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -184,6 +184,8 @@
//U8X8_ST7567_HEM6432_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
//U8X8_ST7571_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX19296_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -184,6 +184,8 @@
//U8X8_ST7567_HEM6432_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
//U8X8_ST7571_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX19296_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
@@ -186,6 +186,8 @@
//U8X8_ST7567_HEM6432_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
//U8X8_ST7571_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX19296_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -183,6 +183,8 @@
//U8X8_ST7567_HEM6432_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
//U8X8_ST7571_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX19296_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -183,6 +183,8 @@
//U8X8_ST7567_HEM6432_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
//U8X8_ST7571_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX19296_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+2
View File
@@ -183,6 +183,8 @@
//U8X8_ST7567_HEM6432_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
//U8X8_ST7571_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST7571_128X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX172104_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_ST75256_JLX19296_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
+1
View File
@@ -257,6 +257,7 @@ https://github.com/olikraus/u8g2 ChangeLog
* Added support for ST7567_HEM6432 (issue 1159)
* U8g2 16 Bit Mode enabled by default for ARM and ESP Systems (issue 1222)
2021-xx-xx v2.29.xx olikraus@gmail.com
* Update for getStrWidth/getUTF8Width: The new value might be little bit larger (issue 1561)
* Added vertical mirror option for u8g2 (mattnutsch@gmail.com).
* Added support for UC1638 based 196x96 display (issue 371)
* Added support for HD44102 and T7932 displays (issue 1492)
+1 -1
View File
@@ -1,5 +1,5 @@
name=U8g2
version=2.29.9
version=2.29.10
author=oliver <olikraus@gmail.com>
maintainer=oliver <olikraus@gmail.com>
sentence=Monochrome LCD, OLED and eInk Library. Display controller: SSD1305, SSD1306, SSD1309, SSD1316, SSD1322, SSD1325, SSD1327, SSD1329, SSD1606, SSD1607, SH1106, SH1107, SH1108, SH1122, T6963, RA8835, LC7981, PCD8544, PCF8812, HX1230, UC1601, UC1604, UC1608, UC1610, UC1611, UC1617, UC1701, ST7511, ST7528, ST7565, ST7567, ST7571, ST7586, ST7588, ST75256, ST75320, NT7534, ST7920, IST3020, IST7920, LD7032, KS0108, KS0713, SED1520, SBN1661, IL3820, MAX7219. Interfaces: I2C, SPI, Parallel.
+78
View File
@@ -0,0 +1,78 @@
/*
MUIU8g2.h
C++ Arduino wrapper for mui.h (monochome minimal user interface)
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.
*/
#ifndef MUIU8G2_HH
#define MUIU8G2_HH
#include "mui.h"
#include "mui_u8g2.h"
class MUIU8G2
{
protected:
mui_t mui;
public:
MUIU8G2(void) { }
MUIU8G2(U8G2 &u8g2, fds_t *fds, muif_t *muif_list, size_t muif_cnt) {
mui_Init(&mui, (void *)u8g2.getU8g2(), fds, muif_list, muif_cnt);
}
void begin(U8G2 &u8g2, fds_t *fds, muif_t *muif_list, size_t muif_cnt) {
mui_Init(&mui, (void *)u8g2.getU8g2(), fds, muif_list, muif_cnt);
}
mui_t *getMUI(void) { return &mui; }
uint8_t getCurrentCursorFocusPosition(void) { return mui_GetCurrentCursorFocusPosition(&mui); }
void draw(void) { mui_Draw(&mui); }
void getSelectableFieldTextOption(uint8_t form_id, uint8_t cursor_position, uint8_t nth_token)
{ mui_GetSelectableFieldTextOption(&mui, form_id, cursor_position, nth_token); }
void enterForm(fds_t *fds, uint8_t initial_cursor_position) { mui_EnterForm(&mui, fds, initial_cursor_position); }
void leaveForm(void) { mui_LeaveForm(&mui); }
uint8_t gotoForm(uint8_t form_id, uint8_t initial_cursor_position) { return mui_GotoForm(&mui, form_id, initial_cursor_position); }
void saveForm(void) { mui_SaveForm(&mui); }
void restoreForm(void) { mui_RestoreForm(&mui); }
void nextField(void) { mui_NextField(&mui); }
void prevField(void) { mui_PrevField(&mui); }
void sendSelect(void) { mui_SendSelect(&mui); }
int isFormActive(void) { return mui_IsFormActive(&mui); }
};
#endif /* MUIU8G2_HH */
+329
View File
@@ -112,6 +112,11 @@ class U8G2 : public Print
void initDisplay(void) {
u8g2_InitDisplay(&u8g2); }
/* call initInterface if the uC comes out of deep sleep mode and display is already running */
/* initInterface is part if initDisplay, do not call both use either initDisplay OR initInterface */
void initInterface(void) {
u8g2_InitInterface(&u8g2); }
void clearDisplay(void) {
u8g2_ClearDisplay(&u8g2); }
@@ -10256,6 +10261,186 @@ class U8G2_UC1608_240X128_F_2ND_HW_I2C : public U8G2 {
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8G2_UC1609_SLG19264_1_4W_SW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_1_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_1(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_1_4W_HW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_1_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_1(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_1_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_1_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_1(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_1_3W_SW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_1_3W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_1(&u8g2, rotation, u8x8_byte_arduino_3wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_SW_SPI(getU8x8(), clock, data, cs, reset);
}
};
class U8G2_UC1609_SLG19264_1_3W_HW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_1_3W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_1(&u8g2, rotation, u8x8_byte_arduino_3wire_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_HW_SPI(getU8x8(), cs, reset);
}
};
class U8G2_UC1609_SLG19264_1_6800 : public U8G2 {
public: U8G2_UC1609_SLG19264_1_6800(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_1(&u8g2, rotation, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_1_8080 : public U8G2 {
public: U8G2_UC1609_SLG19264_1_8080(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_1(&u8g2, rotation, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_2_4W_SW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_2_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_2(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_2_4W_HW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_2_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_2(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_2_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_2_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_2(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_2_3W_SW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_2_3W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_2(&u8g2, rotation, u8x8_byte_arduino_3wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_SW_SPI(getU8x8(), clock, data, cs, reset);
}
};
class U8G2_UC1609_SLG19264_2_3W_HW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_2_3W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_2(&u8g2, rotation, u8x8_byte_arduino_3wire_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_HW_SPI(getU8x8(), cs, reset);
}
};
class U8G2_UC1609_SLG19264_2_6800 : public U8G2 {
public: U8G2_UC1609_SLG19264_2_6800(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_2(&u8g2, rotation, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_2_8080 : public U8G2 {
public: U8G2_UC1609_SLG19264_2_8080(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_2(&u8g2, rotation, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_F_4W_SW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_F_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_f(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_F_4W_HW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_F_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_f(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_F_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_F_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_f(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_F_3W_SW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_F_3W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_f(&u8g2, rotation, u8x8_byte_arduino_3wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_SW_SPI(getU8x8(), clock, data, cs, reset);
}
};
class U8G2_UC1609_SLG19264_F_3W_HW_SPI : public U8G2 {
public: U8G2_UC1609_SLG19264_F_3W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_f(&u8g2, rotation, u8x8_byte_arduino_3wire_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_HW_SPI(getU8x8(), cs, reset);
}
};
class U8G2_UC1609_SLG19264_F_6800 : public U8G2 {
public: U8G2_UC1609_SLG19264_F_6800(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_f(&u8g2, rotation, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_F_8080 : public U8G2 {
public: U8G2_UC1609_SLG19264_F_8080(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_slg19264_f(&u8g2, rotation, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_UC1609_SLG19264_1_SW_I2C : public U8G2 {
public: U8G2_UC1609_SLG19264_1_SW_I2C(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_i2c_slg19264_1(&u8g2, rotation, u8x8_byte_arduino_sw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_SW_I2C(getU8x8(), clock, data, reset);
}
};
class U8G2_UC1609_SLG19264_1_HW_I2C : public U8G2 {
public: U8G2_UC1609_SLG19264_1_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE, uint8_t clock = U8X8_PIN_NONE, uint8_t data = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_i2c_slg19264_1(&u8g2, rotation, u8x8_byte_arduino_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset, clock, data);
}
};
class U8G2_UC1609_SLG19264_1_2ND_HW_I2C : public U8G2 {
public: U8G2_UC1609_SLG19264_1_2ND_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_i2c_slg19264_1(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8G2_UC1609_SLG19264_2_SW_I2C : public U8G2 {
public: U8G2_UC1609_SLG19264_2_SW_I2C(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_i2c_slg19264_2(&u8g2, rotation, u8x8_byte_arduino_sw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_SW_I2C(getU8x8(), clock, data, reset);
}
};
class U8G2_UC1609_SLG19264_2_HW_I2C : public U8G2 {
public: U8G2_UC1609_SLG19264_2_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE, uint8_t clock = U8X8_PIN_NONE, uint8_t data = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_i2c_slg19264_2(&u8g2, rotation, u8x8_byte_arduino_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset, clock, data);
}
};
class U8G2_UC1609_SLG19264_2_2ND_HW_I2C : public U8G2 {
public: U8G2_UC1609_SLG19264_2_2ND_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_i2c_slg19264_2(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8G2_UC1609_SLG19264_F_SW_I2C : public U8G2 {
public: U8G2_UC1609_SLG19264_F_SW_I2C(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_i2c_slg19264_f(&u8g2, rotation, u8x8_byte_arduino_sw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_SW_I2C(getU8x8(), clock, data, reset);
}
};
class U8G2_UC1609_SLG19264_F_HW_I2C : public U8G2 {
public: U8G2_UC1609_SLG19264_F_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE, uint8_t clock = U8X8_PIN_NONE, uint8_t data = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_i2c_slg19264_f(&u8g2, rotation, u8x8_byte_arduino_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset, clock, data);
}
};
class U8G2_UC1609_SLG19264_F_2ND_HW_I2C : public U8G2 {
public: U8G2_UC1609_SLG19264_F_2ND_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1609_i2c_slg19264_f(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8G2_UC1638_160X128_1_4W_SW_SPI : public U8G2 {
public: U8G2_UC1638_160X128_1_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_uc1638_160x128_1(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
@@ -15080,6 +15265,150 @@ class U8G2_ST7571_128X128_F_2ND_HW_I2C : public U8G2 {
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8G2_ST7571_128X96_1_4W_SW_SPI : public U8G2 {
public: U8G2_ST7571_128X96_1_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_1(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_ST7571_128X96_1_4W_HW_SPI : public U8G2 {
public: U8G2_ST7571_128X96_1_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_1(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7571_128X96_1_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_ST7571_128X96_1_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_1(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7571_128X96_1_6800 : public U8G2 {
public: U8G2_ST7571_128X96_1_6800(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_1(&u8g2, rotation, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7571_128X96_1_8080 : public U8G2 {
public: U8G2_ST7571_128X96_1_8080(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_1(&u8g2, rotation, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7571_128X96_2_4W_SW_SPI : public U8G2 {
public: U8G2_ST7571_128X96_2_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_2(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_ST7571_128X96_2_4W_HW_SPI : public U8G2 {
public: U8G2_ST7571_128X96_2_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_2(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7571_128X96_2_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_ST7571_128X96_2_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_2(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7571_128X96_2_6800 : public U8G2 {
public: U8G2_ST7571_128X96_2_6800(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_2(&u8g2, rotation, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7571_128X96_2_8080 : public U8G2 {
public: U8G2_ST7571_128X96_2_8080(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_2(&u8g2, rotation, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7571_128X96_F_4W_SW_SPI : public U8G2 {
public: U8G2_ST7571_128X96_F_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_f(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_ST7571_128X96_F_4W_HW_SPI : public U8G2 {
public: U8G2_ST7571_128X96_F_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_f(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7571_128X96_F_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_ST7571_128X96_F_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_f(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7571_128X96_F_6800 : public U8G2 {
public: U8G2_ST7571_128X96_F_6800(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_f(&u8g2, rotation, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7571_128X96_F_8080 : public U8G2 {
public: U8G2_ST7571_128X96_F_8080(const u8g2_cb_t *rotation, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_128x96_f(&u8g2, rotation, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7571_128X96_1_SW_I2C : public U8G2 {
public: U8G2_ST7571_128X96_1_SW_I2C(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_i2c_128x96_1(&u8g2, rotation, u8x8_byte_arduino_sw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_SW_I2C(getU8x8(), clock, data, reset);
}
};
class U8G2_ST7571_128X96_1_HW_I2C : public U8G2 {
public: U8G2_ST7571_128X96_1_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE, uint8_t clock = U8X8_PIN_NONE, uint8_t data = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_i2c_128x96_1(&u8g2, rotation, u8x8_byte_arduino_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset, clock, data);
}
};
class U8G2_ST7571_128X96_1_2ND_HW_I2C : public U8G2 {
public: U8G2_ST7571_128X96_1_2ND_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_i2c_128x96_1(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8G2_ST7571_128X96_2_SW_I2C : public U8G2 {
public: U8G2_ST7571_128X96_2_SW_I2C(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_i2c_128x96_2(&u8g2, rotation, u8x8_byte_arduino_sw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_SW_I2C(getU8x8(), clock, data, reset);
}
};
class U8G2_ST7571_128X96_2_HW_I2C : public U8G2 {
public: U8G2_ST7571_128X96_2_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE, uint8_t clock = U8X8_PIN_NONE, uint8_t data = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_i2c_128x96_2(&u8g2, rotation, u8x8_byte_arduino_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset, clock, data);
}
};
class U8G2_ST7571_128X96_2_2ND_HW_I2C : public U8G2 {
public: U8G2_ST7571_128X96_2_2ND_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_i2c_128x96_2(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8G2_ST7571_128X96_F_SW_I2C : public U8G2 {
public: U8G2_ST7571_128X96_F_SW_I2C(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_i2c_128x96_f(&u8g2, rotation, u8x8_byte_arduino_sw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_SW_I2C(getU8x8(), clock, data, reset);
}
};
class U8G2_ST7571_128X96_F_HW_I2C : public U8G2 {
public: U8G2_ST7571_128X96_F_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE, uint8_t clock = U8X8_PIN_NONE, uint8_t data = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_i2c_128x96_f(&u8g2, rotation, u8x8_byte_arduino_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset, clock, data);
}
};
class U8G2_ST7571_128X96_F_2ND_HW_I2C : public U8G2 {
public: U8G2_ST7571_128X96_F_2ND_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7571_i2c_128x96_f(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8G2_ST7586S_S028HN118A_1_4W_SW_SPI : public U8G2 {
public: U8G2_ST7586S_S028HN118A_1_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_s028hn118a_1(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
+117
View File
@@ -54,10 +54,14 @@
/* Assumption: All Arduino Boards have "SPI.h" */
#ifndef U8X8_NO_HW_SPI
#define U8X8_HAVE_HW_SPI
#endif
/* Assumption: All Arduino Boards have "Wire.h" */
#ifndef U8X8_NO_HW_I2C
#define U8X8_HAVE_HW_I2C
#endif
/* Undefine U8X8_HAVE_HW_SPI for those Boards without SPI.h */
@@ -210,6 +214,11 @@ class U8X8 : public Print
void initDisplay(void) {
u8x8_InitDisplay(&u8x8); }
/* call initInterface if the uC comes out of deep sleep mode and display is already running */
/* initInterface is part if initDisplay, do not call both use either initDisplay OR initInterface */
void initInterface(void) {
u8x8_InitInterface(&u8x8); }
void clearDisplay(void) {
u8x8_ClearDisplay(&u8x8); }
@@ -3663,6 +3672,66 @@ class U8X8_UC1608_240X128_2ND_HW_I2C : public U8X8 {
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8X8_UC1609_SLG19264_4W_SW_SPI : public U8X8 {
public: U8X8_UC1609_SLG19264_4W_SW_SPI(uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_uc1609_slg19264, u8x8_cad_001, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8X8_UC1609_SLG19264_4W_HW_SPI : public U8X8 {
public: U8X8_UC1609_SLG19264_4W_HW_SPI(uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_uc1609_slg19264, u8x8_cad_001, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8X8_UC1609_SLG19264_2ND_4W_HW_SPI : public U8X8 {
public: U8X8_UC1609_SLG19264_2ND_4W_HW_SPI(uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_uc1609_slg19264, u8x8_cad_001, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8X8_UC1609_SLG19264_3W_SW_SPI : public U8X8 {
public: U8X8_UC1609_SLG19264_3W_SW_SPI(uint8_t clock, uint8_t data, uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_uc1609_slg19264, u8x8_cad_001, u8x8_byte_arduino_3wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_SW_SPI(getU8x8(), clock, data, cs, reset);
}
};
class U8X8_UC1609_SLG19264_3W_HW_SPI : public U8X8 {
public: U8X8_UC1609_SLG19264_3W_HW_SPI(uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_uc1609_slg19264, u8x8_cad_001, u8x8_byte_arduino_3wire_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_HW_SPI(getU8x8(), cs, reset);
}
};
class U8X8_UC1609_SLG19264_6800 : public U8X8 {
public: U8X8_UC1609_SLG19264_6800(uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_uc1609_slg19264, u8x8_cad_001, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8X8_UC1609_SLG19264_8080 : public U8X8 {
public: U8X8_UC1609_SLG19264_8080(uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_uc1609_slg19264, u8x8_cad_001, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8X8_UC1609_SLG19264_SW_I2C : public U8X8 {
public: U8X8_UC1609_SLG19264_SW_I2C(uint8_t clock, uint8_t data, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_uc1609_slg19264, u8x8_cad_uc16xx_i2c, u8x8_byte_arduino_sw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_SW_I2C(getU8x8(), clock, data, reset);
}
};
class U8X8_UC1609_SLG19264_HW_I2C : public U8X8 {
public: U8X8_UC1609_SLG19264_HW_I2C(uint8_t reset = U8X8_PIN_NONE, uint8_t clock = U8X8_PIN_NONE, uint8_t data = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_uc1609_slg19264, u8x8_cad_uc16xx_i2c, u8x8_byte_arduino_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset, clock, data);
}
};
class U8X8_UC1609_SLG19264_2ND_HW_I2C : public U8X8 {
public: U8X8_UC1609_SLG19264_2ND_HW_I2C(uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_uc1609_slg19264, u8x8_cad_uc16xx_i2c, u8x8_byte_arduino_2nd_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8X8_UC1638_160X128_4W_SW_SPI : public U8X8 {
public: U8X8_UC1638_160X128_4W_SW_SPI(uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_uc1638_160x128, u8x8_cad_011, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
@@ -5271,6 +5340,54 @@ class U8X8_ST7571_128X128_2ND_HW_I2C : public U8X8 {
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8X8_ST7571_128X96_4W_SW_SPI : public U8X8 {
public: U8X8_ST7571_128X96_4W_SW_SPI(uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7571_128x96, u8x8_cad_001, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8X8_ST7571_128X96_4W_HW_SPI : public U8X8 {
public: U8X8_ST7571_128X96_4W_HW_SPI(uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7571_128x96, u8x8_cad_001, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8X8_ST7571_128X96_2ND_4W_HW_SPI : public U8X8 {
public: U8X8_ST7571_128X96_2ND_4W_HW_SPI(uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7571_128x96, u8x8_cad_001, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8X8_ST7571_128X96_6800 : public U8X8 {
public: U8X8_ST7571_128X96_6800(uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7571_128x96, u8x8_cad_001, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8X8_ST7571_128X96_8080 : public U8X8 {
public: U8X8_ST7571_128X96_8080(uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7571_128x96, u8x8_cad_001, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8X8_ST7571_128X96_SW_I2C : public U8X8 {
public: U8X8_ST7571_128X96_SW_I2C(uint8_t clock, uint8_t data, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7571_128x96, u8x8_cad_ssd13xx_i2c, u8x8_byte_arduino_sw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_SW_I2C(getU8x8(), clock, data, reset);
}
};
class U8X8_ST7571_128X96_HW_I2C : public U8X8 {
public: U8X8_ST7571_128X96_HW_I2C(uint8_t reset = U8X8_PIN_NONE, uint8_t clock = U8X8_PIN_NONE, uint8_t data = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7571_128x96, u8x8_cad_ssd13xx_i2c, u8x8_byte_arduino_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset, clock, data);
}
};
class U8X8_ST7571_128X96_2ND_HW_I2C : public U8X8 {
public: U8X8_ST7571_128X96_2ND_HW_I2C(uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7571_128x96, u8x8_cad_ssd13xx_i2c, u8x8_byte_arduino_2nd_hw_i2c, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_HW_I2C(getU8x8(), reset);
}
};
class U8X8_ST7586S_S028HN118A_4W_SW_SPI : public U8X8 {
public: U8X8_ST7586S_S028HN118A_4W_SW_SPI(uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7586s_s028hn118a, u8x8_cad_011, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
+761
View File
@@ -0,0 +1,761 @@
/*
mui.c
Monochrome minimal user interface: Core library.
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.
"mui.c" is a graphical user interface, developed as part of u8g2.
However "mui.c" is independent of u8g2 and can be used without u8g2 code.
The glue code between "mui.c" and u8g2 is located in "mui_u8g2.c"
c: cmd
i: ID0
j: ID1
xy: Position (x and y)
/text/: some text. The text can start with any delimiter (except 0 and |), but also has to end with the same delimiter
a: Single char argument
u: Single char argument with the user interface form number
"Uu" the interface --> no ID
Manual ID:
"Fijxy" Generic field: Places field with id ii at x/y --> ID=ij
"Bijxy/text/" Generic field (Button) with Text --> ID=ij
"Tiixya/text/" Generic field with argument and text --> ID = ij
"Aiixya"
Fixed ID:
"Si" the style --> ID=@i
"Lxy/labeltext/" Places a text at the specified position, field with - -> ID=.L, .l
"Gxyu/menutext/" Go to the specified menu without placing the user interface form on the stack --> ID=.G, .g
cijxy
cijxy/text/
cijxya/text/
cxy/text/
cxya/text/
*/
#include "mui.h"
//#define mui_get_fds_char(s) ((uint8_t)(*s))
uint8_t mui_get_fds_char(fds_t *s)
{
//return (uint8_t)(*s);
return (uint8_t)mui_pgm_read(s);
}
/*
s must point to a valid command within FDS
*/
static size_t mui_fds_get_cmd_size_without_text(mui_t *ui, fds_t *s) MUI_NOINLINE;
static size_t mui_fds_get_cmd_size_without_text(mui_t *ui, fds_t *s)
{
uint8_t c = mui_get_fds_char(s);
c &= 0xdf; /* consider upper and lower case */
switch(c)
{
case 'U': return 2;
case 'S': return 2;
case 'F': return 5; // CMD, ID (2 Bytes), X, Y
case 'B': return 5; // CMD, ID (2 Bytes), X, Y, Text (does not count here)
case 'T': return 6; // CMD, ID (2 Bytes), X, Y, Arg, Text (does not count here)
case 'A': return 6; // CMD, ID (2 Bytes), X, Y, Arg, Text
case 'L': return 3;
//case 'M': return 4;
//case 'X': return 3;
//case 'J': return 4;
case 'G': return 4;
case 0: return 0;
}
return 1;
}
/*
s must point to the string delimiter start: first '/' for "B00ab/ok/"
- '/' actually is 0xff
- return the total size of the string, including the delimiter
- copies the content of the string ("ok") to the ui text buffer
*/
static size_t mui_fds_parse_text(mui_t *ui, fds_t *s)
{
uint8_t i = 0;
ui->delimiter = mui_get_fds_char(s);
uint8_t c;
fds_t *t = s;
//printf("mui_fds_parse_text del=%d\n", delimiter);
#ifdef MUI_CHECK_EOFDS
if ( ui->delimiter == 0 )
return 0;
#endif
t++;
for( ;; )
{
c = mui_get_fds_char(t);
//printf("mui_fds_parse_text i=%d, c=%c\n", i, c);
#ifdef MUI_CHECK_EOFDS
if ( c == 0 )
break;
#endif
if ( c == ui->delimiter )
{
t++;
break;
}
if ( i < MUI_MAX_TEXT_LEN )
{
ui->text[i++] = c;
}
t++;
}
ui->text[i] = '\0' ;
return t-s;
}
/*
get the first token within a text argument.
The text argument may look like this:
"B00ab/banana|apple|peach|cherry/"
The outer delimiter "/" is not fixed and can be any char except "|" and "\0"
The inner delimiter "|" is fixed. It must be the pipe symbol.
This function will place "banana" into ui->text if the result is not 0
if ( mui_fds_first_token(ui) )
{
do
{
// handle token in ui->text
} while ( mui_fds_next_token(ui) )
}
*/
uint8_t mui_fds_first_token(mui_t *ui)
{
ui->token = ui->fds;
ui->token += mui_fds_get_cmd_size_without_text(ui, ui->fds);
ui->delimiter = mui_get_fds_char(ui->token);
ui->token++; // place ui->token on the first char of the token
return mui_fds_next_token(ui);
}
uint8_t mui_fds_next_token(mui_t *ui)
{
uint8_t c;
uint8_t i = 0;
// printf("mui_fds_next_token: call, ui->token=%p\n", ui->token);
for( ;; )
{
c = mui_get_fds_char(ui->token);
// printf("mui_fds_next_token: i=%d c=%c\n", i, c);
#ifdef MUI_CHECK_EOFDS
if ( c == 0 )
break;
#endif
if ( c == ui->delimiter )
break;
if ( c == '|' )
{
ui->token++; // place ui->token on the first char of the next token
break;
}
if ( i < MUI_MAX_TEXT_LEN )
{
ui->text[i++] = c;
}
ui->token++;
}
ui->text[i] = '\0' ;
if ( i == 0 )
return 0; // no further token found
return 1; // token placed in ui->text
}
/*
find nth token, return 0 if n exceeds the number of tokens, 1 otherwise
the result is stored in ui->text
*/
uint8_t mui_fds_get_nth_token(mui_t *ui, uint8_t n)
{
// printf("mui_fds_get_nth_token: call, n=%d\n", n);
if ( mui_fds_first_token(ui) )
{
do
{
if ( n == 0 )
{
// printf("mui_fds_get_nth_token: found");
return 1;
}
n--;
} while ( mui_fds_next_token(ui) );
}
//printf("mui_fds_get_nth_token: NOT found\n");
return 0;
}
uint8_t mui_fds_get_token_cnt(mui_t *ui)
{
uint8_t n = 0;
if ( mui_fds_first_token(ui) )
{
do
{
n++;
} while ( mui_fds_next_token(ui) );
}
return n;
}
#define mui_fds_is_text(c) ( (c) == 'U' || (c) == 'S' || (c) == 'F' || (c) == 'A' ? 0 : 1 )
/*
s must point to a valid command within FDS
return
The complete length of the command (including any text part)
sideeffect:
Any existing text part will be copied into ui->text
ui->text will be assigned to empty string if there is no text argument
*/
static size_t mui_fds_get_cmd_size(mui_t *ui, fds_t *s) MUI_NOINLINE;
static size_t mui_fds_get_cmd_size(mui_t *ui, fds_t *s)
{
size_t l = mui_fds_get_cmd_size_without_text(ui, s);
uint8_t c = mui_get_fds_char(s);
ui->text[0] = '\0' ; /* always reset the text buffer */
if ( mui_fds_is_text(c) )
{
l += mui_fds_parse_text(ui, s+l);
}
return l;
}
/*
mui_Init() will setup the menu system but will not activate or display anything.
Use mui_GotoForm() after this command, then use mui_Draw() to draw the menu on a display.
*/
void mui_Init(mui_t *ui, void *graphics_data, fds_t *fds, muif_t *muif_tlist, size_t muif_tcnt)
{
memset(ui, 0, sizeof(mui_t));
ui->root_fds = fds;
//ui->current_form_fds = NULL; // not required, because there was a memset before
ui->muif_tlist = muif_tlist;
ui->muif_tcnt = muif_tcnt;
ui->graphics_data = graphics_data;
}
int mui_find_uif(mui_t *ui, uint8_t id0, uint8_t id1)
{
int i;
for( i = 0; i < ui->muif_tcnt; i++ )
{
/*
if ( ui->muif_tlist[i].id0 == id0 )
if ( ui->muif_tlist[i].id1 == id1 )
return i;
*/
if ( muif_get_id0(ui->muif_tlist+i) == id0 )
if ( muif_get_id1(ui->muif_tlist+i) == id1 )
return i;
}
return -1;
}
/*
assumes a valid position in ui->fds and calculates all the other variables
some fields are alway calculated like the ui->cmd and ui->len field
other member vars are calculated only if the return value is 1
will return 1 if the field id was found.
will return 0 if the field id was not found in uif or if ui->fds points to something else than a field
*/
uint8_t mui_prepare_current_field(mui_t *ui)
{
int muif_tidx;
ui->uif = NULL;
ui->dflags = 0;
ui->id0 = 0;
ui->id1 = 0;
ui->arg = 0;
/* calculate the length of the command and copy the text argument */
/* this will also clear the text in cases where there is no text argument */
ui->len = mui_fds_get_cmd_size(ui, ui->fds);
//printf("mui_prepare_current_field len=%d\n", ui->len);
/* get the command and check whether end of form is reached */
ui->cmd = mui_get_fds_char(ui->fds);
//printf("mui_prepare_current_field cmd='%c'\n", ui->cmd);
/* Copy the cmd also to second id value. This is required for some commands, others will overwrite this below */
ui->id1 = ui->cmd;
/* now make the command uppercase so that both, upper and lower case are considered */
ui->cmd &= 0xdf; /* consider upper and lower case */
if ( ui->cmd == 'U' || ui->cmd == 0 )
return 0;
/* calculate the dynamic flags */
if ( ui->fds == ui->cursor_focus_fds )
ui->dflags |= MUIF_DFLAG_IS_CURSOR_FOCUS;
if ( ui->fds == ui->touch_focus_fds )
ui->dflags |= MUIF_DFLAG_IS_TOUCH_FOCUS;
/* get the id0 and id1 values */
if ( ui->cmd == 'F' || ui->cmd == 'B' || ui->cmd == 'T' || ui->cmd == 'A' )
{
ui->id0 = mui_get_fds_char(ui->fds+1);
ui->id1 = mui_get_fds_char(ui->fds+2);
ui->x = mui_get_fds_char(ui->fds+3);
ui->y = mui_get_fds_char(ui->fds+4);
if ( ui->cmd == 'A' || ui->cmd == 'T' )
{
ui->arg = mui_get_fds_char(ui->fds+5);
}
}
else if ( ui->cmd == 'S' )
{
ui->id0 = 'S';
ui->id1 = mui_get_fds_char(ui->fds+1);
}
else
{
ui->id0 = '.';
/* note that ui->id1 contains the original cmd value */
ui->x = mui_get_fds_char(ui->fds+1);
ui->y = mui_get_fds_char(ui->fds+2);
if ( ui->cmd == 'G' || ui->cmd == 'M' ) /* this is also true for 'g' or 'm' */
{
ui->arg = mui_get_fds_char(ui->fds+3);
}
}
/* find the field */
muif_tidx = mui_find_uif(ui, ui->id0, ui->id1);
//printf("mui_prepare_current_field: muif_tidx=%d\n", muif_tidx);
if ( muif_tidx >= 0 )
{
ui->uif = ui->muif_tlist + muif_tidx;
return 1;
}
return 0;
}
/*
assumes that ui->fds has been assigned correctly
and that ui->target_fds and ui->tmp_fds had been cleared if required
Usually do not call this function directly, instead use mui_loop_over_form
*/
void mui_inner_loop_over_form(mui_t *ui, uint8_t (*task)(mui_t *ui)) MUI_NOINLINE;
void mui_inner_loop_over_form(mui_t *ui, uint8_t (*task)(mui_t *ui))
{
uint8_t cmd;
ui->fds += mui_fds_get_cmd_size(ui, ui->fds); // skip the first entry, it is U always
for(;;)
{
//printf("fds=%p *fds='%c'\n", ui->fds, ui->fds[0]);
/* get the command and check whether end of form is reached */
cmd = mui_get_fds_char(ui->fds);
if ( cmd == 'U' || cmd == 0 )
break;
if ( mui_prepare_current_field(ui) )
if ( task(ui) ) /* call the task, which was provided as argument to this function */
break;
ui->fds += ui->len;
}
//printf("mui_loop_over_form ended\n");
}
void mui_loop_over_form(mui_t *ui, uint8_t (*task)(mui_t *ui))
{
if ( mui_IsFormActive(ui) == 0 )
return;
ui->fds = ui->current_form_fds;
ui->target_fds = NULL;
ui->tmp_fds = NULL;
mui_inner_loop_over_form(ui, task);
}
/*
n is the form number
*/
fds_t *mui_find_form(mui_t *ui, uint8_t n)
{
fds_t *fds = ui->root_fds;
uint8_t cmd;
for( ;; )
{
cmd = mui_get_fds_char(fds);
if ( cmd == 0 )
break;
if ( cmd == 'U' )
{
if ( mui_get_fds_char(fds+1) == n )
{
return fds;
}
/* not found, just coninue */
}
fds += mui_fds_get_cmd_size(ui, fds);
}
return NULL;
}
/* === task procedures (arguments for mui_loop_over_form) === */
/* ui->fds contains the current field */
uint8_t mui_task_draw(mui_t *ui)
{
//printf("mui_task_draw fds=%p uif=%p text=%s\n", ui->fds, ui->uif, ui->text);
muif_get_cb(ui->uif)(ui, MUIF_MSG_DRAW);
return 0; /* continue with the loop */
}
uint8_t mui_task_form_start(mui_t *ui)
{
muif_get_cb(ui->uif)(ui, MUIF_MSG_FORM_START);
return 0; /* continue with the loop */
}
uint8_t mui_task_form_end(mui_t *ui)
{
muif_get_cb(ui->uif)(ui, MUIF_MSG_FORM_END);
return 0; /* continue with the loop */
}
uint8_t mui_task_find_prev_cursor_uif(mui_t *ui)
{
if ( muif_get_cflags(ui->uif) & MUIF_CFLAG_IS_CURSOR_SELECTABLE )
{
if ( ui->fds == ui->cursor_focus_fds )
{
ui->target_fds = ui->tmp_fds;
return 1; /* stop looping */
}
ui->tmp_fds = ui->fds;
}
return 0; /* continue with the loop */
}
uint8_t mui_task_find_first_cursor_uif(mui_t *ui)
{
if ( muif_get_cflags(ui->uif) & MUIF_CFLAG_IS_CURSOR_SELECTABLE )
{
// if ( ui->target_fds == NULL )
// {
ui->target_fds = ui->fds;
return 1; /* stop looping */
// }
}
return 0; /* continue with the loop */
}
uint8_t mui_task_find_last_cursor_uif(mui_t *ui)
{
if ( muif_get_cflags(ui->uif) & MUIF_CFLAG_IS_CURSOR_SELECTABLE )
{
//ui->cursor_focus_position++;
ui->target_fds = ui->fds;
}
return 0; /* continue with the loop */
}
uint8_t mui_task_find_next_cursor_uif(mui_t *ui)
{
if ( muif_get_cflags(ui->uif) & MUIF_CFLAG_IS_CURSOR_SELECTABLE )
{
if ( ui->tmp_fds != NULL )
{
ui->target_fds = ui->fds;
ui->tmp_fds = NULL;
return 1; /* stop looping */
}
if ( ui->fds == ui->cursor_focus_fds )
{
ui->tmp_fds = ui->fds;
}
}
return 0; /* continue with the loop */
}
uint8_t mui_task_get_current_cursor_focus_position(mui_t *ui)
{
if ( muif_get_cflags(ui->uif) & MUIF_CFLAG_IS_CURSOR_SELECTABLE )
{
if ( ui->fds == ui->cursor_focus_fds )
return 1; /* stop looping */
ui->tmp8++;
}
return 0; /* continue with the loop */
}
uint8_t mui_task_read_nth_seleectable_field(mui_t *ui)
{
if ( muif_get_cflags(ui->uif) & MUIF_CFLAG_IS_CURSOR_SELECTABLE )
{
if ( ui->tmp8 == 0 )
return 1; /* stop looping */
ui->tmp8--;
}
return 0; /* continue with the loop */
}
/* === utility functions for the user API === */
void mui_send_cursor_msg(mui_t *ui, uint8_t msg)
{
if ( ui->cursor_focus_fds )
{
ui->fds = ui->cursor_focus_fds;
if ( mui_prepare_current_field(ui) )
muif_get_cb(ui->uif)(ui, msg);
}
}
/* === user API === */
/*
returns the field pos which has the current focus
If the first selectable field has the focus, then 0 will be returned
Unselectable fields (for example labels) are skipped by this count.
If no fields are selectable, then 0 is returned
*/
uint8_t mui_GetCurrentCursorFocusPosition(mui_t *ui)
{
ui->tmp8 = 0;
mui_loop_over_form(ui, mui_task_get_current_cursor_focus_position);
return ui->tmp8;
}
void mui_Draw(mui_t *ui)
{
mui_loop_over_form(ui, mui_task_draw);
}
void mui_next_field(mui_t *ui)
{
mui_loop_over_form(ui, mui_task_find_next_cursor_uif);
// ui->cursor_focus_position++;
ui->cursor_focus_fds = ui->target_fds; // NULL is ok
if ( ui->target_fds == NULL )
{
mui_loop_over_form(ui, mui_task_find_first_cursor_uif);
ui->cursor_focus_fds = ui->target_fds; // NULL is ok
// ui->cursor_focus_position = 0;
}
}
/*
this function will overwrite the ui field related member variables
nth_token can be 0 if the fiel text is not a option list
the result is stored in ui->text
*/
void mui_GetSelectableFieldTextOption(mui_t *ui, uint8_t form_id, uint8_t cursor_position, uint8_t nth_token)
{
fds_t *fds = ui->fds; // backup the current fds, so that this function can be called inside a task loop
int len = ui->len; // backup length of the current command
ui->fds = mui_find_form(ui, form_id); // search for the target form and overwrite the current fds
// use the inner_loop procedure, because ui->fds has been assigned already
ui->tmp8 = cursor_position; // maybe we should also backup tmp8, but at the moment tmp8 is only used by mui_task_get_current_cursor_focus_position
mui_inner_loop_over_form(ui, mui_task_read_nth_seleectable_field);
// at this point ui->fds contains the field which was selected from above
// now get the opion string out of the text field. nth_token can be 0 if this is no opion string
mui_fds_get_nth_token(ui, nth_token); // return value is ignored here
ui->fds = fds; // restore the previous fds position
ui->len = len;
// result is stored in ui->text
}
/*
if called from a field function, then the current field variables are destroyed, so that call should be the last call in the field callback.
mui_EnterForm is similar to mui_GotoForm and differes only in the second argument (which is the form id instead of the fds pointer)
*/
void mui_EnterForm(mui_t *ui, fds_t *fds, uint8_t initial_cursor_position)
{
/* exit any previous form, will not do anything if there is no current form */
mui_LeaveForm(ui);
/* clean focus fields */
ui->touch_focus_fds = NULL;
ui->cursor_focus_fds = NULL;
/* assign the form, which should be entered */
ui->current_form_fds = fds;
/* inform all fields that we start a new form */
mui_loop_over_form(ui, mui_task_form_start);
/* assign initional cursor focus */
mui_loop_over_form(ui, mui_task_find_first_cursor_uif);
ui->cursor_focus_fds = ui->target_fds; // NULL is ok
while( initial_cursor_position > 0 )
{
mui_next_field(ui);
initial_cursor_position--;
}
mui_send_cursor_msg(ui, MUIF_MSG_CURSOR_ENTER);
}
/* input: current_form_fds */
/*
if called from a field function, then the current field variables are destroyed, so that call should be the last call in the field callback.
*/
void mui_LeaveForm(mui_t *ui)
{
if ( mui_IsFormActive(ui) == 0 )
return;
mui_send_cursor_msg(ui, MUIF_MSG_CURSOR_LEAVE);
ui->cursor_focus_fds = NULL;
/* inform all fields that we leave the form */
mui_loop_over_form(ui, mui_task_form_end);
ui->current_form_fds = NULL;
}
/* 0: error, form not found */
/*
if called from a field function, then the current field variables are destroyed, so that call should be the last call in the field callback.
*/
uint8_t mui_GotoForm(mui_t *ui, uint8_t form_id, uint8_t initial_cursor_position)
{
fds_t *fds = mui_find_form(ui, form_id);
if ( fds == NULL )
return 0;
/* EnterForm will also leave any previous form */
mui_EnterForm(ui, fds, initial_cursor_position);
return 1;
}
void mui_SaveForm(mui_t *ui)
{
if ( mui_IsFormActive(ui) == 0 )
return;
ui->last_form_id = mui_get_fds_char(ui->current_form_fds+1);
ui->last_form_cursor_focus_position = mui_GetCurrentCursorFocusPosition(ui);
}
/*
if called from a field function, then the current field variables are destroyed, so that call should be the last call in the field callback.
*/
void mui_RestoreForm(mui_t *ui)
{
mui_GotoForm(ui, ui->last_form_id, ui->last_form_cursor_focus_position);
}
/*
updates "ui->cursor_focus_fds"
*/
/*
if called from a field function, then the current field variables are destroyed, so that call should be the last call in the field callback.
*/
void mui_NextField(mui_t *ui)
{
mui_send_cursor_msg(ui, MUIF_MSG_CURSOR_LEAVE);
mui_next_field(ui);
mui_send_cursor_msg(ui, MUIF_MSG_CURSOR_ENTER);
}
/*
updates "ui->cursor_focus_fds"
*/
/*
if called from a field function, then the current field variables are destroyed, so that call should be the last call in the field callback.
*/
void mui_PrevField(mui_t *ui)
{
mui_send_cursor_msg(ui, MUIF_MSG_CURSOR_LEAVE);
mui_loop_over_form(ui, mui_task_find_prev_cursor_uif);
//ui->cursor_focus_position--;
ui->cursor_focus_fds = ui->target_fds; // NULL is ok
if ( ui->target_fds == NULL )
{
//ui->cursor_focus_position = 0;
mui_loop_over_form(ui, mui_task_find_last_cursor_uif);
ui->cursor_focus_fds = ui->target_fds; // NULL is ok
}
mui_send_cursor_msg(ui, MUIF_MSG_CURSOR_ENTER);
}
void mui_SendSelect(mui_t *ui)
{
mui_send_cursor_msg(ui, MUIF_MSG_CURSOR_SELECT);
}
+520
View File
@@ -0,0 +1,520 @@
/*
mui.h
Monochrome minimal user interface: Core library.
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.
*/
#ifndef MUI_H
#define MUI_H
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <string.h>
#include <sys/types.h>
#if defined(__GNUC__) && defined(__AVR__)
#include <avr/pgmspace.h>
#endif
/*==========================================*/
/* C++ compatible */
#ifdef __cplusplus
extern "C" {
#endif
/*==========================================*/
/* defines */
#define MUI_CHECK_EOFDS
/*==========================================*/
/* GNUC AVR PROGMEM interface */
#ifdef __GNUC__
# define MUI_NOINLINE __attribute__((noinline))
#else
# define MUI_NOINLINE
#endif
#if defined(__GNUC__) && defined(__AVR__)
# define mui_pgm_read(adr) pgm_read_byte_near(adr)
# define mui_pgm_wread(adr) pgm_read_word_near(adr)
# define MUI_PROGMEM PROGMEM
#endif
#ifndef mui_pgm_read
# ifndef CHAR_BIT
# define mui_pgm_read(adr) (*(const uint8_t *)(adr))
# else
# if CHAR_BIT > 8
# define mui_pgm_read(adr) ((*(const uint8_t *)(adr)) & 0x0ff)
# else
# define mui_pgm_read(adr) (*(const uint8_t *)(adr))
# endif
# endif
#endif
#ifndef mui_pgm_wread
# define mui_pgm_wread(adr) (*(const uint16_t *)(adr))
#endif
#ifndef MUI_PROGMEM
# define MUI_PROGMEM
#endif
/*=== forward declarations ===*/
typedef struct mui_struct mui_t;
typedef const struct muif_struct muif_t;
typedef uint8_t (*muif_cb)(mui_t *ui, uint8_t msg);
typedef const char fds_t; // form/field definition string
//typedef const char fds_t MUI_PROGMEM; // will work but instead MUI_PROGMEM should be added explicitly
/*=== struct declarations === */
struct muif_struct
{
uint8_t id0;
uint8_t id1;
uint8_t cflags; // config flags e.g. MUIF_CFLAG_IS_CURSOR_SELECTABLE, if so, then it will not receive any cursor/touch msgs
uint8_t extra;
void *data; // might be a pointer to a variable
muif_cb cb; // callback
};
#define MUIF(id,cflags,data,cb) { id[0], id[1], cflags, 0, data, cb}
/* assumes that pointers are 16 bit so encapusalte the wread i another ifdef __AVR__ */
#if defined(__GNUC__) && defined(__AVR__)
# define muif_get_id0(muif) mui_pgm_read(&((muif)->id0))
# define muif_get_id1(muif) mui_pgm_read(&((muif)->id1))
# define muif_get_cflags(muif) mui_pgm_read(&((muif)->cflags))
# define muif_get_extra(muif) mui_pgm_read(&((muif)->extra))
# define muif_get_data(muif) ((void *)mui_pgm_wread(&((muif)->data)))
# define muif_get_cb(muif) ((muif_cb)mui_pgm_wread(&((muif)->cb)))
#else
# define muif_get_id0(muif) ((muif)->id0)
# define muif_get_id1(muif) ((muif)->id1)
# define muif_get_cflags(muif) ((muif)->cflags)
# define muif_get_extra(muif) ((muif)->extra)
# define muif_get_data(muif) ((muif)->data)
# define muif_get_cb(muif) ((muif)->cb)
#endif
#define MUIF_MSG_NONE 0
#define MUIF_MSG_DRAW 1
#define MUIF_MSG_FORM_START 2
#define MUIF_MSG_FORM_END 3
#define MUIF_MSG_CURSOR_ENTER 4
#define MUIF_MSG_CURSOR_SELECT 5
#define MUIF_MSG_CURSOR_LEAVE 6
#define MUIF_MSG_TOUCH_DOWN 7
#define MUIF_MSG_TOUCH_UP 8
/* dynamic flags */
#define MUIF_DFLAG_IS_CURSOR_FOCUS 0x01
#define MUIF_DFLAG_IS_TOUCH_FOCUS 0x02
/* config flags */
#define MUIF_CFLAG_IS_CURSOR_SELECTABLE 0x01
#define MUIF_CFLAG_IS_TOUCH_SELECTABLE 0x02
/* must be smaller than or equal to 255 */
#define MUI_MAX_TEXT_LEN 31
struct mui_struct
{
void *graphics_data;
fds_t *root_fds;
muif_t *muif_tlist;
size_t muif_tcnt;
fds_t *current_form_fds; // the current form, NULL if the ui is not active at the moment
fds_t *cursor_focus_fds; // the field which has the current cursor focus, NULL if there is no current focus
fds_t *touch_focus_fds; // the field which has touch focus
fds_t *token; // current token position
//uint8_t selected_value; // This variable is not used by the user interface but can be used by any field function
uint8_t tmp8;
/* current field/style variables */
//uint8_t cursor_focus_position; // the index of the field which has focus, can be used as last argument for mui_EnterForm
uint8_t delimiter; // outer delimiter of the text part of a field
uint8_t cmd; // current cmd or field (e.g. U or F)
uint8_t id0; // identifier of the field, manually provided or derived (G cmd has fixed id "FG")
uint8_t id1;
uint8_t x; // position of the field
uint8_t y;
uint8_t dflags;
uint8_t arg; // extra argument of the field. For example the G: form is put here
int len; // length of the current command
fds_t *fds; // current position, *fds = cmd
muif_t *uif; // user interface field or style for the given id0 / id1
char text[MUI_MAX_TEXT_LEN+1];
/* target */
fds_t *tmp_fds;
fds_t *target_fds; // used by several task functions as a return / result value
/* last form and field */
uint8_t last_form_id;
uint8_t last_form_cursor_focus_position;
};
#define mui_IsCursorFocus(mui) ((mui)->dflags & MUIF_DFLAG_IS_CURSOR_FOCUS)
#define mui_IsTouchFocus(mui) ((mui)->dflags & MUIF_CFLAG_IS_TOUCH_SELECTABLE)
/*=== form string definitions ===*/
#define MUI_0 "\x00"
#define MUI_1 "\x01"
#define MUI_2 "\x02"
#define MUI_3 "\x03"
#define MUI_4 "\x04"
#define MUI_5 "\x05"
#define MUI_6 "\x06"
#define MUI_7 "\x07"
#define MUI_8 "\x08"
#define MUI_9 "\x09"
#define MUI_10 "\x0a"
#define MUI_11 "\x0b"
#define MUI_12 "\x0c"
#define MUI_13 "\x0d"
#define MUI_14 "\x0e"
#define MUI_15 "\x0f"
#define MUI_16 "\x10"
#define MUI_17 "\x11"
#define MUI_18 "\x12"
#define MUI_19 "\x13"
#define MUI_20 "\x14"
#define MUI_21 "\x15"
#define MUI_22 "\x16"
#define MUI_23 "\x17"
#define MUI_24 "\x18"
#define MUI_25 "\x19"
#define MUI_26 "\x1a"
#define MUI_27 "\x1b"
#define MUI_28 "\x1c"
#define MUI_29 "\x1d"
#define MUI_30 "\x1e"
#define MUI_31 "\x1f"
#define MUI_32 "\x20"
#define MUI_33 "\x21"
#define MUI_34 "\x22"
#define MUI_35 "\x23"
#define MUI_36 "\x24"
#define MUI_37 "\x25"
#define MUI_38 "\x26"
#define MUI_39 "\x27"
#define MUI_40 "\x28"
#define MUI_41 "\x29"
#define MUI_42 "\x2a"
#define MUI_43 "\x2b"
#define MUI_44 "\x2c"
#define MUI_45 "\x2d"
#define MUI_46 "\x2e"
#define MUI_47 "\x2f"
#define MUI_48 "\x30"
#define MUI_49 "\x31"
#define MUI_50 "\x32"
#define MUI_51 "\x33"
#define MUI_52 "\x34"
#define MUI_53 "\x35"
#define MUI_54 "\x36"
#define MUI_55 "\x37"
#define MUI_56 "\x38"
#define MUI_57 "\x39"
#define MUI_58 "\x3a"
#define MUI_59 "\x3b"
#define MUI_60 "\x3c"
#define MUI_61 "\x3d"
#define MUI_62 "\x3e"
#define MUI_63 "\x3f"
#define MUI_64 "\x40"
#define MUI_65 "\x41"
#define MUI_66 "\x42"
#define MUI_67 "\x43"
#define MUI_68 "\x44"
#define MUI_69 "\x45"
#define MUI_70 "\x46"
#define MUI_71 "\x47"
#define MUI_72 "\x48"
#define MUI_73 "\x49"
#define MUI_74 "\x4a"
#define MUI_75 "\x4b"
#define MUI_76 "\x4c"
#define MUI_77 "\x4d"
#define MUI_78 "\x4e"
#define MUI_79 "\x4f"
#define MUI_80 "\x50"
#define MUI_81 "\x51"
#define MUI_82 "\x52"
#define MUI_83 "\x53"
#define MUI_84 "\x54"
#define MUI_85 "\x55"
#define MUI_86 "\x56"
#define MUI_87 "\x57"
#define MUI_88 "\x58"
#define MUI_89 "\x59"
#define MUI_90 "\x5a"
#define MUI_91 "\x5b"
#define MUI_92 "\x5c"
#define MUI_93 "\x5d"
#define MUI_94 "\x5e"
#define MUI_95 "\x5f"
#define MUI_96 "\x60"
#define MUI_97 "\x61"
#define MUI_98 "\x62"
#define MUI_99 "\x63"
#define MUI_100 "\x64"
#define MUI_101 "\x65"
#define MUI_102 "\x66"
#define MUI_103 "\x67"
#define MUI_104 "\x68"
#define MUI_105 "\x69"
#define MUI_106 "\x6a"
#define MUI_107 "\x6b"
#define MUI_108 "\x6c"
#define MUI_109 "\x6d"
#define MUI_110 "\x6e"
#define MUI_111 "\x6f"
#define MUI_112 "\x70"
#define MUI_113 "\x71"
#define MUI_114 "\x72"
#define MUI_115 "\x73"
#define MUI_116 "\x74"
#define MUI_117 "\x75"
#define MUI_118 "\x76"
#define MUI_119 "\x77"
#define MUI_120 "\x78"
#define MUI_121 "\x79"
#define MUI_122 "\x7a"
#define MUI_123 "\x7b"
#define MUI_124 "\x7c"
#define MUI_125 "\x7d"
#define MUI_126 "\x7e"
#define MUI_127 "\x7f"
#define MUI_128 "\x80"
#define MUI_129 "\x81"
#define MUI_130 "\x82"
#define MUI_131 "\x83"
#define MUI_132 "\x84"
#define MUI_133 "\x85"
#define MUI_134 "\x86"
#define MUI_135 "\x87"
#define MUI_136 "\x88"
#define MUI_137 "\x89"
#define MUI_138 "\x8a"
#define MUI_139 "\x8b"
#define MUI_140 "\x8c"
#define MUI_141 "\x8d"
#define MUI_142 "\x8e"
#define MUI_143 "\x8f"
#define MUI_144 "\x90"
#define MUI_145 "\x91"
#define MUI_146 "\x92"
#define MUI_147 "\x93"
#define MUI_148 "\x94"
#define MUI_149 "\x95"
#define MUI_150 "\x96"
#define MUI_151 "\x97"
#define MUI_152 "\x98"
#define MUI_153 "\x99"
#define MUI_154 "\x9a"
#define MUI_155 "\x9b"
#define MUI_156 "\x9c"
#define MUI_157 "\x9d"
#define MUI_158 "\x9e"
#define MUI_159 "\x9f"
#define MUI_160 "\xa0"
#define MUI_161 "\xa1"
#define MUI_162 "\xa2"
#define MUI_163 "\xa3"
#define MUI_164 "\xa4"
#define MUI_165 "\xa5"
#define MUI_166 "\xa6"
#define MUI_167 "\xa7"
#define MUI_168 "\xa8"
#define MUI_169 "\xa9"
#define MUI_170 "\xaa"
#define MUI_171 "\xab"
#define MUI_172 "\xac"
#define MUI_173 "\xad"
#define MUI_174 "\xae"
#define MUI_175 "\xaf"
#define MUI_176 "\xb0"
#define MUI_177 "\xb1"
#define MUI_178 "\xb2"
#define MUI_179 "\xb3"
#define MUI_180 "\xb4"
#define MUI_181 "\xb5"
#define MUI_182 "\xb6"
#define MUI_183 "\xb7"
#define MUI_184 "\xb8"
#define MUI_185 "\xb9"
#define MUI_186 "\xba"
#define MUI_187 "\xbb"
#define MUI_188 "\xbc"
#define MUI_189 "\xbd"
#define MUI_190 "\xbe"
#define MUI_191 "\xbf"
#define MUI_192 "\xc0"
#define MUI_193 "\xc1"
#define MUI_194 "\xc2"
#define MUI_195 "\xc3"
#define MUI_196 "\xc4"
#define MUI_197 "\xc5"
#define MUI_198 "\xc6"
#define MUI_199 "\xc7"
#define MUI_200 "\xc8"
#define MUI_201 "\xc9"
#define MUI_202 "\xca"
#define MUI_203 "\xcb"
#define MUI_204 "\xcc"
#define MUI_205 "\xcd"
#define MUI_206 "\xce"
#define MUI_207 "\xcf"
#define MUI_208 "\xd0"
#define MUI_209 "\xd1"
#define MUI_210 "\xd2"
#define MUI_211 "\xd3"
#define MUI_212 "\xd4"
#define MUI_213 "\xd5"
#define MUI_214 "\xd6"
#define MUI_215 "\xd7"
#define MUI_216 "\xd8"
#define MUI_217 "\xd9"
#define MUI_218 "\xda"
#define MUI_219 "\xdb"
#define MUI_220 "\xdc"
#define MUI_221 "\xdd"
#define MUI_222 "\xde"
#define MUI_223 "\xdf"
#define MUI_224 "\xe0"
#define MUI_225 "\xe1"
#define MUI_226 "\xe2"
#define MUI_227 "\xe3"
#define MUI_228 "\xe4"
#define MUI_229 "\xe5"
#define MUI_230 "\xe6"
#define MUI_231 "\xe7"
#define MUI_232 "\xe8"
#define MUI_233 "\xe9"
#define MUI_234 "\xea"
#define MUI_235 "\xeb"
#define MUI_236 "\xec"
#define MUI_237 "\xed"
#define MUI_238 "\xee"
#define MUI_239 "\xef"
#define MUI_240 "\xf0"
#define MUI_241 "\xf1"
#define MUI_242 "\xf2"
#define MUI_243 "\xf3"
#define MUI_244 "\xf4"
#define MUI_245 "\xf5"
#define MUI_246 "\xf6"
#define MUI_247 "\xf7"
#define MUI_248 "\xf8"
#define MUI_249 "\xf9"
#define MUI_250 "\xfa"
#define MUI_251 "\xfb"
#define MUI_252 "\xfc"
#define MUI_253 "\xfd"
#define MUI_254 "\xfe"
#define MUI_255 "\xff"
/* form: one id only */
#define MUI_FORM(n) "U" MUI_##n
/* style: one id only */
#define MUI_STYLE(n) "S" #n
#define MUI_XY(id, x, y) "F" id MUI_##x MUI_##y
/* button id must be two chars, but must be unique everywhere */
#define MUI_XYT(id, x,y,text) "B" id MUI_##x MUI_##y "\xff" text "\xff"
#define MUI_XYA(id, x,y,a) "A" id MUI_##x MUI_##y MUI_##a
#define MUI_XYAT(id, x,y,a,text) "T" id MUI_##x MUI_##y MUI_##a "\xff" text "\xff"
#define MUI_LABEL(x,y,text) "L" MUI_##x MUI_##y "\xff" text "\xff"
#define MUI_GOTO(x,y,n,text) "G" MUI_##x MUI_##y MUI_##n "\xff" text "\xff"
#define MUI_goto(x,y,n,text) "g" MUI_##x MUI_##y MUI_##n "\xff" text "\xff"
uint8_t mui_get_fds_char(fds_t *s) MUI_NOINLINE;
uint8_t mui_fds_first_token(mui_t *ui) MUI_NOINLINE;
uint8_t mui_fds_next_token(mui_t *ui) MUI_NOINLINE;
uint8_t mui_fds_get_nth_token(mui_t *ui, uint8_t n) MUI_NOINLINE;
uint8_t mui_fds_get_token_cnt(mui_t *ui) MUI_NOINLINE;
void mui_Init(mui_t *ui, void *graphics_data, fds_t *fds, muif_t *muif_tlist, size_t muif_tcnt);
uint8_t mui_GetCurrentCursorFocusPosition(mui_t *ui);
void mui_Draw(mui_t *ui);
void mui_GetSelectableFieldTextOption(mui_t *ui, uint8_t form_id, uint8_t cursor_position, uint8_t nth_token);
void mui_EnterForm(mui_t *ui, fds_t *fds, uint8_t initial_cursor_position);
void mui_LeaveForm(mui_t *ui);
uint8_t mui_GotoForm(mui_t *ui, uint8_t form_id, uint8_t initial_cursor_position);
void mui_SaveForm(mui_t *ui);
void mui_RestoreForm(mui_t *ui);
void mui_NextField(mui_t *ui);
void mui_PrevField(mui_t *ui);
void mui_SendSelect(mui_t *ui);
#define mui_IsFormActive(ui) ((ui)->current_form_fds != NULL)
#ifdef __cplusplus
}
#endif
#endif /* MUI_H */
+1071
View File
File diff suppressed because it is too large Load Diff
+84
View File
@@ -0,0 +1,84 @@
/*
mui_u8g2.h
Monochrome minimal user interface: Glue code between mui and u8g2.
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.
*/
#ifndef MUI_U8G2_H
#define MUI_U8G2_H
/*==========================================*/
/* C++ compatible */
#ifdef __cplusplus
extern "C" {
#endif
/* helper functions */
u8g2_uint_t mui_get_x(mui_t *ui);
u8g2_uint_t mui_get_y(mui_t *ui);
u8g2_t *mui_get_U8g2(mui_t *ui);
/* incomplete field functions */
uint8_t mui_frame_button_bold_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_frame_button_invers_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_half_width_frame_button_invers_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_line_button_invers_select_u8g2(mui_t *ui, uint8_t msg);
/* ready to use field functions */
uint8_t mui_label_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_goto_frame_button_invers_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_goto_half_width_frame_button_invers_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_leave_menu_frame_button_invers_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_goto_line_button_invers_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_input_uint8_invers_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_single_line_option_invers_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_select_options_parent_invers_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_checkbox_invers_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_radio_invers_select_u8g2(mui_t *ui, uint8_t msg);
uint8_t mui_select_options_child_invers_select_u8g2(mui_t *ui, uint8_t msg);
#ifdef __cplusplus
}
#endif
#endif /* MUI_U8G2_H */
+66
View File
@@ -94,7 +94,9 @@
It will consume about 40 bytes more in flash memory of the AVR.
HVLine procedures are also used by the text drawing functions.
*/
#ifndef U8G2_WITHOUT_HVLINE_SPEED_OPTIMIZATION
#define U8G2_WITH_HVLINE_SPEED_OPTIMIZATION
#endif
/*
The following macro activates the early intersection check with the current visible area.
@@ -103,7 +105,9 @@
With a full framebuffer in RAM and if most graphical elements are drawn within the visible area, then this
macro can be commented to reduce code size.
*/
#ifndef U8G2_WITHOUT_INTERSECTION
#define U8G2_WITH_INTERSECTION
#endif
/*
@@ -113,7 +117,9 @@
Setting a clip window will restrict all drawing to this window.
Clip window support requires about 200 bytes flash memory on AVR systems
*/
#ifndef U8G2_WITHOUT_CLIP_WINDOW_SUPPORT
#define U8G2_WITH_CLIP_WINDOW_SUPPORT
#endif
/*
The following macro enables all four drawing directions for glyphs and strings.
@@ -121,7 +127,9 @@
Jan 2020: Disabling this macro will save up to 600 bytes on AVR
*/
#ifndef U8G2_WITHOUT_FONT_ROTATION
#define U8G2_WITH_FONT_ROTATION
#endif
/*
U8glib V2 contains support for unicode plane 0 (Basic Multilingual Plane, BMP).
@@ -147,9 +155,26 @@
- C-Code Strings are assumbed to be ISO 8859-1/CP1252 encoded
- Only character values 0 to 255 are supported in the font file.
*/
#ifndef U8G2_WITHOUT_UNICODE
#define U8G2_WITH_UNICODE
#endif
/*
See issue https://github.com/olikraus/u8g2/issues/1561
The old behaviour of the StrWidth and UTF8Width functions returned an unbalanced string width, where
a small space was added to the left but not to the right of the string in some cases.
The new "balanced" procedure will assume the same gap on the left and the right side of the string
Example: The string width of "C" with font u8g2_font_helvR08_tr was returned as 7.
A frame of width 9 would place the C a little bit more to the right (width of that "C" are 6 pixel).
If U8G2_BALANCED_STR_WIDTH_CALCULATION is defined, the width of "C" is returned as 8.
Not defining U8G2_BALANCED_STR_WIDTH_CALCULATION would fall back to the old bahavior.
*/
#ifndef U8G2_NO_BALANCED_STR_WIDTH_CALCULATION
#define U8G2_BALANCED_STR_WIDTH_CALCULATION
#endif
/*==========================================*/
@@ -950,6 +975,12 @@ void u8g2_Setup_uc1608_240x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_m
void u8g2_Setup_uc1608_i2c_240x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_uc1608_i2c_240x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_uc1608_i2c_240x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_uc1609_slg19264_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_uc1609_slg19264_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_uc1609_slg19264_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_uc1609_i2c_slg19264_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_uc1609_i2c_slg19264_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_uc1609_i2c_slg19264_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_uc1638_160x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_uc1638_160x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_uc1638_160x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
@@ -1100,6 +1131,12 @@ void u8g2_Setup_st7571_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_m
void u8g2_Setup_st7571_i2c_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7571_i2c_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7571_i2c_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7571_128x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7571_128x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7571_128x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7571_i2c_128x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7571_i2c_128x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7571_i2c_128x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7586s_s028hn118a_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7586s_s028hn118a_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7586s_s028hn118a_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
@@ -1396,6 +1433,33 @@ void u8g2_DrawFrame(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t w, u
void u8g2_DrawRBox(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t w, u8g2_uint_t h, u8g2_uint_t r);
void u8g2_DrawRFrame(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t w, u8g2_uint_t h, u8g2_uint_t r);
/*==========================================*/
/* u8g2_button.c */
/* border width */
#define U8G2_BTN_BW_POS 0
#define U8G2_BTN_BW_MASK 7
#define U8G2_BTN_BW0 0x00
#define U8G2_BTN_BW1 0x01
#define U8G2_BTN_BW2 0x02
#define U8G2_BTN_BW3 0x03
/* enable shadow and define gap to button */
#define U8G2_BTN_SHADOW_POS 3
#define U8G2_BTN_SHADOW_MASK 0x18
#define U8G2_BTN_SHADOW0 0x08
#define U8G2_BTN_SHADOW1 0x10
#define U8G2_BTN_SHADOW2 0x18
/* text is displayed inverted */
#define U8G2_BTN_INV 0x20
/* horizontal center */
#define U8G2_BTN_HCENTER 0x40
void u8g2_DrawButtonFrame(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t flags, u8g2_uint_t text_width, u8g2_uint_t padding_h, u8g2_uint_t padding_v);
void u8g2_DrawButtonUTF8(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t flags, u8g2_uint_t width, u8g2_uint_t padding_h, u8g2_uint_t padding_v, const char *text);
/*==========================================*/
/* u8g2_polygon.c */
@@ -1451,6 +1515,8 @@ uint8_t u8g2_IsAllValidUTF8(u8g2_t *u8g2, const char *str); // checks whether al
u8g2_uint_t u8g2_GetStrWidth(u8g2_t *u8g2, const char *s);
u8g2_uint_t u8g2_GetUTF8Width(u8g2_t *u8g2, const char *str);
/*u8g2_uint_t u8g2_GetExactStrWidth(u8g2_t *u8g2, const char *s);*/ /*obsolete, see also https://github.com/olikraus/u8g2/issues/1561 */
void u8g2_SetFontPosBaseline(u8g2_t *u8g2);
void u8g2_SetFontPosBottom(u8g2_t *u8g2);
+291
View File
@@ -0,0 +1,291 @@
/*
u8g2_button.c
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 "u8g2.h"
/*
Description:
Draws normal or inverted text with optional frame around text.
The text (and the frame) can be horizontally centered around the provided reference position.
This procedure will use the current draw color and current font. The height of the frame
depends on the setting of setFontRefHeightText(), setFontRefHeightExtendedText() or setFontRefHeightAll()
Note 1: drawColor 2 (XOR) is not supported. Result will be broken with draw color 2.
Note 2: This procedure will enforce font mode 1 (transparent mode)
Note 3: Some fonts may add an extra gap on the right side. This is a font problem and can not be avoided (for example inb16 has this problem).
The height of the button is defined by the current font and
setFontRefHeightText,
setFontRefHeightExtendedText
setFontRefHeightAll
Right padding might be influenced by the font.
For example u8g2_font_inb16 may add an extra pixel gap (increase padding by one)
on the right side.
The current draw color is considered, but only draw color 0 and 1 are supported
This function requires transparent font mode: setFontMode(1)
Side effect: Font transparent mode is enabled setFontMode(1)
*/
/*
flags:
U8G2_BTN_BW1 0x01
U8G2_BTN_BW2 0x02
U8G2_BTN_BW3 0x03
U8G2_BTN_SHADOW0 0x08
U8G2_BTN_SHADOW1 0x10
U8G2_BTN_SHADOW2 0x18
U8G2_BTN_INV 0x20
U8G2_BTN_HCENTER 0x40
Total size without shadow: width+2*padding_h+2*border
Total size with U8G2_BTN_SHADOW0: width+2*padding_h+3*border
Total size with U8G2_BTN_SHADOW1: width+2*padding_h+3*border+1
Total size with U8G2_BTN_SHADOW2: width+2*padding_h+3*border+2
*/
void u8g2_DrawButtonFrame(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t flags, u8g2_uint_t text_width, u8g2_uint_t padding_h, u8g2_uint_t padding_v)
{
u8g2_uint_t w = text_width;
u8g2_uint_t xx, yy, ww, hh;
u8g2_uint_t border_width = flags & U8G2_BTN_BW_MASK;
int8_t a = u8g2_GetAscent(u8g2);
int8_t d = u8g2_GetDescent(u8g2);
for(;;)
{
xx = x;
xx -= padding_h;
xx -= border_width;
ww = w+2*padding_h+2*border_width;
yy = y;
yy += u8g2->font_calc_vref(u8g2);
yy -= a;
yy -= padding_v;
yy -= border_width;
hh = a-d+2*padding_v+2*border_width;
if ( border_width == 0 )
break;
u8g2_DrawFrame(u8g2, xx, yy, ww, hh);
if ( flags & U8G2_BTN_SHADOW_MASK )
{
if ( border_width == (flags & U8G2_BTN_BW_MASK) )
{
u8g2_uint_t i;
u8g2_uint_t shadow_gap = (flags & U8G2_BTN_SHADOW_MASK) >> U8G2_BTN_SHADOW_POS;
shadow_gap--;
for( i = 0; i < border_width; i++ )
{
u8g2_DrawHLine(u8g2, xx+border_width+shadow_gap,yy+hh+i+shadow_gap,ww);
u8g2_DrawVLine(u8g2, xx+ww+i+shadow_gap,yy+border_width+shadow_gap,hh);
}
}
}
border_width--;
} /* for */
if ( flags & U8G2_BTN_INV )
{
uint8_t color_backup = u8g2->draw_color;
u8g2_SetDrawColor(u8g2, 2); /* XOR */
u8g2_DrawBox(u8g2, xx, yy, ww, hh);
u8g2_SetDrawColor(u8g2, color_backup);
}
}
void u8g2_DrawButtonUTF8(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t flags, u8g2_uint_t width, u8g2_uint_t padding_h, u8g2_uint_t padding_v, const char *text)
{
u8g2_uint_t w = u8g2_GetUTF8Width(u8g2, text);
u8g2_uint_t text_x_offset = 0;
if ( flags & U8G2_BTN_HCENTER )
x -= (w+1)/2;
if ( w < width )
{
if ( flags & U8G2_BTN_HCENTER )
{
text_x_offset = (width-w)/2;
}
w = width;
}
u8g2_SetFontMode(u8g2, 1);
u8g2_DrawUTF8(u8g2, x,y, text);
u8g2_DrawButtonFrame(u8g2, x-text_x_offset, y, flags, w, padding_h, padding_v);
}
#ifdef NOT_USED
void u8g2_Draw4Pixel(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t w)
{
u8g2_DrawPixel(u8g2, x,y-1);
u8g2_DrawPixel(u8g2, x+w-1,y-1);
u8g2_DrawPixel(u8g2, x+w-1,y-w);
u8g2_DrawPixel(u8g2, x,y-w);
}
void u8g2_DrawRadio(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t w, u8g2_uint_t is_checked)
{
uint8_t color_backup = u8g2->draw_color;
u8g2_DrawCheckbox(u8g2, x,y,w,is_checked);
u8g2_SetDrawColor(u8g2, 2);
u8g2_Draw4Pixel(u8g2, x,y,w);
if ( is_checked )
{
//u8g2_Draw4Pixel(u8g2, x+2,y-2,w-4);
}
u8g2_SetDrawColor(u8g2, color_backup );
}
#endif
#ifdef _THIS_CODE_SHOULD_BE_REWRITTEN_WITHOUT_PADWIDTH_
/*
Shadow is not supported
Note: radius must be at least as high as the border width
border width | good radius values
1 | 3, 5, 7, 8, ...
2 | 3, 5, 7, 8, ...
*/
void u8g2_DrawRButtonUTF8(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t flags, u8g2_uint_t padding_h_or_width, u8g2_uint_t padding_v, u8g2_uint_t r, const char *text)
{
u8g2_uint_t w = u8g2_GetUTF8Width(u8g2, text);
//u8g2_uint_t w = u8g2_GetExactStrWidth(u8g2, text);
u8g2_uint_t xx, yy, ww, hh;
u8g2_uint_t border_width = flags & U8G2_BTN_BW_MASK;
u8g2_uint_t padding_h = padding_h_or_width;
u8g2_uint_t text_x_offset = 0; // used for U8G2_BTN_PADWIDTH mode
int8_t a = u8g2_GetAscent(u8g2);
int8_t d = u8g2_GetDescent(u8g2);
uint8_t color_backup = u8g2->draw_color;
if ( flags & U8G2_BTN_HCENTER )
x -= w/2;
if ( flags & U8G2_BTN_PADWIDTH )
{
padding_h = 0;
if ( w < padding_h_or_width )
{
if ( flags & U8G2_BTN_HCENTER )
{
text_x_offset = (padding_h_or_width-w)/2;
}
w = padding_h_or_width;
}
}
u8g2_SetFontMode(u8g2, 1);
for(;;)
{
if ( padding_h >= u8g2_GetDisplayWidth(u8g2)/2 ) // padding_h is zero if U8G2_BTN_PADWIDTH is set
{
xx = (flags & U8G2_BTN_BW_MASK) - border_width;
ww = u8g2_GetDisplayWidth(u8g2);
ww -= 2*((flags & U8G2_BTN_BW_MASK) - border_width);
//printf("xx=%d ww=%d\n", xx, ww);
//printf("clip_x1=%d clip_x0=%d\n", u8g2->clip_x1, u8g2->clip_x0);
}
else
{
xx = x;
xx -= text_x_offset;
xx -= padding_h;
xx -= border_width;
ww = w+2*padding_h+2*border_width;
}
yy = y;
yy += u8g2->font_calc_vref(u8g2);
yy -= a;
yy -= padding_v;
yy -= border_width;
hh = a-d+2*padding_v+2*border_width;
if ( border_width == 0 )
break;
u8g2_DrawRFrame(u8g2, xx, yy, ww, hh, r);
if ( (flags & U8G2_BTN_BW_MASK) > 1 )
u8g2_DrawRFrame(u8g2, xx, yy, ww, hh, r+1);
border_width--;
if ( r > 1 )
r--;
}
if ( flags & U8G2_BTN_INV )
{
u8g2_DrawRBox(u8g2, xx, yy, ww, hh,r);
u8g2_SetDrawColor(u8g2, 1-u8g2->draw_color);
}
u8g2_DrawUTF8(u8g2, x,y, text);
u8g2_SetDrawColor(u8g2, color_backup);
}
#endif
+112
View File
@@ -3183,6 +3183,62 @@ void u8g2_Setup_uc1608_i2c_240x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8
buf = u8g2_m_30_16_f(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* uc1609 */
/* uc1609 1 */
void u8g2_Setup_uc1609_slg19264_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_uc1609_slg19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_24_8_1(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* uc1609 2 */
void u8g2_Setup_uc1609_slg19264_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_uc1609_slg19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_24_8_2(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* uc1609 f */
void u8g2_Setup_uc1609_slg19264_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_uc1609_slg19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_24_8_f(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* uc1609 */
/* uc1609 1 */
void u8g2_Setup_uc1609_i2c_slg19264_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_uc1609_slg19264, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_24_8_1(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* uc1609 2 */
void u8g2_Setup_uc1609_i2c_slg19264_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_uc1609_slg19264, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_24_8_2(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* uc1609 f */
void u8g2_Setup_uc1609_i2c_slg19264_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_uc1609_slg19264, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_24_8_f(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* uc1638 */
/* uc1638 1 */
void u8g2_Setup_uc1638_160x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
@@ -4523,6 +4579,62 @@ void u8g2_Setup_st7571_i2c_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8
buf = u8g2_m_16_16_f(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* st7571 */
/* st7571 1 */
void u8g2_Setup_st7571_128x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7571_128x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_16_12_1(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* st7571 2 */
void u8g2_Setup_st7571_128x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7571_128x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_16_12_2(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* st7571 f */
void u8g2_Setup_st7571_128x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7571_128x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_16_12_f(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* st7571 */
/* st7571 1 */
void u8g2_Setup_st7571_i2c_128x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7571_128x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_16_12_1(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* st7571 2 */
void u8g2_Setup_st7571_i2c_128x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7571_128x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_16_12_2(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* st7571 f */
void u8g2_Setup_st7571_i2c_128x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7571_128x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_16_12_f(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* st7586s */
/* st7586s 1 */
void u8g2_Setup_st7586s_s028hn118a_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
+69 -28
View File
@@ -524,7 +524,7 @@ int8_t u8g2_font_decode_glyph(u8g2_t *u8g2, const uint8_t *glyph_data)
int8_t h;
u8g2_font_decode_t *decode = &(u8g2->font_decode);
u8g2_font_setup_decode(u8g2, glyph_data);
u8g2_font_setup_decode(u8g2, glyph_data); /* set values in u8g2->font_decode data structure */
h = u8g2->font_decode.glyph_height;
x = u8g2_font_decode_get_signed_bits(decode, u8g2->font_info.bits_per_char_x);
@@ -1118,6 +1118,9 @@ static u8g2_uint_t u8g2_string_width(u8g2_t *u8g2, const char *str)
{
uint16_t e;
u8g2_uint_t w, dx;
#ifdef U8G2_BALANCED_STR_WIDTH_CALCULATION
int8_t initial_x_offset = -64;
#endif
u8g2->font_decode.glyph_width = 0;
u8x8_utf8_init(u8g2_GetU8x8(u8g2));
@@ -1137,17 +1140,29 @@ static u8g2_uint_t u8g2_string_width(u8g2_t *u8g2, const char *str)
if ( e != 0x0fffe )
{
dx = u8g2_GetGlyphWidth(u8g2, e); /* delta x value of the glyph */
#ifdef U8G2_BALANCED_STR_WIDTH_CALCULATION
if ( initial_x_offset == -64 )
initial_x_offset = u8g2->glyph_x_offset;
#endif
//printf("'%c' x=%d dx=%d w=%d io=%d ", e, u8g2->glyph_x_offset, dx, u8g2->font_decode.glyph_width, initial_x_offset);
w += dx;
}
}
//printf("\n");
/* adjust the last glyph, check for issue #16: do not adjust if width is 0 */
if ( u8g2->font_decode.glyph_width != 0 )
{
//printf("string width adjust dx=%d glyph_width=%d x-offset=%d\n", dx, u8g2->font_decode.glyph_width, u8g2->glyph_x_offset);
w -= dx;
w += u8g2->font_decode.glyph_width; /* the real pixel width of the glyph, sideeffect of GetGlyphWidth */
/* issue #46: we have to add the x offset also */
w += u8g2->glyph_x_offset; /* this value is set as a side effect of u8g2_GetGlyphWidth() */
#ifdef U8G2_BALANCED_STR_WIDTH_CALCULATION
/* https://github.com/olikraus/u8g2/issues/1561 */
if ( initial_x_offset > 0 )
w+=initial_x_offset;
#endif
}
// printf("w=%d \n", w);
@@ -1177,12 +1192,24 @@ int8_t u8g2_GetStrX(u8g2_t *u8g2, const char *s)
}
/*
Warning: This function needs to be fixed. I think it was taken over from u8glib, but not fixed as of now
The main difference for this procedure compared to the normal get width, should be, that the initial
offset is removed
Idea: for the user interface it probably would be better to add the xoffset of the first char to the end, so that the overall word looks better.
Maybe then the procedure should be called differently, maybe balanced width instead of exact width
u8g2_calculate_exact_string_width is now OBSOLETE, instead the above str width calculation has been updated:
https://github.com/olikraus/u8g2/issues/1561
*/
#ifdef OBSOLETE
static u8g2_uint_t u8g2_calculate_exact_string_width(u8g2_t *u8g2, const char *str)
{
u8g2_uint_t w;
const char *s = str;
uint16_t enc;
u8g2_uint_t w;
uint8_t cnt;
uint8_t gw;
int8_t ox, dx;
@@ -1191,18 +1218,32 @@ static u8g2_uint_t u8g2_calculate_exact_string_width(u8g2_t *u8g2, const char *s
/* check for empty string, width is already 0 */
do
cnt = 0;
for(;;)
{
enc = u8g2->u8x8.next_cb(u8g2_GetU8x8(u8g2), (uint8_t)*str);
str++;
} while( enc == 0x0fffe );
enc = u8g2->u8x8.next_cb(u8g2_GetU8x8(u8g2), (uint8_t)*s);
if ( enc == 0x0ffff )
break;
s++;
if ( enc != 0x0fffe )
{
if ( cnt == 0 )
{
/* get glyph properties of the first char */
u8g2_GetGlyphHorizontalProperties(u8g2, enc, &gw, &ox, &dx);
}
cnt++;
if ( cnt > 2 )
break;
}
}
if ( enc== 0x0ffff )
return w;
/* get the glyph information of the first char. This must be valid, because we already checked for the empty string */
/* if *s is not inside the font, then the cached parameters of the glyph are all zero */
u8g2_GetGlyphHorizontalProperties(u8g2, enc, &gw, &ox, &dx);
if ( cnt == 0 )
return 0;
if ( cnt == 1 )
return gw;
/* strlen(s) == 1: width = width(s[0]) */
/* strlen(s) == 2: width = - offx(s[0]) + deltax(s[0]) + offx(s[1]) + width(s[1]) */
@@ -1213,39 +1254,37 @@ static u8g2_uint_t u8g2_calculate_exact_string_width(u8g2_t *u8g2, const char *s
w = -ox;
for(;;)
{
/* check and stop if the end of the string is reached */
do
{
enc = u8g2->u8x8.next_cb(u8g2_GetU8x8(u8g2), (uint8_t)*str);
str++;
} while( enc == 0x0fffe );
enc = u8g2->u8x8.next_cb(u8g2_GetU8x8(u8g2), (uint8_t)*str);
if ( enc== 0x0ffff )
break;
u8g2_GetGlyphHorizontalProperties(u8g2, enc, &gw, &ox, &dx);
/* if there are still more characters, add the delta to the next glyph */
w += dx;
str++;
if ( enc != 0x0fffe )
{
u8g2_GetGlyphHorizontalProperties(u8g2, enc, &gw, &ox, &dx);
/* if there are still more characters, add the delta to the next glyph */
w += dx;
}
}
/* finally calculate the width of the last char */
/* here is another exception, if the last char is a black, use the dx value instead */
if ( enc != ' ' )
/* here is another exception, if the last char is a blank, use the dx value instead */
if ( gw != 0 )
{
w -= dx; /* remove the last dx */
/* if g was not updated in the for loop (strlen() == 1), then the initial offset x gets removed */
w += gw;
w += ox;
}
else
{
w += dx;
//w += dx;
}
return w;
}
#endif
@@ -1257,11 +1296,13 @@ u8g2_uint_t u8g2_GetStrWidth(u8g2_t *u8g2, const char *s)
return u8g2_string_width(u8g2, s);
}
/* OBSOLETE
u8g2_uint_t u8g2_GetExactStrWidth(u8g2_t *u8g2, const char *s)
{
u8g2->u8x8.next_cb = u8x8_ascii_next;
return u8g2_calculate_exact_string_width(u8g2, s);
}
*/
/*
source: https://en.wikipedia.org/wiki/UTF-8
+8
View File
@@ -89,7 +89,9 @@
/* Global Defines */
/* Undefine this to remove u8x8_SetContrast function */
#ifndef U8X8_WITHOUT_SET_CONTRAST
#define U8X8_WITH_SET_CONTRAST
#endif
/* Define this for an additional user pointer inside the u8x8 data struct */
//#define U8X8_WITH_USER_PTR
@@ -188,6 +190,10 @@ uint8_t u8x8_pgm_read_esp(const uint8_t * addr); /* u8x8_8x8.c */
#define U8X8_USE_PINS
#endif
#ifdef RTT_U8G2
#define U8X8_USE_PINS
#endif
/*==========================================*/
/* U8X8 typedefs and data structures */
@@ -872,6 +878,7 @@ uint8_t u8x8_d_st7567_64x32(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *ar
uint8_t u8x8_d_st7567_hem6432(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st7567_os12864(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st7571_128x128(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st7571_128x96(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st7586s_s028hn118a(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st7586s_erc240160(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st7586s_ymc240160(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
@@ -925,6 +932,7 @@ uint8_t u8x8_d_uc1608_erc24064(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void
uint8_t u8x8_d_uc1608_dem240064(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_uc1608_erc240120(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_uc1608_240x128(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_uc1609_slg19264(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_uc1610_ea_dogxl160(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_uc1611_ea_dogm240(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_uc1611_ea_dogxl240(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
+102 -1
View File
@@ -35,6 +35,7 @@
ST7571: 128x129 2-bit graylevel LCD
https://github.com/olikraus/u8g2/issues/921
https://github.com/olikraus/u8g2/issues/1575 128x96
*/
@@ -181,12 +182,13 @@ static const uint8_t u8x8_d_st7571_128x128_init_seq[] = {
U8X8_C(0xC8), // SHL select
U8X8_CA(0x44, 0x00), // COM0 register
U8X8_CA(0x40, 0x7f), // initial display line (0x7f... strange but ok... maybe specific for the JLX128128)
// 2 sep 2021: maybe this also wrong because the 0x44 command is overwritten later.
U8X8_C(0xAB), // OSC ON
U8X8_C(0x25), // Voltage regulator
U8X8_CA(0x81, 0x33), // Volume
U8X8_C(0x54), // LCD Bias: 0x056=1/11 (1/11 according to JLX128128 datasheet), 0x054=1/9
U8X8_CA(0x44, 0x7f), // Duty 1/128
U8X8_CA(0x44, 0x7f), // Duty 1/128 // 2 Sep 2021: Should this be 00x48???
U8X8_C(0x2C), // Power Control, VC: ON, VR: OFF, VF: OFF
U8X8_DLY(200),
@@ -257,3 +259,102 @@ uint8_t u8x8_d_st7571_128x128(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *
}
return 1;
}
/*===================================================*/
/*
https://github.com/olikraus/u8g2/issues/1575
http://www.jlxlcd.cn/html/zh-detail-1211.html
*/
static const uint8_t u8x8_d_st7571_128x96_init_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0xAE), // Display OFF
U8X8_C(0x38), // Mode Set
//U8X8_C(0xB8), // FR=1011 (85Hz), BE[1:0]=10, level 3 booster
U8X8_C(0x94), // 128x96: 75 Hz
U8X8_C(0xA0), // ADC select
U8X8_C(0xC8), // SHL select
U8X8_CA(0x44, 0x20), // 128x96: COM0 register
U8X8_CA(0x40, 0x00), // 128x96 datasheet
U8X8_C(0xAB), // OSC ON
U8X8_C(0x27), // 128x96: Voltage regulator
U8X8_CA(0x81, 0x28), // 128x96: Volume
U8X8_C(0x57), // 128x96: LCD Bias: 1/12
U8X8_CA(0x48, 0x61), // 128x96: Duty 1/96
U8X8_C(0x2C), // Power Control, VC: ON, VR: OFF, VF: OFF
U8X8_DLY(200),
U8X8_C(0x2E), // Power Control, VC: ON, VR: ON, VF: OFF
U8X8_DLY(200),
U8X8_C(0x2F), // Power Control, VC: ON, VR: ON, VF: ON
U8X8_DLY(10),
U8X8_C(0x7B), // command set 3
U8X8_C(0x11), // black white mode
U8X8_C(0x00), // exit command set 3
U8X8_C(0xA6), // Display Inverse OFF
U8X8_C(0xA4), // Disable Display All Pixel ON
//U8X8_C(0xAF), // Display on
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const u8x8_display_info_t u8x8_st7571_128x96_display_info =
{
/* chip_enable_level = */ 0,
/* chip_disable_level = */ 1,
/* post_chip_enable_wait_ns = */ 20,
/* pre_chip_disable_wait_ns = */ 20,
/* reset_pulse_width_ms = */ 5,
/* post_reset_wait_ms = */ 5, /**/
/* sda_setup_time_ns = */ 20, /* */
/* sck_pulse_width_ns = */ 40, /* */
/* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */
/* spi_mode = */ 0, /* active high, rising edge */
/* i2c_bus_clock_100kHz = */ 4, /* 400KHz */
/* data_setup_time_ns = */ 15,
/* write_pulse_width_ns = */ 70,
/* tile_width = */ 16,
/* tile_hight = */ 12,
/* default_x_offset = */ 0,
/* flipmode_x_offset = */ 0,
/* pixel_width = */ 128,
/* pixel_height = */ 96
};
uint8_t u8x8_d_st7571_128x96(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{
if ( u8x8_d_st7571_generic(u8x8, msg, arg_int, arg_ptr) != 0 )
return 1;
switch(msg)
{
case U8X8_MSG_DISPLAY_INIT:
u8x8_d_helper_display_init(u8x8);
u8x8_cad_SendSequence(u8x8, u8x8_d_st7571_128x96_init_seq);
break;
case U8X8_MSG_DISPLAY_SETUP_MEMORY:
u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7571_128x96_display_info);
break;
default:
return 0;
}
return 1;
}
+2
View File
@@ -82,6 +82,7 @@ static const uint8_t u8x8_d_st7586s_erc240160_flip1_seq[] = {
};
static const uint8_t u8x8_d_st7586s_erc240160_init_seq[] = {
U8X8_START_TRANSFER(),/* enable chip */
U8X8_END_TRANSFER(),/* disable chip */
// U8G_ESC_RST(1), /* hardware reset */
U8X8_DLY(60), /* Delay 60 ms */
@@ -135,6 +136,7 @@ static const uint8_t u8x8_d_st7586s_erc240160_init_seq[] = {
U8X8_A(0x09F), // 160 pixels
U8X8_C(0x029), // Display ON
U8X8_END_TRANSFER(),/* disable chip */
U8X8_END() /* end of sequence */
};
+2
View File
@@ -134,6 +134,7 @@ static uint8_t u8x8_d_st7586s_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int,
}
static const uint8_t u8x8_d_st7586s_s028hn118a_init_seq[] = {
U8X8_START_TRANSFER(),/* enable chip */
U8X8_END_TRANSFER(),/* disable chip */
// U8G_ESC_RST(15), /* hardware reset */
U8X8_DLY(60), /* Delay 60 ms */
@@ -190,6 +191,7 @@ static const uint8_t u8x8_d_st7586s_s028hn118a_init_seq[] = {
U8X8_A(0x00C), // issue in the US too
U8X8_C(0x029), // Display ON
U8X8_END_TRANSFER(),/* disable chip */
U8X8_END() /* end of sequence */
};
+2
View File
@@ -74,6 +74,7 @@ static const uint8_t u8x8_d_st7586s_ymc240160_flip1_seq[] = {
};
static const uint8_t u8x8_d_st7586s_ymc240160_init_seq[] = {
U8X8_START_TRANSFER(),/* enable chip */
U8X8_END_TRANSFER(),/* disable chip */
// U8G_ESC_RST(1), /* hardware reset */
U8X8_DLY(60), /* Delay 60 ms */
@@ -127,6 +128,7 @@ static const uint8_t u8x8_d_st7586s_ymc240160_init_seq[] = {
U8X8_A(0x09F), // 160 pixels
U8X8_C(0x029), // Display ON
U8X8_END_TRANSFER(),/* disable chip */
U8X8_END() /* end of sequence */
};
+295
View File
@@ -0,0 +1,295 @@
/*
u8x8_d_uc1610.c
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.
cad001
*/
#include "u8x8.h"
static const uint8_t u8x8_d_uc1609_erm19264_init_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_CA(0x0f1, 0x067), /* set COM end (display height-1) */
U8X8_C(0x0c0), /* SEG & COM normal */
U8X8_C(0x040), /* set scroll line lsb to zero */
U8X8_C(0x050), /* set scroll line msb to zero */
U8X8_C(0x02b), /* set panelloading */
U8X8_C(0x0eb), /* set bias 1/2 */
U8X8_CA(0x081, 0x05f), /* set contrast */
/*
AC0: 0: stop at boundary, 1: increment by one
AC1: 0: first column then page, 1: first page, then column increment
AC2: 0: increment page adr, 1: decrement page adr.
*/
U8X8_C(0x08b), /* set auto increment, low bits are AC2 AC1 AC0 */
/*
LC0: 0
MX: Mirror X
MY: Mirror Y
*/
U8X8_C(0x0c0), /* low bits are MY, MX, LC0 */
U8X8_C(0x0f8), // window mode off
U8X8_C(0x010), // col high
U8X8_C(0x000), // col low
U8X8_C(0x0b0), // page
U8X8_C(0x0a6), /* set normal pixel mode (not inverse) */
U8X8_C(0x0a4), /* set normal pixel mode (not all on) */
/* test code
U8X8_C(0x0af), // display on
U8X8_C(0x0f8), // window mode off
U8X8_CA(0x0f4, 0), // set window
U8X8_CA(0x0f5, 0),
U8X8_CA(0x0f6, 4),
U8X8_CA(0x0f7, 1),
U8X8_C(0x0f9), // window mode on
U8X8_D1(0x03),
U8X8_D1(0x0c0),
U8X8_D1(0x0ff),
U8X8_D1(0x0ff),
U8X8_D1(0x0ff),
U8X8_D1(0x0ff),
U8X8_D1(0x0ff),
U8X8_D1(0x0ff),
*/
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const uint8_t u8x8_d_uc1609_erm19264_powersave0_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0x0af), /* display on, UC1610 */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const uint8_t u8x8_d_uc1609_erm19264_powersave1_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0x0ae), /* display off, UC1610 */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const uint8_t u8x8_d_uc1609_erm19264_flip0_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
/*
LC0: 0
MX: Mirror X
MY: Mirror Y
*/
U8X8_C(0x0c0), /* low bits are MY, MX, LC0 */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const uint8_t u8x8_d_uc1609_erm19264_flip1_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
/*
LC0: 0
MX: Mirror X
MY: Mirror Y
*/
U8X8_C(0x0c6), /* low bits are MY, MX, LC0 */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
/*
UC1610 has two chip select inputs (CS0 and CS1).
CS0 is low active, CS1 is high active. It will depend on the display
module whether the display has a is low or high active chip select.
*/
static const u8x8_display_info_t u8x8_uc1609_display_info =
{
/* chip_enable_level = */ 0,
/* chip_disable_level = */ 1,
/* post_chip_enable_wait_ns = */ 15,
/* pre_chip_disable_wait_ns = */ 15,
/* reset_pulse_width_ms = */ 1,
/* post_reset_wait_ms = */ 6,
/* sda_setup_time_ns = */ 30,
/* sck_pulse_width_ns = */ 63, /* half of cycle time (125ns cycle time according to datasheet) --> 8MHz clock */
/* sck_clock_hz = */ 8000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */
/* spi_mode = */ 0, /* active high, rising edge */
/* i2c_bus_clock_100kHz = */ 4,
/* data_setup_time_ns = */ 30,
/* write_pulse_width_ns = */ 40,
/* tile_width = */ 20,
/* tile_hight = */ 13, /* height of 13*8=104 pixel */
/* default_x_offset = */ 0,
/* flipmode_x_offset = */ 0,
/* pixel_width = */ 194,
/* pixel_height = */ 92
};
/*
RAM Organization:
D0 Pix0
D1
D2 Pix1
D3
D4 Pix2
D5
D6 Pix3
D7
D0 Pix4
D1
D2 Pix5
D3
D4 Pix6
D5
D6 Pix7
D7
*/
static uint8_t *u8x8_convert_tile_for_uc1609(uint8_t *t)
{
uint8_t i;
uint16_t r;
static uint8_t buf[16];
uint8_t *pbuf = buf;
for( i = 0; i < 8; i++ )
{
r = u8x8_upscale_byte(*t++);
*pbuf++ = r & 255;
r >>= 8;
*pbuf++ = r;
}
return buf;
}
uint8_t u8x8_d_uc1609_slg19264(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{
uint8_t x, c, page;
uint8_t *ptr;
switch(msg)
{
case U8X8_MSG_DISPLAY_SETUP_MEMORY:
u8x8_d_helper_display_setup_memory(u8x8, &u8x8_uc1609_display_info);
break;
case U8X8_MSG_DISPLAY_INIT:
u8x8_d_helper_display_init(u8x8);
u8x8_cad_SendSequence(u8x8, u8x8_d_uc1609_erm19264_init_seq);
break;
case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
if ( arg_int == 0 )
u8x8_cad_SendSequence(u8x8, u8x8_d_uc1609_erm19264_powersave0_seq);
else
u8x8_cad_SendSequence(u8x8, u8x8_d_uc1609_erm19264_powersave1_seq);
break;
case U8X8_MSG_DISPLAY_SET_FLIP_MODE:
if ( arg_int == 0 )
{
u8x8_cad_SendSequence(u8x8, u8x8_d_uc1609_erm19264_flip0_seq);
u8x8->x_offset = u8x8->display_info->default_x_offset;
}
else
{
u8x8_cad_SendSequence(u8x8, u8x8_d_uc1609_erm19264_flip1_seq);
u8x8->x_offset = u8x8->display_info->flipmode_x_offset;
}
break;
#ifdef U8X8_WITH_SET_CONTRAST
case U8X8_MSG_DISPLAY_SET_CONTRAST:
u8x8_cad_StartTransfer(u8x8);
u8x8_cad_SendCmd(u8x8, 0x081 );
u8x8_cad_SendArg(u8x8, arg_int ); /* uc1610 has range from 0 to 255 */
u8x8_cad_EndTransfer(u8x8);
break;
#endif
case U8X8_MSG_DISPLAY_DRAW_TILE:
u8x8_cad_StartTransfer(u8x8);
x = ((u8x8_tile_t *)arg_ptr)->x_pos;
x *= 8;
x += u8x8->x_offset;
page = (((u8x8_tile_t *)arg_ptr)->y_pos);
page *= 2;
u8x8_cad_SendCmd(u8x8, 0x0f8 ); /* window disable */
//u8x8_cad_SendCmd(u8x8, 0x010 | (x>>4) );
//u8x8_cad_SendCmd(u8x8, 0x000 | ((x&15)));
//u8x8_cad_SendCmd(u8x8, 0x0b0 | page);
u8x8_cad_SendCmd(u8x8, 0x0f4 ); /* window start column */
u8x8_cad_SendArg(u8x8, x);
u8x8_cad_SendCmd(u8x8, 0x0f5 ); /* window start page */
u8x8_cad_SendArg(u8x8, page);
u8x8_cad_SendCmd(u8x8, 0x0f6 ); /* window end column */
u8x8_cad_SendArg(u8x8, 159); /* end of display */
u8x8_cad_SendCmd(u8x8, 0x0f7 ); /* window end page */
u8x8_cad_SendArg(u8x8, page+1);
u8x8_cad_SendCmd(u8x8, 0x0f9 ); /* window enable */
do
{
c = ((u8x8_tile_t *)arg_ptr)->cnt;
ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr;
do
{
u8x8_cad_SendData(u8x8, 16, u8x8_convert_tile_for_uc1609(ptr));
ptr += 8;
x += 8;
c--;
} while( c > 0 );
arg_int--;
} while( arg_int > 0 );
u8x8_cad_EndTransfer(u8x8);
break;
default:
return 0;
}
return 1;
}