aboutsummaryrefslogtreecommitdiffstats
path: root/boards
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-28 13:54:19 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-28 13:54:19 +0000
commitd5cfd83d179d484cb8497c736adb7daf7027efab (patch)
tree5e3dd5ce1ba13af3d7e9cf4d575be431529dcdf5 /boards
parenta40226ad685dbb60d0dd6f70f244be0edea4dfa9 (diff)
downloadChibiOS-d5cfd83d179d484cb8497c736adb7daf7027efab.tar.gz
ChibiOS-d5cfd83d179d484cb8497c736adb7daf7027efab.tar.bz2
ChibiOS-d5cfd83d179d484cb8497c736adb7daf7027efab.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4355 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'boards')
-rw-r--r--boards/OLIMEX_STM32_E407/board.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/boards/OLIMEX_STM32_E407/board.c b/boards/OLIMEX_STM32_E407/board.c
index 59b6e9de6..6c149bbca 100644
--- a/boards/OLIMEX_STM32_E407/board.c
+++ b/boards/OLIMEX_STM32_E407/board.c
@@ -51,6 +51,35 @@ void __early_init(void) {
stm32_clock_init();
}
+#if HAL_USE_SDC
+/*
+ * Card detection through the card internal pull-up on D3.
+ */
+bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
+
+ (void)sdcp;
+ palSetPadMode(GPIOC, GPIOC_SD_D3, PAL_MODE_INPUT);
+ if (palReadPad(GPIOC, GPIOC_SD_D3) != PAL_LOW) {
+ /* Switching the pin to SDIO mode because after detecting the card the
+ SDC driver will start accessing it.*/
+ palSetPadMode(GPIOC, GPIOC_SD_D3, PAL_MODE_ALTERNATE(12));
+ return TRUE;
+ }
+ /* Leaving the pin in input mode, it will be polled again.*/
+ return FALSE;
+}
+
+/*
+ * Card write protection detection is not possible, the card is always
+ * reported as not protected.
+ */
+bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) {
+
+ (void)sdcp;
+ return FALSE;
+}
+#endif /* HAL_USE_SDC */
+
/*
* Board-specific initialization code.
*/