Workaround for using RGB888 with STM32LTDC driver

remotes/origin_old/ugfx_release_2.6
Joel Bodenmann 2016-06-26 11:07:21 +02:00
parent cb26bc2d37
commit 4646a36cff
2 changed files with 6 additions and 5 deletions

View File

@ -71,9 +71,9 @@ typedef struct ltdcConfig {
#define LTDC_PIXELBYTES 2
#define LTDC_PIXELBITS 16
#elif GDISP_LLD_PIXELFORMAT == GDISP_PIXELFORMAT_RGB888
#define LTDC_PIXELFORMAT LTDC_FMT_RGB888
#define LTDC_PIXELBYTES 3
#define LTDC_PIXELBITS 24
#define LTDC_PIXELFORMAT LTDC_FMT_ARGB8888
#define LTDC_PIXELBYTES 4
#define LTDC_PIXELBITS 32
#else
#error "GDISP: STM32LTDC - unsupported pixel format"
#endif
@ -380,14 +380,14 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g) {
#if GDISP_LLD_PIXELFORMAT == GDISP_PIXELFORMAT_RGB565
DMA2D->OPFCCR = OPFCCR_RGB565;
#elif GDISP_LLD_PIXELFORMAT == GDISP_PIXELFORMAT_RGB888
DMA2D->OPFCCR = OPFCCR_RGB888;
DMA2D->OPFCCR = OPFCCR_ARGB8888;
#endif
// Foreground color format
#if GDISP_LLD_PIXELFORMAT == GDISP_PIXELFORMAT_RGB565
DMA2D->FGPFCCR = FGPFCCR_CM_RGB565;
#elif GDISP_LLD_PIXELFORMAT == GDISP_PIXELFORMAT_RGB888
DMA2D->FGPFCCR = FGPFCCR_CM_RGB888;
DMA2D->FGPFCCR = FGPFCCR_CM_ARGB8888;
#endif
}

View File

@ -7,6 +7,7 @@
#define OPFCCR_ARGB1555 0x03
#define OPFCCR_ARGB4444 0x04
#define FGPFCCR_CM_ARGB8888 0x00
#define FGPFCCR_CM_RGB888 0x01
#define FGPFCCR_CM_RGB565 0x02