@@ -642,4 +642,86 @@ uint8_t u8x8_d_t6963_128x128(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *a
642642}
643643
644644
645+ /*=============================================*/
646+
647+ static const u8x8_display_info_t u8x8_t6963_128x160_display_info =
648+ {
649+ /* chip_enable_level = */ 1 ,
650+ /* chip_disable_level = */ 0 ,
651+
652+ /* post_chip_enable_wait_ns = */ 10 , /* T6963 Datasheet p30 */
653+ /* pre_chip_disable_wait_ns = */ 100 , /* T6963 Datasheet p30 */
654+ /* reset_pulse_width_ms = */ 1 ,
655+ /* post_reset_wait_ms = */ 6 ,
656+ /* sda_setup_time_ns = */ 20 ,
657+ /* sck_pulse_width_ns = */ 140 ,
658+ /* sck_clock_hz = */ 1000000UL , /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */
659+ /* spi_mode = */ 0 ,
660+ /* i2c_bus_clock_100kHz = */ 4 ,
661+ /* data_setup_time_ns = */ 80 ,
662+ /* write_pulse_width_ns = */ 80 ,
663+ /* tile_width = */ 16 ,
664+ /* tile_height = */ 20 ,
665+ /* default_x_offset = */ 0 ,
666+ /* flipmode_x_offset = */ 0 ,
667+ /* pixel_width = */ 128 ,
668+ /* pixel_height = */ 160
669+ };
670+
671+ /* 128x160 */
672+ static const uint8_t u8x8_d_t6963_128x160_init_seq [] = {
673+ U8X8_DLY (100 ),
674+ U8X8_START_TRANSFER (), /* enable chip, delay is part of the transfer start */
675+ U8X8_DLY (100 ),
676+
677+ U8X8_AAC (0x00 ,0x00 ,0x021 ), /* low, high, set cursor pos */
678+ U8X8_AAC (0x00 ,0x00 ,0x022 ), /* low, high, set offset */
679+ U8X8_AAC (0x00 ,0x00 ,0x040 ), /* low, high, set text home */
680+ U8X8_AAC (128 /8 ,0x00 ,0x041 ), /* low, high, set text columns */
681+ U8X8_AAC (0x00 ,0x00 ,0x042 ), /* low, high, graphics home */
682+ U8X8_AAC (128 /8 ,0x00 ,0x043 ), /* low, high, graphics columns */
683+ U8X8_DLY (2 ), /* delay 2ms */
684+ // mode set
685+ // 0x080: Internal CG, OR Mode
686+ // 0x081: Internal CG, EXOR Mode
687+ // 0x083: Internal CG, AND Mode
688+ // 0x088: External CG, OR Mode
689+ // 0x089: External CG, EXOR Mode
690+ // 0x08B: External CG, AND Mode
691+ U8X8_C (0x080 ), /* mode register: OR Mode, Internal Character Mode */
692+ // display mode
693+ // 0x090: Display off
694+ // 0x094: Graphic off, text on, cursor off, blink off
695+ // 0x096: Graphic off, text on, cursor on, blink off
696+ // 0x097: Graphic off, text on, cursor on, blink on
697+ // 0x098: Graphic on, text off, cursor off, blink off
698+ // 0x09a: Graphic on, text off, cursor on, blink off
699+ // ...
700+ // 0x09c: Graphic on, text on, cursor off, blink off
701+ // 0x09f: Graphic on, text on, cursor on, blink on
702+ U8X8_C (0x090 ), /* All Off */
703+ U8X8_AAC (0x00 ,0x00 ,0x024 ), /* low, high, set adr pointer */
704+
705+ U8X8_DLY (100 ),
706+ U8X8_END_TRANSFER (), /* disable chip */
707+ U8X8_DLY (100 ),
708+ };
709+
710+ uint8_t u8x8_d_t6963_128x160 (u8x8_t * u8x8 , uint8_t msg , uint8_t arg_int , void * arg_ptr )
711+ {
712+ switch (msg )
713+ {
714+ case U8X8_MSG_DISPLAY_SETUP_MEMORY :
715+ u8x8_d_helper_display_setup_memory (u8x8 , & u8x8_t6963_128x160_display_info );
716+ break ;
717+ case U8X8_MSG_DISPLAY_INIT :
718+ u8x8_d_helper_display_init (u8x8 );
719+ u8x8_cad_SendSequence (u8x8 , u8x8_d_t6963_128x160_init_seq );
720+ break ;
721+ default :
722+ return u8x8_d_t6963_common (u8x8 , msg , arg_int , arg_ptr );
723+ }
724+ return 1 ;
725+ }
726+
645727
0 commit comments