diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-10-03 23:58:25 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-10-03 23:58:25 +0000 |
commit | 0eda7244af71108683fb409517ccb18dd78dd65c (patch) | |
tree | 23311478a2eecd426d6b0d0d2e2e866565cc607b /nuttx/configs/sam3u-ek/src | |
parent | 0da537768a85ab863bd1a46425db167d6333e51c (diff) | |
download | px4-nuttx-0eda7244af71108683fb409517ccb18dd78dd65c.tar.gz px4-nuttx-0eda7244af71108683fb409517ccb18dd78dd65c.tar.bz2 px4-nuttx-0eda7244af71108683fb409517ccb18dd78dd65c.zip |
SAM3U SPI driver update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4017 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/sam3u-ek/src')
-rw-r--r-- | nuttx/configs/sam3u-ek/src/up_spi.c | 9 | ||||
-rwxr-xr-x | nuttx/configs/sam3u-ek/src/up_touchscreen.c | 14 |
2 files changed, 18 insertions, 5 deletions
diff --git a/nuttx/configs/sam3u-ek/src/up_spi.c b/nuttx/configs/sam3u-ek/src/up_spi.c index 3b5089238..5c70a5ab5 100644 --- a/nuttx/configs/sam3u-ek/src/up_spi.c +++ b/nuttx/configs/sam3u-ek/src/up_spi.c @@ -134,18 +134,21 @@ void weak_function sam3u_spiinitialize(void) ****************************************************************************/ #ifdef CONFIG_SAM3U_SPI -void sam3u_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) +int sam3u_spiselect(enum spi_dev_e devid) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + int cs = -EINVAL; #if defined(CONFIG_INPUT) && defined(CONFIG_INPUT_ADS7843E) if (devid == SPIDEV_TOUCHSCREEN) { /* Assert the CS pin to the OLED display */ - (void)lpc17_gpiowrite(GPIO_TSC_NPCS2, !selected); + cs = 2; } #endif + + spidbg("devid: %d CS: %d\n", (int)devid, cs); + return cs; } uint8_t sam3u_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/nuttx/configs/sam3u-ek/src/up_touchscreen.c b/nuttx/configs/sam3u-ek/src/up_touchscreen.c index 2d4b2ef18..40dd2db15 100755 --- a/nuttx/configs/sam3u-ek/src/up_touchscreen.c +++ b/nuttx/configs/sam3u-ek/src/up_touchscreen.c @@ -50,11 +50,21 @@ #include <nuttx/input/ads7843e.h> #include "sam3u_internal.h" -#include "sam3uek_internal.h.h" +#include "sam3uek_internal.h" /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ +/* Configuration ************************************************************/ + +#ifdef CONFIG_INPUT_ADS7843E +#ifndef CONFIG_INPUT +# error "Touchscreen support requires CONFIG_INPUT" +#endif + +#ifndef CONFIG_SAM3U_SPI +# error "Touchscreen support requires CONFIG_SAM3U_SPI" +#endif /**************************************************************************** * Static Function Prototypes @@ -150,7 +160,6 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) return sam3u_gpioread(GPIO_ADS7843E); } -#endif /* HAVE_TOUCHSCREEN */ /**************************************************************************** * Public Functions @@ -195,3 +204,4 @@ int up_tcinitialize(void) return OK; } +#endif /* CONFIG_INPUT_ADS7843E */
\ No newline at end of file |