summaryrefslogtreecommitdiff
path: root/nuttx/configs/sam3u-ek/src
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-06-13 09:14:40 +0200
committerLorenz Meier <lm@inf.ethz.ch>2013-06-13 09:14:40 +0200
commitc255df1df9c1cd51e6d0e71ee5f2e92a22eac5cf (patch)
tree2254ceb7c66ba63b6cb6738af92c839f3868c748 /nuttx/configs/sam3u-ek/src
parentbc5c15a4909386a1efd556f4648385440379b164 (diff)
downloadpx4-nuttx-c255df1df9c1cd51e6d0e71ee5f2e92a22eac5cf.tar.gz
px4-nuttx-c255df1df9c1cd51e6d0e71ee5f2e92a22eac5cf.tar.bz2
px4-nuttx-c255df1df9c1cd51e6d0e71ee5f2e92a22eac5cf.zip
Merged in upstream, took upstream UART driver without changes, needs re-evaluation (minor diffs to local version)
Diffstat (limited to 'nuttx/configs/sam3u-ek/src')
-rw-r--r--nuttx/configs/sam3u-ek/src/Makefile2
-rw-r--r--nuttx/configs/sam3u-ek/src/sam3u-ek.h7
-rw-r--r--nuttx/configs/sam3u-ek/src/up_lcd.c6
-rw-r--r--nuttx/configs/sam3u-ek/src/up_nsh.c39
-rw-r--r--nuttx/configs/sam3u-ek/src/up_touchscreen.c4
5 files changed, 35 insertions, 23 deletions
diff --git a/nuttx/configs/sam3u-ek/src/Makefile b/nuttx/configs/sam3u-ek/src/Makefile
index 8dbf0eae5..788a50620 100644
--- a/nuttx/configs/sam3u-ek/src/Makefile
+++ b/nuttx/configs/sam3u-ek/src/Makefile
@@ -42,7 +42,7 @@ AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = up_boot.c up_leds.c up_buttons.c up_spi.c up_usbdev.c
-ifeq ($(CONFIG_SAM34_HSMCI),y)
+ifeq ($(CONFIG_LCD),y)
CSRCS += up_lcd.c
endif
diff --git a/nuttx/configs/sam3u-ek/src/sam3u-ek.h b/nuttx/configs/sam3u-ek/src/sam3u-ek.h
index 21e0e2649..df53985cf 100644
--- a/nuttx/configs/sam3u-ek/src/sam3u-ek.h
+++ b/nuttx/configs/sam3u-ek/src/sam3u-ek.h
@@ -138,7 +138,12 @@
#define GPIO_LCD_BKL (GPIO_OUTPUT|GPIO_CFG_DEFAULT|GPIO_OUTPUT_CLEAR|GPIO_PORT_PIOC|GPIO_PIN19)
-/* Touchscreen controller (TSC) */
+/* Touchscreen controller (TSC)
+ *
+ * BUSY is high impedance when CS is high (not selected). When CS is
+ * is low, BUSY is active high. Since the pin is pulled up, it will appear
+ * busy if CS is not selected.
+ */
#define GPIO_TCS_IRQ (GPIO_INPUT|GPIO_CFG_PULLUP|GPIO_PORT_PIOA|GPIO_PIN24)
#define GPIO_TCS_BUSY (GPIO_INPUT|GPIO_CFG_PULLUP|GPIO_PORT_PIOA|GPIO_PIN2)
diff --git a/nuttx/configs/sam3u-ek/src/up_lcd.c b/nuttx/configs/sam3u-ek/src/up_lcd.c
index ebeb35d91..5951f7a18 100644
--- a/nuttx/configs/sam3u-ek/src/up_lcd.c
+++ b/nuttx/configs/sam3u-ek/src/up_lcd.c
@@ -88,7 +88,7 @@
* other custom usage).
*
* The SAM3U4E communicates with the LCD through PIOB where a 16-bit parallel
- * “8080-like” protocol data bus has to be implemented by software.
+ * 8080-like protocol data bus has to be implemented by software.
*
* LCD backlight is made of 4 white chip LEDs in parallel, driven by an AAT3194
* charge pump, MN4. The AAT3194 is controlled by the SAM3U4E through a single line
@@ -125,7 +125,7 @@
#include "up_arch.h"
#include "sam_gpio.h"
-#include "chip/sam_pmc.h"
+#include "chip/sam3u_pmc.h"
#include "chip/sam_smc.h"
#include "sam3u-ek.h"
@@ -910,7 +910,7 @@ int up_lcdinitialize(void)
putreg32(regval, SAM_SMCCS_SETUP(2));
regval = (5 << SMCCS_PULSE_NWEPULSE_SHIFT) | (18 << SMCCS_PULSE_NCSWRPULSE_SHIFT) |
- (5 << SMCCS_PULSE_RDPULSE_SHIFT) | (18 << SMCCS_PULSE_NCSRDPULSE_SHIFT);
+ (5 << SMCCS_PULSE_NRDPULSE_SHIFT) | (18 << SMCCS_PULSE_NCSRDPULSE_SHIFT);
putreg32(regval, SAM_SMCCS_PULSE(2));
regval = (22 << SMCCS_CYCLE_NWECYCLE_SHIFT) | (22 << SMCCS_CYCLE_NRDCYCLE_SHIFT);
diff --git a/nuttx/configs/sam3u-ek/src/up_nsh.c b/nuttx/configs/sam3u-ek/src/up_nsh.c
index dfa296117..ded7d5527 100644
--- a/nuttx/configs/sam3u-ek/src/up_nsh.c
+++ b/nuttx/configs/sam3u-ek/src/up_nsh.c
@@ -50,8 +50,6 @@
#include "sam_hsmci.h"
#include "sam3u-ek.h"
-#ifdef CONFIG_SAM34_HSMCI
-
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
@@ -63,19 +61,10 @@
#define NSH_HAVE_USBDEV 1
#define NSH_HAVE_MMCSD 1
-#if defined(CONFIG_NSH_MMCSDSLOTNO) && CONFIG_NSH_MMCSDSLOTNO != 0
-# error "Only one MMC/SD slot"
-# undef CONFIG_NSH_MMCSDSLOTNO
-#endif
-
-#ifndef CONFIG_NSH_MMCSDSLOTNO
-# define CONFIG_NSH_MMCSDSLOTNO 0
-#endif
-
-/* Can't support USB features if USB is not enabled */
+/* Can't support MMC/SD if the card interface is not enable */
-#ifndef CONFIG_USBDEV
-# undef NSH_HAVE_USBDEV
+#ifndef CONFIG_SAM34_HSMCI
+# undef NSH_HAVE_MMCSD
#endif
/* Can't support MMC/SD features if mountpoints are disabled or if SDIO support
@@ -86,8 +75,25 @@
# undef NSH_HAVE_MMCSD
#endif
-#ifndef CONFIG_NSH_MMCSDMINOR
-# define CONFIG_NSH_MMCSDMINOR 0
+#ifdef NSH_HAVE_MMCSD
+# if defined(CONFIG_NSH_MMCSDSLOTNO) && CONFIG_NSH_MMCSDSLOTNO != 0
+# error "Only one MMC/SD slot"
+# undef CONFIG_NSH_MMCSDSLOTNO
+# endif
+
+# ifndef CONFIG_NSH_MMCSDMINOR
+# define CONFIG_NSH_MMCSDMINOR 0
+# endif
+
+# ifndef CONFIG_NSH_MMCSDSLOTNO
+# define CONFIG_NSH_MMCSDSLOTNO 0
+# endif
+#endif
+
+/* Can't support USB features if USB is not enabled */
+
+#ifndef CONFIG_USBDEV
+# undef NSH_HAVE_USBDEV
#endif
/* Debug ********************************************************************/
@@ -155,4 +161,3 @@ int nsh_archinitialize(void)
#endif
return OK;
}
-#endif
diff --git a/nuttx/configs/sam3u-ek/src/up_touchscreen.c b/nuttx/configs/sam3u-ek/src/up_touchscreen.c
index 251d9b624..f8b465748 100644
--- a/nuttx/configs/sam3u-ek/src/up_touchscreen.c
+++ b/nuttx/configs/sam3u-ek/src/up_touchscreen.c
@@ -183,7 +183,9 @@ static bool tsc_busy(FAR struct ads7843e_config_s *state)
static bool last = (bool)-1;
#endif
- /* REVISIT: This might need to be inverted */
+ /* BUSY is high impedance when CS is high (not selected). When CS is
+ * is low, BUSY is active high.
+ */
bool busy = sam_gpioread(GPIO_TCS_BUSY);
#if defined(CONFIG_DEBUG_INPUT) && defined(CONFIG_DEBUG_VERBOSE)