stm32h747i_discovery.h
Go to the documentation of this file.
1 
24 /* Define to prevent recursive inclusion -------------------------------------*/
25 #ifndef STM32H747I_DISCO_H
26 #define STM32H747I_DISCO_H
27 
28 #ifdef __cplusplus
29  extern "C" {
30 #endif
31 
32 /* Includes ------------------------------------------------------------------*/
35 
36  #if (USE_BSP_COM_FEATURE > 0)
37  #if (USE_COM_LOG > 0)
38  #ifndef __GNUC__
39  #include "stdio.h"
40  #endif
41  #endif
42 #endif
43 
59 typedef enum
60 {
61  LED1 = 0U,
63  LED2 = 1U,
65  LED3 = 2U,
67  LED4 = 3U,
70 } Led_TypeDef;
71 
72 typedef enum
73 {
77 
78 typedef enum
79 {
83 
84 #if (USE_BSP_COM_FEATURE > 0)
85 typedef enum
86 {
87  COM1 = 0U,
88  COMn
89 }COM_TypeDef;
90 
91 typedef enum
92 {
93  COM_STOPBITS_1 = UART_STOPBITS_1,
94  COM_STOPBITS_2 = UART_STOPBITS_2,
95 }COM_StopBitsTypeDef;
96 
97 typedef enum
98 {
99  COM_PARITY_NONE = UART_PARITY_NONE,
100  COM_PARITY_EVEN = UART_PARITY_EVEN,
101  COM_PARITY_ODD = UART_PARITY_ODD,
102 }COM_ParityTypeDef;
103 
104 typedef enum
105 {
106  COM_HWCONTROL_NONE = UART_HWCONTROL_NONE,
107  COM_HWCONTROL_RTS = UART_HWCONTROL_RTS,
108  COM_HWCONTROL_CTS = UART_HWCONTROL_CTS,
109  COM_HWCONTROL_RTS_CTS = UART_HWCONTROL_RTS_CTS,
110 }COM_HwFlowCtlTypeDef;
111 
112 typedef enum
113 {
114  COM_WORDLENGTH_7B = UART_WORDLENGTH_7B,
115  COM_WORDLENGTH_8B = UART_WORDLENGTH_8B,
116  COM_WORDLENGTH_9B = UART_WORDLENGTH_9B,
117 }COM_WordLengthTypeDef;
118 
119 typedef struct
120 {
121  uint32_t BaudRate;
122  COM_WordLengthTypeDef WordLength;
123  COM_StopBitsTypeDef StopBits;
124  COM_ParityTypeDef Parity;
125  COM_HwFlowCtlTypeDef HwFlowCtl;
126 }COM_InitTypeDef;
127 
128 #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
129 typedef struct
130 {
131  void (* pMspInitCb)(UART_HandleTypeDef *);
132  void (* pMspDeInitCb)(UART_HandleTypeDef *);
133 }BSP_COM_Cb_t;
134 #endif /* (USE_HAL_UART_REGISTER_CALLBACKS == 1) */
135 #endif
136 
137 typedef enum
138 {
142 
143 typedef enum
144 {
145  JOY1 = 0U,
147 }JOY_TypeDef;
148 
149 typedef enum
150 {
151  JOY_NONE = 0x00U,
152  JOY_SEL = 0x01U,
153  JOY_DOWN = 0x02U,
154  JOY_LEFT = 0x04U,
155  JOY_RIGHT = 0x08U,
156  JOY_UP = 0x10U,
157  JOY_ALL = 0x1FU
170 #if !defined (USE_STM32H747I_DISCO)
171  #define USE_STM32H747I_DISCO
172 #endif
173 
176 #define STM32H747I_DISCO_BSP_VERSION_MAIN (0x03)
177 #define STM32H747I_DISCO_BSP_VERSION_SUB1 (0x01)
178 #define STM32H747I_DISCO_BSP_VERSION_SUB2 (0x00)
179 #define STM32H747I_DISCO_BSP_VERSION_RC (0x00)
180 #define STM32H747I_DISCO_BSP_VERSION ((STM32H747I_DISCO_BSP_VERSION_MAIN << 24)\
181  |(STM32H747I_DISCO_BSP_VERSION_SUB1 << 16)\
182  |(STM32H747I_DISCO_BSP_VERSION_SUB2 << 8 )\
183  |(STM32H747I_DISCO_BSP_VERSION_RC))
184 #define STM32H747I_DISCO_BSP_BOARD_NAME "STM32H747I-DISCO";
185 #define STM32H747I_DISCO_BSP_BOARD_ID "MB12481D";
186 
190 #define LED1_GPIO_PORT GPIOI
191 #define LED1_PIN GPIO_PIN_12
192 
193 #define LED2_GPIO_PORT GPIOI
194 #define LED2_PIN GPIO_PIN_13
195 
196 #define LED3_GPIO_PORT GPIOI
197 #define LED3_PIN GPIO_PIN_14
198 
199 #define LED4_GPIO_PORT GPIOI
200 #define LED4_PIN GPIO_PIN_15
201 
202 #define LEDx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
203 #define LEDx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
204 
211 /* Button state */
212 #define BUTTON_RELEASED 0U
213 #define BUTTON_PRESSED 1U
214 
217 #define BUTTON_WAKEUP_PIN GPIO_PIN_13
218 #define BUTTON_WAKEUP_GPIO_PORT GPIOC
219 #define BUTTON_WAKEUP_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
220 #define BUTTON_WAKEUP_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
221 #define BUTTON_WAKEUP_EXTI_IRQn EXTI15_10_IRQn
222 #define BUTTON_WAKEUP_EXTI_LINE EXTI_LINE_13
223 
231 #if (USE_BSP_COM_FEATURE > 0)
232 
235 #define COM1_UART USART1
236 #define COM1_CLK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE()
237 #define COM1_CLK_DISABLE() __HAL_RCC_USART1_CLK_DISABLE()
238 
239 #define COM1_TX_PIN GPIO_PIN_9
240 #define COM1_TX_GPIO_PORT GPIOA
241 #define COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
242 #define COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
243 #define COM1_TX_AF GPIO_AF7_USART1
244 
245 #define COM1_RX_PIN GPIO_PIN_10
246 #define COM1_RX_GPIO_PORT GPIOA
247 #define COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
248 #define COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
249 #define COM1_RX_AF GPIO_AF7_USART1
250 #define COM_POLL_TIMEOUT 1000
251 
252 #define MX_UART_InitTypeDef COM_InitTypeDef
253 #endif
254 
261 #define JOY_KEY_NUMBER 5U
262 
263 #define JOY1_SEL_PIN GPIO_PIN_2
264 #define JOY1_SEL_GPIO_PORT GPIOK
265 #define JOY1_SEL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
266 #define JOY1_SEL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
267 #define JOY1_SEL_EXTI_IRQn EXTI2_IRQn
268 #define JOY1_SEL_EXTI_LINE EXTI_LINE_2
269 
270 #define JOY1_DOWN_PIN GPIO_PIN_3
271 #define JOY1_DOWN_GPIO_PORT GPIOK
272 #define JOY1_DOWN_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
273 #define JOY1_DOWN_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
274 #define JOY1_DOWN_EXTI_IRQn EXTI3_IRQn
275 #define JOY1_DOWN_EXTI_LINE EXTI_LINE_3
276 
277 #define JOY1_LEFT_PIN GPIO_PIN_4
278 #define JOY1_LEFT_GPIO_PORT GPIOK
279 #define JOY1_LEFT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
280 #define JOY1_LEFT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
281 #define JOY1_LEFT_EXTI_IRQn EXTI4_IRQn
282 #define JOY1_LEFT_EXTI_LINE EXTI_LINE_4
283 
284 #define JOY1_RIGHT_PIN GPIO_PIN_5
285 #define JOY1_RIGHT_GPIO_PORT GPIOK
286 #define JOY1_RIGHT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
287 #define JOY1_RIGHT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
288 #define JOY1_RIGHT_EXTI_IRQn EXTI9_5_IRQn
289 #define JOY1_RIGHT_EXTI_LINE EXTI_LINE_5
290 
291 #define JOY1_UP_PIN GPIO_PIN_6
292 #define JOY1_UP_GPIO_PORT GPIOK
293 #define JOY1_UP_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
294 #define JOY1_UP_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
295 #define JOY1_UP_EXTI_IRQn EXTI9_5_IRQn
296 #define JOY1_UP_EXTI_LINE EXTI_LINE_6
297 
310 extern USART_TypeDef* COM_USART[];
311 
319 int32_t BSP_GetVersion(void);
320 const uint8_t* BSP_GetBoardName(void);
321 const uint8_t* BSP_GetBoardID(void);
322 
323 int32_t BSP_LED_Init(Led_TypeDef Led);
324 int32_t BSP_LED_DeInit(Led_TypeDef Led);
325 int32_t BSP_LED_On(Led_TypeDef Led);
326 int32_t BSP_LED_Off(Led_TypeDef Led);
327 int32_t BSP_LED_Toggle(Led_TypeDef Led);
328 int32_t BSP_LED_GetState (Led_TypeDef Led);
329 int32_t BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode);
330 int32_t BSP_PB_DeInit(Button_TypeDef Button);
331 int32_t BSP_PB_GetState(Button_TypeDef Button);
332 void BSP_PB_Callback(Button_TypeDef Button);
333 #if (USE_BSP_COM_FEATURE > 0)
334 int32_t BSP_COM_Init(COM_TypeDef COM, COM_InitTypeDef *COM_Init);
335 int32_t BSP_COM_DeInit(COM_TypeDef COM);
336 #if( USE_COM_LOG > 0)
337 int32_t BSP_COM_SelectLogPort (COM_TypeDef COM);
338 #endif
339 
340 #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
341 int32_t BSP_COM_RegisterDefaultMspCallbacks(COM_TypeDef COM);
342 int32_t BSP_COM_RegisterMspCallbacks(COM_TypeDef COM, BSP_COM_Cb_t *Callback);
343 #endif /* USE_HAL_UART_REGISTER_CALLBACKS */
344 HAL_StatusTypeDef MX_USART1_Init(UART_HandleTypeDef *huart, MX_UART_InitTypeDef *COM_Init);
345 #endif
346 
347 
348 int32_t BSP_JOY_Init(JOY_TypeDef JOY, JOYMode_TypeDef JoyMode, JOYPin_TypeDef JoyPins);
349 int32_t BSP_JOY_DeInit(JOY_TypeDef JOY, JOYPin_TypeDef JoyPins);
350 int32_t BSP_JOY_GetState(JOY_TypeDef JOY,uint32_t JoyPin);
351 void BSP_JOY_Callback(JOY_TypeDef JOY, uint32_t JoyPin);
353 
355 void BSP_PB_IRQHandler(Button_TypeDef Button);
372 #ifdef __cplusplus
373 }
374 #endif
375 
376 #endif /* STM32H747I_DISCO_H */
377 
378 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
COM_USART
USART_TypeDef * COM_USART[]
UART_PARITY_ODD
#define UART_PARITY_ODD
Definition: stm32f4xx_hal_uart.h:267
JOY_MODE_EXTI
@ JOY_MODE_EXTI
Definition: stm32h747i_discovery.h:140
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
UART_STOPBITS_2
#define UART_STOPBITS_2
Definition: stm32f4xx_hal_uart.h:257
JOY_TypeDef
JOY_TypeDef
Definition: stm32h747i_discovery.h:143
BSP_LED_DeInit
void BSP_LED_DeInit(Led_TypeDef Led)
DeInit LEDs.
Definition: stm32469i_discovery.c:232
USART_TypeDef
Universal Synchronous Asynchronous Receiver Transmitter.
Definition: stm32f407xx.h:758
BSP_GetBoardID
const uint8_t * BSP_GetBoardID(void)
This method returns the board ID.
Definition: stm32h747i_discovery.c:155
BUTTON_MODE_GPIO
@ BUTTON_MODE_GPIO
Definition: stm32h747i_discovery.h:80
hpb_exti
EXTI_HandleTypeDef hpb_exti[]
Definition: stm32h747i_discovery.c:67
JOY_NONE
@ JOY_NONE
Definition: stm32h747i_discovery.h:151
BSP_JOY_Callback
__weak void BSP_JOY_Callback(JOY_TypeDef JOY, uint32_t JoyPin)
BSP Joystick Callback.
Definition: stm32h747i_discovery.c:798
LED4
@ LED4
Definition: stm32h747i_discovery.h:67
LED_ORANGE
@ LED_ORANGE
Definition: stm32h747i_discovery.h:64
UART_WORDLENGTH_7B
#define UART_WORDLENGTH_7B
Definition: stm32f7xx_hal_uart_ex.h:74
huart
UART_HandleTypeDef huart
Definition: pv_stm32f469.c:31
JOYMode_TypeDef
JOYMode_TypeDef
Definition: stm32h747i_discovery.h:137
__UART_HandleTypeDef
UART handle Structure definition.
Definition: stm32f4xx_hal_uart.h:141
EXTI_HandleTypeDef
EXTI Handle structure definition.
Definition: stm32f7xx_hal_exti.h:53
UART_WORDLENGTH_9B
#define UART_WORDLENGTH_9B
Definition: stm32f4xx_hal_uart.h:248
BSP_PB_Callback
__weak void BSP_PB_Callback(Button_TypeDef Button)
BSP Push Button callback.
Definition: stm32h747i_discovery.c:382
BSP_PB_IRQHandler
void BSP_PB_IRQHandler(Button_TypeDef Button)
This function handles Push-Button interrupt requests.
Definition: stm32h747i_discovery.c:364
BSP_LED_Off
void BSP_LED_Off(Led_TypeDef Led)
Turns selected LED Off.
Definition: stm32f4_discovery.c:211
JOY_DOWN
@ JOY_DOWN
Definition: stm32h747i_discovery.h:153
JOY_RIGHT
@ JOY_RIGHT
Definition: stm32h747i_discovery.h:155
BUTTON_MODE_EXTI
@ BUTTON_MODE_EXTI
Definition: stm32h747i_discovery.h:81
LED2
@ LED2
Definition: stm32h747i_discovery.h:63
ButtonMode_TypeDef
ButtonMode_TypeDef
Definition: stm32f4_discovery.h:76
UART_HWCONTROL_NONE
#define UART_HWCONTROL_NONE
Definition: stm32f4xx_hal_uart.h:275
JOY_SEL
@ JOY_SEL
Definition: stm32h747i_discovery.h:152
UART_PARITY_EVEN
#define UART_PARITY_EVEN
Definition: stm32f4xx_hal_uart.h:266
BSP_GetVersion
uint32_t BSP_GetVersion(void)
This method returns the STM32F4 DISCO BSP Driver revision.
Definition: stm32f4_discovery.c:156
LED_RED
@ LED_RED
Definition: stm32h747i_discovery.h:66
stm32h747i_discovery_errno.h
LED1
@ LED1
Definition: stm32h747i_discovery.h:61
BSP_LED_On
void BSP_LED_On(Led_TypeDef Led)
Turns selected LED On.
Definition: stm32f4_discovery.c:197
BSP_PB_GetState
uint32_t BSP_PB_GetState(Button_TypeDef Button)
Returns the selected Button state.
Definition: stm32f4_discovery.c:287
stm32h747i_discovery_conf.h
Button_TypeDef
Button_TypeDef
Definition: stm32h747i_discovery.h:72
JOYn
@ JOYn
Definition: stm32h747i_discovery.h:146
UART_HWCONTROL_CTS
#define UART_HWCONTROL_CTS
Definition: stm32f4xx_hal_uart.h:277
JOY_LEFT
@ JOY_LEFT
Definition: stm32h747i_discovery.h:154
UART_HWCONTROL_RTS_CTS
#define UART_HWCONTROL_RTS_CTS
Definition: stm32f4xx_hal_uart.h:278
JOY_MODE_GPIO
@ JOY_MODE_GPIO
Definition: stm32h747i_discovery.h:139
ButtonMode_TypeDef
ButtonMode_TypeDef
Definition: stm32h747i_discovery.h:78
UART_WORDLENGTH_8B
#define UART_WORDLENGTH_8B
Definition: stm32f4xx_hal_uart.h:247
BSP_LED_GetState
int32_t BSP_LED_GetState(Led_TypeDef Led)
Get the selected LED state.
Definition: stm32h747i_discovery.c:275
LED3
@ LED3
Definition: stm32h747i_discovery.h:65
BSP_JOY_Init
int32_t BSP_JOY_Init(JOY_TypeDef JOY, JOYMode_TypeDef JoyMode, JOYPin_TypeDef JoyPins)
Configures joystick GPIO and EXTI modes.
Definition: stm32h747i_discovery.c:599
Button_TypeDef
Button_TypeDef
Definition: stm32f4_discovery.h:71
LED_GREEN
@ LED_GREEN
Definition: stm32h747i_discovery.h:62
BSP_JOY_DeInit
int32_t BSP_JOY_DeInit(JOY_TypeDef JOY, JOYPin_TypeDef JoyPins)
DeInit joystick GPIOs.
Definition: stm32h747i_discovery.c:696
JOY1
@ JOY1
Definition: stm32h747i_discovery.h:145
Led_TypeDef
Led_TypeDef
Definition: stm32f4_discovery.h:63
BUTTONn
@ BUTTONn
Definition: stm32h747i_discovery.h:75
JOY_ALL
@ JOY_ALL
Definition: stm32h747i_discovery.h:157
UART_HWCONTROL_RTS
#define UART_HWCONTROL_RTS
Definition: stm32f4xx_hal_uart.h:276
JOY_UP
@ JOY_UP
Definition: stm32h747i_discovery.h:156
BSP_PB_DeInit
void BSP_PB_DeInit(Button_TypeDef Button)
Push Button DeInit.
Definition: stm32469i_discovery.c:354
Led_TypeDef
Led_TypeDef
Definition: stm32h747i_discovery.h:59
LED_BLUE
@ LED_BLUE
Definition: stm32h747i_discovery.h:68
UART_PARITY_NONE
#define UART_PARITY_NONE
Definition: stm32f4xx_hal_uart.h:265
BSP_LED_Toggle
void BSP_LED_Toggle(Led_TypeDef Led)
Toggles the selected LED.
Definition: stm32f4_discovery.c:225
JOYPin_TypeDef
JOYPin_TypeDef
Definition: stm32h747i_discovery.h:149
BSP_GetBoardName
const uint8_t * BSP_GetBoardName(void)
This method returns the board name.
Definition: stm32h747i_discovery.c:146
BSP_JOY_IRQHandler
void BSP_JOY_IRQHandler(JOY_TypeDef JOY, JOYPin_TypeDef JoyPin)
This function handles JOY keys interrupt request.
Definition: stm32h747i_discovery.c:784
BUTTON_WAKEUP
@ BUTTON_WAKEUP
Definition: stm32h747i_discovery.h:74
BSP_LED_Init
void BSP_LED_Init(Led_TypeDef Led)
Configures LED GPIO.
Definition: stm32f4_discovery.c:170
hcom_uart
UART_HandleTypeDef hcom_uart[]
UART_STOPBITS_1
#define UART_STOPBITS_1
Definition: stm32f4xx_hal_uart.h:256
LEDn
@ LEDn
Definition: stm32h747i_discovery.h:69
BSP_JOY_GetState
int32_t BSP_JOY_GetState(JOY_TypeDef JOY, uint32_t JoyPin)
Returns the current joystick status.
Definition: stm32h747i_discovery.c:753
BSP_PB_Init
void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Mode)
Configures Button GPIO and EXTI Line.
Definition: stm32f4_discovery.c:248


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:54