diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-26 22:34:15 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-26 22:34:15 +0000 |
commit | 68cd11bf2a8f0f37e733572ce2bad747c3ee81b3 (patch) | |
tree | f0ee8c209f166bbc014aeeb8b9713471e76871e2 /nuttx/arch/arm/src/lpc17xx/lpc17_lcd.h | |
parent | 0ad5854398fe8a6228556b96a1609a78ee73f83d (diff) | |
download | px4-nuttx-68cd11bf2a8f0f37e733572ce2bad747c3ee81b3.tar.gz px4-nuttx-68cd11bf2a8f0f37e733572ce2bad747c3ee81b3.tar.bz2 px4-nuttx-68cd11bf2a8f0f37e733572ce2bad747c3ee81b3.zip |
Change the way that BPP is configured for the LPC17xx LCD so that all possible BPP options can be selected
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5790 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lpc17xx/lpc17_lcd.h')
-rw-r--r-- | nuttx/arch/arm/src/lpc17xx/lpc17_lcd.h | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_lcd.h b/nuttx/arch/arm/src/lpc17xx/lpc17_lcd.h index 345e0154c..1545a7a56 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_lcd.h +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_lcd.h @@ -62,23 +62,52 @@ # define CONFIG_LPC17_LCD_REFRESH_FREQ (50) /* Hz */ #endif -/* Bits per pixel */ - -#ifndef CONFIG_LPC17_LCD_BPP -# define CONFIG_LPC17_LCD_BPP 24 /* Bits per pixel */ -#endif - -/* Color format */ - -#undef FB_FMT -#if CONFIG_LPC17_LCD_BPP == 16 -# define FB_FMT FB_FMT_RGB16_565 -#elif CONFIG_LPC17_LCD_BPP == 24 -# define FB_FMT FB_FMT_RGB24 +/* Bits per pixel / color format */ + +#undef LPC17_COLOR_FMT +#if defined(CONFIG_LPC17_LCD_BPP1) +# define LPC17_BPP 1 +# define LPC17_COLOR_FMT FB_FMT_Y1 +#elif defined(CONFIG_LPC17_LCD_BPP2) +# define LPC17_BPP 2 +# define LPC17_COLOR_FMT FB_FMT_Y2 +#elif defined(CONFIG_LPC17_LCD_BPP4) +# define LPC17_BPP 4 +# define LPC17_COLOR_FMT FB_FMT_Y4 +#elif defined(CONFIG_LPC17_LCD_BPP8) +# define LPC17_BPP 8 +# define LPC17_COLOR_FMT FB_FMT_Y8 +#elif defined(CONFIG_LPC17_LCD_BPP16) +# define LPC17_BPP 16 +# define LPC17_COLOR_FMT FB_FMT_Y16 +#elif defined(CONFIG_LPC17_LCD_BPP24) +# define LPC17_BPP 24 +# define LPC17_COLOR_FMT FB_FMT_RGB24 +# ifndef CONFIG_LPC17_LCD_TFTPANEL +# error "24 BPP is only available for a TFT panel" +# endif +#elif defined(CONFIG_LPC17_LCD_BPP16_565) +# define LPC17_BPP 16 +# define LPC17_COLOR_FMT FB_FMT_RGB16_565 +#elif defined(CONFIG_LPC17_LCD_BPP12_444) +# define LPC17_BPP 1 2 +# define LPC17_COLOR_FMT FB_FMT_RGB12_444 #else -# error "Unsupported BPP" +# ifndef CONFIG_LPC17_LCD_TFTPANEL +# warning "Assuming 24 BPP" +# define LPC17_BPP 24 +# define CONFIG_LPC17_LCD_BPP24 1 +# define LPC17_COLOR_FMT FB_FMT_RGB24 +# else +# warning "Assuming 16 BPP 5:6:5" +# define LPC17_BPP 16 +# define CONFIG_LPC17_LCD_BPP16_565 1 +# define LPC17_COLOR_FMT FB_FMT_RGB16_565 +# endif #endif +/* Background color */ + #ifndef CONFIG_LPC17_LCD_BACKCOLOR # define CONFIG_LPC17_LCD_BACKCOLOR 0 /* Initial background color */ #endif |