Adafruit ssd1331 OLED 96x64 SPI model

Fork of OledLib by tetsuya noguchi

Files at this revision

API Documentation at this revision

Comitter:
AhJie
Date:
Tue Feb 02 15:08:01 2016 +0000
Parent:
6:7c25a9403243
Child:
8:a6060524095f
Commit message:
Adafruit ssd1331
; 96x64 OLED

Changed in this revision

ascii_font6x8.h Show annotated file Show diff for this revision Revisions of this file
spioled96x64.cpp Show annotated file Show diff for this revision Revisions of this file
spioled96x64.h Show annotated file Show diff for this revision Revisions of this file
--- a/ascii_font6x8.h	Sat Jan 15 03:24:10 2011 +0000
+++ b/ascii_font6x8.h	Tue Feb 02 15:08:01 2016 +0000
@@ -1,20 +1,20 @@
 #ifndef __ascii_font6x8__
 #define __ascii_font6x8__
 /*
-  6*8ƒhƒbƒg“ú–{Œêƒrƒbƒgƒ}ƒbƒvƒtƒHƒ“ƒg    k6x8 period ƒÀ1
+  6*8�h�b�g���{���r�b�g�}�b�v�t�H���g    k6x8 period ��1
    Copyright(C) 2000-2006 Num Kadoma
-   ƒx[ƒX‚É”¼ŠpƒtƒHƒ“ƒg‘Š“–•”‚ðƒƒ‚ƒŠ“WŠJ
+   �x�[�X�ɔ��p�t�H���g���������������W�J
 */
-// 0x20~7f‚Ü‚Å‚Ì0x60ƒoƒCƒg‚̃f[ƒ^ (‘—e—Ê240byte)
-// ƒAƒNƒZƒX‚·‚é“Y‚¦Žš‚É’ˆÓ(ƒLƒƒƒ‰ƒNƒ^ƒR[ƒh-0x20‚őΏۃtƒHƒ“ƒg‚É‚È‚é)
+// 0x20~7f�܂ł�0x60�o�C�g�̃f�[�^ (���e��240byte)
+// �A�N�Z�X�����Y�����ɒ���(�L�����N�^�R�[�h-0x20�őΏۃt�H���g�ɂȂ�)
 static const char FontLookup_ABC[0x60][6] = {
     { 0x00,0x00,0x00,0x00,0x00,0x00 } , /*SPC */ 
     { 0x00,0x00,0x5F,0x00,0x00,0x00 } , /* !  */ 
     { 0x04,0x03,0x04,0x03,0x00,0x00 } , /* "  */ 
     { 0x28,0x7E,0x14,0x3F,0x0A,0x00 } , /* #  */ 
-    { 0x24,0x2A,0x7F,0x2A,0x12,0x00 } , /* $  */ 
+    { 0x00,0x12,0x2A,0x7F,0x2A,0x24 } , /* $  */ 
     { 0x23,0x13,0x08,0x64,0x62,0x00 } , /* %  */ 
-    { 0x30,0x4E,0x59,0x26,0x50,0x00 } , /* &  */ 
+    { 0x00,0x50,0x26,0x59,0x4e,0x30 } , /* &  */ 
     { 0x00,0x00,0x02,0x01,0x00,0x00 } , /* '  */ 
     { 0x00,0x00,0x1C,0x22,0x41,0x00 } , /* (  */ 
     { 0x41,0x22,0x1C,0x00,0x00,0x00 } , /* )  */ 
@@ -23,87 +23,87 @@
     { 0x50,0x30,0x00,0x00,0x00,0x00 } , /* ,  */ 
     { 0x08,0x08,0x08,0x08,0x08,0x00 } , /* -  */ 
     { 0x60,0x60,0x00,0x00,0x00,0x00 } , /* .  */ 
-    { 0x20,0x10,0x08,0x04,0x02,0x00 } , /* /  */ 
+    { 0x15,0x16,0x7C,0x16,0x11,0x00 } , /* /  */ 
     { 0x3E,0x51,0x49,0x45,0x3E,0x00 } , /* 0  */ 
-    { 0x00,0x42,0x7F,0x40,0x00,0x00 } , /* 1  */ 
-    { 0x62,0x51,0x49,0x49,0x46,0x00 } , /* 2  */ 
-    { 0x22,0x41,0x49,0x49,0x36,0x00 } , /* 3  */ 
-    { 0x18,0x14,0x12,0x7F,0x10,0x00 } , /* 4  */ 
-    { 0x2F,0x45,0x45,0x45,0x39,0x00 } , /* 5  */ 
-    { 0x3E,0x49,0x49,0x49,0x32,0x00 } , /* 6  */ 
-    { 0x01,0x61,0x19,0x05,0x03,0x00 } , /* 7  */ 
+    { 0x00,0x00,0x40,0x7f,0x42,0x00 } , /* 1  */ 
+    { 0x00,0x46,0x49,0x49,0x51,0x62 } , /* 2  */ 
+    { 0x00,0x36,0x49,0x49,0x41,0x22 } , /* 3  */ 
+    { 0x00,0x10,0x7f,0x12,0x14,0x18 } , /* 4  */ 
+    { 0x39,0x45,0x45,0x45,0x2f,0x00 } , /* 5  */ 
+    { 0x00,0x32,0x49,0x49,0x49,0x3e } , /* 6  */ 
+    { 0x00,0x03,0x05,0x19,0x61,0x01 } , /* 7  */ 
     { 0x36,0x49,0x49,0x49,0x36,0x00 } , /* 8  */ 
-    { 0x26,0x49,0x49,0x49,0x3E,0x00 } , /* 9  */ 
+    { 0x00,0x3e,0x49,0x49,0x49,0x26 } , /* 9  */ 
     { 0x00,0x36,0x36,0x00,0x00,0x00 } , /* :  */ 
-    { 0x00,0x56,0x36,0x00,0x00,0x00 } , /* ;  */ 
+    { 0x00,0x00,0x00,0x36,0x56,0x00 } , /* ;  */ 
     { 0x00,0x08,0x14,0x22,0x41,0x00 } , /* <  */ 
     { 0x14,0x14,0x14,0x14,0x14,0x00 } , /* =  */ 
     { 0x41,0x22,0x14,0x08,0x00,0x00 } , /* >  */ 
-    { 0x02,0x01,0x59,0x09,0x06,0x00 } , /* ?  */ 
-    { 0x3E,0x41,0x5D,0x55,0x2E,0x00 } , /* @  */ 
-    { 0x60,0x1C,0x13,0x1C,0x60,0x00 } , /* A  */ 
-    { 0x7F,0x49,0x49,0x49,0x36,0x00 } , /* B  */ 
-    { 0x3E,0x41,0x41,0x41,0x22,0x00 } , /* C  */ 
-    { 0x7F,0x41,0x41,0x22,0x1C,0x00 } , /* D  */ 
-    { 0x7F,0x49,0x49,0x49,0x41,0x00 } , /* E  */ 
-    { 0x7F,0x09,0x09,0x09,0x01,0x00 } , /* F  */ 
-    { 0x1C,0x22,0x41,0x49,0x3A,0x00 } , /* G  */ 
+    { 0x00,0x06,0x09,0x59,0x01,0x02 } , /* ?  */ 
+    { 0x00,0x2e,0x55,0x5d,0x41,0x3e } , /* @  */ 
+    { 0x00,0x60,0x1c,0x13,0x1c,0x60 } , /* A  */ 
+    { 0x00,0x36,0x49,0x49,0x49,0x7f } , /* B  */ 
+    { 0x00,0x22,0x41,0x41,0x41,0x3e } , /* C  */ 
+    { 0x00,0x1c,0x22,0x41,0x41,0x7f } , /* D  */ 
+    { 0x00,0x41,0x49,0x49,0x49,0x7f } , /* E  */ 
+    { 0x00,0x01,0x09,0x09,0x09,0x7f } , /* F  */ 
+    { 0x3A,0x49,0x41,0x22,0x1C,0x00 } , /* G  */ 
     { 0x7F,0x08,0x08,0x08,0x7F,0x00 } , /* H  */ 
     { 0x00,0x41,0x7F,0x41,0x00,0x00 } , /* I  */ 
-    { 0x20,0x40,0x40,0x40,0x3F,0x00 } , /* J  */ 
-    { 0x7F,0x08,0x14,0x22,0x41,0x00 } , /* K  */ 
-    { 0x7F,0x40,0x40,0x40,0x00,0x00 } , /* L  */ 
+    { 0x00,0x3f,0x40,0x40,0x40,0x20 } , /* J  */ 
+    { 0x00,0x41,0x22,0x14,0x08,0x7f } , /* K  */ 
+    { 0x00,0x00,0x40,0x40,0x40,0x7f } , /* L  */ 
     { 0x7F,0x04,0x18,0x04,0x7F,0x00 } , /* M  */ 
-    { 0x7F,0x04,0x08,0x10,0x7F,0x00 } , /* N  */ 
+    { 0x00,0x7f,0x10,0x08,0x04,0x7f } , /* N  */ 
     { 0x3E,0x41,0x41,0x41,0x3E,0x00 } , /* O  */ 
-    { 0x7F,0x09,0x09,0x09,0x06,0x00 } , /* P  */ 
-    { 0x3E,0x41,0x51,0x21,0x5E,0x00 } , /* Q  */ 
-    { 0x7F,0x09,0x19,0x29,0x46,0x00 } , /* R  */ 
-    { 0x26,0x49,0x49,0x49,0x32,0x00 } , /* S  */ 
+    { 0x00,0x06,0x09,0x09,0x09,0x7f } , /* P  */ 
+    { 0x00,0x5e,0x21,0x51,0x41,0x3e } , /* Q  */ 
+    { 0x00,0x46,0x29,0x19,0x09,0x7f } , /* R  */ 
+    { 0x32,0x49,0x49,0x49,0x26,0x00 } , /* S  */ 
     { 0x01,0x01,0x7F,0x01,0x01,0x00 } , /* T  */ 
     { 0x3F,0x40,0x40,0x40,0x3F,0x00 } , /* U  */ 
     { 0x03,0x1C,0x60,0x1C,0x03,0x00 } , /* V  */ 
     { 0x0F,0x70,0x0F,0x70,0x0F,0x00 } , /* W  */ 
     { 0x41,0x36,0x08,0x36,0x41,0x00 } , /* X  */ 
     { 0x01,0x06,0x78,0x02,0x01,0x00 } , /* Y  */ 
-    { 0x61,0x51,0x49,0x45,0x43,0x00 } , /* Z  */ 
-    { 0x00,0x00,0x7F,0x41,0x41,0x00 } , /* [  */ 
-    { 0x15,0x16,0x7C,0x16,0x11,0x00 } , /* \  */ 
-    { 0x41,0x41,0x7F,0x00,0x00,0x00 } , /* ]  */ 
+    { 0x00,0x43,0x45,0x49,0x51,0x61 } , /* Z  */ 
+    { 0x41,0x41,0x7F,0x00,0x00,0x00 } , /* [  */ 
+    { 0x20,0x10,0x08,0x04,0x02,0x00 } , /* \  */ 
+    { 0x00,0x00,0x7F,0x41,0x41,0x00 } , /* ]  */ 
     { 0x00,0x02,0x01,0x02,0x00,0x00 } , /* ^  */ 
     { 0x40,0x40,0x40,0x40,0x40,0x00 } , /* _  */ 
     { 0x00,0x01,0x02,0x00,0x00,0x00 } , /* `  */ 
-    { 0x00,0x20,0x54,0x54,0x78,0x00 } , /* a  */ 
-    { 0x00,0x7F,0x44,0x44,0x38,0x00 } , /* b  */ 
-    { 0x00,0x38,0x44,0x44,0x28,0x00 } , /* c  */ 
-    { 0x00,0x38,0x44,0x44,0x7F,0x00 } , /* d  */ 
-    { 0x00,0x38,0x54,0x54,0x18,0x00 } , /* e  */ 
-    { 0x00,0x04,0x3E,0x05,0x01,0x00 } , /* f  */ 
-    { 0x00,0x08,0x54,0x54,0x3C,0x00 } , /* g  */ 
-    { 0x00,0x7F,0x04,0x04,0x78,0x00 } , /* h  */ 
+    { 0x00,0x78,0x54,0x54,0x20,0x00 } , /* a  */ 
+    { 0x00,0x38,0x44,0x44,0x7f,0x00 } , /* b  */ 
+    { 0x00,0x28,0x44,0x44,0x38,0x00 } , /* c  */ 
+    { 0x00,0x7f,0x44,0x44,0x38,0x00 } , /* d  */ 
+    { 0x00,0x18,0x54,0x54,0x38,0x00 } , /* e  */ 
+    { 0x00,0x01,0x05,0x3e,0x04,0x00 } , /* f  */ 
+    { 0x00,0x08,0x54,0x54,0x3c,0x00 } , /* g  */ 
+    { 0x00,0x78,0x04,0x04,0x7f,0x00 } , /* h  */ 
     { 0x00,0x00,0x7D,0x00,0x00,0x00 } , /* i  */ 
-    { 0x00,0x40,0x40,0x3D,0x00,0x00 } , /* j  */ 
-    { 0x00,0x7F,0x10,0x28,0x44,0x00 } , /* k  */ 
+    { 0x00,0x00,0x3d,0x40,0x040,0x00} , /* j  */ 
+    { 0x00,0x44,0x28,0x10,0x7f,0x00 } , /* k  */ 
     { 0x00,0x01,0x7F,0x00,0x00,0x00 } , /* l  */ 
     { 0x7C,0x04,0x7C,0x04,0x78,0x00 } , /* m  */ 
     { 0x00,0x7C,0x04,0x04,0x78,0x00 } , /* n  */ 
     { 0x00,0x38,0x44,0x44,0x38,0x00 } , /* o  */ 
-    { 0x00,0x7C,0x14,0x14,0x08,0x00 } , /* p  */ 
-    { 0x00,0x08,0x14,0x14,0x7C,0x00 } , /* q  */ 
-    { 0x00,0x7C,0x08,0x04,0x04,0x00 } , /* r  */ 
-    { 0x00,0x48,0x54,0x54,0x24,0x00 } , /* s  */ 
-    { 0x00,0x04,0x3E,0x44,0x40,0x00 } , /* t  */ 
+    { 0x00,0x08,0x14,0x14,0x7c,0x00 } , /* p  */ 
+    { 0x00,0x7c,0x14,0x14,0x08,0x00 } , /* q  */ 
+    { 0x00,0x04,0x04,0x08,0x7c,0x00 } , /* r  */ 
+    { 0x00,0x24,0x54,0x54,0x48,0x00 } , /* s  */ 
+    { 0x00,0x40,0x44,0x3e,0x04,0x00 } , /* t  */ 
     { 0x00,0x3C,0x40,0x40,0x7C,0x00 } , /* u  */ 
     { 0x00,0x7C,0x20,0x10,0x0C,0x00 } , /* v  */ 
     { 0x1C,0x60,0x1C,0x60,0x1C,0x00 } , /* w  */ 
     { 0x00,0x6C,0x10,0x10,0x6C,0x00 } , /* x  */ 
     { 0x00,0x4C,0x50,0x30,0x1C,0x00 } , /* y  */ 
-    { 0x00,0x44,0x64,0x54,0x4C,0x00 } , /* z  */ 
-    { 0x00,0x08,0x36,0x41,0x41,0x00 } , /* {  */ 
+    { 0x00,0x4c,0x54,0x64,0x44,0x00 } , /* z  */ 
+    { 0x41,0x41,0x36,0x08,0x00,0x00 } , /* {  */ 
     { 0x00,0x00,0x7F,0x00,0x00,0x00 } , /* |  */ 
-    { 0x41,0x41,0x36,0x08,0x00,0x00 } , /* }  */ 
+    { 0x00,0x08,0x36,0x41,0x41,0x00 } , /* }  */ 
     { 0x08,0x04,0x08,0x10,0x08,0x00 } , /* ~  */ 
-    { 0x00,0x00,0x00,0x00,0x00,0x00 }    /*null*/ 
+    { 0x00,0x00,0x00,0x00,0x00,0x00 }   /*null*/ 
 };
 
 #endif
\ No newline at end of file
--- a/spioled96x64.cpp	Sat Jan 15 03:24:10 2011 +0000
+++ b/spioled96x64.cpp	Tue Feb 02 15:08:01 2016 +0000
@@ -1,4 +1,3 @@
-
 
 // ALO-095BWNN-J9 test program
 // See also "http://www.aitendo.co.jp/product/2099"
@@ -187,14 +186,34 @@
         *lpx=1;
         *lpy=2;
         break;
-    case CS_WH  :
+    case CS_WHx4  :
         *lpx=2;
         *lpy=2;
         break;
+    case CS_WHx9  :
+        *lpx=3;
+        *lpy=3;
+        break;
+    case CS_WHx16  :
+        *lpx=4;
+        *lpy=4;
+        break;
+    case CS_WHx25  :
+        *lpx=5;
+        *lpy=5;
+        break;
     case CS_WHx36  :
         *lpx=6;
         *lpy=6;
         break;
+    case CS_WHx49  :
+        *lpx=7;
+        *lpy=7;
+        break;
+    case CS_WHx64  :
+        *lpx=8;
+        *lpy=8;
+        break;
     case CS_NORMAL:
     default:
         *lpx=1;
@@ -614,5 +633,6 @@
         RegWrite(cmd);
         
     }
+    
 }
 
--- a/spioled96x64.h	Sat Jan 15 03:24:10 2011 +0000
+++ b/spioled96x64.h	Tue Feb 02 15:08:01 2016 +0000
@@ -20,10 +20,13 @@
 #define CS_NORMAL  0
 #define CS_WIDE    1
 #define CS_HIGH    2
-#define CS_WH      3
-#define CS_WHx36   4
-
-
+#define CS_WHx4    3
+#define CS_WHx9    4
+#define CS_WHx16   5
+#define CS_WHx25   6
+#define CS_WHx36   7
+#define CS_WHx49   8
+#define CS_WHx64   9
 
 #define GAC_FILL_ENABLE_DISABLE  0x26   // �h��‚Ԃ��”ۃR�}���h
 #define GAC_DRAW_RECTANGLE       0x22   // Rectangle cmd