|
41 | 41 | #include "stm324x7i_eval.h" |
42 | 42 | //#include "stm32f4xx_i2c.h" |
43 | 43 |
|
44 | | -/** @addtogroup Utilities |
45 | | - * @{ |
46 | | - */ |
47 | | - |
48 | | -/** @addtogroup STM32_EVAL |
49 | | - * @{ |
50 | | - */ |
51 | | - |
52 | | -/** @addtogroup STM324x7I_EVAL |
53 | | - * @{ |
54 | | - */ |
55 | | - |
56 | | -/** @defgroup STM324x7I_EVAL_LOW_LEVEL |
57 | | - * @brief This file provides firmware functions to manage Leds, push-buttons, |
58 | | - * COM ports, SD card on SDIO and serial EEPROM (sEE) available on |
59 | | - * STM324x7I-EVAL evaluation board from STMicroelectronics. |
60 | | - * @{ |
61 | | - */ |
62 | | - |
63 | | -/** @defgroup STM324x7I_EVAL_LOW_LEVEL_Private_TypesDefinitions |
64 | | - * @{ |
65 | | - */ |
66 | | -/** |
67 | | - * @} |
68 | | - */ |
69 | | - |
70 | | - |
71 | | -/** @defgroup STM324x7I_EVAL_LOW_LEVEL_Private_Defines |
72 | | - * @{ |
73 | | - */ |
74 | | -/** |
75 | | - * @} |
76 | | - */ |
77 | | - |
78 | | - |
79 | | -/** @defgroup STM324x7I_EVAL_LOW_LEVEL_Private_Macros |
80 | | - * @{ |
81 | | - */ |
82 | | -/** |
83 | | - * @} |
84 | | - */ |
85 | | - |
86 | | - |
87 | | -/** @defgroup STM324x7I_EVAL_LOW_LEVEL_Private_Variables |
88 | | - * @{ |
89 | | - */ |
90 | | -#if 0 |
91 | | -GPIO_TypeDef* GPIO_PORT[LEDn] = {LED1_GPIO_PORT, LED2_GPIO_PORT, LED3_GPIO_PORT, |
92 | | - LED4_GPIO_PORT}; |
93 | | -const uint16_t GPIO_PIN[LEDn] = {LED1_PIN, LED2_PIN, LED3_PIN, |
94 | | - LED4_PIN}; |
95 | | -const uint32_t GPIO_CLK[LEDn] = {LED1_GPIO_CLK, LED2_GPIO_CLK, LED3_GPIO_CLK, |
96 | | - LED4_GPIO_CLK}; |
97 | | - |
98 | | -GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT, TAMPER_BUTTON_GPIO_PORT, |
99 | | - KEY_BUTTON_GPIO_PORT}; |
100 | | - |
101 | | -const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN, TAMPER_BUTTON_PIN, |
102 | | - KEY_BUTTON_PIN}; |
103 | | - |
104 | | -const uint32_t BUTTON_CLK[BUTTONn] = {WAKEUP_BUTTON_GPIO_CLK, TAMPER_BUTTON_GPIO_CLK, |
105 | | - KEY_BUTTON_GPIO_CLK}; |
106 | | - |
107 | | -const uint16_t BUTTON_EXTI_LINE[BUTTONn] = {WAKEUP_BUTTON_EXTI_LINE, |
108 | | - TAMPER_BUTTON_EXTI_LINE, |
109 | | - KEY_BUTTON_EXTI_LINE}; |
110 | | - |
111 | | -const uint16_t BUTTON_PORT_SOURCE[BUTTONn] = {WAKEUP_BUTTON_EXTI_PORT_SOURCE, |
112 | | - TAMPER_BUTTON_EXTI_PORT_SOURCE, |
113 | | - KEY_BUTTON_EXTI_PORT_SOURCE}; |
114 | | - |
115 | | -const uint16_t BUTTON_PIN_SOURCE[BUTTONn] = {WAKEUP_BUTTON_EXTI_PIN_SOURCE, |
116 | | - TAMPER_BUTTON_EXTI_PIN_SOURCE, |
117 | | - KEY_BUTTON_EXTI_PIN_SOURCE}; |
118 | | -const uint16_t BUTTON_IRQn[BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn, TAMPER_BUTTON_EXTI_IRQn, |
119 | | - KEY_BUTTON_EXTI_IRQn}; |
120 | | - |
121 | | -GPIO_TypeDef* COM_TX_PORT[COMn] = {EVAL_COM1_TX_GPIO_PORT}; |
122 | | - |
123 | | -GPIO_TypeDef* COM_RX_PORT[COMn] = {EVAL_COM1_RX_GPIO_PORT}; |
124 | | - |
125 | | -const uint32_t COM_TX_PORT_CLK[COMn] = {EVAL_COM1_TX_GPIO_CLK}; |
126 | | - |
127 | | -const uint32_t COM_RX_PORT_CLK[COMn] = {EVAL_COM1_RX_GPIO_CLK}; |
128 | | - |
129 | | -const uint16_t COM_TX_PIN[COMn] = {EVAL_COM1_TX_PIN}; |
130 | | - |
131 | | -const uint16_t COM_RX_PIN[COMn] = {EVAL_COM1_RX_PIN}; |
132 | | - |
133 | | -const uint16_t COM_TX_PIN_SOURCE[COMn] = {EVAL_COM1_TX_SOURCE}; |
134 | | - |
135 | | -const uint16_t COM_RX_PIN_SOURCE[COMn] = {EVAL_COM1_RX_SOURCE}; |
136 | | - |
137 | | -const uint16_t COM_TX_AF[COMn] = {EVAL_COM1_TX_AF}; |
138 | | - |
139 | | -const uint16_t COM_RX_AF[COMn] = {EVAL_COM1_RX_AF}; |
140 | | - |
141 | | -DMA_InitTypeDef sEEDMA_InitStructure; |
142 | | -NVIC_InitTypeDef NVIC_InitStructure; |
143 | | -#endif |
144 | | - |
145 | | -/** |
146 | | - * @} |
147 | | - */ |
148 | | - |
149 | | - |
150 | | -/** @defgroup STM324x7I_EVAL_LOW_LEVEL_Private_FunctionPrototypes |
151 | | - * @{ |
152 | | - */ |
153 | | - |
154 | | -/** |
155 | | - * @} |
156 | | - */ |
157 | | - |
158 | | -/** @defgroup STM324x7I_EVAL_LOW_LEVEL_Private_Functions |
159 | | - * @{ |
160 | | - */ |
161 | | - |
162 | 44 | /** |
163 | 45 | * @brief DeInitializes the SDIO interface. |
164 | 46 | * @param None |
@@ -240,12 +122,21 @@ void SD_LowLevel_Init(void) |
240 | 122 | GPIO_Init(GPIOC, &GPIO_InitStructure); |
241 | 123 |
|
242 | 124 | /*!< Configure SD_SPI_DETECT_PIN pin: SD Card detect pin */ |
243 | | - // dpgeorge: switch is normally open, connected to VDD when card inserted |
| 125 | +#if defined(PYBOARD) |
| 126 | + // dpgeorge: PYBv2-v3: switch is normally open, connected to VDD when card inserted |
244 | 127 | GPIO_InitStructure.GPIO_Pin = SD_DETECT_PIN; |
245 | 128 | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; // needs to be 2MHz due to restrictions on PC13 |
246 | 129 | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; |
247 | 130 | GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN; |
248 | 131 | GPIO_Init(SD_DETECT_GPIO_PORT, &GPIO_InitStructure); |
| 132 | +#elif defined(PYBOARD4) |
| 133 | + // dpgeorge: PYBv4: switch is normally open, connected to GND when card inserted |
| 134 | + GPIO_InitStructure.GPIO_Pin = SD_DETECT_PIN; |
| 135 | + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; |
| 136 | + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; |
| 137 | + GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; |
| 138 | + GPIO_Init(SD_DETECT_GPIO_PORT, &GPIO_InitStructure); |
| 139 | +#endif |
249 | 140 |
|
250 | 141 | /* Enable the SDIO APB2 Clock */ |
251 | 142 | RCC_APB2PeriphClockCmd(RCC_APB2Periph_SDIO, ENABLE); |
@@ -337,26 +228,4 @@ void SD_LowLevel_DMA_RxConfig(uint32_t *BufferDST, uint32_t BufferSize) |
337 | 228 | DMA_Cmd(SD_SDIO_DMA_STREAM, ENABLE); |
338 | 229 | } |
339 | 230 |
|
340 | | - |
341 | | -/** |
342 | | - * @} |
343 | | - */ |
344 | | - |
345 | | - |
346 | | -/** |
347 | | - * @} |
348 | | - */ |
349 | | - |
350 | | -/** |
351 | | - * @} |
352 | | - */ |
353 | | - |
354 | | -/** |
355 | | - * @} |
356 | | - */ |
357 | | - |
358 | | -/** |
359 | | - * @} |
360 | | - */ |
361 | | - |
362 | 231 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
0 commit comments