diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-09-11 02:53:07 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-09-11 02:53:07 +0000 |
commit | 49df4c8bc3e19225c22f34b1290be89c2518e184 (patch) | |
tree | 0c3f791872d113fcfa17c56b4119a809fd9690bb /nuttx/configs/ea3131/src/up_spi.c | |
parent | 1088be447cd6113169d3646182680a87213d68b8 (diff) | |
download | px4-nuttx-49df4c8bc3e19225c22f34b1290be89c2518e184.tar.gz px4-nuttx-49df4c8bc3e19225c22f34b1290be89c2518e184.tar.bz2 px4-nuttx-49df4c8bc3e19225c22f34b1290be89c2518e184.zip |
Add support for SPI NOR chip select
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2938 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/ea3131/src/up_spi.c')
-rwxr-xr-x | nuttx/configs/ea3131/src/up_spi.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nuttx/configs/ea3131/src/up_spi.c b/nuttx/configs/ea3131/src/up_spi.c index 7eef2db66..66c9d228f 100755 --- a/nuttx/configs/ea3131/src/up_spi.c +++ b/nuttx/configs/ea3131/src/up_spi.c @@ -100,6 +100,7 @@ void weak_function lpc313x_spiinitialize(void) * architecture. */ + gpio_outputhigh(LPC313X_IOCONFIG_SPI, SPINOR_CS); } /**************************************************************************** @@ -130,6 +131,18 @@ void weak_function lpc313x_spiinitialize(void) void lpc313x_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + + if (devid == SPIDEV_FLASH) + { + if (selected) + { + gpio_outputlow(LPC313X_IOCONFIG_SPI, SPINOR_CS); + } + else + { + gpio_outputhigh(LPC313X_IOCONFIG_SPI, SPINOR_CS); + } + } } uint8_t lpc313x_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) |