summaryrefslogtreecommitdiff
path: root/nuttx/configs
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-05-16 16:52:04 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-05-16 16:52:04 +0000
commit694de4eb08b74ddea49c85716f452ddd33a15925 (patch)
treee7ce99f5070575f1a12ebb767c544db78f323f2c /nuttx/configs
parent5634f4a9b27ec9601e8dc807dd54bc26f06f1cf6 (diff)
downloadpx4-nuttx-694de4eb08b74ddea49c85716f452ddd33a15925.tar.gz
px4-nuttx-694de4eb08b74ddea49c85716f452ddd33a15925.tar.bz2
px4-nuttx-694de4eb08b74ddea49c85716f452ddd33a15925.zip
Misc OLED-related bug fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2681 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs')
-rw-r--r--nuttx/configs/eagle100/src/eagle100_internal.h2
-rwxr-xr-xnuttx/configs/lm3s6965-ek/src/lm3s6965ek_internal.h5
-rwxr-xr-xnuttx/configs/lm3s6965-ek/src/up_boot.c3
-rwxr-xr-xnuttx/configs/lm3s6965-ek/src/up_oled.c57
4 files changed, 52 insertions, 15 deletions
diff --git a/nuttx/configs/eagle100/src/eagle100_internal.h b/nuttx/configs/eagle100/src/eagle100_internal.h
index 67eec836d..173f5e274 100644
--- a/nuttx/configs/eagle100/src/eagle100_internal.h
+++ b/nuttx/configs/eagle100/src/eagle100_internal.h
@@ -44,6 +44,8 @@
#include <nuttx/config.h>
#include <nuttx/compiler.h>
+#include "chip.h"
+
/************************************************************************************
* Definitions
************************************************************************************/
diff --git a/nuttx/configs/lm3s6965-ek/src/lm3s6965ek_internal.h b/nuttx/configs/lm3s6965-ek/src/lm3s6965ek_internal.h
index c0ddfa6d9..fb3a8a4ea 100755
--- a/nuttx/configs/lm3s6965-ek/src/lm3s6965ek_internal.h
+++ b/nuttx/configs/lm3s6965-ek/src/lm3s6965ek_internal.h
@@ -44,6 +44,8 @@
#include <nuttx/config.h>
#include <nuttx/compiler.h>
+#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/nuttx/configs/lm3s6965-ek/src/up_boot.c b/nuttx/configs/lm3s6965-ek/src/up_boot.c
index 2a3d59389..3fb75cf54 100755
--- a/nuttx/configs/lm3s6965-ek/src/up_boot.c
+++ b/nuttx/configs/lm3s6965-ek/src/up_boot.c
@@ -45,6 +45,7 @@
#include <arch/board/board.h>
#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/nuttx/configs/lm3s6965-ek/src/up_oled.c b/nuttx/configs/lm3s6965-ek/src/up_oled.c
index 5bc3e9146..55b8a3414 100755
--- a/nuttx/configs/lm3s6965-ek/src/up_oled.c
+++ b/nuttx/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)
{