Various projects using Raspberry Pi
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
18 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. with Interfaces;
  2. with Interfaces.C;
  3. with Ada.Streams.Stream_IO;
  4. package st7565lcd is
  5. -- type definitions
  6. subtype byte is Interfaces.Unsigned_8;
  7. subtype word is Interfaces.Unsigned_16;
  8. subtype dword is Interfaces.Unsigned_32;
  9. type t_byte_array is array (natural range <>) of byte;
  10. type t_font_array is array (natural range <>) of t_byte_array (0 .. 4);
  11. type t_bmp_array is array (0 .. 128 * 64 - 1) of t_byte_array (0 .. 3);
  12. subtype t_lcd_array is t_byte_array (0 .. 128 * 8 - 1);
  13. -- bmp header structure
  14. type t_bmp_header is record
  15. bfType : word;
  16. bfSize : dword;
  17. bfReserved : dword;
  18. bfOffBits : dword;
  19. biSize : dword;
  20. biWidth : integer;
  21. biHeight : integer;
  22. biPlanes : word;
  23. biBitCount : word;
  24. biCompression : dword;
  25. biSizeImage : dword;
  26. biXPelsPerMeter : integer;
  27. biYPelsPerMeter : integer;
  28. biClrUsed : dword;
  29. biClrImportant : dword;
  30. end record;
  31. -- color mask
  32. type t_color_mask is record
  33. red : dword := 16#00FF0000#;
  34. green : dword := 16#0000FF00#;
  35. blue : dword := 16#000000FF#;
  36. alpha : dword := 16#FF000000#;
  37. end record;
  38. -- bmp record
  39. type t_bmp_picture is record
  40. header : t_bmp_header;
  41. mask : t_color_mask;
  42. data : t_bmp_array;
  43. end record;
  44. -- character set
  45. font_5x7 : constant t_font_array (32 .. 126) := (
  46. ( 16#00#, 16#00#, 16#00#, 16#00#, 16#00# ), -- - 16#20 - 32
  47. ( 16#00#, 16#00#, 16#5f#, 16#00#, 16#00# ), -- ! - 16#21 - 33
  48. ( 16#00#, 16#07#, 16#00#, 16#07#, 16#00# ), -- " - 16#22 - 34
  49. ( 16#14#, 16#7f#, 16#14#, 16#7f#, 16#14# ), -- # - 16#23 - 35
  50. ( 16#24#, 16#2a#, 16#7f#, 16#2a#, 16#12# ), -- $ - 16#24 - 36
  51. ( 16#23#, 16#13#, 16#08#, 16#64#, 16#62# ), -- % - 16#25 - 37
  52. ( 16#36#, 16#49#, 16#55#, 16#22#, 16#50# ), -- & - 16#26 - 38
  53. ( 16#00#, 16#05#, 16#03#, 16#00#, 16#00# ), -- ' - 16#27 - 39
  54. ( 16#00#, 16#1c#, 16#22#, 16#41#, 16#00# ), -- ( - 16#28 - 40
  55. ( 16#00#, 16#41#, 16#22#, 16#1c#, 16#00# ), -- ) - 16#29 - 41
  56. ( 16#14#, 16#08#, 16#3e#, 16#08#, 16#14# ), -- * - 16#2a - 42
  57. ( 16#08#, 16#08#, 16#3e#, 16#08#, 16#08# ), -- + - 16#2b - 43
  58. ( 16#00#, 16#50#, 16#30#, 16#00#, 16#00# ), -- , - 16#2c - 44
  59. ( 16#08#, 16#08#, 16#08#, 16#08#, 16#08# ), -- - - 16#2d - 45
  60. ( 16#00#, 16#60#, 16#60#, 16#00#, 16#00# ), -- . - 16#2e - 46
  61. ( 16#20#, 16#10#, 16#08#, 16#04#, 16#02# ), -- / - 16#2f - 47
  62. ( 16#3e#, 16#51#, 16#49#, 16#45#, 16#3e# ), -- 0 - 16#30 - 48
  63. ( 16#00#, 16#42#, 16#7f#, 16#40#, 16#00# ), -- 1 - 16#31 - 49
  64. ( 16#42#, 16#61#, 16#51#, 16#49#, 16#46# ), -- 2 - 16#32 - 50
  65. ( 16#21#, 16#41#, 16#45#, 16#4b#, 16#31# ), -- 3 - 16#33 - 51
  66. ( 16#18#, 16#14#, 16#12#, 16#7f#, 16#10# ), -- 4 - 16#34 - 52
  67. ( 16#27#, 16#45#, 16#45#, 16#45#, 16#39# ), -- 5 - 16#35 - 53
  68. ( 16#3c#, 16#4a#, 16#49#, 16#49#, 16#30# ), -- 6 - 16#36 - 54
  69. ( 16#01#, 16#71#, 16#09#, 16#05#, 16#03# ), -- 7 - 16#37 - 55
  70. ( 16#36#, 16#49#, 16#49#, 16#49#, 16#36# ), -- 8 - 16#38 - 56
  71. ( 16#06#, 16#49#, 16#49#, 16#29#, 16#1e# ), -- 9 - 16#39 - 57
  72. ( 16#00#, 16#36#, 16#36#, 16#00#, 16#00# ), -- : - 16#3a - 58
  73. ( 16#00#, 16#56#, 16#36#, 16#00#, 16#00# ), -- ; - 16#3b - 59
  74. ( 16#08#, 16#14#, 16#22#, 16#41#, 16#00# ), -- < - 16#3c - 60
  75. ( 16#14#, 16#14#, 16#14#, 16#14#, 16#14# ), -- = - 16#3d - 61
  76. ( 16#00#, 16#41#, 16#22#, 16#14#, 16#08# ), -- > - 16#3e - 62
  77. ( 16#02#, 16#01#, 16#51#, 16#09#, 16#06# ), -- ? - 16#3f - 63
  78. ( 16#32#, 16#49#, 16#79#, 16#41#, 16#3e# ), -- @ - 16#40 - 64
  79. ( 16#7e#, 16#11#, 16#11#, 16#11#, 16#7e# ), -- A - 16#41 - 65
  80. ( 16#7f#, 16#49#, 16#49#, 16#49#, 16#36# ), -- B - 16#42 - 66
  81. ( 16#3e#, 16#41#, 16#41#, 16#41#, 16#22# ), -- C - 16#43 - 67
  82. ( 16#7f#, 16#41#, 16#41#, 16#22#, 16#1c# ), -- D - 16#44 - 68
  83. ( 16#7f#, 16#49#, 16#49#, 16#49#, 16#41# ), -- E - 16#45 - 69
  84. ( 16#7f#, 16#09#, 16#09#, 16#09#, 16#01# ), -- F - 16#46 - 70
  85. ( 16#3e#, 16#41#, 16#49#, 16#49#, 16#7a# ), -- G - 16#47 - 71
  86. ( 16#7f#, 16#08#, 16#08#, 16#08#, 16#7f# ), -- H - 16#48 - 72
  87. ( 16#00#, 16#41#, 16#7f#, 16#41#, 16#00# ), -- I - 16#49 - 73
  88. ( 16#20#, 16#40#, 16#41#, 16#3f#, 16#01# ), -- J - 16#4a - 74
  89. ( 16#7f#, 16#08#, 16#14#, 16#22#, 16#41# ), -- K - 16#4b - 75
  90. ( 16#7f#, 16#40#, 16#40#, 16#40#, 16#40# ), -- L - 16#4c - 76
  91. ( 16#7f#, 16#02#, 16#0c#, 16#02#, 16#7f# ), -- M - 16#4d - 77
  92. ( 16#7f#, 16#04#, 16#08#, 16#10#, 16#7f# ), -- N - 16#4e - 78
  93. ( 16#3e#, 16#41#, 16#41#, 16#41#, 16#3e# ), -- O - 16#4f - 79
  94. ( 16#7f#, 16#09#, 16#09#, 16#09#, 16#06# ), -- P - 16#50 - 80
  95. ( 16#3e#, 16#41#, 16#51#, 16#21#, 16#5e# ), -- Q - 16#51 - 81
  96. ( 16#7f#, 16#09#, 16#19#, 16#29#, 16#46# ), -- R - 16#52 - 82
  97. ( 16#46#, 16#49#, 16#49#, 16#49#, 16#31# ), -- S - 16#53 - 83
  98. ( 16#01#, 16#01#, 16#7f#, 16#01#, 16#01# ), -- T - 16#54 - 84
  99. ( 16#3f#, 16#40#, 16#40#, 16#40#, 16#3f# ), -- U - 16#55 - 85
  100. ( 16#1f#, 16#20#, 16#40#, 16#20#, 16#1f# ), -- V - 16#56 - 86
  101. ( 16#3f#, 16#40#, 16#38#, 16#40#, 16#3f# ), -- W - 16#57 - 87
  102. ( 16#63#, 16#14#, 16#08#, 16#14#, 16#63# ), -- X - 16#58 - 88
  103. ( 16#07#, 16#08#, 16#70#, 16#08#, 16#07# ), -- Y - 16#59 - 89
  104. ( 16#61#, 16#51#, 16#49#, 16#45#, 16#43# ), -- Z - 16#5a - 90
  105. ( 16#00#, 16#7f#, 16#41#, 16#41#, 16#00# ), -- [ - 16#5b - 91
  106. ( 16#02#, 16#04#, 16#08#, 16#10#, 16#20# ), -- \ - 16#5c - 92
  107. ( 16#00#, 16#41#, 16#41#, 16#7f#, 16#00# ), -- ] - 16#5d - 93
  108. ( 16#04#, 16#02#, 16#01#, 16#02#, 16#04# ), -- ^ - 16#5e - 94
  109. ( 16#40#, 16#40#, 16#40#, 16#40#, 16#40# ), -- _ - 16#5f - 95
  110. ( 16#00#, 16#01#, 16#02#, 16#04#, 16#00# ), -- ` - 16#60 - 96
  111. ( 16#20#, 16#54#, 16#54#, 16#54#, 16#78# ), -- a - 16#61 - 97
  112. ( 16#7f#, 16#48#, 16#44#, 16#44#, 16#38# ), -- b - 16#62 - 98
  113. ( 16#38#, 16#44#, 16#44#, 16#44#, 16#20# ), -- c - 16#63 - 99
  114. ( 16#38#, 16#44#, 16#44#, 16#48#, 16#7f# ), -- d - 16#64 - 100
  115. ( 16#38#, 16#54#, 16#54#, 16#54#, 16#18# ), -- e - 16#65 - 101
  116. ( 16#08#, 16#7e#, 16#09#, 16#01#, 16#02# ), -- f - 16#66 - 102
  117. ( 16#38#, 16#44#, 16#44#, 16#54#, 16#34# ), -- g - 16#67 - 103
  118. ( 16#7f#, 16#08#, 16#04#, 16#04#, 16#78# ), -- h - 16#68 - 104
  119. ( 16#00#, 16#44#, 16#7d#, 16#40#, 16#00# ), -- i - 16#69 - 105
  120. ( 16#20#, 16#40#, 16#44#, 16#3d#, 16#00# ), -- j - 16#6a - 106
  121. ( 16#7f#, 16#10#, 16#28#, 16#44#, 16#00# ), -- k - 16#6b - 107
  122. ( 16#00#, 16#41#, 16#7f#, 16#40#, 16#00# ), -- l - 16#6c - 108
  123. ( 16#7c#, 16#04#, 16#18#, 16#04#, 16#78# ), -- m - 16#6d - 109
  124. ( 16#7c#, 16#08#, 16#04#, 16#04#, 16#78# ), -- n - 16#6e - 110
  125. ( 16#38#, 16#44#, 16#44#, 16#44#, 16#38# ), -- o - 16#6f - 111
  126. ( 16#7c#, 16#14#, 16#14#, 16#14#, 16#08# ), -- p - 16#70 - 112
  127. ( 16#08#, 16#14#, 16#14#, 16#18#, 16#7c# ), -- q - 16#71 - 113
  128. ( 16#7c#, 16#08#, 16#04#, 16#04#, 16#08# ), -- r - 16#72 - 114
  129. ( 16#48#, 16#54#, 16#54#, 16#54#, 16#20# ), -- s - 16#73 - 115
  130. ( 16#04#, 16#3f#, 16#44#, 16#40#, 16#20# ), -- t - 16#74 - 116
  131. ( 16#3c#, 16#40#, 16#40#, 16#20#, 16#7c# ), -- u - 16#75 - 117
  132. ( 16#1c#, 16#20#, 16#40#, 16#20#, 16#1c# ), -- v - 16#76 - 118
  133. ( 16#3c#, 16#40#, 16#30#, 16#40#, 16#3c# ), -- w - 16#77 - 119
  134. ( 16#44#, 16#28#, 16#10#, 16#28#, 16#44# ), -- x - 16#78 - 120
  135. ( 16#0c#, 16#50#, 16#50#, 16#50#, 16#3c# ), -- y - 16#79 - 121
  136. ( 16#44#, 16#64#, 16#54#, 16#4c#, 16#44# ), -- z - 16#7a - 122
  137. ( 16#00#, 16#08#, 16#36#, 16#41#, 16#00# ), -- { - 16#7b - 123
  138. ( 16#00#, 16#00#, 16#7f#, 16#00#, 16#00# ), -- | - 16#7c - 124
  139. ( 16#00#, 16#41#, 16#36#, 16#08#, 16#00# ), -- } - 16#7d - 125
  140. ( 16#10#, 16#08#, 16#08#, 16#10#, 16#08# ) -- ~ - 16#7e - 126
  141. );
  142. -- raspberry picture
  143. raspberry : constant t_lcd_array := (
  144. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 1. row
  145. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 1. row
  146. 16#00#,16#00#,16#00#,16#00#,16#F0#,16#F8#,16#58#,16#1C#,16#1C#,16#0C#,16#0C#,16#06#,16#86#,16#86#,16#86#,16#0E#, -- 1. row
  147. 16#0E#,16#06#,16#0E#,16#1E#,16#1C#,16#1C#,16#0C#,16#3C#,16#38#,16#78#,16#F0#,16#E0#,16#C0#,16#C0#,16#E0#,16#70#, -- 1. row
  148. 16#38#,16#18#,16#1C#,16#1C#,16#0C#,16#0E#,16#0E#,16#0E#,16#0E#,16#0E#,16#0E#,16#86#,16#86#,16#06#,16#04#,16#0C#, -- 1. row
  149. 16#0C#,16#18#,16#F8#,16#F8#,16#F8#,16#F0#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 1. row
  150. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 1. row
  151. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 1. row
  152. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 2. row
  153. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 2. row
  154. 16#00#,16#00#,16#00#,16#00#,16#03#,16#0F#,16#3F#,16#7C#,16#F0#,16#C0#,16#C0#,16#C0#,16#C0#,16#00#,16#01#,16#01#, -- 2. row
  155. 16#03#,16#02#,16#06#,16#04#,16#04#,16#1C#,16#B8#,16#F0#,16#E0#,16#70#,16#30#,16#1F#,16#0F#,16#0F#,16#3F#,16#30#, -- 2. row
  156. 16#F0#,16#E0#,16#B0#,16#18#,16#08#,16#0C#,16#04#,16#06#,16#02#,16#01#,16#01#,16#00#,16#00#,16#00#,16#00#,16#C0#, -- 2. row
  157. 16#F0#,16#F8#,16#7F#,16#1F#,16#07#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 2. row
  158. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 2. row
  159. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 2. row
  160. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 3. row
  161. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 3. row
  162. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#80#,16#E0#,16#F3#,16#33#,16#3F#,16#1F#,16#1E#,16#0E#,16#0E#, -- 3. row
  163. 16#0C#,16#0C#,16#EC#,16#EC#,16#EE#,16#BE#,16#0F#,16#0F#,16#07#,16#06#,16#02#,16#02#,16#02#,16#02#,16#02#,16#06#, -- 3. row
  164. 16#06#,16#0F#,16#0F#,16#BE#,16#EE#,16#CC#,16#8C#,16#0C#,16#0C#,16#0C#,16#0E#,16#1E#,16#1E#,16#3F#,16#73#,16#E1#, -- 3. row
  165. 16#C1#,16#00#,16#36#,16#25#,16#55#,16#5D#,16#49#,16#6D#,16#32#,16#0C#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 3. row
  166. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 3. row
  167. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 3. row
  168. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 4. row
  169. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 4. row
  170. 16#00#,16#00#,16#00#,16#80#,16#C0#,16#E0#,16#70#,16#7F#,16#7F#,16#3F#,16#FC#,16#FC#,16#FC#,16#3C#,16#1C#,16#0E#, -- 4. row
  171. 16#07#,16#07#,16#03#,16#03#,16#03#,16#03#,16#03#,16#02#,16#06#,16#0E#,16#1C#,16#FC#,16#FC#,16#FC#,16#3C#,16#0E#, -- 4. row
  172. 16#06#,16#02#,16#03#,16#03#,16#03#,16#03#,16#03#,16#03#,16#07#,16#06#,16#0C#,16#18#,16#78#,16#F0#,16#F0#,16#33#, -- 4. row
  173. 16#7F#,16#7F#,16#70#,16#F0#,16#C0#,16#80#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 4. row
  174. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 4. row
  175. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 4. row
  176. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 5. row
  177. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 5. row
  178. 16#00#,16#00#,16#FF#,16#FF#,16#83#,16#00#,16#00#,16#00#,16#00#,16#C0#,16#FF#,16#FF#,16#F0#,16#F0#,16#F0#,16#80#, -- 5. row
  179. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#80#,16#80#,16#C0#,16#60#,16#78#,16#7F#,16#7F#,16#7F#,16#7C#,16#70#, -- 5. row
  180. 16#E0#,16#C0#,16#80#,16#80#,16#00#,16#00#,16#00#,16#00#,16#00#,16#80#,16#80#,16#C0#,16#E0#,16#FF#,16#FF#,16#C0#, -- 5. row
  181. 16#00#,16#00#,16#00#,16#00#,16#C3#,16#FF#,16#FE#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 5. row
  182. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 5. row
  183. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 5. row
  184. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 6. row
  185. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 6. row
  186. 16#00#,16#00#,16#00#,16#03#,16#0F#,16#3E#,16#FC#,16#FC#,16#0E#,16#03#,16#03#,16#03#,16#03#,16#07#,16#07#,16#0F#, -- 6. row
  187. 16#1F#,16#3F#,16#7F#,16#FF#,16#FF#,16#07#,16#01#,16#01#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 6. row
  188. 16#00#,16#00#,16#01#,16#03#,16#FF#,16#FF#,16#7F#,16#1F#,16#0F#,16#07#,16#07#,16#03#,16#01#,16#01#,16#01#,16#01#, -- 6. row
  189. 16#03#,16#FE#,16#FE#,16#7E#,16#07#,16#03#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 6. row
  190. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 6. row
  191. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 6. row
  192. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 7. row
  193. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 7. row
  194. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#01#,16#07#,16#1F#,16#3C#,16#78#,16#70#,16#E0#,16#E0#,16#E0#,16#C0#, -- 7. row
  195. 16#C0#,16#C0#,16#C0#,16#E1#,16#FF#,16#7F#,16#7F#,16#3C#,16#3C#,16#3C#,16#38#,16#30#,16#30#,16#30#,16#30#,16#38#, -- 7. row
  196. 16#38#,16#3C#,16#3C#,16#7F#,16#FF#,16#E1#,16#C0#,16#C0#,16#C0#,16#C0#,16#C0#,16#E0#,16#60#,16#70#,16#38#,16#38#, -- 7. row
  197. 16#1E#,16#0F#,16#03#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 7. row
  198. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 7. row
  199. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 7. row
  200. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 8. row
  201. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 8. row
  202. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#01#,16#01#, -- 8. row
  203. 16#01#,16#03#,16#03#,16#07#,16#07#,16#0E#,16#18#,16#18#,16#38#,16#30#,16#30#,16#30#,16#30#,16#30#,16#30#,16#30#, -- 8. row
  204. 16#38#,16#18#,16#1C#,16#1E#,16#0F#,16#07#,16#03#,16#03#,16#01#,16#01#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 8. row
  205. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 8. row
  206. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#, -- 8. row
  207. 16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00# -- 8. row
  208. );
  209. -- lcd init values
  210. lcd_init_data : constant t_byte_array := (
  211. 16#a0#, -- cmd8: adc select
  212. 16#c0#, -- cmd15: shl select
  213. 16#a3#, -- cmd11: lcd bias set
  214. 16#2c#, -- cmd16: power control set (vc=1, vr=0, vf=0)
  215. 16#2e#, -- cmd16: power control set (vc=1, vr=1, vf=0)
  216. 16#2f#, -- cmd16: power control set (vc=1, vr=1, vf=1)
  217. 16#26#, -- cmd17: regulator resistor select
  218. 16#60#, -- cmd2: display start line
  219. 16#a6#, -- cmd6: display normal
  220. 16#c8#, -- cmd15: common output mode select (reversed)
  221. 16#af#, -- cmd1: display on
  222. 16#a4#, -- cmd10: all points off
  223. 16#81#, -- cmd18: set volume 1st
  224. 16#18# -- cmd18: set volume 2nd (brightness)
  225. );
  226. -- pin definitions
  227. LCD_CS : constant Interfaces.C.unsigned_char := 24;
  228. LCD_RST : constant Interfaces.C.unsigned_char := 23;
  229. LCD_A0 : constant Interfaces.C.unsigned_char := 22;
  230. LCD_CLK : constant Interfaces.C.unsigned_char := 27;
  231. LCD_SI : constant Interfaces.C.unsigned_char := 17;
  232. -- exceptions
  233. mask_exception : exception;
  234. bmp_exception : exception;
  235. exception_head : string := "raspi-lcd version 0.1, (c) 2014 by tmeissner";
  236. -- procedure declarations
  237. procedure io_init;
  238. procedure lcd_init;
  239. procedure lcd_ascii57_string (xpos : natural; ypos : natural; data : string);
  240. procedure lcd_ascii57 (xpos : natural; ypos : natural; data : character);
  241. procedure lcd_picture (xpos : natural; ypos: natural; picture : t_lcd_array);
  242. procedure lcd_clear;
  243. procedure lcd_set_page (page : natural; column : natural);
  244. procedure lcd_transfer_data (value : byte; si : boolean);
  245. procedure lcd_byte (data : byte);
  246. procedure read_bmp (file : in Ada.Streams.Stream_IO.File_Type;
  247. file_access : access Ada.Streams.Root_Stream_Type'Class;
  248. bmp_picture : in out t_bmp_picture);
  249. -- function declarations
  250. function bmp_to_lcd (bmp_picture : t_bmp_picture) return t_lcd_array;
  251. function which_byte (data : dword) return integer;
  252. end st7565lcd;