diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-07-01 07:21:54 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-07-01 07:21:54 +0000 |
commit | b03af35eb389d6452eb547845afcc20721ed5934 (patch) | |
tree | f2924780697bc20342f313b99a626728795e0173 /boards/OLIMEX_STM32_P107/board.c | |
parent | bb9153e85fe364f580048c2a069af6e15acad650 (diff) | |
download | ChibiOS-b03af35eb389d6452eb547845afcc20721ed5934.tar.gz ChibiOS-b03af35eb389d6452eb547845afcc20721ed5934.tar.bz2 ChibiOS-b03af35eb389d6452eb547845afcc20721ed5934.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4376 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'boards/OLIMEX_STM32_P107/board.c')
-rw-r--r-- | boards/OLIMEX_STM32_P107/board.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/boards/OLIMEX_STM32_P107/board.c b/boards/OLIMEX_STM32_P107/board.c index 6734597fc..3d4aaafbe 100644 --- a/boards/OLIMEX_STM32_P107/board.c +++ b/boards/OLIMEX_STM32_P107/board.c @@ -47,6 +47,30 @@ void __early_init(void) { stm32_clock_init();
}
+#if HAL_USE_MMC_SPI
+/*
+ * Card detection through the card internal pull-up on D3.
+ */
+bool_t mmc_lld_is_card_inserted(MMCDriver *mmcp) {
+ static bool_t last_status = FALSE;
+
+ (void)mmcp;
+ if ((palReadLatch(GPIOA) & PAL_PORT_BIT(GPIOA_SPI3_CS_MMC)) == 0)
+ return last_status;
+ return last_status = (bool_t)palReadPad(GPIOA, GPIOA_SPI3_CS_MMC);
+}
+
+/*
+ * Card write protection detection is not possible, the card is always
+ * reported as not protected.
+ */
+bool_t mmc_lld_is_write_protected(MMCDriver *mmcp) {
+
+ (void)mmcp;
+ return FALSE;
+}
+#endif
+
/*
* Board-specific initialization code.
*/
|