17#ifndef __VSF_DISP_ST7735_H__
18#define __VSF_DISP_ST7735_H__
24#if VSF_USE_UI == ENABLED && VSF_DISP_USE_ST7735 == ENABLED
26#include "../common/vsf_disp_sitronix_common.h"
28#if defined(__VSF_DISP_ST7735_CLASS_IMPLEMENT)
29# undef __VSF_DISP_ST7735_CLASS_IMPLEMENT
30# define __VSF_CLASS_IMPLEMENT__
41#define ST7735_SLPIN (0x10)
42#define ST7735_SLPOUT (0x11)
44#define ST7735_INV(__ON) (0x20 | ((__ON) ? 1 : 0))
45#define ST7735_DISP(__ON) (0x28 | ((__ON) ? 1 : 0))
46#define ST7735_CASET (0x2A)
47#define ST7735_RASET (0x2B)
48#define ST7735_RAMWR (0x2C)
50#define ST7735_MADCTL (0x36)
51# define ST7735_MADCTL_COLOR_RGB (0 << 3)
52# define ST7735_MADCTL_COLOR_BGR (1 << 3)
53# define ST7735_MADCTL_MV (1 << 5)
54# define ST7735_MADCTL_MX (1 << 6)
55# define ST7735_MADCTL_MY (1 << 7)
57#define ST7735_COLMOD (0x3A)
58# define ST7735_COLMOD_PIXEL_12B (3 << 0)
59# define ST7735_COLMOD_PIXEL_16B (5 << 0)
60# define ST7735_COLMOD_PIXEL_18B (6 << 0)
62#define ST7735_DISPLAY_SETTING_COLOR_RGB ST7735_MADCTL_COLOR_RGB
63#define ST7735_DISPLAY_SETTING_COLOR_BGR ST7735_MADCTL_COLOR_BGR
64#define ST7735_DISPLAY_SETTING_XY_EXCHANGE ST7735_MADCTL_MV
65#define ST7735_DISPLAY_SETTING_X_REVERSE ST7735_MADCTL_MX
66#define ST7735_DISPLAY_SETTING_Y_REVERSE ST7735_MADCTL_MY
68#define ST7735_PIXEL_12B ST7735_COLMOD_PIXEL_12B
69#define ST7735_PIXEL_16B ST7735_COLMOD_PIXEL_16B
70#define ST7735_PIXEL_18B ST7735_COLMOD_PIXEL_18B
74#define VSF_DISP_ST7735_INIT_SEQ(__PIXEL_FORMAT, __DISPLAY_SETTING, __INVERSE) \
75 VSF_DISP_SITRONIX_WRITE(0xB1, 3, 0x05, 0x3C, 0x3C), \
76 VSF_DISP_SITRONIX_WRITE(0xB2, 3, 0x05, 0x3C, 0x3C), \
77 VSF_DISP_SITRONIX_WRITE(0xB3, 6, 0x05, 0x3C, 0x3C, 0x05, 0x3C, 0x3C),\
78 VSF_DISP_SITRONIX_WRITE(0xB4, 1, 0x03), \
79 VSF_DISP_SITRONIX_WRITE(0xC0, 3, 0xAB, 0x0B, 0x04), \
80 VSF_DISP_SITRONIX_WRITE(0xC1, 1, 0xC5), \
81 VSF_DISP_SITRONIX_WRITE(0xC2, 2, 0x0D, 0x00), \
82 VSF_DISP_SITRONIX_WRITE(0xC3, 2, 0x8D, 0x6A), \
83 VSF_DISP_SITRONIX_WRITE(0xC4, 2, 0x8D, 0xEE), \
84 VSF_DISP_SITRONIX_WRITE(0xC5, 1, 0x0F), \
85 VSF_DISP_SITRONIX_WRITE(0xE0, 16, 0x07, 0x0E, 0x08, 0x07, 0x10, 0x07, 0x02, 0x07, 0x09, 0x0F, 0x25, 0x36, 0x00, 0x08, 0x04, 0x10),\
86 VSF_DISP_SITRONIX_WRITE(0xE1, 16, 0x0A, 0x0D, 0x08, 0x07, 0x0F, 0x07, 0x02, 0x07, 0x09, 0x0F, 0x25, 0x35, 0x00, 0x09, 0x04, 0x10),\
87 VSF_DISP_SITRONIX_WRITE(0xFC, 1, 0x80), \
88 VSF_DISP_SITRONIX_WRITE(0xF0, 1, 0x11), \
89 VSF_DISP_SITRONIX_WRITE(0xD6, 1, 0xCB), \
90 VSF_DISP_SITRONIX_WRITE(ST7735_COLMOD, 1, __PIXEL_FORMAT), \
91 VSF_DISP_SITRONIX_WRITE(ST7735_MADCTL, 1, __DISPLAY_SETTING), \
92 VSF_DISP_SITRONIX_WRITE(ST7735_INV(__INVERSE), 0), \
93 VSF_DISP_SITRONIX_WRITE(ST7735_DISP(1), 0)
118 uint8_t set_area_cmd_buffer[12];
Definition vsf_disp.h:149
Definition vsf_disp_sitronix_common.h:58
Definition vsf_disp_st7735.h:97
unsigned short uint16_t
Definition lvgl.h:41
unsigned char uint8_t
Definition lvgl.h:40
#define vsf_class(__name)
Definition ooc_class.h:48
Definition vsf_disp.h:144
const vk_disp_drv_t vk_disp_drv_st7735
Definition vsf_disp_st7735.c:49
uint8_t state
Definition vsf_msg_tree.h:247