SAM3U SPI driver update

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4017 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2011-10-03 23:58:25 +00:00
parent 7cb99a4d3d
commit 3dac46f931
3 changed files with 19 additions and 6 deletions

View File

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

View File

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

View File

@ -322,7 +322,7 @@ CONFIG_SEM_NNESTPRIO=0
CONFIG_FDCLONE_DISABLE=n
CONFIG_FDCLONE_STDIO=n
CONFIG_SDCLONE_DISABLE=y
CONFIG_SCHED_WORKQUEUE=n
CONFIG_SCHED_WORKQUEUE=y
CONFIG_SCHED_WORKPRIORITY=50
CONFIG_SCHED_WORKPERIOD=(50*1000)
CONFIG_SCHED_WORKSTACKSIZE=1024