samples: display: Added support for sitronix_st7735r

Requires a ST7735R based LCD

Signed-off-by: Kim Bøndergaard <kim@fam-boendergaard.dk>
Signed-off-by: Kim Bøndergaard <kibo@prevas.dk>
This commit is contained in:
Kim Bøndergaard 2021-02-04 22:00:08 +01:00 committed by Anas Nashif
commit 48f5e746c8

View file

@ -30,6 +30,10 @@ LOG_MODULE_REGISTER(sample, LOG_LEVEL_INF);
#define DISPLAY_DEV_NAME DT_LABEL(DT_INST(0, sitronix_st7789v)) #define DISPLAY_DEV_NAME DT_LABEL(DT_INST(0, sitronix_st7789v))
#endif #endif
#if DT_NODE_HAS_STATUS(DT_INST(0, sitronix_st7735r), okay)
#define DISPLAY_DEV_NAME DT_LABEL(DT_INST(0, sitronix_st7735r))
#endif
#if DT_NODE_HAS_STATUS(DT_INST(0, fsl_imx6sx_lcdif), okay) #if DT_NODE_HAS_STATUS(DT_INST(0, fsl_imx6sx_lcdif), okay)
#define DISPLAY_DEV_NAME DT_LABEL(DT_INST(0, fsl_imx6sx_lcdif)) #define DISPLAY_DEV_NAME DT_LABEL(DT_INST(0, fsl_imx6sx_lcdif))
#endif #endif
@ -77,7 +81,7 @@ static void posix_exit_main(int exit_code)
#endif #endif
static void fill_buffer_argb8888(enum corner corner, uint8_t grey, uint8_t *buf, static void fill_buffer_argb8888(enum corner corner, uint8_t grey, uint8_t *buf,
size_t buf_size) size_t buf_size)
{ {
uint32_t color = 0; uint32_t color = 0;
@ -219,7 +223,7 @@ void main(void)
display_get_capabilities(display_dev, &capabilities); display_get_capabilities(display_dev, &capabilities);
if (capabilities.screen_info & SCREEN_INFO_MONO_VTILED) { if (capabilities.screen_info & SCREEN_INFO_MONO_VTILED) {
rect_w = 16; rect_w = 16;
rect_h = 8; rect_h = 8;
} else { } else {