u8x8_d_ssd1362.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. /*
  2. u8x8_d_ssd1362.c
  3. https://github.com/olikraus/u8g2/issues/2051
  4. Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
  5. Copyright (c) 2022, olikraus@gmail.com
  6. All rights reserved.
  7. Redistribution and use in source and binary forms, with or without modification,
  8. are permitted provided that the following conditions are met:
  9. * Redistributions of source code must retain the above copyright notice, this list
  10. of conditions and the following disclaimer.
  11. * Redistributions in binary form must reproduce the above copyright notice, this
  12. list of conditions and the following disclaimer in the documentation and/or other
  13. materials provided with the distribution.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  15. CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  16. INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  17. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  19. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  21. NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  23. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  24. STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  25. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  26. ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. SSD1362:
  28. 256 x 64 (ssd1322: 480 x 128)
  29. 16 gray scale
  30. Note: Currently the external IREF is activated.
  31. Maybe we need a constructor with internal IREF
  32. */
  33. #include "u8x8.h"
  34. static const uint8_t u8x8_d_ssd1362_powersave0_seq[] = {
  35. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  36. U8X8_C(0x0af), /* ssd1362: display on */
  37. U8X8_END_TRANSFER(), /* disable chip */
  38. U8X8_END() /* end of sequence */
  39. };
  40. static const uint8_t u8x8_d_ssd1362_powersave1_seq[] = {
  41. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  42. U8X8_C(0x0ae), /* ssd1362: display off */
  43. U8X8_END_TRANSFER(), /* disable chip */
  44. U8X8_END() /* end of sequence */
  45. };
  46. /*
  47. input:
  48. one tile (8 Bytes)
  49. output:
  50. Tile for SSD1362 (32 Bytes)
  51. */
  52. static uint8_t u8x8_ssd1362_to32_dest_buf[32];
  53. static uint8_t *u8x8_ssd1362_8to32(U8X8_UNUSED u8x8_t *u8x8, uint8_t *ptr)
  54. {
  55. uint8_t v;
  56. uint8_t a,b;
  57. uint8_t i, j;
  58. uint8_t *dest;
  59. for( j = 0; j < 4; j++ )
  60. {
  61. dest = u8x8_ssd1362_to32_dest_buf;
  62. dest += j;
  63. a =*ptr;
  64. ptr++;
  65. b = *ptr;
  66. ptr++;
  67. for( i = 0; i < 8; i++ )
  68. {
  69. v = 0;
  70. if ( a&1 ) v |= 0xf0;
  71. if ( b&1 ) v |= 0x0f;
  72. *dest = v;
  73. dest+=4;
  74. a >>= 1;
  75. b >>= 1;
  76. }
  77. }
  78. return u8x8_ssd1362_to32_dest_buf;
  79. }
  80. /* special case for the 206x36 display: send only half of the last tile */
  81. static uint8_t *u8x8_ssd1362_8to24(U8X8_UNUSED u8x8_t *u8x8, uint8_t *ptr)
  82. {
  83. uint8_t v;
  84. uint8_t a,b;
  85. uint8_t i, j;
  86. uint8_t *dest;
  87. for( j = 0; j < 3; j++ )
  88. {
  89. dest = u8x8_ssd1362_to32_dest_buf;
  90. dest += j;
  91. a =*ptr;
  92. ptr++;
  93. b = *ptr;
  94. ptr++;
  95. for( i = 0; i < 8; i++ )
  96. {
  97. v = 0;
  98. if ( a&1 ) v |= 0xf0;
  99. if ( b&1 ) v |= 0x0f;
  100. *dest = v;
  101. dest+=3;
  102. a >>= 1;
  103. b >>= 1;
  104. }
  105. }
  106. return u8x8_ssd1362_to32_dest_buf;
  107. }
  108. uint8_t u8x8_d_ssd1362_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
  109. {
  110. uint8_t x;
  111. uint8_t y, c;
  112. uint8_t *ptr;
  113. switch(msg)
  114. {
  115. /* U8X8_MSG_DISPLAY_SETUP_MEMORY is handled by the calling function */
  116. /*
  117. case U8X8_MSG_DISPLAY_SETUP_MEMORY:
  118. break;
  119. case U8X8_MSG_DISPLAY_INIT:
  120. u8x8_d_helper_display_init(u8x8);
  121. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_256x64_init_seq);
  122. break;
  123. */
  124. case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
  125. if ( arg_int == 0 )
  126. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_powersave0_seq);
  127. else
  128. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_powersave1_seq);
  129. break;
  130. #ifdef U8X8_WITH_SET_CONTRAST
  131. case U8X8_MSG_DISPLAY_SET_CONTRAST:
  132. u8x8_cad_StartTransfer(u8x8);
  133. u8x8_cad_SendCmd(u8x8, 0x081 );
  134. u8x8_cad_SendArg(u8x8, arg_int ); /* ssd1362 has range from 0 to 255 */
  135. u8x8_cad_EndTransfer(u8x8);
  136. break;
  137. #endif
  138. case U8X8_MSG_DISPLAY_DRAW_TILE:
  139. u8x8_cad_StartTransfer(u8x8);
  140. x = ((u8x8_tile_t *)arg_ptr)->x_pos;
  141. x *= 4; // convert from tile pos to display column
  142. x += u8x8->x_offset;
  143. y = (((u8x8_tile_t *)arg_ptr)->y_pos);
  144. y *= 8;
  145. u8x8_cad_SendCmd(u8x8, 0x075 ); /* set row address, moved out of the loop (issue 302) */
  146. u8x8_cad_SendArg(u8x8, y);
  147. u8x8_cad_SendArg(u8x8, y+7);
  148. do
  149. {
  150. c = ((u8x8_tile_t *)arg_ptr)->cnt;
  151. ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr;
  152. do
  153. {
  154. u8x8_cad_SendCmd(u8x8, 0x015 ); /* set column address */
  155. u8x8_cad_SendArg(u8x8, x ); /* start */
  156. u8x8_cad_SendArg(u8x8, x+3 ); /* end */
  157. u8x8_cad_SendData(u8x8, 32, u8x8_ssd1362_8to32(u8x8, ptr));
  158. ptr += 8;
  159. x += 4;
  160. c--;
  161. } while( c > 0 );
  162. arg_int--;
  163. } while( arg_int > 0 );
  164. u8x8_cad_EndTransfer(u8x8);
  165. break;
  166. default:
  167. return 0;
  168. }
  169. return 1;
  170. }
  171. uint8_t u8x8_d_ssd1362_common_0_75(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
  172. {
  173. uint8_t x;
  174. uint8_t y, c;
  175. uint8_t *ptr;
  176. switch(msg)
  177. {
  178. /* U8X8_MSG_DISPLAY_SETUP_MEMORY is handled by the calling function */
  179. /*
  180. case U8X8_MSG_DISPLAY_SETUP_MEMORY:
  181. break;
  182. case U8X8_MSG_DISPLAY_INIT:
  183. u8x8_d_helper_display_init(u8x8);
  184. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_256x64_init_seq);
  185. break;
  186. */
  187. case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
  188. if ( arg_int == 0 )
  189. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_powersave0_seq);
  190. else
  191. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_powersave1_seq);
  192. break;
  193. #ifdef U8X8_WITH_SET_CONTRAST
  194. case U8X8_MSG_DISPLAY_SET_CONTRAST:
  195. u8x8_cad_StartTransfer(u8x8);
  196. u8x8_cad_SendCmd(u8x8, 0x081 );
  197. u8x8_cad_SendArg(u8x8, arg_int ); /* ssd1362 has range from 0 to 255 */
  198. u8x8_cad_EndTransfer(u8x8);
  199. break;
  200. #endif
  201. case U8X8_MSG_DISPLAY_DRAW_TILE:
  202. u8x8_cad_StartTransfer(u8x8);
  203. x = ((u8x8_tile_t *)arg_ptr)->x_pos;
  204. x *= 4; // convert from tile pos to display column
  205. x += u8x8->x_offset;
  206. y = (((u8x8_tile_t *)arg_ptr)->y_pos);
  207. y *= 8;
  208. u8x8_cad_SendCmd(u8x8, 0x075 ); /* set row address, moved out of the loop (issue 302) */
  209. u8x8_cad_SendArg(u8x8, y);
  210. u8x8_cad_SendArg(u8x8, y+7);
  211. do
  212. {
  213. c = ((u8x8_tile_t *)arg_ptr)->cnt;
  214. ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr;
  215. do
  216. {
  217. u8x8_cad_SendCmd(u8x8, 0x015 ); /* set column address */
  218. if ( x < 123 )
  219. {
  220. u8x8_cad_SendArg(u8x8, x ); /* start */
  221. u8x8_cad_SendArg(u8x8, x+3 ); /* end */
  222. u8x8_cad_SendData(u8x8, 32, u8x8_ssd1362_8to32(u8x8, ptr));
  223. }
  224. else
  225. {
  226. u8x8_cad_SendArg(u8x8, x ); /* start */
  227. u8x8_cad_SendArg(u8x8, x+2 ); /* end */
  228. u8x8_cad_SendData(u8x8, 24, u8x8_ssd1362_8to24(u8x8, ptr));
  229. }
  230. ptr += 8;
  231. x += 4;
  232. c--;
  233. } while( c > 0 );
  234. arg_int--;
  235. } while( arg_int > 0 );
  236. u8x8_cad_EndTransfer(u8x8);
  237. break;
  238. default:
  239. return 0;
  240. }
  241. return 1;
  242. }
  243. /*=========================================================*/
  244. static const uint8_t u8x8_d_ssd1362_256x64_flip0_seq[] = {
  245. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  246. U8X8_CA(0xa0, 0xc3), //Set Remap c3 = 11000011
  247. U8X8_END_TRANSFER(), /* disable chip */
  248. U8X8_END() /* end of sequence */
  249. };
  250. static const uint8_t u8x8_d_ssd1362_256x64_flip1_seq[] = {
  251. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  252. U8X8_CA(0xa0, 0xd0),
  253. U8X8_END_TRANSFER(), /* disable chip */
  254. U8X8_END() /* end of sequence */
  255. };
  256. static const u8x8_display_info_t u8x8_ssd1362_256x64_display_info =
  257. {
  258. /* chip_enable_level = */ 0,
  259. /* chip_disable_level = */ 1,
  260. /* post_chip_enable_wait_ns = */ 20,
  261. /* pre_chip_disable_wait_ns = */ 10,
  262. /* reset_pulse_width_ms = */ 100, /* ssd1362: 2 us */
  263. /* post_reset_wait_ms = */ 100, /* far east OLEDs need much longer setup time */
  264. /* sda_setup_time_ns = */ 50, /* ssd1362: 15ns, but cycle time is 100ns, so use 100/2 */
  265. /* sck_pulse_width_ns = */ 50, /* ssd1362: 20ns, but cycle time is 100ns, so use 100/2, AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */
  266. /* sck_clock_hz = */ 10000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns, increased to 8MHz (issue 215), 10 MHz (issue 301) */
  267. /* spi_mode = */ 0, /* active high, rising edge */
  268. /* i2c_bus_clock_100kHz = */ 4,
  269. /* data_setup_time_ns = */ 10,
  270. /* write_pulse_width_ns = */ 150, /* ssd1362: cycle time is 300ns, so use 300/2 = 150 */
  271. /* tile_width = */ 32, /* 256 pixel, so we require 32 bytes for this */
  272. /* tile_height = */ 8,
  273. /* default_x_offset = */ 0, /* this is the byte offset (there are two pixel per byte with 4 bit per pixel) */
  274. /* flipmode_x_offset = */ 0,
  275. /* pixel_width = */ 256,
  276. /* pixel_height = */ 64
  277. };
  278. /* https://github.com/olikraus/u8g2/issues/2051 */
  279. static const uint8_t u8x8_d_ssd1362_256x64_init_seq[] = {
  280. U8X8_DLY(1),
  281. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  282. U8X8_DLY(1),
  283. U8X8_CA(0xfd, 0x12), /* unlock */
  284. U8X8_C(0xae), /* display off */
  285. U8X8_CA(0x23, 0x00), //POR 0x00; Disable fade mode
  286. U8X8_CA(0x81, 0x9f), //Set contrast
  287. /*
  288. Re- map setting in Graphic Display Data RAM
  289. (GDDRAM)
  290. A[0] = 0b, Disable Column Address Re-map (RESET)
  291. A[0] = 1b, Enable Column Address Re-map ***
  292. A[1] = 0b, Disable Nibble Re-map (RESET)
  293. A[1] = 1b, Enable Nibble Re-map ***
  294. A[2] = 0b, Enable Horizontal Address Increment (RESET) ***
  295. A[2] = 1b, Enable Vertical Address Increment
  296. A[4] = 0b, Disable COM Re-map (RESET)
  297. A[4] = 1b, Enable COM Re-map
  298. A[6] = 0b, Disable SEG Split Odd Even ***
  299. A[6] = 1b, Enable SEG Split Odd Even (RESET)
  300. A[7] = 0b, Disable SEG left/right remap (RESET)
  301. A[7] = 1b, Enable SEG left/right remap
  302. */
  303. U8X8_CA(0xa0, 0xc3),
  304. U8X8_CA(0xa1, 0), //Set Display Start Line
  305. U8X8_CA(0xa2, 0), //Set Display Offset
  306. U8X8_C(0xa4), //Normal Display
  307. U8X8_CA(0xa8, 63), //Set Multiplex Ratio: (63 rows)
  308. U8X8_CA(0xab, 1), //Set VDD regulator
  309. U8X8_CA(0xad, 0x8e), //External /Internal IREF Selection, 9e: internal, 8e: external
  310. U8X8_CA(0xb1, 0x22), //Set Phase Length, reset: 0x82
  311. U8X8_CA(0xb3, 0xa0), //Display clock Divider
  312. U8X8_CA(0xb6, 0x04), //Set Second precharge Period
  313. U8X8_C(0xb9), //Set Linear LUT
  314. U8X8_CA(0xbc, 0x1f), //Set pre-charge voltage level, 0..0x1f, 0x1f = 0.51*Vcc
  315. U8X8_CA(0xbd, 1), //Pre-charge voltage capacitor Selection, 0: without, 1: with Vp capacitor
  316. U8X8_CA(0xbe, 7), //Set cOM deselect voltage level, 7 = 0.86*Vcc
  317. U8X8_DLY(1), /* delay 1ms */
  318. U8X8_END_TRANSFER(), /* disable chip */
  319. U8X8_END() /* end of sequence */
  320. };
  321. uint8_t u8x8_d_ssd1362_256x64(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
  322. {
  323. switch(msg)
  324. {
  325. case U8X8_MSG_DISPLAY_SETUP_MEMORY:
  326. u8x8_d_helper_display_setup_memory(u8x8, &u8x8_ssd1362_256x64_display_info);
  327. break;
  328. case U8X8_MSG_DISPLAY_INIT:
  329. u8x8_d_helper_display_init(u8x8);
  330. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_256x64_init_seq);
  331. break;
  332. case U8X8_MSG_DISPLAY_SET_FLIP_MODE:
  333. if ( arg_int == 0 )
  334. {
  335. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_256x64_flip0_seq);
  336. u8x8->x_offset = u8x8->display_info->default_x_offset;
  337. }
  338. else
  339. {
  340. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_256x64_flip1_seq);
  341. u8x8->x_offset = u8x8->display_info->flipmode_x_offset;
  342. }
  343. break;
  344. default:
  345. return u8x8_d_ssd1362_common(u8x8, msg, arg_int, arg_ptr);
  346. }
  347. return 1;
  348. }
  349. /*=========================================================*/
  350. static const u8x8_display_info_t u8x8_ssd1362_206x36_display_info =
  351. {
  352. /* chip_enable_level = */ 0,
  353. /* chip_disable_level = */ 1,
  354. /* post_chip_enable_wait_ns = */ 20,
  355. /* pre_chip_disable_wait_ns = */ 10,
  356. /* reset_pulse_width_ms = */ 100, /* ssd1362: 2 us */
  357. /* post_reset_wait_ms = */ 100, /* far east OLEDs need much longer setup time */
  358. /* sda_setup_time_ns = */ 50, /* ssd1362: 15ns, but cycle time is 100ns, so use 100/2 */
  359. /* sck_pulse_width_ns = */ 50, /* ssd1362: 20ns, but cycle time is 100ns, so use 100/2, AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */
  360. /* sck_clock_hz = */ 10000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns, increased to 8MHz (issue 215), 10 MHz (issue 301) */
  361. /* spi_mode = */ 0, /* active high, rising edge */
  362. /* i2c_bus_clock_100kHz = */ 4,
  363. /* data_setup_time_ns = */ 10,
  364. /* write_pulse_width_ns = */ 150, /* ssd1362: cycle time is 300ns, so use 300/2 = 150 */
  365. /* tile_width = */ 26, /* 26*8 = 208 */
  366. /* tile_height = */ 5, /* 5*8 = 40 */
  367. /* default_x_offset = */ 0, /* this is the byte offset (there are two pixel per byte with 4 bit per pixel) */
  368. /* flipmode_x_offset = */ 25,
  369. /* pixel_width = */ 206,
  370. /* pixel_height = */ 36
  371. };
  372. /* https://github.com/olikraus/u8g2/issues/2051 */
  373. static const uint8_t u8x8_d_ssd1362_206x36_init_seq[] = {
  374. U8X8_DLY(1),
  375. U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
  376. U8X8_DLY(1),
  377. U8X8_CA(0xfd, 0x12), /* unlock */
  378. U8X8_C(0xae), /* display off */
  379. U8X8_CA(0x23, 0x00), //POR 0x00; Disable fade mode
  380. U8X8_CA(0x81, 0x9f), //Set contrast
  381. /*
  382. Re- map setting in Graphic Display Data RAM
  383. (GDDRAM)
  384. A[0] = 0b, Disable Column Address Re-map (RESET)
  385. A[0] = 1b, Enable Column Address Re-map ***
  386. A[1] = 0b, Disable Nibble Re-map (RESET)
  387. A[1] = 1b, Enable Nibble Re-map ***
  388. A[2] = 0b, Enable Horizontal Address Increment (RESET) ***
  389. A[2] = 1b, Enable Vertical Address Increment
  390. A[4] = 0b, Disable COM Re-map (RESET)
  391. A[4] = 1b, Enable COM Re-map
  392. A[6] = 0b, Disable SEG Split Odd Even ***
  393. A[6] = 1b, Enable SEG Split Odd Even (RESET)
  394. A[7] = 0b, Disable SEG left/right remap (RESET)
  395. A[7] = 1b, Enable SEG left/right remap
  396. */
  397. U8X8_CA(0xa0, 0xc3),
  398. U8X8_CA(0xa1, 50), //Set Display Start Line
  399. U8X8_CA(0xa2, 0), //Set Display Offset
  400. U8X8_C(0xa4), //Normal Display
  401. U8X8_CA(0xa8, 63), //Set Multiplex Ratio
  402. U8X8_CA(0xab, 1), //Set VDD regulator
  403. U8X8_CA(0xad, 0x8e), //External /Internal IREF Selection, 9e: internal, 8e: external
  404. U8X8_CA(0xb1, 0x22), //Set Phase Length, reset: 0x82
  405. U8X8_CA(0xb3, 0xa0), //Display clock Divider
  406. U8X8_CA(0xb6, 0x04), //Set Second precharge Period
  407. U8X8_C(0xb9), //Set Linear LUT
  408. U8X8_CA(0xbc, 0x1f), //Set pre-charge voltage level, 0..0x1f, 0x1f = 0.51*Vcc
  409. U8X8_CA(0xbd, 1), //Pre-charge voltage capacitor Selection, 0: without, 1: with Vp capacitor
  410. U8X8_CA(0xbe, 7), //Set cOM deselect voltage level, 7 = 0.86*Vcc
  411. U8X8_DLY(1), /* delay 1ms */
  412. U8X8_END_TRANSFER(), /* disable chip */
  413. U8X8_END() /* end of sequence */
  414. };
  415. uint8_t u8x8_d_ssd1362_206x36(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
  416. {
  417. switch(msg)
  418. {
  419. case U8X8_MSG_DISPLAY_SETUP_MEMORY:
  420. u8x8_d_helper_display_setup_memory(u8x8, &u8x8_ssd1362_206x36_display_info);
  421. break;
  422. case U8X8_MSG_DISPLAY_INIT:
  423. u8x8_d_helper_display_init(u8x8);
  424. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_206x36_init_seq);
  425. break;
  426. case U8X8_MSG_DISPLAY_SET_FLIP_MODE:
  427. if ( arg_int == 0 )
  428. {
  429. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_256x64_flip0_seq);
  430. u8x8->x_offset = u8x8->display_info->default_x_offset;
  431. }
  432. else
  433. {
  434. u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1362_256x64_flip1_seq);
  435. u8x8->x_offset = u8x8->display_info->flipmode_x_offset;
  436. }
  437. break;
  438. default:
  439. return u8x8_d_ssd1362_common_0_75(u8x8, msg, arg_int, arg_ptr);
  440. }
  441. return 1;
  442. }