adapted for ST7567 (aitendo CH12864F-SPI)

Fork of st7565LCD by jun imamura

/media/uploads/masato/ch12864f-spi.jpg

jun imamura さんの st7565 SPI LCD ライブラリを st7567 (aitendo CH12864 SPI) LCD 用にちょっとだけ手をいれたもの。 st7565LCD.cpp 内で #define ST7567 とする。この定義を外せば元の ST7565 用となる。写真は FRDM-KL05Z での動作例。テスト用プログラムは jun imamura のものをそのまま使っている。

aitendo CH12864 SPI の説明には3.3〜5Vで動作するとあるが、ST7567R のドキュメントには 3.3V までとあるから 5V 動作はしないほうが良いだろう。また、手元の製品ではシルクでピンネームが入っていたが、Web ページの表とは異なっている。これはシルクのほうが誤り。aitendo の商品ページには Adafruit の ST7565 ライブラリでの動作例がでているが、これも同じように修正できる。

Revision:
1:29ff79184a05
Parent:
0:f2eba6cbd093
--- a/st7565LCD.cpp	Tue Mar 18 09:26:16 2014 +0000
+++ b/st7565LCD.cpp	Sat Jan 09 12:21:39 2016 +0000
@@ -35,12 +35,19 @@
 #include "st7565LCD.h"
 #include "st7565LCDfont.h"
 
+#define ST7567 //
+
+#ifdef ST7567
+#define ST7565_STARTBYTES 0 
+const uint8_t pagemap[] = { 7, 6, 5, 4, 3, 2, 1, 0 };
+#else
 #define ST7565_STARTBYTES 1
+const uint8_t pagemap[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
+#endif
 
 uint8_t is_reversed = 0;
 
 // a handy reference to where the pages are on the screen
-const uint8_t pagemap[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
 
 // a 5x7 font table
 extern const uint8_t font[];