mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Several fixes to get a clean compile of the Arduino touch screen
This commit is contained in:
@@ -1024,6 +1024,9 @@ Configuration sub-directories
|
|||||||
Application Configuration -> NSH Library
|
Application Configuration -> NSH Library
|
||||||
CONFIG_NSH_ARCHINIT=y : Board has architecture-specific initialization
|
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
|
3. This configuration has been used for verifying the touchscreen on
|
||||||
on the ITEAD TFT Shield. With the modifications below, you can
|
on the ITEAD TFT Shield. With the modifications below, you can
|
||||||
include the touchscreen test program at apps/examples/touchscreen as
|
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_SPI_BITBANG=y : Enable SPI bit-bang support
|
||||||
|
|
||||||
CONFIG_INPUT=y : Enable support for input devices
|
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:
|
System Type:
|
||||||
CONFIG_GPIO_IRQ=y : GPIO interrupt support
|
CONFIG_GPIO_IRQ=y : GPIO interrupt support
|
||||||
@@ -1064,3 +1074,7 @@ Configuration sub-directories
|
|||||||
CONFIG_DEBUG=y : Enable debug features
|
CONFIG_DEBUG=y : Enable debug features
|
||||||
CONFIG_DEBUG_VERBOSE=y : Enable verbose debug output
|
CONFIG_DEBUG_VERBOSE=y : Enable verbose debug output
|
||||||
CONFIG_DEBUG_INPUT=y : Enable debug output from input devices
|
CONFIG_DEBUG_INPUT=y : Enable debug output from input devices
|
||||||
|
|
||||||
|
STATUS:
|
||||||
|
2013-7-2: TSC is not responding. All 0's received on SPI.
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@
|
|||||||
|
|
||||||
# define GPIO_TSC_IRQ (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_INT_BOTHEDGES | \
|
# define GPIO_TSC_IRQ (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_INT_BOTHEDGES | \
|
||||||
GPIO_PORT_PIOC | GPIO_PIN21)
|
GPIO_PORT_PIOC | GPIO_PIN21)
|
||||||
# define SAM_TCS_IRQ SAM_IRQ_PC21
|
# define SAM_TSC_IRQ SAM_IRQ_PC21
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* Only CONFIG_LCD is expected to enable the TFT LCD */
|
/* Only CONFIG_LCD is expected to enable the TFT LCD */
|
||||||
|
|||||||
@@ -264,22 +264,22 @@ static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr)
|
|||||||
{
|
{
|
||||||
/* Attach the XPT2046 interrupt */
|
/* Attach the XPT2046 interrupt */
|
||||||
|
|
||||||
ivdbg("Attaching %p to IRQ %d\n", isr, SAM_TCS_IRQ);
|
ivdbg("Attaching %p to IRQ %d\n", isr, SAM_TSC_IRQ);
|
||||||
return irq_attach(SAM_TCS_IRQ, isr);
|
return irq_attach(SAM_TSC_IRQ, isr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
|
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
|
||||||
{
|
{
|
||||||
/* Attach and enable, or detach and disable */
|
/* 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)
|
if (enable)
|
||||||
{
|
{
|
||||||
sam_gpioirqenable(SAM_TCS_IRQ);
|
sam_gpioirqenable(SAM_TSC_IRQ);
|
||||||
}
|
}
|
||||||
else
|
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)
|
static bool tsc_busy(FAR struct ads7843e_config_s *state)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_DEBUG_INPUT) && defined(CONFIG_DEBUG_VERBOSE)
|
return false; /* The BUSY signal is not connected */
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||||
{
|
{
|
||||||
/* The /PENIRQ value is active low */
|
/* 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);
|
ivdbg("pendown:%d\n", pendown);
|
||||||
return pendown;
|
return pendown;
|
||||||
}
|
}
|
||||||
@@ -382,7 +365,7 @@ int arch_tcinitialize(int minor)
|
|||||||
|
|
||||||
/* Configure the PIO interrupt */
|
/* 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 */
|
/* Get an instance of the SPI interface for the touchscreen chip select */
|
||||||
|
|
||||||
|
|||||||
@@ -589,7 +589,7 @@ Configurations
|
|||||||
CONFIG_SPI_OWNBUS=y : Smaller code if this is the only SPI device
|
CONFIG_SPI_OWNBUS=y : Smaller code if this is the only SPI device
|
||||||
|
|
||||||
CONFIG_INPUT=y : Enable support for input devices
|
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_SPIDEV=2 : Use SPI CS 2 for communication
|
||||||
CONFIG_ADS7843E_SPIMODE=0 : Use SPI mode 0
|
CONFIG_ADS7843E_SPIMODE=0 : Use SPI mode 0
|
||||||
CONFIG_ADS7843E_FREQUENCY=1000000 : SPI BAUD 1MHz
|
CONFIG_ADS7843E_FREQUENCY=1000000 : SPI BAUD 1MHz
|
||||||
|
|||||||
Reference in New Issue
Block a user