diff options
author | Joel Bodenmann <joel@embedded.pro> | 2016-06-26 11:07:21 +0200 |
---|---|---|
committer | Joel Bodenmann <joel@embedded.pro> | 2016-06-26 11:07:21 +0200 |
commit | 4646a36cffa639375c7f6f650665d92aba53a45c (patch) | |
tree | 482e56770e9d3e26e71f73795fa360899a0a029d /drivers/gdisp/STM32LTDC | |
parent | cb26bc2d3778e6bbb631b6366d2db242de16279a (diff) | |
download | uGFX-4646a36cffa639375c7f6f650665d92aba53a45c.tar.gz uGFX-4646a36cffa639375c7f6f650665d92aba53a45c.tar.bz2 uGFX-4646a36cffa639375c7f6f650665d92aba53a45c.zip |
Workaround for using RGB888 with STM32LTDC driver
Diffstat (limited to 'drivers/gdisp/STM32LTDC')
-rw-r--r-- | drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c | 10 | ||||
-rw-r--r-- | drivers/gdisp/STM32LTDC/stm32_dma2d.h | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c index 4aa16eff..dca11ae8 100644 --- a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c +++ b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c @@ -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 } diff --git a/drivers/gdisp/STM32LTDC/stm32_dma2d.h b/drivers/gdisp/STM32LTDC/stm32_dma2d.h index d3374d05..1b3478c9 100644 --- a/drivers/gdisp/STM32LTDC/stm32_dma2d.h +++ b/drivers/gdisp/STM32LTDC/stm32_dma2d.h @@ -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 |