diff --git a/configs/eagle100/src/eagle100_internal.h b/configs/eagle100/src/eagle100_internal.h index 67eec836d5..173f5e274b 100644 --- a/configs/eagle100/src/eagle100_internal.h +++ b/configs/eagle100/src/eagle100_internal.h @@ -44,6 +44,8 @@ #include #include +#include "chip.h" + /************************************************************************************ * Definitions ************************************************************************************/ diff --git a/configs/lm3s6965-ek/src/lm3s6965ek_internal.h b/configs/lm3s6965-ek/src/lm3s6965ek_internal.h index c0ddfa6d96..fb3a8a4eae 100755 --- a/configs/lm3s6965-ek/src/lm3s6965ek_internal.h +++ b/configs/lm3s6965-ek/src/lm3s6965ek_internal.h @@ -44,6 +44,8 @@ #include #include +#include "chip.h" + /************************************************************************************ * Definitions ************************************************************************************/ @@ -103,12 +105,15 @@ /* GPIOs for OLED: * - PC7: OLED display data/control select (D/Cn) * - PA3: OLED display chip select (CSn) + * - PC6: Enable +15V needed by OLED (EN+15V) */ #define OLEDDC_GPIO (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STD | GPIO_STRENGTH_8MA | \ GPIO_VALUE_ONE | GPIO_PORTC | 7) #define OLEDCS_GPIO (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STDWPU | GPIO_STRENGTH_4MA | \ GPIO_VALUE_ONE | GPIO_PORTA | 3) +#define OLEDEN_GPIO (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STD | GPIO_STRENGTH_8MA | \ + GPIO_VALUE_ONE | GPIO_PORTC | 6) /************************************************************************************ * Public Functions diff --git a/configs/lm3s6965-ek/src/up_boot.c b/configs/lm3s6965-ek/src/up_boot.c index 2a3d593898..3fb75cf543 100755 --- a/configs/lm3s6965-ek/src/up_boot.c +++ b/configs/lm3s6965-ek/src/up_boot.c @@ -45,6 +45,7 @@ #include #include "up_arch.h" +#include "up_internal.h" #include "lm3s6965ek_internal.h" /************************************************************************************ @@ -74,7 +75,7 @@ void lm3s_boardinitialize(void) * lm3s_ssiinitialize() has been brought into the link. */ - /* The LM3S6965 Eval Kit microSD CS and OLED are on SSI0 */ + /* The LM3S6965 Eval Kit microSD CS and OLED are on SSI0 (Duh! There is no SSI1) */ #if !defined(CONFIG_SSI0_DISABLE) /* || !defined(CONFIG_SSI1_DISABLE) */ if (lm3s_ssiinitialize) diff --git a/configs/lm3s6965-ek/src/up_oled.c b/configs/lm3s6965-ek/src/up_oled.c index 5bc3e9146a..55b8a3414a 100755 --- a/configs/lm3s6965-ek/src/up_oled.c +++ b/configs/lm3s6965-ek/src/up_oled.c @@ -55,28 +55,57 @@ * Pre-Processor Definitions ****************************************************************************/ +/* Define the CONFIG_LCD_RITDEBUG to enable detailed debug output (stuff you + * would never want to see unless you are debugging this file). + * + * Verbose debug must also be enabled + */ + +#ifndef CONFIG_DEBUG +# undef CONFIG_DEBUG_VERBOSE +# undef CONFIG_DEBUG_GRAPHICS +#endif + +#ifndef CONFIG_DEBUG_VERBOSE +# undef CONFIG_LCD_RITDEBUG +#endif + +#ifdef CONFIG_LCD_RITDEBUG +# define ritdbg(format, arg...) vdbg(format, ##arg) +# define oleddc_dumpgpio(m) lm3s_dumpgpio(OLEDDC_GPIO, m) +# define oledcs_dumpgpio(m) lm3s_dumpgpio(OLEDCS_GPIO, m) +#else +# define ritdbg(x...) +# define oleddc_dumpgpio(m) +# define oledcs_dumpgpio(m) +#endif + /**************************************************************************** * Public Functions ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: up_nxdrvinit * * Description: * Called NX initialization logic to configure the OLED. * - ************************************************************************************/ + ****************************************************************************/ FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno) { FAR struct spi_dev_s *spi; FAR struct lcd_dev_s *dev; - /* Configure the OLED D/Cn GPIO */ + /* Configure the OLED GPIOs */ - lm3s_configgpio(OLEDDC_GPIO); + oledcs_dumpgpio("up_nxdrvinit: After OLEDCS setup"); + oleddc_dumpgpio("up_nxdrvinit: On entry"); + lm3s_configgpio(OLEDDC_GPIO); /* PC7: OLED display data/control select (D/Cn) */ + lm3s_configgpio(OLEDEN_GPIO); /* PC6: Enable +15V needed by OLED (EN+15V) */ + oleddc_dumpgpio("up_nxdrvinit: After OLEDDC/EN setup"); - /* Get the SPI port */ + /* Get the SSI port (configure as a Freescale SPI port) */ spi = up_spiinitialize(0); if (!spi) @@ -85,16 +114,16 @@ FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno) } else { - /* Bind the SPI port to the OLED */ + /* Bind the SSI port to the OLED */ dev = rit_initialize(spi, devno); if (!dev) { - glldbg("Failed to bind SPI port 0 to OLED %d: %d\n", devno); + glldbg("Failed to bind SSI port 0 to OLED %d: %d\n", devno); } else { - gllvdbg("Bound SPI port 0 to OLED %d\n", devno); + gllvdbg("Bound SSI port 0 to OLED %d\n", devno); /* And turn the OLED on (CONFIG_LCD_MAXPOWER should be 1) */ @@ -105,23 +134,23 @@ FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno) return NULL; } -/************************************************************************************** +/****************************************************************************** * Name: rit_seldata * * Description: - * Set or clear the SD1329 D/Cn bit to select data (true) or command (false). This - * function must be provided by platform-specific logic. + * Set or clear the SD1329 D/Cn bit to select data (true) or command + * (false). This function must be provided by platform-specific logic. * * Input Parameters: * - * devno - A value in the range of 0 throuh CONFIG_P14201_NINTERFACES-1. This allows - * support for multiple OLED devices. + * devno - A value in the range of 0 throuh CONFIG_P14201_NINTERFACES-1. + * This allows support for multiple OLED devices. * data - true: select data; false: select command * * Returned Value: * None * - **************************************************************************************/ + ******************************************************************************/ void rit_seldata(unsigned int devno, bool data) {