Go to the documentation of this file.
38 #ifndef __STM32F411E_DISCOVERY_H
39 #define __STM32F411E_DISCOVERY_H
46 #include "stm32f4xx_hal.h"
92 #if !defined (USE_STM32F411E_DISCO)
93 #define USE_STM32F411E_DISCO
101 #define LED4_PIN GPIO_PIN_12
102 #define LED4_GPIO_PORT GPIOD
103 #define LED4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
104 #define LED4_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
107 #define LED3_PIN GPIO_PIN_13
108 #define LED3_GPIO_PORT GPIOD
109 #define LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
110 #define LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
113 #define LED5_PIN GPIO_PIN_14
114 #define LED5_GPIO_PORT GPIOD
115 #define LED5_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
116 #define LED5_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
119 #define LED6_PIN GPIO_PIN_15
120 #define LED6_GPIO_PORT GPIOD
121 #define LED6_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
122 #define LED6_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
124 #define LEDx_GPIO_CLK_ENABLE(__INDEX__) do{if((__INDEX__) == 0) LED4_GPIO_CLK_ENABLE(); else \
125 if((__INDEX__) == 1) LED3_GPIO_CLK_ENABLE(); else \
126 if((__INDEX__) == 2) LED5_GPIO_CLK_ENABLE(); else \
127 if((__INDEX__) == 3) LED6_GPIO_CLK_ENABLE(); \
130 #define LEDx_GPIO_CLK_DISABLE(__INDEX__) do{if((__INDEX__) == 0) LED4_GPIO_CLK_DISABLE(); else \
131 if((__INDEX__) == 1) LED3_GPIO_CLK_DISABLE(); else \
132 if((__INDEX__) == 2) LED5_GPIO_CLK_DISABLE(); else \
133 if((__INDEX__) == 3) LED6_GPIO_CLK_DISABLE(); \
147 #define KEY_BUTTON_PIN GPIO_PIN_0
148 #define KEY_BUTTON_GPIO_PORT GPIOA
149 #define KEY_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
150 #define KEY_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
151 #define KEY_BUTTON_EXTI_IRQn EXTI0_IRQn
153 #define BUTTONx_GPIO_CLK_ENABLE(__INDEX__) do{if((__INDEX__) == 0) KEY_BUTTON_GPIO_CLK_ENABLE(); \
155 #define BUTTONx_GPIO_CLK_DISABLE(__INDEX__) do{if((__INDEX__) == 0) KEY_BUTTON_GPIO_CLK_DISABLE(); \
166 #define DISCOVERY_I2Cx I2C1
167 #define DISCOVERY_I2Cx_CLOCK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
168 #define DISCOVERY_I2Cx_GPIO_PORT GPIOB
169 #define DISCOVERY_I2Cx_SCL_PIN GPIO_PIN_6
170 #define DISCOVERY_I2Cx_SDA_PIN GPIO_PIN_9
171 #define DISCOVERY_I2Cx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
172 #define DISCOVERY_I2Cx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
173 #define DISCOVERY_I2Cx_AF GPIO_AF4_I2C1
175 #define DISCOVERY_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
176 #define DISCOVERY_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
179 #define DISCOVERY_I2Cx_EV_IRQn I2C1_EV_IRQn
180 #define DISCOVERY_I2Cx_ER_IRQn I2C1_ER_IRQn
183 #define I2Cx_TIMEOUT_MAX 0xA000
184 #define I2Cx_MAX_COMMUNICATION_FREQ ((uint32_t) 100000)
187 #define DISCOVERY_SPIx SPI1
188 #define DISCOVERY_SPIx_CLOCK_ENABLE() __HAL_RCC_SPI1_CLK_ENABLE()
189 #define DISCOVERY_SPIx_GPIO_PORT GPIOA
190 #define DISCOVERY_SPIx_AF GPIO_AF5_SPI1
191 #define DISCOVERY_SPIx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
192 #define DISCOVERY_SPIx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
193 #define DISCOVERY_SPIx_SCK_PIN GPIO_PIN_5
194 #define DISCOVERY_SPIx_MISO_PIN GPIO_PIN_6
195 #define DISCOVERY_SPIx_MOSI_PIN GPIO_PIN_7
201 #define SPIx_TIMEOUT_MAX ((uint32_t)0x1000)
205 #define READWRITE_CMD ((uint8_t)0x80)
207 #define MULTIPLEBYTE_CMD ((uint8_t)0x40)
209 #define DUMMY_BYTE ((uint8_t)0x00)
212 #define GYRO_CS_LOW() HAL_GPIO_WritePin(GYRO_CS_GPIO_PORT, GYRO_CS_PIN, GPIO_PIN_RESET)
213 #define GYRO_CS_HIGH() HAL_GPIO_WritePin(GYRO_CS_GPIO_PORT, GYRO_CS_PIN, GPIO_PIN_SET)
218 #define GYRO_CS_GPIO_PORT GPIOE
219 #define GYRO_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
220 #define GYRO_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
221 #define GYRO_CS_PIN GPIO_PIN_3
223 #define GYRO_INT_GPIO_PORT GPIOE
224 #define GYRO_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
225 #define GYRO_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
226 #define GYRO_INT1_PIN GPIO_PIN_0
227 #define GYRO_INT1_EXTI_IRQn EXTI0_IRQn
228 #define GYRO_INT2_PIN GPIO_PIN_1
229 #define GYRO_INT2_EXTI_IRQn EXTI1_IRQn
236 #define AUDIO_I2C_ADDRESS 0x94
239 #define CODEC_AUDIO_POWER_OFF() HAL_GPIO_WritePin(AUDIO_RESET_GPIO, AUDIO_RESET_PIN, GPIO_PIN_RESET)
240 #define CODEC_AUDIO_POWER_ON() HAL_GPIO_WritePin(AUDIO_RESET_GPIO, AUDIO_RESET_PIN, GPIO_PIN_SET)
243 #define AUDIO_RESET_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
244 #define AUDIO_RESET_PIN GPIO_PIN_4
245 #define AUDIO_RESET_GPIO GPIOD
254 #define ACCELERO_DRDY_GPIO_PORT GPIOE
255 #define ACCELERO_DRDY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
256 #define ACCELERO_DRDY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
257 #define ACCELERO_DRDY_PIN GPIO_PIN_2
258 #define ACCELERO_DRDY_EXTI_IRQn TAMP_STAMP_IRQn
260 #define ACCELERO_INT_GPIO_PORT GPIOE
261 #define ACCELERO_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
262 #define ACCELERO_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
263 #define ACCELERO_INT1_PIN GPIO_PIN_4
264 #define ACCELERO_INT1_EXTI_IRQn EXTI4_IRQn
265 #define ACCELERO_INT2_PIN GPIO_PIN_5
266 #define ACCELERO_INT2_EXTI_IRQn EXTI9_5_IRQn
void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
Configures Button GPIO and EXTI Line.
uint32_t BSP_PB_GetState(Button_TypeDef Button)
Returns the selected Button state.
uint32_t BSP_GetVersion(void)
This method returns the STM32F4 DISCO BSP Driver revision.
void BSP_LED_Toggle(Led_TypeDef Led)
Toggles the selected LED.
void BSP_LED_Off(Led_TypeDef Led)
Turns selected LED Off.
void BSP_LED_Init(Led_TypeDef Led)
Configures LED GPIO.
void BSP_LED_On(Led_TypeDef Led)
Turns selected LED On.