diff options
Diffstat (limited to 'src/tft.c')
-rw-r--r-- | src/tft.c | 52 |
1 files changed, 26 insertions, 26 deletions
@@ -12,51 +12,51 @@ _delay_ms(u8 ms); static inline void tft_soft_reset(void) { - tft_ctrl = SWRESET; + tft_ctrl = SWRESET; } static inline void tft_enable_ext_cmd(void) { - tft_ctrl = SETEXTC; - tft_data = 0xFF; - tft_data = 0x83; - tft_data = 0x57; + tft_ctrl = SETEXTC; + tft_data = 0xFF; + tft_data = 0x83; + tft_data = 0x57; } static inline void tft_memory_access_ctrl(u8 bits) { - tft_ctrl = MADCTL; - tft_data = bits; + tft_ctrl = MADCTL; + tft_data = bits; } static inline void tft_sleep_out(void) { - tft_ctrl = SLPOUT; + tft_ctrl = SLPOUT; } static inline void tft_display_on(void) { - tft_ctrl = DISPON; + tft_ctrl = DISPON; } static inline void tft_pixel_format(u8 dbi, u8 dpi) { - tft_ctrl = COLMOD; - tft_data = (dpi << 4) | dbi; + tft_ctrl = COLMOD; + tft_data = (dpi << 4) | dbi; } static inline void tft_set_rgb_interface(void) { - tft_ctrl = SETRGB; - tft_data = 0x00; - tft_data = 0x00; - tft_data = 0x06; - tft_data = 0x06; + tft_ctrl = SETRGB; + tft_data = 0x00; + tft_data = 0x00; + tft_data = 0x06; + tft_data = 0x06; } static inline void @@ -123,24 +123,24 @@ clear_screen(void) void tft_init(void) { - _delay_ms(200); + _delay_ms(200); - tft_soft_reset(); - tft_enable_ext_cmd(); + tft_soft_reset(); + tft_enable_ext_cmd(); - _delay_ms(250); + _delay_ms(250); - tft_set_rgb_interface(); + tft_set_rgb_interface(); - tft_pixel_format(BIT16, BIT16); + tft_pixel_format(BIT16, BIT16); tft_memory_access_ctrl(MV | 0x0C); - tft_sleep_out(); + tft_sleep_out(); - _delay_ms(150); + _delay_ms(150); - tft_display_on(); + tft_display_on(); - _delay_ms(50); + _delay_ms(50); clear_screen(); } |