u8x8_d_ssd1329.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. /*
  2. u8x8_d_ssd1329.c
  3. Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
  4. Copyright (c) 2016, olikraus@gmail.com
  5. All rights reserved.
  6. Redistribution and use in source and binary forms, with or without modification,
  7. are permitted provided that the following conditions are met:
  8. * Redistributions of source code must retain the above copyright notice, this list
  9. of conditions and the following disclaimer.
  10. * Redistributions in binary form must reproduce the above copyright notice, this
  11. list of conditions and the following disclaimer in the documentation and/or other
  12. materials provided with the distribution.
  13. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  14. CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  15. INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  18. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  19. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  20. NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  21. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  22. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  23. STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  24. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  25. ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. #include "u8x8.h"
  28. static const uint8_t u8x8_d_ssd1329_128x96_noname_init_seq[] = {
  29. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  30. U8X8_C(0x0ae), /* display off */
  31. U8X8_CA(0x0b3, 0x091), /* set display clock divide ratio/oscillator frequency (set clock as 135 frames/sec) */
  32. U8X8_CA(0x0a8, 0x05f), /* multiplex ratio: 0x03f * 1/64 duty - changed by CREESOO, acc. to datasheet, 100317*/
  33. U8X8_CA(0x0a2, 0x000), /* display offset, shift mapping ram counter */
  34. U8X8_CA(0x0a1, 0x000), /* display start line */
  35. U8X8_CA(0x0ad, 0x002), /* master configuration: disable embedded DC-DC, enable internal VCOMH */
  36. U8X8_CA(0x0a0, 0x052), /* remap configuration, horizontal address increment (bit 2 = 0), enable nibble remap (upper nibble is left, bit 1 = 1) */
  37. U8X8_C(0x086), /* full current range (0x084, 0x085, 0x086) */
  38. #ifdef removed
  39. U8X8_C(0x0b8), /* set gray scale table */
  40. U8X8_A(1), /* */
  41. U8X8_A(5), /* */
  42. U8X8_A(10), /* */
  43. U8X8_A(14), /* */
  44. U8X8_A(19), /* */
  45. U8X8_A(23), /* */
  46. U8X8_A(28), /* */
  47. U8X8_A(32), /* */
  48. U8X8_A(37), /* */
  49. U8X8_A(41), /* */
  50. U8X8_A(46), /* */
  51. U8X8_A(50), /* */
  52. U8X8_A(55), /* */
  53. U8X8_A(59), /* */
  54. U8X8_A(63), /* */
  55. #endif
  56. U8X8_C(0x0b7), /* set default gray scale table */
  57. U8X8_CA(0x081, 0x070), /* contrast, brightness, 0..128 */
  58. U8X8_CA(0x0b2, 0x051), /* frame frequency (row period) */
  59. U8X8_CA(0x0b1, 0x055), /* phase length */
  60. U8X8_CA(0x0bc, 0x010), /* pre-charge voltage level */
  61. U8X8_CA(0x0b4, 0x002), /* set pre-charge compensation level (not documented in the SDD1325 datasheet, but used in the NHD init seq.) */
  62. U8X8_CA(0x0b0, 0x028), /* enable pre-charge compensation (not documented in the SDD1325 datasheet, but used in the NHD init seq.) */
  63. U8X8_CA(0x0be, 0x01c), /* VCOMH voltage */
  64. U8X8_CA(0x0bf, 0x002|0x00d), /* VSL voltage level (not documented in the SDD1325 datasheet, but used in the NHD init seq.) */
  65. U8X8_C(0x0a4), /* normal display mode */
  66. U8X8_CA(0x023, 0x003), /* graphics accelleration: fill pixel */
  67. U8X8_END_TRANSFER(), /* disable chip */
  68. U8X8_END() /* end of sequence */
  69. };
  70. static const uint8_t u8x8_d_ssd1329_128x96_nhd_powersave0_seq[] = {
  71. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  72. U8X8_C(0x0af), /* display on */
  73. U8X8_END_TRANSFER(), /* disable chip */
  74. U8X8_END() /* end of sequence */
  75. };
  76. static const uint8_t u8x8_d_ssd1329_128x96_nhd_powersave1_seq[] = {
  77. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  78. U8X8_C(0x0ae), /* display off */
  79. U8X8_END_TRANSFER(), /* disable chip */
  80. U8X8_END() /* end of sequence */
  81. };
  82. static const uint8_t u8x8_d_ssd1329_128x96_nhd_flip0_seq[] = {
  83. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  84. U8X8_CA(0x0a0, 0x052), /* remap */
  85. U8X8_END_TRANSFER(), /* disable chip */
  86. U8X8_END() /* end of sequence */
  87. };
  88. static const uint8_t u8x8_d_ssd1329_128x96_nhd_flip1_seq[] = {
  89. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  90. U8X8_CA(0x0a0, 0x041), /* remap */
  91. U8X8_END_TRANSFER(), /* disable chip */
  92. U8X8_END() /* end of sequence */
  93. };
  94. /*
  95. input:
  96. one tile (8 Bytes)
  97. output:
  98. Tile for ssd1329 (32 Bytes)
  99. */
  100. static uint8_t u8x8_ssd1329_8to32_dest_buf[32];
  101. static uint8_t *u8x8_ssd1329_8to32(U8X8_UNUSED u8x8_t *u8x8, uint8_t *ptr)
  102. {
  103. uint8_t v;
  104. uint8_t a,b;
  105. uint8_t i, j;
  106. uint8_t *dest;
  107. for( j = 0; j < 4; j++ )
  108. {
  109. dest = u8x8_ssd1329_8to32_dest_buf;
  110. dest += j;
  111. a =*ptr;
  112. ptr++;
  113. b = *ptr;
  114. ptr++;
  115. for( i = 0; i < 8; i++ )
  116. {
  117. v = 0;
  118. if ( a&1 ) v |= 0xf0;
  119. if ( b&1 ) v |= 0x0f;
  120. *dest = v;
  121. dest+=4;
  122. a >>= 1;
  123. b >>= 1;
  124. }
  125. }
  126. return u8x8_ssd1329_8to32_dest_buf;
  127. }
  128. static uint8_t u8x8_d_ssd1329_128x96_generic(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
  129. {
  130. uint8_t x, y, c;
  131. uint8_t *ptr;
  132. switch(msg)
  133. {
  134. /* handled by the calling function
  135. case U8X8_MSG_DISPLAY_SETUP_MEMORY:
  136. u8x8_d_helper_display_setup_memory(u8x8, &u8x8_ssd1329_128x96_nhd_display_info);
  137. break;
  138. */
  139. case U8X8_MSG_DISPLAY_INIT:
  140. u8x8_d_helper_display_init(u8x8);
  141. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1329_128x96_noname_init_seq);
  142. break;
  143. case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
  144. if ( arg_int == 0 )
  145. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1329_128x96_nhd_powersave0_seq);
  146. else
  147. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1329_128x96_nhd_powersave1_seq);
  148. break;
  149. case U8X8_MSG_DISPLAY_SET_FLIP_MODE:
  150. if ( arg_int == 0 )
  151. {
  152. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1329_128x96_nhd_flip0_seq);
  153. u8x8->x_offset = u8x8->display_info->default_x_offset;
  154. }
  155. else
  156. {
  157. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1329_128x96_nhd_flip1_seq);
  158. u8x8->x_offset = u8x8->display_info->flipmode_x_offset;
  159. }
  160. break;
  161. #ifdef U8X8_WITH_SET_CONTRAST
  162. case U8X8_MSG_DISPLAY_SET_CONTRAST:
  163. u8x8_cad_StartTransfer(u8x8);
  164. u8x8_cad_SendCmd(u8x8, 0x081 );
  165. u8x8_cad_SendArg(u8x8, arg_int ); /* ssd1329 has range from 0 to 255 */
  166. u8x8_cad_EndTransfer(u8x8);
  167. break;
  168. #endif
  169. case U8X8_MSG_DISPLAY_DRAW_TILE:
  170. u8x8_cad_StartTransfer(u8x8);
  171. x = ((u8x8_tile_t *)arg_ptr)->x_pos;
  172. x *= 4;
  173. y = (((u8x8_tile_t *)arg_ptr)->y_pos);
  174. y *= 8;
  175. y += u8x8->x_offset; /* x_offset is used as y offset for the ssd1329 */
  176. do
  177. {
  178. c = ((u8x8_tile_t *)arg_ptr)->cnt;
  179. ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr;
  180. do
  181. {
  182. if ( ptr[0] | ptr[1] | ptr[2] | ptr[3] | ptr[4] | ptr[5] | ptr[6] | ptr[7] )
  183. {
  184. /* draw the tile if pattern is not zero for all bytes */
  185. u8x8_cad_SendCmd(u8x8, 0x015 ); /* set column address */
  186. u8x8_cad_SendArg(u8x8, x ); /* start */
  187. u8x8_cad_SendArg(u8x8, x+3 ); /* end */
  188. u8x8_cad_SendCmd(u8x8, 0x075 ); /* set row address */
  189. u8x8_cad_SendArg(u8x8, y);
  190. u8x8_cad_SendArg(u8x8, y+7);
  191. u8x8_cad_SendData(u8x8, 32, u8x8_ssd1329_8to32(u8x8, ptr));
  192. }
  193. else
  194. {
  195. /* tile is empty, use the graphics acceleration command */
  196. /* are this really available on the SSD1329??? */
  197. u8x8_cad_SendCmd(u8x8, 0x024 ); // draw rectangle
  198. u8x8_cad_SendArg(u8x8, x );
  199. u8x8_cad_SendArg(u8x8, y );
  200. u8x8_cad_SendArg(u8x8, x+3 );
  201. u8x8_cad_SendArg(u8x8, y+7 );
  202. u8x8_cad_SendArg(u8x8, 0 ); // clear
  203. }
  204. ptr += 8;
  205. x += 4;
  206. c--;
  207. } while( c > 0 );
  208. //x += 4;
  209. arg_int--;
  210. } while( arg_int > 0 );
  211. u8x8_cad_EndTransfer(u8x8);
  212. break;
  213. default:
  214. return 0;
  215. }
  216. return 1;
  217. }
  218. static const u8x8_display_info_t u8x8_ssd1329_128x96_display_info =
  219. {
  220. /* chip_enable_level = */ 0,
  221. /* chip_disable_level = */ 1,
  222. /* post_chip_enable_wait_ns = */ 20,
  223. /* pre_chip_disable_wait_ns = */ 15,
  224. /* reset_pulse_width_ms = */ 100,
  225. /* post_reset_wait_ms = */ 100, /**/
  226. /* sda_setup_time_ns = */ 100, /* ssd1329 */
  227. /* sck_pulse_width_ns = */ 100, /* ssd1329 */
  228. /* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */
  229. /* spi_mode = */ 0, /* active high, rising edge */
  230. /* i2c_bus_clock_100kHz = */ 4,
  231. /* data_setup_time_ns = */ 40,
  232. /* write_pulse_width_ns = */ 60, /* ssd1329 */
  233. /* tile_width = */ 16,
  234. /* tile_height = */ 12,
  235. /* default_x_offset = */ 0, /* x_offset is used as y offset for the ssd1329 */
  236. /* flipmode_x_offset = */ 0, /* x_offset is used as y offset for the ssd1329 */
  237. /* pixel_width = */ 128,
  238. /* pixel_height = */ 96
  239. };
  240. uint8_t u8x8_d_ssd1329_128x96_noname(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
  241. {
  242. if ( msg == U8X8_MSG_DISPLAY_SETUP_MEMORY )
  243. {
  244. u8x8_d_helper_display_setup_memory(u8x8, &u8x8_ssd1329_128x96_display_info);
  245. return 1;
  246. }
  247. return u8x8_d_ssd1329_128x96_generic(u8x8, msg, arg_int, arg_ptr);
  248. }
  249. /*=================================================*/
  250. /*
  251. SSD1329 with 96x96
  252. For this display, the x_offset has been reverted to its original meaning!
  253. https://github.com/olikraus/u8g2/issues/1511
  254. FlipMode 1 probably does not work, see issue
  255. */
  256. static const uint8_t u8x8_d_ssd1329_96x96_flip0_seq[] = {
  257. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  258. U8X8_CA(0x0a2, 0x000), /* display offset, shift mapping ram counter */
  259. U8X8_CA(0x0a1, 0x000), /* display start line */
  260. U8X8_CA(0x0a0, 0x042), /* remap */
  261. U8X8_END_TRANSFER(), /* disable chip */
  262. U8X8_END() /* end of sequence */
  263. };
  264. static const uint8_t u8x8_d_ssd1329_96x96_flip1_seq[] = {
  265. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  266. U8X8_CA(0x0a2, 0x060), /* display offset, shift mapping ram counter */
  267. U8X8_CA(0x0a1, 0x000), /* display start line */
  268. U8X8_CA(0x0a0, 0x051), /* remap */
  269. U8X8_END_TRANSFER(), /* disable chip */
  270. U8X8_END() /* end of sequence */
  271. };
  272. static const uint8_t u8x8_d_ssd1329_96x96_noname_init_seq[] = {
  273. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  274. U8X8_C(0x0ae), /* display off */
  275. U8X8_CA(0x0b3, 0x0f0), /* set display clock divide ratio/oscillator frequency, see #1511*/
  276. U8X8_CA(0x0a8, 0x05f), /* multiplex ratio: 0x03f * 1/64 duty */
  277. U8X8_CA(0x0a2, 0x000), /* display offset, shift mapping ram counter */
  278. U8X8_CA(0x0a1, 0x000), /* display start line */
  279. U8X8_CA(0x0ad, 0x002), /* master configuration: disable embedded DC-DC, enable internal VCOMH */
  280. U8X8_CA(0x0a0, 0x042), /* remap configuration, horizontal address increment (bit 2 = 0), enable nibble remap (upper nibble is left, bit 1 = 1) */
  281. U8X8_C(0x086), /* full current range (0x084, 0x085, 0x086) */
  282. #ifdef removed
  283. U8X8_C(0x0b8), /* set gray scale table */
  284. U8X8_A(1), /* */
  285. U8X8_A(5), /* */
  286. U8X8_A(10), /* */
  287. U8X8_A(14), /* */
  288. U8X8_A(19), /* */
  289. U8X8_A(23), /* */
  290. U8X8_A(28), /* */
  291. U8X8_A(32), /* */
  292. U8X8_A(37), /* */
  293. U8X8_A(41), /* */
  294. U8X8_A(46), /* */
  295. U8X8_A(50), /* */
  296. U8X8_A(55), /* */
  297. U8X8_A(59), /* */
  298. U8X8_A(63), /* */
  299. #endif
  300. U8X8_C(0x0b7), /* set default gray scale table */
  301. U8X8_CA(0x081, 0x070), /* contrast, brightness, 0..255 */
  302. U8X8_CA(0x0b2, 0x023), /* frame frequency (row period), see #1511 */
  303. U8X8_CA(0x0b1, 0x021), /* phase length, see #1511 */
  304. U8X8_CA(0x0bc, 0x010), /* pre-charge voltage level */
  305. U8X8_CA(0x0b4, 0x002), /* set pre-charge compensation level (not documented in the SDD1325 datasheet, but used in the NHD init seq.) */
  306. U8X8_CA(0x0b0, 0x028), /* enable pre-charge compensation (not documented in the SDD1325 datasheet, but used in the NHD init seq.) */
  307. U8X8_CA(0x0be, 0x01f), /* VCOMH voltage */
  308. U8X8_CA(0x0bf, 0x002|0x00d), /* VSL voltage level (not documented in the SDD1325 datasheet, but used in the NHD init seq.) */
  309. U8X8_C(0x0a4), /* normal display mode */
  310. U8X8_CA(0x023, 0x003), /* graphics accelleration: fill pixel */
  311. U8X8_END_TRANSFER(), /* disable chip */
  312. U8X8_END() /* end of sequence */
  313. };
  314. static uint8_t u8x8_d_ssd1329_96x96_generic(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
  315. {
  316. uint8_t x, y, c;
  317. uint8_t *ptr;
  318. switch(msg)
  319. {
  320. /* handled by the calling function
  321. case U8X8_MSG_DISPLAY_SETUP_MEMORY:
  322. u8x8_d_helper_display_setup_memory(u8x8, &u8x8_ssd1329_128x96_nhd_display_info);
  323. break;
  324. */
  325. case U8X8_MSG_DISPLAY_INIT:
  326. u8x8_d_helper_display_init(u8x8);
  327. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1329_96x96_noname_init_seq);
  328. break;
  329. case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
  330. if ( arg_int == 0 )
  331. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1329_128x96_nhd_powersave0_seq);
  332. else
  333. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1329_128x96_nhd_powersave1_seq);
  334. break;
  335. case U8X8_MSG_DISPLAY_SET_FLIP_MODE:
  336. if ( arg_int == 0 )
  337. {
  338. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1329_96x96_flip0_seq);
  339. u8x8->x_offset = u8x8->display_info->default_x_offset;
  340. }
  341. else
  342. {
  343. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1329_96x96_flip1_seq);
  344. u8x8->x_offset = u8x8->display_info->flipmode_x_offset;
  345. }
  346. break;
  347. #ifdef U8X8_WITH_SET_CONTRAST
  348. case U8X8_MSG_DISPLAY_SET_CONTRAST:
  349. u8x8_cad_StartTransfer(u8x8);
  350. u8x8_cad_SendCmd(u8x8, 0x081 );
  351. u8x8_cad_SendArg(u8x8, arg_int ); /* ssd1329 has range from 0 to 255 */
  352. u8x8_cad_EndTransfer(u8x8);
  353. break;
  354. #endif
  355. case U8X8_MSG_DISPLAY_DRAW_TILE:
  356. u8x8_cad_StartTransfer(u8x8);
  357. x = ((u8x8_tile_t *)arg_ptr)->x_pos;
  358. x *= 4;
  359. x += u8x8->x_offset;
  360. y = (((u8x8_tile_t *)arg_ptr)->y_pos);
  361. y *= 8;
  362. do
  363. {
  364. c = ((u8x8_tile_t *)arg_ptr)->cnt;
  365. ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr;
  366. do
  367. {
  368. if ( ptr[0] | ptr[1] | ptr[2] | ptr[3] | ptr[4] | ptr[5] | ptr[6] | ptr[7] )
  369. {
  370. /* draw the tile if pattern is not zero for all bytes */
  371. u8x8_cad_SendCmd(u8x8, 0x015 ); /* set column address */
  372. u8x8_cad_SendArg(u8x8, x ); /* start */
  373. u8x8_cad_SendArg(u8x8, x+3 ); /* end */
  374. u8x8_cad_SendCmd(u8x8, 0x075 ); /* set row address */
  375. u8x8_cad_SendArg(u8x8, y);
  376. u8x8_cad_SendArg(u8x8, y+7);
  377. u8x8_cad_SendData(u8x8, 32, u8x8_ssd1329_8to32(u8x8, ptr));
  378. }
  379. else
  380. {
  381. /* tile is empty, use the graphics acceleration command */
  382. /* are this really available on the SSD1329??? */
  383. u8x8_cad_SendCmd(u8x8, 0x024 ); // draw rectangle
  384. u8x8_cad_SendArg(u8x8, x );
  385. u8x8_cad_SendArg(u8x8, y );
  386. u8x8_cad_SendArg(u8x8, x+3 );
  387. u8x8_cad_SendArg(u8x8, y+7 );
  388. u8x8_cad_SendArg(u8x8, 0 ); // clear
  389. }
  390. ptr += 8;
  391. x += 4;
  392. c--;
  393. } while( c > 0 );
  394. //x += 4;
  395. arg_int--;
  396. } while( arg_int > 0 );
  397. u8x8_cad_EndTransfer(u8x8);
  398. break;
  399. default:
  400. return 0;
  401. }
  402. return 1;
  403. }
  404. static const u8x8_display_info_t u8x8_ssd1329_96x96_display_info =
  405. {
  406. /* chip_enable_level = */ 0,
  407. /* chip_disable_level = */ 1,
  408. /* post_chip_enable_wait_ns = */ 20,
  409. /* pre_chip_disable_wait_ns = */ 15,
  410. /* reset_pulse_width_ms = */ 100,
  411. /* post_reset_wait_ms = */ 100, /**/
  412. /* sda_setup_time_ns = */ 100, /* ssd1329 */
  413. /* sck_pulse_width_ns = */ 100, /* ssd1329 */
  414. /* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */
  415. /* spi_mode = */ 0, /* active high, rising edge */
  416. /* i2c_bus_clock_100kHz = */ 4,
  417. /* data_setup_time_ns = */ 40,
  418. /* write_pulse_width_ns = */ 60, /* ssd1329 */
  419. /* tile_width = */ 12,
  420. /* tile_height = */ 12,
  421. /* default_x_offset = */ 0, /* x offset for flip mode 0 */
  422. /* flipmode_x_offset = */ 16, /* x offset for flip mode 1 */
  423. /* pixel_width = */ 96,
  424. /* pixel_height = */ 96
  425. };
  426. uint8_t u8x8_d_ssd1329_96x96_noname(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
  427. {
  428. if ( msg == U8X8_MSG_DISPLAY_SETUP_MEMORY )
  429. {
  430. u8x8_d_helper_display_setup_memory(u8x8, &u8x8_ssd1329_96x96_display_info);
  431. return 1;
  432. }
  433. return u8x8_d_ssd1329_96x96_generic(u8x8, msg, arg_int, arg_ptr);
  434. }