summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-09-27 01:26:47 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-09-27 01:26:47 +0000
commit2ee480b59e7f6d641dde0ec63254aaa8a87401c2 (patch)
treec8cf994dce3eb57a24b51273051e3208c78f9753
parent4e2728ef8651d0047d0f251bb1495327d2349414 (diff)
downloadpx4-nuttx-2ee480b59e7f6d641dde0ec63254aaa8a87401c2.tar.gz
px4-nuttx-2ee480b59e7f6d641dde0ec63254aaa8a87401c2.tar.bz2
px4-nuttx-2ee480b59e7f6d641dde0ec63254aaa8a87401c2.zip
Fixes mostly related to touchscreen on Shenzhou board (still does not work)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5196 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--NxWidgets/libnxwidgets/src/cnxserver.cxx2
-rw-r--r--NxWidgets/nxwm/src/chexcalculator.cxx2
-rw-r--r--nuttx/configs/shenzhou/README.txt58
-rw-r--r--nuttx/configs/shenzhou/src/up_touchscreen.c17
-rw-r--r--nuttx/drivers/input/Kconfig9
-rw-r--r--nuttx/drivers/input/ads7843e.c9
-rw-r--r--nuttx/drivers/input/ads7843e.h6
7 files changed, 94 insertions, 9 deletions
diff --git a/NxWidgets/libnxwidgets/src/cnxserver.cxx b/NxWidgets/libnxwidgets/src/cnxserver.cxx
index be67e5641..8816c73bc 100644
--- a/NxWidgets/libnxwidgets/src/cnxserver.cxx
+++ b/NxWidgets/libnxwidgets/src/cnxserver.cxx
@@ -214,7 +214,7 @@ bool CNxServer::connect(void)
// Start the server task
- gvdbg("NxServer::connect: Starting server task\n");
+ gvdbg("CNxServer::connect: Starting server task\n");
serverId = TASK_CREATE("NX Server", CONFIG_NXWIDGETS_SERVERPRIO,
CONFIG_NXWIDGETS_SERVERSTACK, server, (FAR const char **)0);
if (serverId < 0)
diff --git a/NxWidgets/nxwm/src/chexcalculator.cxx b/NxWidgets/nxwm/src/chexcalculator.cxx
index 167c114b7..f8f1bb246 100644
--- a/NxWidgets/nxwm/src/chexcalculator.cxx
+++ b/NxWidgets/nxwm/src/chexcalculator.cxx
@@ -656,7 +656,7 @@ int64_t CHexCalculator::evaluateBinaryOperation(uint8_t operation, int64_t value
return value1 + value2;
default:
- gdbg("ERROR: Unexpected pending operation %d\n", m_pending);
+ gdbg("ERROR: Unexpected pending operation %d\n", operation);
return 0;
}
}
diff --git a/nuttx/configs/shenzhou/README.txt b/nuttx/configs/shenzhou/README.txt
index 833da5bd1..9c358c5a5 100644
--- a/nuttx/configs/shenzhou/README.txt
+++ b/nuttx/configs/shenzhou/README.txt
@@ -696,3 +696,61 @@ Where <subdir> is one of the following:
delay (maybe 30 seconds?) before anything happens. That is the timeout
before the networking finally gives up and decides that no network is
available.
+
+ nxwm
+ ----
+ This is a special configuration setup for the NxWM window manager
+ UnitTest. The NxWM window manager can be found here:
+
+ trunk/NxWidgets/nxwm
+
+ The NxWM unit test can be found at:
+
+ trunk/NxWidgets/UnitTests/nxwm
+
+ NOTE: JP6 selects between the touchscreen interrupt and the MII
+ interrupt. It should be positioned 1-2 to enable the touchscreen
+ interrupt.
+
+ Documentation for installing the NxWM unit test can be found here:
+
+ trunk/NxWidgets/UnitTests/README.txt
+
+ Here is the quick summary of the build steps:
+
+ 1. Intall the nxwm configuration
+
+ $ cd ~/nuttx/trunk/nuttx/tools
+ $ ./configure.sh shenzhou/nxwm
+
+ 2. Make the build context (only)
+
+ $ cd ..
+ $ . ./setenv.sh
+ $ make context
+ ...
+
+ 3. Install the nxwm unit test
+
+ $ cd ~/nuttx/trunk/NxWidgets
+ $ tools/install.sh ~/nuttx/trunk/apps nxwm
+ Creating symbolic link
+ - To ~/nuttx/trunk/NxWidgets/UnitTests/nxwm
+ - At ~/nuttx/trunk/apps/external
+
+ 4. Build the NxWidgets library
+
+ $ cd ~/nuttx/trunk/NxWidgets/libnxwidgets
+ $ make TOPDIR=~/nuttx/trunk/nuttx
+ ...
+
+ 5. Build the NxWM library
+
+ $ cd ~/nuttx/trunk/NxWidgets/nxwm
+ $ make TOPDIR=~//nuttx/trunk/nuttx
+ ...
+
+ 6. Built NuttX with the installed unit test as the application
+
+ $ cd ~/nuttx/trunk/nuttx
+ $ make
diff --git a/nuttx/configs/shenzhou/src/up_touchscreen.c b/nuttx/configs/shenzhou/src/up_touchscreen.c
index 9f584e5bb..7f6d49eb5 100644
--- a/nuttx/configs/shenzhou/src/up_touchscreen.c
+++ b/nuttx/configs/shenzhou/src/up_touchscreen.c
@@ -173,19 +173,23 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
{
FAR struct stm32_config_s *priv = (FAR struct stm32_config_s *)state;
- DEBUGASSERT(priv->handler);
+ /* The caller should not attempt to enable interrupts if the handler
+ * has not yet been 'attached'
+ */
+
+ DEBUGASSERT(priv->handler || !enable);
/* Attach and enable, or detach and disable */
ivdbg("enable:%d\n", enable);
if (enable)
{
- (void)stm32_gpiosetevent(GPIO_TP_INT, false, true, true,
+ (void)stm32_gpiosetevent(GPIO_TP_INT, true, true, false,
priv->handler);
}
else
{
- (void)stm32_gpiosetevent(GPIO_TP_INT, false, true, true, NULL);
+ (void)stm32_gpiosetevent(GPIO_TP_INT, false, false, false, NULL);
}
}
@@ -205,9 +209,12 @@ static bool tsc_busy(FAR struct ads7843e_config_s *state)
static bool tsc_pendown(FAR struct ads7843e_config_s *state)
{
- /* REVISIT: This might need to be inverted */
+ /* XPT2046 uses an an internal pullup resistor. The PENIRQ output goes low
+ * due to the current path through the touch screen to ground, which
+ * initiates an interrupt to the processor via TP_INT.
+ */
- bool pendown = stm32_gpioread(GPIO_TP_INT);
+ bool pendown = !stm32_gpioread(GPIO_TP_INT);
ivdbg("pendown:%d\n", pendown);
return pendown;
}
diff --git a/nuttx/drivers/input/Kconfig b/nuttx/drivers/input/Kconfig
index 1303cfbd0..9fde35ff6 100644
--- a/nuttx/drivers/input/Kconfig
+++ b/nuttx/drivers/input/Kconfig
@@ -6,8 +6,15 @@ config INPUT_TSC2007
bool "TI TSC2007 touchscreen controller"
default n
select I2C
+ ---help---
+ Enable support for the TI TSC2007 touchscreen controller
+
config INPUT_ADS7843E
- bool "TI ADS7843E touchscreen controller"
+ bool "TI ADS7843/TSC2046 touchscreen controller"
default n
select SPI
+ ---help---
+ Enable support for the TI/Burr-Brown ADS7842 touchscreen controller. I believe
+ that driver should be compatibile with the TI/Burr-Brown TSC2046 and XPT2046
+ touchscreen controllers as well.
diff --git a/nuttx/drivers/input/ads7843e.c b/nuttx/drivers/input/ads7843e.c
index e08a7a728..555ce3480 100644
--- a/nuttx/drivers/input/ads7843e.c
+++ b/nuttx/drivers/input/ads7843e.c
@@ -9,6 +9,12 @@
* "Touch Screen Controller, ADS7843," Burr-Brown Products from Texas
* Instruments, SBAS090B, September 2000, Revised May 2002"
*
+ * See also:
+ * "Low Voltage I/O Touch Screen Controller, TSC2046," Burr-Brown Products
+ * from Texas Instruments, SBAS265F, October 2002, Revised August 2007.
+ *
+ * "XPT2046 Data Sheet," Shenzhen XPTek Technology Co., Ltd, 2007
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -566,7 +572,7 @@ static void ads7843e_worker(FAR void *arg)
/* Check for pen up or down by reading the PENIRQ GPIO. */
pendown = config->pendown(config);
-
+dbg("pendown: %d\n", pendown); // REMOVE ME
/* Handle the change from pen down to pen up */
if (!pendown)
@@ -637,6 +643,7 @@ static void ads7843e_worker(FAR void *arg)
/* Exit, re-enabling ADS7843E interrupts */
errout:
+dbg("Exiting\n"); // REMOVE ME
(void)ads7843e_sendcmd(priv, ADS7843_CMD_ENABPINIRQ);
config->enable(config, true);
}
diff --git a/nuttx/drivers/input/ads7843e.h b/nuttx/drivers/input/ads7843e.h
index 030d1cb33..43b79c7b7 100644
--- a/nuttx/drivers/input/ads7843e.h
+++ b/nuttx/drivers/input/ads7843e.h
@@ -8,6 +8,12 @@
* "Touch Screen Controller, ADS7843," Burr-Brown Products from Texas
* Instruments, SBAS090B, September 2000, Revised May 2002"
*
+ * See also:
+ * "Low Voltage I/O Touch Screen Controller, TSC2046," Burr-Brown Products
+ * from Texas Instruments, SBAS265F, October 2002, Revised August 2007."
+ *
+ * "XPT2046 Data Sheet," Shenzhen XPTek Technology Co., Ltd, 2007
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met: