summaryrefslogtreecommitdiff
path: root/nuttx/configs/sam4l-xplained/src/sam4l-xplained.h
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-06-15 10:56:08 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-06-15 10:56:08 -0600
commit123f7dc4f8825a277f2e416558bbb49fa19cc2b7 (patch)
treee54dd6223c6040d670644783235ae9ee6d96900f /nuttx/configs/sam4l-xplained/src/sam4l-xplained.h
parent9c82995c7a5847034355250dd9438649151ca58c (diff)
downloadpx4-nuttx-123f7dc4f8825a277f2e416558bbb49fa19cc2b7.tar.gz
px4-nuttx-123f7dc4f8825a277f2e416558bbb49fa19cc2b7.tar.bz2
px4-nuttx-123f7dc4f8825a277f2e416558bbb49fa19cc2b7.zip
Add support for the SAM4L Xplained Pro I/O1 module
Diffstat (limited to 'nuttx/configs/sam4l-xplained/src/sam4l-xplained.h')
-rw-r--r--nuttx/configs/sam4l-xplained/src/sam4l-xplained.h63
1 files changed, 60 insertions, 3 deletions
diff --git a/nuttx/configs/sam4l-xplained/src/sam4l-xplained.h b/nuttx/configs/sam4l-xplained/src/sam4l-xplained.h
index ba6978a82..9e7a0f4ac 100644
--- a/nuttx/configs/sam4l-xplained/src/sam4l-xplained.h
+++ b/nuttx/configs/sam4l-xplained/src/sam4l-xplained.h
@@ -99,10 +99,54 @@
* PC24 SW0
*/
-#define GPIO_SW0 (GPIO_INPUT | GPIO_PULL_UP | GPIO_GLITCH_FILTER | \
+#define GPIO_SW0 (GPIO_INTERRUPT | GPIO_PULL_UP | GPIO_GLITCH_FILTER | \
GPIO_PORTC | GPIO_PIN24)
#define IRQ_SW0 SAM_IRQ_PC24
+/* I/O1
+ *
+ * Support for the microSD card slot on the I/O1 module. The I/O1 requires
+ * SPI support and two GPIOs. These two GPIOs will vary if the
+ *
+ *
+ * PIN EXT1 EXT2 Description
+ * --- -------------- --------------- -------------------------------------
+ * 15 PC03 SPI/NPCS0 PB11 SPI/NPCS2 Active low chip select OUTPUT, pulled
+ * high on board.
+ * 10 PB13 SPI/NPCS1 10 PC09 GPIO Active low card detect INPUT, must
+ * use internal pull-up.
+ */
+
+#ifdef CONFIG_SAM4L_XPLAINED_IOMODULE
+
+# ifndef CONFIG_SAM34_SPI
+# error CONFIG_SAM34_SPI is required to use the I/O1 module
+# endif
+
+# if defined(CONFIG_SAM4L_XPLAINED_IOMODULE_EXT1)
+
+# define GPIO_SD_CD (GPIO_INTERRUPT | GPIO_INT_CHANGE | GPIO_PULL_UP | \
+ GPIO_GLITCH_FILTER | GPIO_PORTB | GPIO_PIN13)
+# define IRQ_SD_CD SAM_IRQ_PB13
+
+# define GPIO_SD_CS (GPIO_OUTPUT | GPIO_PULL_NONE | GPIO_OUTPUT_SET | \
+ GPIO_PORTC | GPIO_PIN3)
+# define SD_CSNO 0
+
+# elif defined(CONFIG_SAM4L_XPLAINED_IOMODULE_EXT2)
+# define GPIO_CD (GPIO_INTERRUPT | GPIO_INT_CHANGE | GPIO_PULL_UP | \
+ GPIO_GLITCH_FILTER | GPIO_PORTC | GPIO_PIN9)
+# define IRQ_CD SAM_IRQ_PC9
+
+# define GPIO_SD_CS (GPIO_OUTPUT | GPIO_PULL_NONE | GPIO_OUTPUT_SET | \
+ GPIO_PORTB | GPIO_PIN11)
+# define SD_CSNO 2
+
+# else
+# error Which connector is the I/O1 module installed in?
+# endif
+#endif
+
/************************************************************************************
* Public Types
************************************************************************************/
@@ -127,9 +171,22 @@
void weak_function sam_spiinitialize(void);
-/****************************************************************************
+/************************************************************************************
+ * Name: sam_sdinitialize
+ *
+ * Description:
+ * Initialize the SPI-based SD card. Requires CONFIG_SAM4L_XPLAINED_IOMODULE=y,
+ * CONFIG_DISABLE_MOUNTPOINT=n, CONFIG_MMCSD=y, and CONFIG_SAM34_SPI=y
+ *
+ ************************************************************************************/
+
+#ifdef CONFIG_SAM4L_XPLAINED_IOMODULE
+int sam_sdinitialize(int minor);
+#endif
+
+/************************************************************************************
* Name: up_ledinit
- ****************************************************************************/
+ ************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void up_ledinit(void);