summaryrefslogtreecommitdiff
path: root/nuttx/configs
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-07-02 13:52:09 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-07-02 13:52:09 -0600
commit839fa173a58af540fe9b8232ded8559661d3826c (patch)
treebe54613e8a52887b1ca52b81032edf5e35f4e61f /nuttx/configs
parentcae1325e2b7a87ca6fb94b96ef01d524aebb3e0f (diff)
downloadpx4-nuttx-839fa173a58af540fe9b8232ded8559661d3826c.tar.gz
px4-nuttx-839fa173a58af540fe9b8232ded8559661d3826c.tar.bz2
px4-nuttx-839fa173a58af540fe9b8232ded8559661d3826c.zip
Several fixes to get a clean compile of the Arduino touch screen
Diffstat (limited to 'nuttx/configs')
-rw-r--r--nuttx/configs/arduino-due/README.txt14
-rw-r--r--nuttx/configs/arduino-due/src/arduino-due.h2
-rw-r--r--nuttx/configs/arduino-due/src/sam_touchscreen.c33
-rw-r--r--nuttx/configs/sam3u-ek/README.txt2
4 files changed, 24 insertions, 27 deletions
diff --git a/nuttx/configs/arduino-due/README.txt b/nuttx/configs/arduino-due/README.txt
index 976322e43..92b3437a7 100644
--- a/nuttx/configs/arduino-due/README.txt
+++ b/nuttx/configs/arduino-due/README.txt
@@ -1024,6 +1024,9 @@ Configuration sub-directories
Application Configuration -> NSH Library
CONFIG_NSH_ARCHINIT=y : Board has architecture-specific initialization
+ STATUS:
+ 2013-7-2: SD card is not responding. All 0's received on SPI.
+
3. This configuration has been used for verifying the touchscreen on
on the ITEAD TFT Shield. With the modifications below, you can
include the touchscreen test program at apps/examples/touchscreen as
@@ -1043,6 +1046,13 @@ Configuration sub-directories
CONFIG_SPI_BITBANG=y : Enable SPI bit-bang support
CONFIG_INPUT=y : Enable support for input devices
+ CONFIG_INPUT_ADS7843E=y : Enable support for the XPT2046
+ CONFIG_ADS7843E_SPIDEV=0 : (Doesn't matter)
+ CONFIG_ADS7843E_SPIMODE=0 : Use SPI mode 0
+ CONFIG_ADS7843E_FREQUENCY=1000000 : SPI BAUD 1MHz
+ CONFIG_ADS7843E_SWAPXY=y : If landscpe orientation
+ CONFIG_ADS7843E_THRESHX=51 : These will probably need to be tuned
+ CONFIG_ADS7843E_THRESHY=39
System Type:
CONFIG_GPIO_IRQ=y : GPIO interrupt support
@@ -1064,3 +1074,7 @@ Configuration sub-directories
CONFIG_DEBUG=y : Enable debug features
CONFIG_DEBUG_VERBOSE=y : Enable verbose debug output
CONFIG_DEBUG_INPUT=y : Enable debug output from input devices
+
+ STATUS:
+ 2013-7-2: TSC is not responding. All 0's received on SPI.
+
diff --git a/nuttx/configs/arduino-due/src/arduino-due.h b/nuttx/configs/arduino-due/src/arduino-due.h
index 0679f6ea4..34a33b3a6 100644
--- a/nuttx/configs/arduino-due/src/arduino-due.h
+++ b/nuttx/configs/arduino-due/src/arduino-due.h
@@ -248,7 +248,7 @@
# define GPIO_TSC_IRQ (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_INT_BOTHEDGES | \
GPIO_PORT_PIOC | GPIO_PIN21)
-# define SAM_TCS_IRQ SAM_IRQ_PC21
+# define SAM_TSC_IRQ SAM_IRQ_PC21
# endif
/* Only CONFIG_LCD is expected to enable the TFT LCD */
diff --git a/nuttx/configs/arduino-due/src/sam_touchscreen.c b/nuttx/configs/arduino-due/src/sam_touchscreen.c
index 0ed62cb63..7aefb1279 100644
--- a/nuttx/configs/arduino-due/src/sam_touchscreen.c
+++ b/nuttx/configs/arduino-due/src/sam_touchscreen.c
@@ -264,22 +264,22 @@ static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr)
{
/* Attach the XPT2046 interrupt */
- ivdbg("Attaching %p to IRQ %d\n", isr, SAM_TCS_IRQ);
- return irq_attach(SAM_TCS_IRQ, isr);
+ ivdbg("Attaching %p to IRQ %d\n", isr, SAM_TSC_IRQ);
+ return irq_attach(SAM_TSC_IRQ, isr);
}
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
{
/* Attach and enable, or detach and disable */
- ivdbg("IRQ:%d enable:%d\n", SAM_TCS_IRQ, enable);
+ ivdbg("IRQ:%d enable:%d\n", SAM_TSC_IRQ, enable);
if (enable)
{
- sam_gpioirqenable(SAM_TCS_IRQ);
+ sam_gpioirqenable(SAM_TSC_IRQ);
}
else
{
- sam_gpioirqdisable(SAM_TCS_IRQ);
+ sam_gpioirqdisable(SAM_TSC_IRQ);
}
}
@@ -290,31 +290,14 @@ static void tsc_clear(FAR struct ads7843e_config_s *state)
static bool tsc_busy(FAR struct ads7843e_config_s *state)
{
-#if defined(CONFIG_DEBUG_INPUT) && defined(CONFIG_DEBUG_VERBOSE)
- static bool last = (bool)-1;
-#endif
-
- /* 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)
- if (busy != last)
- {
- ivdbg("busy:%d\n", busy);
- last = busy;
- }
-#endif
-
- return busy;
+ return false; /* The BUSY signal is not connected */
}
static bool tsc_pendown(FAR struct ads7843e_config_s *state)
{
/* The /PENIRQ value is active low */
- bool pendown = !sam_gpioread(GPIO_TCS_IRQ);
+ bool pendown = !sam_gpioread(GPIO_TSC_IRQ);
ivdbg("pendown:%d\n", pendown);
return pendown;
}
@@ -382,7 +365,7 @@ int arch_tcinitialize(int minor)
/* Configure the PIO interrupt */
- sam_gpioirq(SAM_TCS_IRQ);
+ sam_gpioirq(SAM_TSC_IRQ);
/* Get an instance of the SPI interface for the touchscreen chip select */
diff --git a/nuttx/configs/sam3u-ek/README.txt b/nuttx/configs/sam3u-ek/README.txt
index e6c77331f..c1193b831 100644
--- a/nuttx/configs/sam3u-ek/README.txt
+++ b/nuttx/configs/sam3u-ek/README.txt
@@ -589,7 +589,7 @@ Configurations
CONFIG_SPI_OWNBUS=y : Smaller code if this is the only SPI device
CONFIG_INPUT=y : Enable support for input devices
- CONFIG_INPUT_ADS7843E=y : Enable support for the XPT2048
+ CONFIG_INPUT_ADS7843E=y : Enable support for the XPT2046
CONFIG_ADS7843E_SPIDEV=2 : Use SPI CS 2 for communication
CONFIG_ADS7843E_SPIMODE=0 : Use SPI mode 0
CONFIG_ADS7843E_FREQUENCY=1000000 : SPI BAUD 1MHz