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
This commit is contained in:
patacongo 2012-09-27 01:26:47 +00:00
parent 3558feeaf5
commit 41396d5960
5 changed files with 92 additions and 7 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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.

View File

@ -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);
}

View File

@ -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: