[ltdc-stm32f4] add helper function to convert rgb565 to rgb888

This commit is contained in:
Oliver Meier 2014-12-10 19:16:36 +01:00 committed by Piotr Esden-Tempski
parent c26831fab0
commit 3c9b07d776
1 changed files with 10 additions and 0 deletions

View File

@ -168,6 +168,16 @@ void ltdc_setup_windowing(
uint16_t active_width, uint16_t active_height
);
/**
* color conversion helper function
* (simulate the ltdc color conversion)
*/
#define ltdc_get_rgb888_from_rgb565(rgb888) ( \
((((rgb888) & 0xF800) >> (11-8))/31)<<16 \
| ((((rgb888) & 0x07E0) << ( 8-5))/63)<<8 \
| ((((rgb888) & 0x001F) << ( 8-0))/31)<<0 \
)
#endif /* LIBOPENCM3_STM32_F4_LTDC_H_ */