summaryrefslogtreecommitdiff
path: root/nuttx/configs
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-05-24 16:03:08 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-05-24 16:03:08 +0000
commit9b2ed5ff44f02983b6ed3ca810ab6a951b838b17 (patch)
treefae5b37ef40f6c0e17eb7a2d18dbc8bef7e48159 /nuttx/configs
parente2a24a1500e26a3c53a64238bd249f512ca736f1 (diff)
downloadpx4-nuttx-9b2ed5ff44f02983b6ed3ca810ab6a951b838b17.tar.gz
px4-nuttx-9b2ed5ff44f02983b6ed3ca810ab6a951b838b17.tar.bz2
px4-nuttx-9b2ed5ff44f02983b6ed3ca810ab6a951b838b17.zip
Fixe LM3S GPIO output settings; fix Eagle-100 LEDs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1823 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs')
-rw-r--r--nuttx/configs/eagle100/include/board.h3
-rw-r--r--nuttx/configs/eagle100/src/up_boot.c4
-rw-r--r--nuttx/configs/eagle100/src/up_leds.c40
-rw-r--r--nuttx/configs/eagle100/src/up_ssi.c2
4 files changed, 40 insertions, 9 deletions
diff --git a/nuttx/configs/eagle100/include/board.h b/nuttx/configs/eagle100/include/board.h
index 16cae3d78..096ca8410 100644
--- a/nuttx/configs/eagle100/include/board.h
+++ b/nuttx/configs/eagle100/include/board.h
@@ -114,7 +114,8 @@
/* GPIO for microSD card chip select */
-#define SDC_CS (GPIO_PORTG | 2)
+#define SDCCS_GPIO (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STDWPU | GPIO_STRENGTH_4MA | GPIO_VALUE_ONE | GPIO_PORTG | 2)
+#define LED_GPIO (GPIO_FUNC_OUTPUT | GPIO_VALUE_ONE | GPIO_PORTE | 1)
/************************************************************************************
* Public Function Prototypes
diff --git a/nuttx/configs/eagle100/src/up_boot.c b/nuttx/configs/eagle100/src/up_boot.c
index 4b7d5f6ef..874d3dc06 100644
--- a/nuttx/configs/eagle100/src/up_boot.c
+++ b/nuttx/configs/eagle100/src/up_boot.c
@@ -41,6 +41,8 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <debug.h>
+
#include <arch/board/board.h>
#include "up_arch.h"
@@ -70,7 +72,7 @@ void lm3s_boardinitialize(void)
{
/* Configure the SPI-based microSD CS GPIO */
- lm3s_configgpio(SDC_CS | GPIO_PADTYPE_STDWPU | GPIO_STRENGTH_4MA | GPIO_VALUE_ONE);
+ lm3s_configgpio(SDCCS_GPIO);
/* Configure on-board LEDs */
diff --git a/nuttx/configs/eagle100/src/up_leds.c b/nuttx/configs/eagle100/src/up_leds.c
index 5a9d36382..5cb6be0d7 100644
--- a/nuttx/configs/eagle100/src/up_leds.c
+++ b/nuttx/configs/eagle100/src/up_leds.c
@@ -41,6 +41,8 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <debug.h>
+
#include <arch/board/board.h>
#include "chip.h"
@@ -52,6 +54,28 @@
* Definitions
****************************************************************************/
+/* Enables debug output from this file (needs CONFIG_DEBUG with
+ * CONFIG_DEBUG_VERBOSE too)
+ */
+
+#undef LED_DEBUG /* Define to enable debug */
+
+#ifdef LED_DEBUG
+# define leddbg lldbg
+# define ledvdbg llvdbg
+#else
+# define leddbg(x...)
+# define ledvdbg(x...)
+#endif
+
+/* Dump GPIO registers */
+
+#ifdef LED_DEBUG
+# define led_dumpgpio(m) lm3s_dumpgpio(LED_GPIO, m)
+#else
+# define led_dumpgpio(m)
+#endif
+
/****************************************************************************
* Private Data
****************************************************************************/
@@ -73,13 +97,13 @@ static boolean g_nest;
#ifdef CONFIG_ARCH_LEDS
void up_ledinit(void)
{
- /* Make sure that the GPIOE peripheral is enabled */
-
- modifyreg32(LM3S_SYSCON_RCGC2_OFFSET, 0, SYSCON_RCGC2_GPIOE);
+ leddbg("Initializing\n");
/* Configure Port E, Bit 1 as an output, initial value=OFF */
- lm3s_configgpio(GPIO_FUNC_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTE | 1);
+ led_dumpgpio("up_ledinit before lm3s_configgpio()");
+ lm3s_configgpio(LED_GPIO);
+ led_dumpgpio("up_ledinit after lm3s_configgpio()");
g_nest = 0;
}
@@ -103,7 +127,9 @@ void up_ledon(int led)
g_nest++;
case LED_IRQSENABLED:
case LED_STACKCREATED:
- modifyreg32(LM3S_GPIOE_DATA, 0, (1 << 1));
+ led_dumpgpio("up_ledon: before lm3s_gpiowrite()");
+ lm3s_gpiowrite(LED_GPIO, FALSE);
+ led_dumpgpio("up_ledon: after lm3s_gpiowrite()");
break;
}
}
@@ -129,7 +155,9 @@ void up_ledoff(int led)
case LED_PANIC:
if (--g_nest <= 0)
{
- modifyreg32(LM3S_GPIOE_DATA, (1 << 1), 0);
+ led_dumpgpio("up_ledoff: before lm3s_gpiowrite()");
+ lm3s_gpiowrite(LED_GPIO, TRUE);
+ led_dumpgpio("up_ledoff: after lm3s_gpiowrite()");
}
break;
}
diff --git a/nuttx/configs/eagle100/src/up_ssi.c b/nuttx/configs/eagle100/src/up_ssi.c
index 2a09ce4a8..c14c7ab89 100644
--- a/nuttx/configs/eagle100/src/up_ssi.c
+++ b/nuttx/configs/eagle100/src/up_ssi.c
@@ -84,7 +84,7 @@ void lm3s_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, boolean sel
{
/* Assert the CS pin to the card */
- lm3s_gpiowrite(SDC_CS, selected ? 0 : 1);
+ lm3s_gpiowrite(SDCCS_GPIO, !selected);
}
}