summaryrefslogtreecommitdiffstats
path: root/nuttx/configs/ea3131
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2010-09-11 02:53:07 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2010-09-11 02:53:07 +0000
commitc3a53b2dc92e5039164bddd023156efa74f63494 (patch)
tree0c3f791872d113fcfa17c56b4119a809fd9690bb /nuttx/configs/ea3131
parent2794f1b7f87a97785ea08023b15bf2f5389469ad (diff)
Add support for SPI NOR chip select
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@2938 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/configs/ea3131')
-rwxr-xr-xnuttx/configs/ea3131/src/ea3131_internal.h8
-rwxr-xr-xnuttx/configs/ea3131/src/up_spi.c13
2 files changed, 19 insertions, 2 deletions
diff --git a/nuttx/configs/ea3131/src/ea3131_internal.h b/nuttx/configs/ea3131/src/ea3131_internal.h
index 58368e80e5..0f28ea1cc6 100755
--- a/nuttx/configs/ea3131/src/ea3131_internal.h
+++ b/nuttx/configs/ea3131/src/ea3131_internal.h
@@ -45,20 +45,24 @@
#include <nuttx/compiler.h>
#include <stdint.h>
+#include "lpc313x_ioconfig.h"
+
/************************************************************************************
* Definitions
************************************************************************************/
/* EA3131L GPIOs ********************************************************************/
-/* LEDs */
+/* LEDs -- interface through an I2C GPIO expander */
/* BUTTONS -- NOTE that some have EXTI interrupts configured */
/* SPI Chip Selects */
+/* SPI NOR flash is the only device on SPI. SPI_CS_OUT0 is its chip select */
-/* USB Soft Connect Pullup*/
+#define SPINOR_CS IOCONFIG_SPI_CSOUT0
+/* USB Soft Connect Pullup -- NONE */
/************************************************************************************
* Public Types
diff --git a/nuttx/configs/ea3131/src/up_spi.c b/nuttx/configs/ea3131/src/up_spi.c
index 7eef2db664..66c9d228f3 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)