找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1343|回复: 1
打印 上一主题 下一主题
收起左侧

128*64 oled显示源码

[复制链接]
跳转到指定楼层
楼主
ID:318324 发表于 2018-4-28 11:20 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
oled 128*64显示驱动源码

单片机源程序如下:
  1. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. //
  3. //  FET113011 (2864-91H) Reference Code
  4. //
  5. //    Dot Matrix: 128*64
  6. //    Driver IC : SSD1306 (Solomon Systech)
  7. //    Interface : 8-bit 68XX/80XX Parallel, 3-/4-wire SPI
  8. //    Revision  :
  9. //    Date      : 2011/07/15
  10. //    Author    :
  11. //    Editor    : Humphrey Lin
  12. //
  13. //  Copyright (c) WiseChip Semiconductor Inc.
  14. //
  15. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  16. #include <at89x51.h>

  17. //#define        M68                                // 8-bit 68XX Parallel
  18.                                                 //   BS0=0; BS1=1; BS2=1
  19.   #define                I80                                // 8-bit 80XX Parallel
  20.                                                 //   BS0=0; BS1=0; BS2=1
  21. //#define        SPI                                // 4-wire SPI
  22.                                                 //   BS0=0; BS1=0; BS2=0
  23.                                                 //   The unused pins should be connected with VSS mostly or floating (D2).
  24.                                                 //   Please refer to the SSD1306 specification for detail.


  25. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  26. //  Pin Definition
  27. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  28. #define xData        P1                                // Parallel Data Input/Output

  29. #define SCLK        P1_0                                // Serial Clock Input
  30. #define SDIN        P1_1                                // Serial Data Input

  31. #define RES        P3_3                                // Reset
  32. #define CS        P3_4                                // Chip Select
  33. #define DC        P3_2                                // Data/Command Control

  34. #define E        P3_0                                // Read/Write Enable
  35. #define RW        P3_1                                // Read/Write Select

  36. #define RD        P3_0                                // Read Signal
  37. #define WR        P3_1                                // Write Signal


  38. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  39. //  Delay Time
  40. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  41. void uDelay(unsigned char l)
  42. {
  43.         while(l--);
  44. }


  45. void Delay(unsigned char n)
  46. {
  47. unsigned char i,j,k;

  48.         for(k=0;k<n;k++)
  49.         {
  50.                 for(i=0;i<131;i++)
  51.                 {
  52.                         for(j=0;j<15;j++)
  53.                         {
  54.                                 uDelay(203);       
  55.                         }
  56.                 }
  57.         }
  58. }


  59. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  60. //  Read/Write Sequence
  61. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  62. #ifdef M68                                        // 8-bit 68XX Parallel
  63. void Write_Command(unsigned char Data)
  64. {
  65.         DC=0;
  66.         CS=0;
  67.         RW=0;
  68.         E=1;
  69.         xData=Data;
  70.         E=0;
  71.         RW=1;
  72.         CS=1;
  73.         DC=1;
  74. }


  75. void Write_Data(unsigned char Data)
  76. {
  77.         DC=1;
  78.         CS=0;
  79.         RW=0;
  80.         E=1;
  81.         xData=Data;
  82.         E=0;
  83.         RW=1;
  84.         CS=1;
  85.         DC=1;
  86. }
  87. #endif


  88. #ifdef I80                                        // 8-bit 80XX Parallel
  89. void Write_Command(unsigned char Data)
  90. {
  91.         DC=0;
  92.         CS=0;
  93.         WR=0;
  94.         xData=Data;
  95.         WR=1;
  96.         CS=1;
  97.         DC=1;
  98. }


  99. void Write_Data(unsigned char Data)
  100. {
  101.         DC=1;
  102.         CS=0;
  103.         WR=0;
  104.         xData=Data;
  105.         WR=1;
  106.         CS=1;
  107.         DC=1;
  108. }
  109. #endif


  110. #ifdef SPI                                        // 4-wire SPI
  111. void Write_Command(unsigned char Data)
  112. {
  113. unsigned char i;

  114.         CS=0;
  115.         DC=0;
  116.         for (i=0; i<8; i++)
  117.         {
  118.                 SCLK=0;
  119.                 SDIN=(Data&0x80)>>7;
  120.                 Data = Data << 1;
  121. //                uDelay(1);
  122.                 SCLK=1;
  123. //                uDelay(1);
  124.         }
  125. //        SCLK=0;
  126.         DC=1;
  127.         CS=1;
  128. }


  129. void Write_Data(unsigned char Data)
  130. {
  131. unsigned char i;

  132.         CS=0;
  133.         DC=1;
  134.         for (i=0; i<8; i++)
  135.         {
  136.                 SCLK=0;
  137.                 SDIN=(Data&0x80)>>7;
  138.                 Data = Data << 1;
  139. //                uDelay(1);
  140.                 SCLK=1;
  141. //                uDelay(1);
  142.         }
  143. //        SCLK=0;
  144.         DC=1;
  145.         CS=1;
  146. }
  147. #endif


  148. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  149. //  Instruction Setting
  150. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  151. void Set_Start_Column(unsigned char d)
  152. {
  153.         Write_Command(0x00+d%16);                // Set Lower Column Start Address for Page Addressing Mode
  154.                                                 //   Default => 0x00
  155.         Write_Command(0x10+d/16);                // Set Higher Column Start Address for Page Addressing Mode
  156.                                                 //   Default => 0x10
  157. }


  158. void Set_Addressing_Mode(unsigned char d)
  159. {
  160.         Write_Command(0x20);                        // Set Memory Addressing Mode
  161.         Write_Command(d);                        //   Default => 0x02
  162.                                                 //     0x00 => Horizontal Addressing Mode
  163.                                                 //     0x01 => Vertical Addressing Mode
  164.                                                 //     0x02 => Page Addressing Mode
  165. }


  166. void Set_Column_Address(unsigned char a, unsigned char b)
  167. {
  168.         Write_Command(0x21);                        // Set Column Address
  169.         Write_Command(a);                        //   Default => 0x00 (Column Start Address)
  170.         Write_Command(b);                        //   Default => 0x7F (Column End Address)
  171. }


  172. void Set_Page_Address(unsigned char a, unsigned char b)
  173. {
  174.         Write_Command(0x22);                        // Set Page Address
  175.         Write_Command(a);                        //   Default => 0x00 (Page Start Address)
  176.         Write_Command(b);                        //   Default => 0x07 (Page End Address)
  177. }


  178. void Set_Start_Line(unsigned char d)
  179. {
  180.         Write_Command(0x40|d);                        // Set Display Start Line
  181.                                                 //   Default => 0x40 (0x00)
  182. }


  183. void Set_Contrast_Control(unsigned char d)
  184. {
  185.         Write_Command(0x81);                        // Set Contrast Control
  186.         Write_Command(d);                        //   Default => 0x7F
  187. }


  188. void Set_Charge_Pump(unsigned char d)
  189. {
  190.         Write_Command(0x8D);                        // Set Charge Pump
  191.         Write_Command(d);                        //   Default => 0x10
  192.                                                 //     0x10 => Disable Charge Pump
  193.                                                 //     0x14 => Enable Charge Pump
  194. }


  195. void Set_Segment_Remap(unsigned char d)
  196. {
  197.         Write_Command(d);                        // Set Segment Re-Map
  198.                                                 //   Default => 0xA0
  199.                                                 //     0xA0 => Column Address 0 Mapped to SEG0
  200.                                                 //     0xA1 => Column Address 0 Mapped to SEG127
  201. }


  202. void Set_Entire_Display(unsigned char d)
  203. {
  204.         Write_Command(d);                        // Set Entire Display On / Off
  205.                                                 //   Default => 0xA4
  206.                                                 //     0xA4 => Normal Display
  207.                                                 //     0xA5 => Entire Display On
  208. }


  209. void Set_Inverse_Display(unsigned char d)
  210. {
  211.         Write_Command(d);                        // Set Inverse Display On/Off
  212.                                                 //   Default => 0xA6
  213.                                                 //     0xA6 => Normal Display
  214.                                                 //     0xA7 => Inverse Display On
  215. }


  216. void Set_Multiplex_Ratio(unsigned char d)
  217. {
  218.         Write_Command(0xA8);                        // Set Multiplex Ratio
  219.         Write_Command(d);                        //   Default => 0x3F (1/64 Duty)
  220. }


  221. void Set_Display_On_Off(unsigned char d)       
  222. {
  223.         Write_Command(d);                        // Set Display On/Off
  224.                                                 //   Default => 0xAE
  225.                                                 //     0xAE => Display Off
  226.                                                 //     0xAF => Display On
  227. }


  228. void Set_Start_Page(unsigned char d)
  229. {
  230.         Write_Command(0xB0|d);                        // Set Page Start Address for Page Addressing Mode
  231.                                                 //   Default => 0xB0 (0x00)
  232. }


  233. void Set_Common_Remap(unsigned char d)
  234. {
  235.         Write_Command(d);                        // Set COM Output Scan Direction
  236.                                                 //   Default => 0xC0
  237.                                                 //     0xC0 => Scan from COM0 to 63
  238.                                                 //     0xC8 => Scan from COM63 to 0
  239. }


  240. void Set_Display_Offset(unsigned char d)                                    
  241. {
  242.         Write_Command(0xD3);                        // Set Display Offset
  243.         Write_Command(d);                        //   Default => 0x00
  244. }


  245. void Set_Display_Clock(unsigned char d)
  246. {
  247.         Write_Command(0xD5);                        // Set Display Clock Divide Ratio / Oscillator Frequency
  248.         Write_Command(d);                        //   Default => 0x80
  249.                                                 //     D[3:0] => Display Clock Divider
  250.                                                 //     D[7:4] => Oscillator Frequency
  251. }


  252. void Set_Precharge_Period(unsigned char d)
  253. {
  254.         Write_Command(0xD9);                        // Set Pre-Charge Period
  255.         Write_Command(d);                        //   Default => 0x22 (2 Display Clocks [Phase 2] / 2 Display Clocks [Phase 1])
  256.                                                 //     D[3:0] => Phase 1 Period in 1~15 Display Clocks
  257.                                                 //     D[7:4] => Phase 2 Period in 1~15 Display Clocks
  258. }


  259. void Set_Common_Config(unsigned char d)
  260. {
  261.         Write_Command(0xDA);                        // Set COM Pins Hardware Configuration
  262.         Write_Command(d);                        //   Default => 0x12
  263.                                                 //     Alternative COM Pin Configuration
  264.                                                 //     Disable COM Left/Right Re-Map
  265. }


  266. void Set_VCOMH(unsigned char d)
  267. {
  268.         Write_Command(0xDB);                        // Set VCOMH Deselect Level
  269.         Write_Command(d);                        //   Default => 0x20 (0.77*VCC)
  270. }


  271. void Set_NOP()
  272. {
  273.         Write_Command(0xE3);                        // Command for No Operation
  274. }


  275. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  276. //  Global Variables
  277. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  278. #define XLevelL                0x00
  279. #define XLevelH                0x10
  280. #define XLevel                ((XLevelH&0x0F)*16+XLevelL)
  281. #define Max_Column        128
  282. #define Max_Row                64
  283. #define        Brightness        0xFF


  284. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  285. //  Patterns
  286. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  287. unsigned char code UniV[][48]={                        // UniV OLED
  288.         0x00,0x00,0xFC,0xFC,0xFC,0xFC,0x00,0x00,0x00,0xFC,0xFC,0xFC,0xFC,0x00,0x00,0x00,0xE0,0xE0,0xE0,0xE0,0x60,0xE0,0xE0,0xE0,0xC0,0x00,0x00,0x00,0xEC,0xEC,0xEC,0xEC,0x00,0x00,0x00,0x04,0x3C,0xFC,0xFC,0xF0,0x80,0x80,0xF0,0xFC,0xFC,0x3C,0x04,0x00,
  289.         0x00,0x00,0x07,0x0F,0x1F,0x1F,0x1C,0x18,0x1C,0x1F,0x1F,0x0F,0x07,0x00,0x00,0x00,0x1F,0x1F,0x1F,0x1F,0x00,0x1F,0x1F,0x1F,0x1F,0x00,0x00,0x00,0x1F,0x1F,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x01,0x0F,0x1F,0x1F,0x1F,0x1F,0x0F,0x01,0x00,0x00,0x00,
  290.         0x00,0x80,0xE0,0xE0,0xF0,0x70,0x30,0x70,0xF0,0xE0,0xE0,0x80,0x00,0x00,0x00,0xF0,0xF0,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0,0xF0,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0xF0,0xF0,0xF0,0xF0,0x30,0x70,0xF0,0xF0,0xE0,0x80,
  291.         0x00,0x0F,0x3F,0x3F,0x7F,0x70,0x60,0x70,0x7F,0x3F,0x3F,0x0F,0x00,0x00,0x00,0x7F,0x7F,0x7F,0x7F,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x7F,0x7F,0x7F,0x7F,0x63,0x63,0x63,0x63,0x60,0x00,0x00,0x00,0x7F,0x7F,0x7F,0x7F,0x60,0x70,0x7F,0x7F,0x3F,0x0F,
  292. };


  293. unsigned char code Ascii_1[240][5]={                // Refer to "Times New Roman" Font Database...
  294.                                                 //   Basic Characters
  295.         {0x00,0x00,0x4F,0x00,0x00},                //   (  1)  ! - 0x0021 Exclamation Mark
  296.         {0x00,0x07,0x00,0x07,0x00},                //   (  2)  " - 0x0022 Quotation Mark
  297.         {0x14,0x7F,0x14,0x7F,0x14},                //   (  3)  # - 0x0023 Number Sign
  298.         {0x24,0x2A,0x7F,0x2A,0x12},                //   (  4)  $ - 0x0024 Dollar Sign
  299.         {0x23,0x13,0x08,0x64,0x62},                //   (  5)  % - 0x0025 Percent Sign
  300.         {0x36,0x49,0x55,0x22,0x50},                //   (  6)  & - 0x0026 Ampersand
  301.         {0x00,0x05,0x03,0x00,0x00},                //   (  7)  ' - 0x0027 Apostrophe
  302.         {0x00,0x1C,0x22,0x41,0x00},                //   (  8)  ( - 0x0028 Left Parenthesis
  303.         {0x00,0x41,0x22,0x1C,0x00},                //   (  9)  ) - 0x0029 Right Parenthesis
  304.         {0x14,0x08,0x3E,0x08,0x14},                //   ( 10)  * - 0x002A Asterisk
  305.         {0x08,0x08,0x3E,0x08,0x08},                //   ( 11)  + - 0x002B Plus Sign
  306.         {0x00,0x50,0x30,0x00,0x00},                //   ( 12)  , - 0x002C Comma
  307.         {0x08,0x08,0x08,0x08,0x08},                //   ( 13)  - - 0x002D Hyphen-Minus
  308.         {0x00,0x60,0x60,0x00,0x00},                //   ( 14)  . - 0x002E Full Stop
  309.         {0x20,0x10,0x08,0x04,0x02},                //   ( 15)  / - 0x002F Solidus
  310.         {0x3E,0x51,0x49,0x45,0x3E},                //   ( 16)  0 - 0x0030 Digit Zero
  311.         {0x00,0x42,0x7F,0x40,0x00},                //   ( 17)  1 - 0x0031 Digit One
  312.         {0x42,0x61,0x51,0x49,0x46},                //   ( 18)  2 - 0x0032 Digit Two
  313.         {0x21,0x41,0x45,0x4B,0x31},                //   ( 19)  3 - 0x0033 Digit Three
  314.         {0x18,0x14,0x12,0x7F,0x10},                //   ( 20)  4 - 0x0034 Digit Four
  315.         {0x27,0x45,0x45,0x45,0x39},                //   ( 21)  5 - 0x0035 Digit Five
  316.         {0x3C,0x4A,0x49,0x49,0x30},                //   ( 22)  6 - 0x0036 Digit Six
  317.         {0x01,0x71,0x09,0x05,0x03},                //   ( 23)  7 - 0x0037 Digit Seven
  318.         {0x36,0x49,0x49,0x49,0x36},                //   ( 24)  8 - 0x0038 Digit Eight
  319.         {0x06,0x49,0x49,0x29,0x1E},                //   ( 25)  9 - 0x0039 Dight Nine
  320.         {0x00,0x36,0x36,0x00,0x00},                //   ( 26)  : - 0x003A Colon
  321.         {0x00,0x56,0x36,0x00,0x00},                //   ( 27)  ; - 0x003B Semicolon
  322.         {0x08,0x14,0x22,0x41,0x00},                //   ( 28)  < - 0x003C Less-Than Sign
  323.         {0x14,0x14,0x14,0x14,0x14},                //   ( 29)  = - 0x003D Equals Sign
  324.         {0x00,0x41,0x22,0x14,0x08},                //   ( 30)  > - 0x003E Greater-Than Sign
  325.         {0x02,0x01,0x51,0x09,0x06},                //   ( 31)  ? - 0x003F Question Mark
  326.         {0x32,0x49,0x79,0x41,0x3E},                //   ( 32)  @ - 0x0040 Commercial At
  327.         {0x7E,0x11,0x11,0x11,0x7E},                //   ( 33)  A - 0x0041 Latin Capital Letter A
  328.         {0x7F,0x49,0x49,0x49,0x36},                //   ( 34)  B - 0x0042 Latin Capital Letter B
  329.         {0x3E,0x41,0x41,0x41,0x22},                //   ( 35)  C - 0x0043 Latin Capital Letter C
  330.         {0x7F,0x41,0x41,0x22,0x1C},                //   ( 36)  D - 0x0044 Latin Capital Letter D
  331.         {0x7F,0x49,0x49,0x49,0x41},                //   ( 37)  E - 0x0045 Latin Capital Letter E
  332.         {0x7F,0x09,0x09,0x09,0x01},                //   ( 38)  F - 0x0046 Latin Capital Letter F
  333.         {0x3E,0x41,0x49,0x49,0x7A},                //   ( 39)  G - 0x0047 Latin Capital Letter G
  334.         {0x7F,0x08,0x08,0x08,0x7F},                //   ( 40)  H - 0x0048 Latin Capital Letter H
  335.         {0x00,0x41,0x7F,0x41,0x00},                //   ( 41)  I - 0x0049 Latin Capital Letter I
  336.         {0x20,0x40,0x41,0x3F,0x01},                //   ( 42)  J - 0x004A Latin Capital Letter J
  337.         {0x7F,0x08,0x14,0x22,0x41},                //   ( 43)  K - 0x004B Latin Capital Letter K
  338.         {0x7F,0x40,0x40,0x40,0x40},                //   ( 44)  L - 0x004C Latin Capital Letter L
  339.         {0x7F,0x02,0x0C,0x02,0x7F},                //   ( 45)  M - 0x004D Latin Capital Letter M
  340.         {0x7F,0x04,0x08,0x10,0x7F},                //   ( 46)  N - 0x004E Latin Capital Letter N
  341.         {0x3E,0x41,0x41,0x41,0x3E},                //   ( 47)  O - 0x004F Latin Capital Letter O
  342.         {0x7F,0x09,0x09,0x09,0x06},                //   ( 48)  P - 0x0050 Latin Capital Letter P
  343.         {0x3E,0x41,0x51,0x21,0x5E},                //   ( 49)  Q - 0x0051 Latin Capital Letter Q
  344.         {0x7F,0x09,0x19,0x29,0x46},                //   ( 50)  R - 0x0052 Latin Capital Letter R
  345.         {0x46,0x49,0x49,0x49,0x31},                //   ( 51)  S - 0x0053 Latin Capital Letter S
  346.         {0x01,0x01,0x7F,0x01,0x01},                //   ( 52)  T - 0x0054 Latin Capital Letter T
  347.         {0x3F,0x40,0x40,0x40,0x3F},                //   ( 53)  U - 0x0055 Latin Capital Letter U
  348.         {0x1F,0x20,0x40,0x20,0x1F},                //   ( 54)  V - 0x0056 Latin Capital Letter V
  349.         {0x3F,0x40,0x38,0x40,0x3F},                //   ( 55)  W - 0x0057 Latin Capital Letter W
  350.         {0x63,0x14,0x08,0x14,0x63},                //   ( 56)  X - 0x0058 Latin Capital Letter X
  351.         {0x07,0x08,0x70,0x08,0x07},                //   ( 57)  Y - 0x0059 Latin Capital Letter Y
  352.         {0x61,0x51,0x49,0x45,0x43},                //   ( 58)  Z - 0x005A Latin Capital Letter Z
  353.         {0x00,0x7F,0x41,0x41,0x00},                //   ( 59)  [ - 0x005B Left Square Bracket
  354.         {0x02,0x04,0x08,0x10,0x20},                //   ( 60)  \ - 0x005C Reverse Solidus
  355.         {0x00,0x41,0x41,0x7F,0x00},                //   ( 61)  ] - 0x005D Right Square Bracket
  356.         {0x04,0x02,0x01,0x02,0x04},                //   ( 62)  ^ - 0x005E Circumflex Accent
  357.         {0x40,0x40,0x40,0x40,0x40},                //   ( 63)  _ - 0x005F Low Line
  358.         {0x01,0x02,0x04,0x00,0x00},                //   ( 64)  ` - 0x0060 Grave Accent
  359.         {0x20,0x54,0x54,0x54,0x78},                //   ( 65)  a - 0x0061 Latin Small Letter A
  360.         {0x7F,0x48,0x44,0x44,0x38},                //   ( 66)  b - 0x0062 Latin Small Letter B
  361.         {0x38,0x44,0x44,0x44,0x20},                //   ( 67)  c - 0x0063 Latin Small Letter C
  362.         {0x38,0x44,0x44,0x48,0x7F},                //   ( 68)  d - 0x0064 Latin Small Letter D
  363.         {0x38,0x54,0x54,0x54,0x18},                //   ( 69)  e - 0x0065 Latin Small Letter E
  364.         {0x08,0x7E,0x09,0x01,0x02},                //   ( 70)  f - 0x0066 Latin Small Letter F
  365.         {0x06,0x49,0x49,0x49,0x3F},                //   ( 71)  g - 0x0067 Latin Small Letter G
  366.         {0x7F,0x08,0x04,0x04,0x78},                //   ( 72)  h - 0x0068 Latin Small Letter H
  367.         {0x00,0x44,0x7D,0x40,0x00},                //   ( 73)  i - 0x0069 Latin Small Letter I
  368.         {0x20,0x40,0x44,0x3D,0x00},                //   ( 74)  j - 0x006A Latin Small Letter J
  369.         {0x7F,0x10,0x28,0x44,0x00},                //   ( 75)  k - 0x006B Latin Small Letter K
  370.         {0x00,0x41,0x7F,0x40,0x00},                //   ( 76)  l - 0x006C Latin Small Letter L
  371.         {0x7C,0x04,0x18,0x04,0x7C},                //   ( 77)  m - 0x006D Latin Small Letter M
  372.         {0x7C,0x08,0x04,0x04,0x78},                //   ( 78)  n - 0x006E Latin Small Letter N
  373.         {0x38,0x44,0x44,0x44,0x38},                //   ( 79)  o - 0x006F Latin Small Letter O
  374.         {0x7C,0x14,0x14,0x14,0x08},                //   ( 80)  p - 0x0070 Latin Small Letter P
  375.         {0x08,0x14,0x14,0x18,0x7C},                //   ( 81)  q - 0x0071 Latin Small Letter Q
  376.         {0x7C,0x08,0x04,0x04,0x08},                //   ( 82)  r - 0x0072 Latin Small Letter R
  377.         {0x48,0x54,0x54,0x54,0x20},                //   ( 83)  s - 0x0073 Latin Small Letter S
  378.         {0x04,0x3F,0x44,0x40,0x20},                //   ( 84)  t - 0x0074 Latin Small Letter T
  379.         {0x3C,0x40,0x40,0x20,0x7C},                //   ( 85)  u - 0x0075 Latin Small Letter U
  380.         {0x1C,0x20,0x40,0x20,0x1C},                //   ( 86)  v - 0x0076 Latin Small Letter V
  381.         {0x3C,0x40,0x30,0x40,0x3C},                //   ( 87)  w - 0x0077 Latin Small Letter W
  382.         {0x44,0x28,0x10,0x28,0x44},                //   ( 88)  x - 0x0078 Latin Small Letter X
  383.         {0x0C,0x50,0x50,0x50,0x3C},                //   ( 89)  y - 0x0079 Latin Small Letter Y
  384.         {0x44,0x64,0x54,0x4C,0x44},                //   ( 90)  z - 0x007A Latin Small Letter Z
  385.         {0x00,0x08,0x36,0x41,0x00},                //   ( 91)  { - 0x007B Left Curly Bracket
  386.         {0x00,0x00,0x7F,0x00,0x00},                //   ( 92)  | - 0x007C Vertical Line
  387.         {0x00,0x41,0x36,0x08,0x00},                //   ( 93)  } - 0x007D Right Curly Bracket
  388.         {0x02,0x01,0x02,0x04,0x02},                //   ( 94)  ~ - 0x007E Tilde
  389.         {0x3E,0x55,0x55,0x41,0x22},                //   ( 95)  C - 0x0080 <Control>
  390.         {0x00,0x00,0x00,0x00,0x00},                //   ( 96)    - 0x00A0 No-Break Space
  391.         {0x00,0x00,0x79,0x00,0x00},                //   ( 97)  ! - 0x00A1 Inverted Exclamation Mark
  392.         {0x18,0x24,0x74,0x2E,0x24},                //   ( 98)  c - 0x00A2 Cent Sign
  393.         {0x48,0x7E,0x49,0x42,0x40},                //   ( 99)  L - 0x00A3 Pound Sign
  394.         {0x5D,0x22,0x22,0x22,0x5D},                //   (100)  o - 0x00A4 Currency Sign
  395.         {0x15,0x16,0x7C,0x16,0x15},                //   (101)  Y - 0x00A5 Yen Sign
  396.         {0x00,0x00,0x77,0x00,0x00},                //   (102)  | - 0x00A6 Broken Bar
  397.         {0x0A,0x55,0x55,0x55,0x28},                //   (103)    - 0x00A7 Section Sign
  398.         {0x00,0x01,0x00,0x01,0x00},                //   (104)  " - 0x00A8 Diaeresis
  399.         {0x00,0x0A,0x0D,0x0A,0x04},                //   (105)    - 0x00AA Feminine Ordinal Indicator
  400.         {0x08,0x14,0x2A,0x14,0x22},                //   (106) << - 0x00AB Left-Pointing Double Angle Quotation Mark
  401.         {0x04,0x04,0x04,0x04,0x1C},                //   (107)    - 0x00AC Not Sign
  402.         {0x00,0x08,0x08,0x08,0x00},                //   (108)  - - 0x00AD Soft Hyphen
  403.         {0x01,0x01,0x01,0x01,0x01},                //   (109)    - 0x00AF Macron
  404.         {0x00,0x02,0x05,0x02,0x00},                //   (110)    - 0x00B0 Degree Sign
  405.         {0x44,0x44,0x5F,0x44,0x44},                //   (111) +- - 0x00B1 Plus-Minus Sign
  406.         {0x00,0x00,0x04,0x02,0x01},                //   (112)  ` - 0x00B4 Acute Accent
  407.         {0x7E,0x20,0x20,0x10,0x3E},                //   (113)  u - 0x00B5 Micro Sign
  408.         {0x06,0x0F,0x7F,0x00,0x7F},                //   (114)    - 0x00B6 Pilcrow Sign
  409.         {0x00,0x18,0x18,0x00,0x00},                //   (115)  . - 0x00B7 Middle Dot
  410.         {0x00,0x40,0x50,0x20,0x00},                //   (116)    - 0x00B8 Cedilla
  411.         {0x00,0x0A,0x0D,0x0A,0x00},                //   (117)    - 0x00BA Masculine Ordinal Indicator
  412.         {0x22,0x14,0x2A,0x14,0x08},                //   (118) >> - 0x00BB Right-Pointing Double Angle Quotation Mark
  413.         {0x17,0x08,0x34,0x2A,0x7D},                //   (119) /4 - 0x00BC Vulgar Fraction One Quarter
  414.         {0x17,0x08,0x04,0x6A,0x59},                //   (120) /2 - 0x00BD Vulgar Fraction One Half
  415.         {0x30,0x48,0x45,0x40,0x20},                //   (121)  ? - 0x00BF Inverted Question Mark
  416.         {0x70,0x29,0x26,0x28,0x70},                //   (122) `A - 0x00C0 Latin Capital Letter A with Grave
  417.         {0x70,0x28,0x26,0x29,0x70},                //   (123) 'A - 0x00C1 Latin Capital Letter A with Acute
  418.         {0x70,0x2A,0x25,0x2A,0x70},                //   (124) ^A - 0x00C2 Latin Capital Letter A with Circumflex
  419.         {0x72,0x29,0x26,0x29,0x70},                //   (125) ~A - 0x00C3 Latin Capital Letter A with Tilde
  420.         {0x70,0x29,0x24,0x29,0x70},                //   (126) "A - 0x00C4 Latin Capital Letter A with Diaeresis
  421.         {0x70,0x2A,0x2D,0x2A,0x70},                //   (127)  A - 0x00C5 Latin Capital Letter A with Ring Above
  422.         {0x7E,0x11,0x7F,0x49,0x49},                //   (128) AE - 0x00C6 Latin Capital Letter Ae
  423.         {0x0E,0x51,0x51,0x71,0x11},                //   (129)  C - 0x00C7 Latin Capital Letter C with Cedilla
  424.         {0x7C,0x55,0x56,0x54,0x44},                //   (130) `E - 0x00C8 Latin Capital Letter E with Grave
  425.         {0x7C,0x55,0x56,0x54,0x44},                //   (131) 'E - 0x00C9 Latin Capital Letter E with Acute
  426.         {0x7C,0x56,0x55,0x56,0x44},                //   (132) ^E - 0x00CA Latin Capital Letter E with Circumflex
  427.         {0x7C,0x55,0x54,0x55,0x44},                //   (133) "E - 0x00CB Latin Capital Letter E with Diaeresis
  428.         {0x00,0x45,0x7E,0x44,0x00},                //   (134) `I - 0x00CC Latin Capital Letter I with Grave
  429.         {0x00,0x44,0x7E,0x45,0x00},                //   (135) 'I - 0x00CD Latin Capital Letter I with Acute
  430.         {0x00,0x46,0x7D,0x46,0x00},                //   (136) ^I - 0x00CE Latin Capital Letter I with Circumflex
  431.         {0x00,0x45,0x7C,0x45,0x00},                //   (137) "I - 0x00CF Latin Capital Letter I with Diaeresis
  432.         {0x7F,0x49,0x49,0x41,0x3E},                //   (138)  D - 0x00D0 Latin Capital Letter Eth
  433.         {0x7C,0x0A,0x11,0x22,0x7D},                //   (139) ~N - 0x00D1 Latin Capital Letter N with Tilde
  434.         {0x38,0x45,0x46,0x44,0x38},                //   (140) `O - 0x00D2 Latin Capital Letter O with Grave
  435.         {0x38,0x44,0x46,0x45,0x38},                //   (141) 'O - 0x00D3 Latin Capital Letter O with Acute
  436.         {0x38,0x46,0x45,0x46,0x38},                //   (142) ^O - 0x00D4 Latin Capital Letter O with Circumflex
  437.         {0x38,0x46,0x45,0x46,0x39},                //   (143) ~O - 0x00D5 Latin Capital Letter O with Tilde
  438.         {0x38,0x45,0x44,0x45,0x38},                //   (144) "O - 0x00D6 Latin Capital Letter O with Diaeresis
  439.         {0x22,0x14,0x08,0x14,0x22},                //   (145)  x - 0x00D7 Multiplcation Sign
  440.         {0x2E,0x51,0x49,0x45,0x3A},                //   (146)  O - 0x00D8 Latin Capital Letter O with Stroke
  441.         {0x3C,0x41,0x42,0x40,0x3C},                //   (147) `U - 0x00D9 Latin Capital Letter U with Grave
  442.         {0x3C,0x40,0x42,0x41,0x3C},                //   (148) 'U - 0x00DA Latin Capital Letter U with Acute
  443.         {0x3C,0x42,0x41,0x42,0x3C},                //   (149) ^U - 0x00DB Latin Capital Letter U with Circumflex
  444.         {0x3C,0x41,0x40,0x41,0x3C},                //   (150) "U - 0x00DC Latin Capital Letter U with Diaeresis
  445.         {0x0C,0x10,0x62,0x11,0x0C},                //   (151) `Y - 0x00DD Latin Capital Letter Y with Acute
  446.         {0x7F,0x12,0x12,0x12,0x0C},                //   (152)  P - 0x00DE Latin Capital Letter Thom
  447.         {0x40,0x3E,0x01,0x49,0x36},                //   (153)  B - 0x00DF Latin Capital Letter Sharp S
  448.         {0x20,0x55,0x56,0x54,0x78},                //   (154) `a - 0x00E0 Latin Small Letter A with Grave
  449.         {0x20,0x54,0x56,0x55,0x78},                //   (155) 'a - 0x00E1 Latin Small Letter A with Acute
  450.         {0x20,0x56,0x55,0x56,0x78},                //   (156) ^a - 0x00E2 Latin Small Letter A with Circumflex
  451.         {0x20,0x55,0x56,0x55,0x78},                //   (157) ~a - 0x00E3 Latin Small Letter A with Tilde
  452.         {0x20,0x55,0x54,0x55,0x78},                //   (158) "a - 0x00E4 Latin Small Letter A with Diaeresis
  453.         {0x20,0x56,0x57,0x56,0x78},                //   (159)  a - 0x00E5 Latin Small Letter A with Ring Above
  454.         {0x24,0x54,0x78,0x54,0x58},                //   (160) ae - 0x00E6 Latin Small Letter Ae
  455.         {0x0C,0x52,0x52,0x72,0x13},                //   (161)  c - 0x00E7 Latin Small Letter c with Cedilla
  456.         {0x38,0x55,0x56,0x54,0x18},                //   (162) `e - 0x00E8 Latin Small Letter E with Grave
  457.         {0x38,0x54,0x56,0x55,0x18},                //   (163) 'e - 0x00E9 Latin Small Letter E with Acute
  458.         {0x38,0x56,0x55,0x56,0x18},                //   (164) ^e - 0x00EA Latin Small Letter E with Circumflex
  459.         {0x38,0x55,0x54,0x55,0x18},                //   (165) "e - 0x00EB Latin Small Letter E with Diaeresis
  460.         {0x00,0x49,0x7A,0x40,0x00},                //   (166) `i - 0x00EC Latin Small Letter I with Grave
  461.         {0x00,0x48,0x7A,0x41,0x00},                //   (167) 'i - 0x00ED Latin Small Letter I with Acute
  462.         {0x00,0x4A,0x79,0x42,0x00},                //   (168) ^i - 0x00EE Latin Small Letter I with Circumflex
  463.         {0x00,0x4A,0x78,0x42,0x00},                //   (169) "i - 0x00EF Latin Small Letter I with Diaeresis
  464.         {0x31,0x4A,0x4E,0x4A,0x30},                //   (170)    - 0x00F0 Latin Small Letter Eth
  465.         {0x7A,0x11,0x0A,0x09,0x70},                //   (171) ~n - 0x00F1 Latin Small Letter N with Tilde
  466.         {0x30,0x49,0x4A,0x48,0x30},                //   (172) `o - 0x00F2 Latin Small Letter O with Grave
  467.         {0x30,0x48,0x4A,0x49,0x30},                //   (173) 'o - 0x00F3 Latin Small Letter O with Acute
  468.         {0x30,0x4A,0x49,0x4A,0x30},                //   (174) ^o - 0x00F4 Latin Small Letter O with Circumflex
  469.         {0x30,0x4A,0x49,0x4A,0x31},                //   (175) ~o - 0x00F5 Latin Small Letter O with Tilde
  470.         {0x30,0x4A,0x48,0x4A,0x30},                //   (176) "o - 0x00F6 Latin Small Letter O with Diaeresis
  471.         {0x08,0x08,0x2A,0x08,0x08},                //   (177)  + - 0x00F7 Division Sign
  472.         {0x38,0x64,0x54,0x4C,0x38},                //   (178)  o - 0x00F8 Latin Small Letter O with Stroke
  473.         {0x38,0x41,0x42,0x20,0x78},                //   (179) `u - 0x00F9 Latin Small Letter U with Grave
  474.         {0x38,0x40,0x42,0x21,0x78},                //   (180) 'u - 0x00FA Latin Small Letter U with Acute
  475.         {0x38,0x42,0x41,0x22,0x78},                //   (181) ^u - 0x00FB Latin Small Letter U with Circumflex
  476.         {0x38,0x42,0x40,0x22,0x78},                //   (182) "u - 0x00FC Latin Small Letter U with Diaeresis
  477.         {0x0C,0x50,0x52,0x51,0x3C},                //   (183) 'y - 0x00FD Latin Small Letter Y with Acute
  478.         {0x7E,0x14,0x14,0x14,0x08},                //   (184)  p - 0x00FE Latin Small Letter Thom
  479.         {0x0C,0x51,0x50,0x51,0x3C},                //   (185) "y - 0x00FF Latin Small Letter Y with Diaeresis
  480.         {0x1E,0x09,0x09,0x29,0x5E},                //   (186)  A - 0x0104 Latin Capital Letter A with Ogonek
  481.         {0x08,0x15,0x15,0x35,0x4E},                //   (187)  a - 0x0105 Latin Small Letter A with Ogonek
  482.         {0x38,0x44,0x46,0x45,0x20},                //   (188) 'C - 0x0106 Latin Capital Letter C with Acute
  483.         {0x30,0x48,0x4A,0x49,0x20},                //   (189) 'c - 0x0107 Latin Small Letter C with Acute
  484.         {0x38,0x45,0x46,0x45,0x20},                //   (190)  C - 0x010C Latin Capital Letter C with Caron
  485.         {0x30,0x49,0x4A,0x49,0x20},                //   (191)  c - 0x010D Latin Small Letter C with Caron
  486.         {0x7C,0x45,0x46,0x45,0x38},                //   (192)  D - 0x010E Latin Capital Letter D with Caron
  487.         {0x20,0x50,0x50,0x7C,0x03},                //   (193) d' - 0x010F Latin Small Letter D with Caron
  488.         {0x1F,0x15,0x15,0x35,0x51},                //   (194)  E - 0x0118 Latin Capital Letter E with Ogonek
  489.         {0x0E,0x15,0x15,0x35,0x46},                //   (195)  e - 0x0119 Latin Small Letter E with Ogonek
  490.         {0x7C,0x55,0x56,0x55,0x44},                //   (196)  E - 0x011A Latin Capital Letter E with Caron
  491.         {0x38,0x55,0x56,0x55,0x18},                //   (197)  e - 0x011B Latin Small Letter E with Caron
  492.         {0x00,0x44,0x7C,0x40,0x00},                //   (198)  i - 0x0131 Latin Small Letter Dotless I
  493.         {0x7F,0x48,0x44,0x40,0x40},                //   (199)  L - 0x0141 Latin Capital Letter L with Stroke
  494.         {0x00,0x49,0x7F,0x44,0x00},                //   (200)  l - 0x0142 Latin Small Letter L with Stroke
  495.         {0x7C,0x08,0x12,0x21,0x7C},                //   (201) 'N - 0x0143 Latin Capital Letter N with Acute
  496.         {0x78,0x10,0x0A,0x09,0x70},                //   (202) 'n - 0x0144 Latin Small Letter N with Acute
  497.         {0x7C,0x09,0x12,0x21,0x7C},                //   (203)  N - 0x0147 Latin Capital Letter N with Caron
  498.         {0x78,0x11,0x0A,0x09,0x70},                //   (204)  n - 0x0148 Latin Small Letter N with Caron
  499.         {0x38,0x47,0x44,0x47,0x38},                //   (205) "O - 0x0150 Latin Capital Letter O with Double Acute
  500.         {0x30,0x4B,0x48,0x4B,0x30},                //   (206) "o - 0x0151 Latin Small Letter O with Double Acute
  501.         {0x3E,0x41,0x7F,0x49,0x49},                //   (207) OE - 0x0152 Latin Capital Ligature Oe
  502.         {0x38,0x44,0x38,0x54,0x58},                //   (208) oe - 0x0153 Latin Small Ligature Oe
  503.         {0x7C,0x15,0x16,0x35,0x48},                //   (209)  R - 0x0158 Latin Capital Letter R with Caron
  504.         {0x78,0x11,0x0A,0x09,0x10},                //   (210)  r - 0x0159 Latin Small Letter R with Caron
  505.         {0x48,0x54,0x56,0x55,0x20},                //   (211) 'S - 0x015A Latin Capital Letter S with Acute
  506.         {0x20,0x48,0x56,0x55,0x20},                //   (212) 's - 0x015B Latin Small Letter S with Acute
  507.         {0x48,0x55,0x56,0x55,0x20},                //   (213)  S - 0x0160 Latin Capital Letter S with Caron
  508.         {0x20,0x49,0x56,0x55,0x20},                //   (214)  s - 0x0161 Latin Small Letter S with Caron
  509.         {0x04,0x05,0x7E,0x05,0x04},                //   (215)  T - 0x0164 Latin Capital Letter T with Caron
  510.         {0x08,0x3C,0x48,0x22,0x01},                //   (216) t' - 0x0165 Latin Small Letter T with Caron
  511.         {0x3C,0x42,0x45,0x42,0x3C},                //   (217)  U - 0x016E Latin Capital Letter U with Ring Above
  512.         {0x38,0x42,0x45,0x22,0x78},                //   (218)  u - 0x016F Latin Small Letter U with Ring Above
  513.         {0x3C,0x43,0x40,0x43,0x3C},                //   (219) "U - 0x0170 Latin Capital Letter U with Double Acute
  514.         {0x38,0x43,0x40,0x23,0x78},                //   (220) "u - 0x0171 Latin Small Letter U with Double Acute
  515.         {0x0C,0x11,0x60,0x11,0x0C},                //   (221) "Y - 0x0178 Latin Capital Letter Y with Diaeresis
  516.         {0x44,0x66,0x55,0x4C,0x44},                //   (222) 'Z - 0x0179 Latin Capital Letter Z with Acute
  517.         {0x48,0x6A,0x59,0x48,0x00},                //   (223) 'z - 0x017A Latin Small Letter Z with Acute
  518.         {0x44,0x64,0x55,0x4C,0x44},                //   (224)  Z - 0x017B Latin Capital Letter Z with Dot Above
  519.         {0x48,0x68,0x5A,0x48,0x00},                //   (225)  z - 0x017C Latin Small Letter Z with Dot Above
  520.         {0x44,0x65,0x56,0x4D,0x44},                //   (226)  Z - 0x017D Latin Capital Letter Z with Caron
  521.         {0x48,0x69,0x5A,0x49,0x00},                //   (227)  z - 0x017E Latin Small Letter Z with Caron
  522.         {0x00,0x02,0x01,0x02,0x00},                //   (228)  ^ - 0x02C6 Modifier Letter Circumflex Accent
  523.         {0x00,0x01,0x02,0x01,0x00},                //   (229)    - 0x02C7 Caron
  524.         {0x00,0x01,0x01,0x01,0x00},                //   (230)    - 0x02C9 Modifier Letter Macron
  525.         {0x01,0x02,0x02,0x01,0x00},                //   (231)    - 0x02D8 Breve
  526.         {0x00,0x00,0x01,0x00,0x00},                //   (232)    - 0x02D9 Dot Above
  527.         {0x00,0x02,0x05,0x02,0x00},                //   (233)    - 0x02DA Ring Above
  528.         {0x02,0x01,0x02,0x01,0x00},                //   (234)  ~ - 0x02DC Small Tilde
  529.         {0x7F,0x05,0x15,0x3A,0x50},                //   (235) Pt - 0x20A7 Peseta Sign
  530.         {0x3E,0x55,0x55,0x41,0x22},                //   (236)  C - 0x20AC Euro Sign
  531.         {0x18,0x14,0x08,0x14,0x0C},                //   (237)    - 0x221E Infinity
  532.         {0x44,0x4A,0x4A,0x51,0x51},                //   (238)  < - 0x2264 Less-Than or Equal to
  533.         {0x51,0x51,0x4A,0x4A,0x44},                //   (239)  > - 0x2265 Greater-Than or Equal to
  534.         {0x74,0x42,0x41,0x42,0x74},                //   (240)    - 0x2302 House
  535. };


  536. unsigned char code Ascii_2[107][5]={                // Refer to "Times New Roman" Font Database...
  537.                                                 //   Greek & Japanese Letters
  538.         {0x7E,0x11,0x11,0x11,0x7E},                //   (  1)  A - 0x0391 Greek Capital Letter Alpha
  539.         {0x7F,0x49,0x49,0x49,0x36},                //   (  2)  B - 0x0392 Greek Capital Letter Beta
  540.         {0x7F,0x02,0x01,0x01,0x03},                //   (  3)    - 0x0393 Greek Capital Letter Gamma
  541.         {0x70,0x4E,0x41,0x4E,0x70},                //   (  4)    - 0x0394 Greek Capital Letter Delta
  542.         {0x7F,0x49,0x49,0x49,0x41},                //   (  5)  E - 0x0395 Greek Capital Letter Epsilon
  543.         {0x61,0x51,0x49,0x45,0x43},                //   (  6)  Z - 0x0396 Greek Capital Letter Zeta
  544.         {0x7F,0x08,0x08,0x08,0x7F},                //   (  7)  H - 0x0397 Greek Capital Letter Eta
  545.         {0x3E,0x49,0x49,0x49,0x3E},                //   (  8)    - 0x0398 Greek Capital Letter Theta
  546.         {0x00,0x41,0x7F,0x41,0x00},                //   (  9)  I - 0x0399 Greek Capital Letter Iota
  547.         {0x7F,0x08,0x14,0x22,0x41},                //   ( 10)  K - 0x039A Greek Capital Letter Kappa
  548.         {0x70,0x0E,0x01,0x0E,0x70},                //   ( 11)    - 0x039B Greek Capital Letter Lamda
  549.         {0x7F,0x02,0x0C,0x02,0x7F},                //   ( 12)  M - 0x039C Greek Capital Letter Mu
  550.         {0x7F,0x04,0x08,0x10,0x7F},                //   ( 13)  N - 0x039D Greek Capital Letter Nu
  551.         {0x63,0x5D,0x49,0x5D,0x63},                //   ( 14)    - 0x039E Greek Capital Letter Xi
  552.         {0x3E,0x41,0x41,0x41,0x3E},                //   ( 15)  O - 0x039F Greek Capital Letter Omicron
  553.         {0x41,0x3F,0x01,0x3F,0x41},                //   ( 16)    - 0x03A0 Greek Capital Letter Pi
  554.         {0x7F,0x09,0x09,0x09,0x06},                //   ( 17)  P - 0x03A1 Greek Capital Letter Rho
  555.         {0x63,0x55,0x49,0x41,0x41},                //   ( 18)    - 0x03A3 Greek Capital Letter Sigma
  556.         {0x01,0x01,0x7F,0x01,0x01},                //   ( 19)  T - 0x03A4 Greek Capital Letter Tau
  557.         {0x03,0x01,0x7E,0x01,0x03},                //   ( 20)    - 0x03A5 Greek Capital Letter Upsilon
  558.         {0x08,0x55,0x7F,0x55,0x08},                //   ( 21)    - 0x03A6 Greek Capital Letter Phi
  559.         {0x63,0x14,0x08,0x14,0x63},                //   ( 22)  X - 0x03A7 Greek Capital Letter Chi
  560.         {0x07,0x48,0x7F,0x48,0x07},                //   ( 23)    - 0x03A8 Greek Capital Letter Psi
  561.         {0x5E,0x61,0x01,0x61,0x5E},                //   ( 24)    - 0x03A9 Greek Capital Letter Omega
  562.         {0x38,0x44,0x48,0x30,0x4C},                //   ( 25)  a - 0x03B1 Greek Small Letter Alpha
  563.         {0x7C,0x2A,0x2A,0x2A,0x14},                //   ( 26)  B - 0x03B2 Greek Small Letter Beta
  564.         {0x44,0x38,0x04,0x04,0x08},                //   ( 27)  r - 0x03B3 Greek Small Letter Gamma
  565.         {0x30,0x4B,0x4D,0x59,0x30},                //   ( 28)    - 0x03B4 Greek Small Letter Delta
  566.         {0x28,0x54,0x54,0x44,0x20},                //   ( 29)    - 0x03B5 Greek Small Letter Epsilon
  567.         {0x00,0x18,0x55,0x52,0x22},                //   ( 30)    - 0x03B6 Greek Small Letter Zeta
  568.         {0x3E,0x04,0x02,0x02,0x7C},                //   ( 31)  n - 0x03B7 Greek Small Letter Eta
  569.         {0x3C,0x4A,0x4A,0x4A,0x3C},                //   ( 32)    - 0x03B8 Greek Small Letter Theta
  570.         {0x00,0x3C,0x40,0x20,0x00},                //   ( 33)  i - 0x03B9 Greek Small Letter Iota
  571.         {0x7C,0x10,0x28,0x44,0x40},                //   ( 34)  k - 0x03BA Greek Small Letter Kappa
  572.         {0x41,0x32,0x0C,0x30,0x40},                //   ( 35)    - 0x03BB Greek Small Letter Lamda
  573.         {0x7E,0x20,0x20,0x10,0x3E},                //   ( 36)  u - 0x03BC Greek Small Letter Mu
  574.         {0x1C,0x20,0x40,0x20,0x1C},                //   ( 37)  v - 0x03BD Greek Small Letter Nu
  575.         {0x14,0x2B,0x2A,0x2A,0x60},                //   ( 38)    - 0x03BE Greek Small Letter Xi
  576.         {0x38,0x44,0x44,0x44,0x38},                //   ( 39)  o - 0x03BF Greek Small Letter Omicron
  577.         {0x44,0x3C,0x04,0x7C,0x44},                //   ( 40)    - 0x03C0 Greek Small Letter Pi
  578.         {0x70,0x28,0x24,0x24,0x18},                //   ( 41)  p - 0x03C1 Greek Small Letter Rho
  579.         {0x0C,0x12,0x12,0x52,0x60},                //   ( 42)    - 0x03C2 Greek Small Letter Final Sigma
  580.         {0x38,0x44,0x4C,0x54,0x24},                //   ( 43)    - 0x03C3 Greek Small Letter Sigma
  581.         {0x04,0x3C,0x44,0x20,0x00},                //   ( 44)  t - 0x03C4 Greek Small Letter Tau
  582.         {0x3C,0x40,0x40,0x20,0x1C},                //   ( 45)  v - 0x03C5 Greek Small Letter Upsilon
  583.         {0x18,0x24,0x7E,0x24,0x18},                //   ( 46)    - 0x03C6 Greek Small Letter Phi
  584.         {0x44,0x28,0x10,0x28,0x44},                //   ( 47)  x - 0x03C7 Greek Small Letter Chi
  585.         {0x0C,0x10,0x7E,0x10,0x0C},                //   ( 48)    - 0x03C8 Greek Small Letter Psi
  586.         {0x38,0x44,0x30,0x44,0x38},                //   ( 49)  w - 0x03C9 Greek Small Letter Omega
  587.         {0x0A,0x0A,0x4A,0x2A,0x1E},                //   ( 50)    - 0xFF66 Katakana Letter Wo
  588.         {0x04,0x44,0x34,0x14,0x0C},                //   ( 51)    - 0xFF67 Katakana Letter Small A
  589.         {0x20,0x10,0x78,0x04,0x00},                //   ( 52)    - 0xFF68 Katakana Letter Small I
  590.         {0x18,0x08,0x4C,0x48,0x38},                //   ( 53)    - 0xFF69 Katakana Letter Small U
  591.         {0x48,0x48,0x78,0x48,0x48},                //   ( 54)    - 0xFF6A Katakana Letter Small E
  592.         {0x48,0x28,0x18,0x7C,0x08},                //   ( 55)    - 0xFF6B Katakana Letter Small O
  593.         {0x08,0x7C,0x08,0x28,0x18},                //   ( 56)    - 0xFF6C Katakana Letter Small Ya
  594.         {0x40,0x48,0x48,0x78,0x40},                //   ( 57)    - 0xFF6D Katakana Letter Small Yu
  595.         {0x54,0x54,0x54,0x7C,0x00},                //   ( 58)    - 0xFF6E Katakana Letter Small Yo
  596.         {0x18,0x00,0x58,0x40,0x38},                //   ( 59)    - 0xFF6F Katakana Letter Small Tu
  597.         {0x08,0x08,0x08,0x08,0x08},                //   ( 60)    - 0xFF70 Katakana-Hiragana Prolonged Sound Mark
  598.         {0x01,0x41,0x3D,0x09,0x07},                //   ( 61)    - 0xFF71 Katakana Letter A
  599.         {0x10,0x08,0x7C,0x02,0x01},                //   ( 62)    - 0xFF72 Katakana Letter I
  600.         {0x0E,0x02,0x43,0x22,0x1E},                //   ( 63)    - 0xFF73 Katakana Letter U
  601.         {0x42,0x42,0x7E,0x42,0x42},                //   ( 64)    - 0xFF74 Katakana Letter E
  602.         {0x22,0x12,0x0A,0x7F,0x02},                //   ( 65)    - 0xFF75 Katakana Letter O
  603.         {0x42,0x3F,0x02,0x42,0x3E},                //   ( 66)    - 0xFF76 Katakana Letter Ka
  604.         {0x0A,0x0A,0x7F,0x0A,0x0A},                //   ( 67)    - 0xFF77 Katakana Letter Ki
  605.         {0x08,0x46,0x42,0x22,0x1E},                //   ( 68)    - 0xFF78 Katakana Letter Ku
  606.         {0x04,0x03,0x42,0x3E,0x02},                //   ( 69)    - 0xFF79 Katakana Letter Ke
  607.         {0x42,0x42,0x42,0x42,0x7E},                //   ( 70)    - 0xFF7A Katakana Letter Ko
  608.         {0x02,0x4F,0x22,0x1F,0x02},                //   ( 71)    - 0xFF7B Katakana Letter Sa
  609.         {0x4A,0x4A,0x40,0x20,0x1C},                //   ( 72)    - 0xFF7C Katakana Letter Shi
  610.         {0x42,0x22,0x12,0x2A,0x46},                //   ( 73)    - 0xFF7D Katakana Letter Su
  611.         {0x02,0x3F,0x42,0x4A,0x46},                //   ( 74)    - 0xFF7E Katakana Letter Se
  612.         {0x06,0x48,0x40,0x20,0x1E},                //   ( 75)    - 0xFF7F Katakana Letter So
  613.         {0x08,0x46,0x4A,0x32,0x1E},                //   ( 76)    - 0xFF80 Katakana Letter Ta
  614.         {0x0A,0x4A,0x3E,0x09,0x08},                //   ( 77)    - 0xFF81 Katakana Letter Chi
  615.         {0x0E,0x00,0x4E,0x20,0x1E},                //   ( 78)    - 0xFF82 Katakana Letter Tsu
  616.         {0x04,0x45,0x3D,0x05,0x04},                //   ( 79)    - 0xFF83 Katakana Letter Te
  617.         {0x00,0x7F,0x08,0x10,0x00},                //   ( 80)    - 0xFF84 Katakana Letter To
  618.         {0x44,0x24,0x1F,0x04,0x04},                //   ( 81)    - 0xFF85 Katakana Letter Na
  619.         {0x40,0x42,0x42,0x42,0x40},                //   ( 82)    - 0xFF86 Katakana Letter Ni
  620.         {0x42,0x2A,0x12,0x2A,0x06},                //   ( 83)    - 0xFF87 Katakana Letter Nu
  621.         {0x22,0x12,0x7B,0x16,0x22},                //   ( 84)    - 0xFF88 Katakana Letter Ne
  622.         {0x00,0x40,0x20,0x1F,0x00},                //   ( 85)    - 0xFF89 Katakana Letter No
  623.         {0x78,0x00,0x02,0x04,0x78},                //   ( 86)    - 0xFF8A Katakana Letter Ha
  624.         {0x3F,0x44,0x44,0x44,0x44},                //   ( 87)    - 0xFF8B Katakana Letter Hi
  625.         {0x02,0x42,0x42,0x22,0x1E},                //   ( 88)    - 0xFF8C Katakana Letter Fu
  626.         {0x04,0x02,0x04,0x08,0x30},                //   ( 89)    - 0xFF8D Katakana Letter He
  627.         {0x32,0x02,0x7F,0x02,0x32},                //   ( 90)    - 0xFF8E Katakana Letter Ho
  628.         {0x02,0x12,0x22,0x52,0x0E},                //   ( 91)    - 0xFF8F Katakana Letter Ma
  629.         {0x00,0x2A,0x2A,0x2A,0x40},                //   ( 92)    - 0xFF90 Katakana Letter Mi
  630.         {0x38,0x24,0x22,0x20,0x70},                //   ( 93)    - 0xFF91 Katakana Letter Mu
  631.         {0x40,0x28,0x10,0x28,0x06},                //   ( 94)    - 0xFF92 Katakana Letter Me
  632.         {0x0A,0x3E,0x4A,0x4A,0x4A},                //   ( 95)    - 0xFF93 Katakana Letter Mo
  633.         {0x04,0x7F,0x04,0x14,0x0C},                //   ( 96)    - 0xFF94 Katakana Letter Ya
  634.         {0x40,0x42,0x42,0x7E,0x40},                //   ( 97)    - 0xFF95 Katakana Letter Yu
  635.         {0x4A,0x4A,0x4A,0x4A,0x7E},                //   ( 98)    - 0xFF96 Katakana Letter Yo
  636.         {0x04,0x05,0x45,0x25,0x1C},                //   ( 99)    - 0xFF97 Katakana Letter Ra
  637.         {0x0F,0x40,0x20,0x1F,0x00},                //   (100)    - 0xFF98 Katakana Letter Ri
  638.         {0x7C,0x00,0x7E,0x40,0x30},                //   (101)    - 0xFF99 Katakana Letter Ru
  639.         {0x7E,0x40,0x20,0x10,0x08},                //   (102)    - 0xFF9A Katakana Letter Re
  640.         {0x7E,0x42,0x42,0x42,0x7E},                //   (103)    - 0xFF9B Katakana Letter Ro
  641.         {0x0E,0x02,0x42,0x22,0x1E},                //   (104)    - 0xFF9C Katakana Letter Wa
  642.         {0x42,0x42,0x40,0x20,0x18},                //   (105)    - 0xFF9D Katakana Letter N
  643.         {0x02,0x04,0x01,0x02,0x00},                //   (106)    - 0xFF9E Katakana Voiced Sound Mark
  644.         {0x07,0x05,0x07,0x00,0x00},                //   (107)    - 0xFF9F Katakana Semi-Voiced Sound Mark
  645. };


  646. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  647. //  Show Regular Pattern (Full Screen)
  648. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  649. void Fill_RAM(unsigned char Data)
  650. {
  651. unsigned char i,j;

  652.         for(i=0;i<8;i++)
  653.         {
  654.                 Set_Start_Page(i);
  655.                 Set_Start_Column(0x00);

  656.                 for(j=0;j<128;j++)
  657.                 {
  658.                         Write_Data(Data);
  659.                 }
  660.         }
  661. }



  662. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  663. //  Show Regular Pattern (Partial or Full Screen)
  664. //
  665. //    a: Start Page
  666. //    b: End Page
  667. //    c: Start Column
  668. //    d: Total Columns
  669. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  670. void Fill_Block(unsigned char Data, unsigned char a, unsigned char b, unsigned char c, unsigned char d)
  671. {
  672. unsigned char i,j;
  673.        
  674.         for(i=a;i<(b+1);i++)
  675.         {
  676.                 Set_Start_Page(i);
  677.                 Set_Start_Column(c);

  678.                 for(j=0;j<d;j++)
  679.                 {
  680.                         Write_Data(Data);
  681.                 }
  682.         }
  683. }


  684. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  685. //  Show Checkboard (Full Screen)
  686. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  687. void Checkerboard()
  688. {
  689. unsigned char i,j;
  690.        
  691.         for(i=0;i<8;i++)
  692.         {
  693.                 Set_Start_Page(i);
  694.                 Set_Start_Column(0x00);

  695.                 for(j=0;j<64;j++)
  696.                 {
  697.                         Write_Data(0x55);
  698.                         Write_Data(0xaa);
  699.                 }
  700.         }
  701. }


  702. /*
  703. void Checkerboard()
  704. {
  705.         Set_Start_Page(0);
  706.         Set_Start_Column(0x00);
  707.         Write_Data(0x55);
  708.         Write_Data(0xaa);
  709.         Write_Data(0x55);
  710.         Write_Data(0xaa);
  711. }
  712. */
  713. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  714. //  Show Frame (Full Screen)
  715. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  716. void Frame()
  717. {
  718. unsigned char i,j;
  719.        
  720.         Set_Start_Page(0x00);
  721.         Set_Start_Column(XLevel);

  722.         for(i=0;i<Max_Column;i++)
  723.         {
  724.                 Write_Data(0x01);
  725.         }

  726.         Set_Start_Page(0x07);
  727.         Set_Start_Column(XLevel);

  728.         for(i=0;i<Max_Column;i++)
  729.         {
  730.                 Write_Data(0x80);
  731.         }

  732.         for(i=0;i<8;i++)
  733.         {
  734.                 Set_Start_Page(i);

  735.                 for(j=0;j<Max_Column;j+=(Max_Column-1))
  736.                 {
  737.                         Set_Start_Column(XLevel+j);

  738.                         Write_Data(0xFF);
  739.                 }
  740.         }
  741. }
  742. //-----------------------------------------------------------------------


  743. void Frame_2()
  744. {
  745.         unsigned char i,j;
  746.         Set_Start_Page(0x00);
  747.         Set_Start_Column(XLevel);
  748.         for(i=0;i<Max_Column;i++)
  749.         {
  750.                 Write_Data(0x01);       
  751.         }
  752.         Set_Start_Page(0x04);
  753.         Set_Start_Column(XLevel);
  754.         for(i=0;i<Max_Column;i++)
  755.         {
  756.                 Write_Data(0x80);
  757.         }
  758.         Set_Start_Page(0x05);
  759.         Set_Start_Column(XLevel);
  760.         for(i=0;i<Max_Column;i++)
  761.         {
  762.                 Write_Data(0x01);
  763.         }
  764.         Set_Start_Page(0x07);
  765.         Set_Start_Column(XLevel);
  766.         for(i=0;i<Max_Column;i++)
  767.         {
  768.                 Write_Data(0x80);
  769.         }
  770.                
  771.         for(i=0;i<8;i++)
  772.         {
  773.                 Set_Start_Page(i);
  774.                 for(j=0;j<Max_Column;j+=(Max_Column-1))
  775.                 {
  776.                         Set_Start_Column(XLevel+j);
  777.                         Write_Data(0xFF);
  778.                 }
  779.         }

  780. }

  781. //-----------------------------------------------------------------------

  782. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  783. //  Show Character (5x7)
  784. //
  785. //    a: Database
  786. //    b: Ascii
  787. //    c: Start Page
  788. //    d: Start Column
  789. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  790. void Show_Font57(unsigned char a, unsigned char b, unsigned char c, unsigned char d)
  791. {
  792. unsigned char *Src_Pointer;
  793. unsigned char i;

  794.         switch(a)
  795.         {
  796.                 case 1:
  797.                         Src_Pointer=&Ascii_1[(b-1)][0];
  798.                         break;
  799.                 case 2:
  800.                         Src_Pointer=&Ascii_2[(b-1)][0];
  801.                         break;
  802.         }
  803.         Set_Start_Page(c);
  804.         Set_Start_Column(d);

  805.         for(i=0;i<5;i++)
  806.         {
  807.                 Write_Data(*Src_Pointer);
  808.                 Src_Pointer++;
  809.         }
  810.         Write_Data(0x00);
  811. }


  812. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  813. //  Show String
  814. //
  815. //    a: Database
  816. //    b: Start Page
  817. //    c: Start Column
  818. //    * Must write "0" in the end...
  819. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  820. void Show_String(unsigned char a, unsigned char *Data_Pointer, unsigned char b, unsigned char c)
  821. {
  822. unsigned char *Src_Pointer;

  823.         Src_Pointer=Data_Pointer;
  824.         Show_Font57(1,96,b,c);                        // No-Break Space
  825.                                                 //   Must be written first before the string start...

  826.         while(1)
  827.         {
  828.                 Show_Font57(a,*Src_Pointer,b,c);
  829.                 Src_Pointer++;
  830.                 c+=6;
  831.                 if(*Src_Pointer == 0) break;
  832.         }
  833. }


  834. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  835. //  Show Pattern (Partial or Full Screen)
  836. //
  837. //    a: Start Page
  838. //    b: End Page
  839. //    c: Start Column
  840. //    d: Total Columns
  841. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  842. void Show_Pattern(unsigned char *Data_Pointer, unsigned char a, unsigned char b, unsigned char c, unsigned char d)
  843. {
  844. unsigned char *Src_Pointer;
  845. unsigned char i,j;

  846.         Src_Pointer=Data_Pointer;
  847.         for(i=a;i<(b+1);i++)
  848.         {
  849.                 Set_Start_Page(i);
  850.                 Set_Start_Column(c);

  851.                 for(j=0;j<d;j++)
  852.                 {
  853.                         Write_Data(*Src_Pointer);
  854.                         Src_Pointer++;
  855.                 }
  856.         }
  857. }


  858. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  859. //  Vertical / Fade Scrolling (Partial or Full Screen)
  860. //
  861. //    a: Scrolling Direction
  862. //       "0x00" (Upward)
  863. //       "0x01" (Downward)
  864. //    b: Set Top Fixed Area
  865. //    c: Set Vertical Scroll Area
  866. //    d: Set Numbers of Row Scroll per Step
  867. //    e: Set Time Interval between Each Scroll Step
  868. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  869. void Vertical_Scroll(unsigned char a, unsigned char b, unsigned char c, unsigned char d, unsigned char e)
  870. {
  871. unsigned int i,j;       

  872.         Write_Command(0xA3);                        // Set Vertical Scroll Area
  873.         Write_Command(b);                        //   Default => 0x00 (Top Fixed Area)
  874.         Write_Command(c);                        //   Default => 0x40 (Vertical Scroll Area)

  875.         switch(a)
  876.         {
  877.                 case 0:
  878.                         for(i=0;i<c;i+=d)
  879.                         {
  880.                                 Set_Start_Line(i);
  881.                                 for(j=0;j<e;j++)
  882.                                 {
  883.                                         uDelay(200);
  884.                                 }
  885.                         }
  886.                         break;
  887.                 case 1:
  888.                         for(i=0;i<c;i+=d)
  889.                         {
  890.                                 Set_Start_Line(c-i);
  891.                                 for(j=0;j<e;j++)
  892.                                 {
  893.                                         uDelay(200);
  894.                                 }
  895.                         }
  896.                         break;
  897.         }
  898.         Set_Start_Line(0x00);
  899. }


  900. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  901. //  Continuous Horizontal Scrolling (Partial or Full Screen)
  902. //
  903. //    a: Scrolling Direction
  904. //       "0x00" (Rightward)
  905. //       "0x01" (Leftward)
  906. //    b: Define Start Page Address
  907. //    c: Define End Page Address
  908. //    d: Set Time Interval between Each Scroll Step in Terms of Frame Frequency
  909. //    e: Delay Time
  910. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  911. void Horizontal_Scroll(unsigned char a, unsigned char b, unsigned char c, unsigned char d, unsigned char e)
  912. {
  913.         Write_Command(0x26|a);                        // Horizontal Scroll Setup
  914.         Write_Command(0x00);                        //           => (Dummy Write for First Parameter)
  915.         Write_Command(b);
  916.         Write_Command(d);
  917.         Write_Command(c);
  918.         Write_Command(0x2F);                        // Activate Scrolling
  919.         Delay(e);
  920. }


  921. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  922. //  Continuous Vertical / Horizontal / Diagonal Scrolling (Partial or Full Screen)
  923. //
  924. //    a: Scrolling Direction
  925. //       "0x00" (Vertical & Rightward)
  926. //       "0x01" (Vertical & Leftward)
  927. //    b: Define Start Row Address (Horizontal / Diagonal Scrolling)
  928. //    c: Define End Page Address (Horizontal / Diagonal Scrolling)
  929. //    d: Set Top Fixed Area (Vertical Scrolling)
  930. //    e: Set Vertical Scroll Area (Vertical Scrolling)
  931. //    f: Set Numbers of Row Scroll per Step (Vertical / Diagonal Scrolling)
  932. //    g: Set Time Interval between Each Scroll Step in Terms of Frame Frequency
  933. //    h: Delay Time
  934. //    * d+e must be less than or equal to the Multiplex Ratio...
  935. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  936. void Continuous_Scroll(unsigned char a, unsigned char b, unsigned char c, unsigned char d, unsigned char e, unsigned char f, unsigned char g, unsigned char h)
  937. {
  938.         Write_Command(0xA3);                        // Set Vertical Scroll Area
  939.         Write_Command(d);                        //   Default => 0x00 (Top Fixed Area)
  940.         Write_Command(e);                        //   Default => 0x40 (Vertical Scroll Area)

  941.         Write_Command(0x29+a);                        // Continuous Vertical & Horizontal Scroll Setup
  942.         Write_Command(0x00);                        //           => (Dummy Write for First Parameter)
  943.         Write_Command(b);
  944.         Write_Command(g);
  945.         Write_Command(c);
  946.         Write_Command(f);
  947.         Write_Command(0x2F);                        // Activate Scrolling
  948.         Delay(h);
  949. }


  950. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  951. //  Deactivate Scrolling (Full Screen)
  952. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  953. void Deactivate_Scroll()
  954. {
  955.         Write_Command(0x2E);                        // Deactivate Scrolling
  956. }


  957. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  958. //  Fade In (Full Screen)
  959. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  960. void Fade_In()
  961. {
  962. unsigned int i;       

  963.         Set_Display_On_Off(0xAF);
  964.         for(i=0;i<(Brightness+1);i++)
  965.         {
  966.                 Set_Contrast_Control(i);
  967.                 uDelay(200);
  968.                 uDelay(200);
  969.                 uDelay(200);
  970.         }
  971. }


  972. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  973. //  Fade Out (Full Screen)
  974. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  975. void Fade_Out()
  976. {
  977. unsigned int i;       

  978.         for(i=(Brightness+1);i>0;i--)
  979.         {
  980.                 Set_Contrast_Control(i-1);
  981.                 uDelay(200);
  982.                 uDelay(200);
  983.                 uDelay(200);
  984.         }
  985.         Set_Display_On_Off(0xAE);
  986. }


  987. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  988. //  Sleep Mode
  989. //
  990. //    "0x00" Enter Sleep Mode
  991. //    "0x01" Exit Sleep Mode
  992. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  993. void Sleep(unsigned char a)
  994. {
  995.         switch(a)
  996.         {
  997.                 case 0:
  998.                         Set_Display_On_Off(0xAE);
  999.                         Set_Entire_Display(0xA5);
  1000.                         break;
  1001.                 case 1:
  1002.                         Set_Entire_Display(0xA4);
  1003.                         Set_Display_On_Off(0xAF);
  1004.                         break;
  1005.         }
  1006. }


  1007. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1008. //  Connection Test
  1009. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1010. void Test()
  1011. {
  1012. unsigned char i;

  1013.         RES=0;
  1014.         for(i=0;i<200;i++)
  1015.         {
  1016.                 uDelay(200);
  1017.         }
  1018.         RES=1;

  1019.         Set_Entire_Display(0xA5);                // Enable Entire Display On (0xA4/0xA5)

  1020.         while(1)
  1021.         {
  1022.                 Set_Display_On_Off(0xAF);        // Display On (0xAE/0xAF)
  1023.                 Delay(2);
  1024.                 Set_Display_On_Off(0xAE);        // Display Off (0xAE/0xAF)
  1025.                 Delay(2);
  1026.         }
  1027. }


  1028. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1029. //  Initialization
  1030. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1031. void OLED_Init_E()                                // VCC Supplied Externally
  1032. {
  1033. unsigned char i;

  1034.         RES=0;
  1035.         for(i=0;i<200;i++)
  1036.         {
  1037.                 uDelay(200);
  1038.         }
  1039.         RES=1;

  1040.         Set_Display_On_Off(0xAE);                // Display Off (0xAE/0xAF)
  1041.         Set_Display_Clock(0x80);                // Set Clock as 100 Frames/Sec
  1042.         Set_Multiplex_Ratio(0x3F);                // 1/64 Duty (0x0F~0x3F)
  1043.         Set_Display_Offset(0x3F);                // Shift Mapping RAM Counter (0x00~0x3F)
  1044.         Set_Start_Line(0x00);                        // Set Mapping RAM Display Start Line (0x00~0x3F)
  1045.         Set_Charge_Pump(0x14);                        // Disable Embedded DC/DC Converter (0x10/0x14)                  0x10
  1046.         Set_Addressing_Mode(0x02);                // Set Page Addressing Mode (0x00/0x01/0x02)       
  1047.         Set_Segment_Remap(0xA1);                // Set SEG/Column Mapping (0xA0/0xA1)
  1048.         Set_Common_Remap(0xC8);                        // Set COM/Row Scan Direction (0xC0/0xC8)
  1049.         Set_Common_Config(0x12);                // Set Sequential Configuration (0x02/0x12)
  1050.         Set_Contrast_Control(Brightness);        // Set SEG Output Current
  1051.         Set_Precharge_Period(0x22);                // Set Pre-Charge as 2 Clocks & Discharge as 2 Clocks
  1052.         Set_VCOMH(0x20);                        // Set VCOM Deselect Level                          0x40
  1053.         Set_Entire_Display(0xA4);                // Disable Entire Display On (0xA4/0xA5)                                                         
  1054.         Set_Inverse_Display(0xA6);                // Disable Inverse Display On (0xA6/0xA7)

  1055.         Fill_RAM(0x00);                                // Clear Screen

  1056.         Set_Display_On_Off(0xAF);                // Display On (0xAE/0xAF)
  1057. }


  1058. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1059. //  Main Program
  1060. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1061. void main()
  1062. {
  1063. unsigned char code Name[]={44,85,13,65,73,13,81,73,79,78,71,0};//{55,73,83,69,35,72,73,80,0};
  1064.                                                 // WiseChip
  1065. unsigned char code Tel[]={11,24,24,22,13,19,23,13,21,24,23,17,22,24,0};
  1066.                                                 // +886-37-587168
  1067. unsigned char i;

  1068.         P1=0xFF;
  1069.         P3=0xFF;
  1070.         OLED_Init_E();

  1071.         while(1)
  1072.         {
  1073.         // Show Pattern - UniV OLED
  1074.                 Show_Pattern(&UniV[0][0],0x02,0x05,XLevel+0x28,0x30);
  1075.                 Delay(1);

  1076.        
  1077.         // Fade In/Out (Full Screen)
  1078.                 Fade_Out();                                            
  1079.                 Fade_In();
  1080.                 Fade_Out();
  1081.                 Fade_In();
  1082.                 Delay(1);

  1083.         // Scrolling (Partial or Full Screen)
  1084.                 Vertical_Scroll(0x00,0x00,Max_Row,0x01,0x20);
  1085.                                                 // Upward
  1086.                 Delay(1);
  1087.                 Vertical_Scroll(0x01,0x00,Max_Row,0x01,0x20);
  1088.                                                 // Downward
  1089.                 Delay(1);
  1090.                 Deactivate_Scroll();
  1091.                 Continuous_Scroll(0x00,0x00,0x00,0x00,0x20,0x01,0x00,0x01);
  1092.                                                 // Upward - Top Area
  1093.                 Continuous_Scroll(0x00,0x00,0x00,0x00,0x20,0x1F,0x00,0x01);
  1094.                                                 // Downward - Top Area
  1095.                 Continuous_Scroll(0x00,0x00,0x03,0x00,0x20,0x01,0x00,0x02);
  1096.                                                 // Up & Rightward - Top Area
  1097.                 Continuous_Scroll(0x01,0x00,0x03,0x00,0x20,0x1F,0x00,0x02);
  1098.                                                 // Down & Leftward - Top Area
  1099.                 Continuous_Scroll(0x01,0x04,0x07,0x00,0x20,0x01,0x00,0x02);
  1100.                                                 // Upward - Top Area
  1101.                                                 // Leftward - Bottom Area
  1102.                 Continuous_Scroll(0x00,0x04,0x07,0x00,0x20,0x1F,0x00,0x02);
  1103.                                                 // Downward - Top Area
  1104.                                                 // Rightward - Bottom Area
  1105.                 Deactivate_Scroll();
  1106.                 Delay(1);
  1107.                 Fill_RAM(0x00);       
  1108.         //        Show string
  1109.             Show_String(1,&Name,0x03,XLevel+0x28);
  1110.                 Delay(1);
  1111.         // All Pixels On (Test Pattern)                                  
  1112.                 Fill_RAM(0xFF);                                
  1113.                 Delay(1);
  1114.                 Fill_RAM(0x00);
  1115.                 Frame_2();
  1116.                 Delay(1);

  1117.         // Checkerboard (Test Pattern)
  1118.                 Checkerboard();                                  
  1119.                 Delay(1);
  1120.                 Fill_RAM(0x00);                        // Clear Screen

  1121.         // Frame (Test Pattern)
  1122.                 Frame();
  1123.                 Delay(1);

  1124.         // Show String - WiseChip +886-37-587168
  1125.                 Show_String(1,&Name,0x03,XLevel+0x28);
  1126.         //        Show_String(1,&Tel,0x04,XLevel+0x16);
  1127.                 Delay(1);
  1128.                 Fill_RAM(0x00);                        // Clear Screen
  1129.         }
  1130. }
复制代码

所有资料51hei提供下载:
12864_01.rar (10.07 KB, 下载次数: 9)


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏2 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:344053 发表于 2018-6-18 00:01 | 只看该作者
下载看看
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表