From 43fa294ec93a5277cefdb882d762ef6ab6de23f6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 26 Mar 2013 20:06:53 +0000 Subject: [PATCH] LPC17 LCD driver is code complete and in need of testing git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5788 42af7a65-404d-4744-a932-0658087f49c3 --- configs/open1788/knsh/defconfig | 2 +- configs/open1788/nsh/defconfig | 2 +- configs/open1788/src/lpc17_boardinitialize.c | 15 +++++++++++++++ configs/open1788/src/open1788.h | 5 +++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/configs/open1788/knsh/defconfig b/configs/open1788/knsh/defconfig index 291740f8e25..9fef87f5bb4 100755 --- a/configs/open1788/knsh/defconfig +++ b/configs/open1788/knsh/defconfig @@ -191,7 +191,7 @@ CONFIG_LPC17_GPDMA=y # # SDIO Configuration # -# CONFIG_SDIO_DMA is not defined +# CONFIG_SDIO_DMA is not set # CONFIG_SDIO_WIDTH_D1_ONLY is not set # diff --git a/configs/open1788/nsh/defconfig b/configs/open1788/nsh/defconfig index 27ae8582947..03c7a22b999 100644 --- a/configs/open1788/nsh/defconfig +++ b/configs/open1788/nsh/defconfig @@ -185,7 +185,7 @@ CONFIG_LPC17_GPDMA=y # # SDIO Configuration # -# CONFIG_SDIO_DMA is not defined +# CONFIG_SDIO_DMA is not set # CONFIG_SDIO_WIDTH_D1_ONLY is not set # diff --git a/configs/open1788/src/lpc17_boardinitialize.c b/configs/open1788/src/lpc17_boardinitialize.c index ac0417a65da..a16f8302483 100644 --- a/configs/open1788/src/lpc17_boardinitialize.c +++ b/configs/open1788/src/lpc17_boardinitialize.c @@ -48,6 +48,7 @@ #include "up_internal.h" #include "lpc17_emc.h" +#include "lpc17_gpio.h" #include "open1788.h" @@ -106,6 +107,14 @@ void lpc17_boardinitialize(void) #ifdef CONFIG_ARCH_LEDS up_ledinit(); #endif + + /* Enable the LCD backlight (unless we can defer this to a later + * initialization phase. + */ + +#if defined(CONFIG_LPC17_LCD) && !defined(CONFIG_BOARD_INITIALIZE) + lpc17_configgpio(GPIO_LCD_BL); +#endif } /**************************************************************************** @@ -124,6 +133,12 @@ void lpc17_boardinitialize(void) #ifdef CONFIG_BOARD_INITIALIZE void board_initialize(void) { + /* Enable the LCD backlight */ + +#ifdef CONFIG_LPC17_LCD + lpc17_configgpio(GPIO_LCD_BL); +#endif + /* Perform NSH initialization here instead of from the NSH. This * alternative NSH initialization is necessary when NSH is ran in user-space * but the initialization function must run in kernel space. diff --git a/configs/open1788/src/open1788.h b/configs/open1788/src/open1788.h index 8078fe9c535..ccac52db484 100644 --- a/configs/open1788/src/open1788.h +++ b/configs/open1788/src/open1788.h @@ -111,6 +111,11 @@ #define GPIO_SD_CD (GPIO_INTBOTH | GPIO_PULLUP | GPIO_PORT0 | GPIO_PIN13) +/* LCD ******************************************************************************/ +/* Backlight enable, P2[1]. Initial state is ON */ + +#define GPIO_LCD_BL (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT2 | GPIO_PIN1) + /************************************************************************************ * Public Types ************************************************************************************/