[ltdc-stm32f4] add helper function to convert rgb565 to rgb888
This commit is contained in:
parent
c26831fab0
commit
3c9b07d776
@ -168,6 +168,16 @@ void ltdc_setup_windowing(
|
|||||||
uint16_t active_width, uint16_t active_height
|
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_ */
|
#endif /* LIBOPENCM3_STM32_F4_LTDC_H_ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user