stm32h747i_discovery.c
Go to the documentation of this file.
1 
24 /* Includes ------------------------------------------------------------------*/
25 #include "stm32h747i_discovery.h"
26 
42 typedef void (* BSP_EXTI_LineCallback) (void);
50  static void BUTTON_WAKEUP_EXTI_Callback(void);
51  #if (USE_BSP_COM_FEATURE > 0)
52 static void USART1_MspInit(UART_HandleTypeDef *huart);
53 static void USART1_MspDeInit(UART_HandleTypeDef *huart);
54 #endif
55 static void JOY1_UP_EXTI_Callback(void);
56 static void JOY1_DOWN_EXTI_Callback(void);
57 static void JOY1_LEFT_EXTI_Callback(void);
58 static void JOY1_RIGHT_EXTI_Callback(void);
59 static void JOY1_SEL_EXTI_Callback(void);
68 #if (USE_BSP_COM_FEATURE > 0)
70 USART_TypeDef* COM_USART[COMn] = {COM1_UART};
71 #endif
72 
84 
85 static const uint32_t LED_PIN[LEDn] = { LED1_PIN,
86  LED2_PIN,
87  LED3_PIN,
88  LED4_PIN};
89 
91 static const uint16_t BUTTON_PIN[BUTTONn] = {BUTTON_WAKEUP_PIN};
93 
94 #if (USE_COM_LOG > 0)
95 static COM_TypeDef COM_ActiveLogPort = COM1;
96 #endif
97 #if (USE_BSP_COM_FEATURE > 0)
98  #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
99  static uint32_t IsComMspCbValid[COMn] = {0};
100  #endif
101 #endif
102 
103 static uint32_t JoyPinsMask;
109  };
110 
111 static const uint16_t JOY1_PIN[JOY_KEY_NUMBER] = {JOY1_SEL_PIN,
116  };
117 
123  };
137 int32_t BSP_GetVersion(void)
138 {
139  return (int32_t)STM32H747I_DISCO_BSP_VERSION;
140 }
141 
146 const uint8_t* BSP_GetBoardName(void)
147 {
148  return (uint8_t*)STM32H747I_DISCO_BSP_BOARD_NAME;
149 }
150 
155 const uint8_t* BSP_GetBoardID(void)
156 {
157  return (uint8_t*)STM32H747I_DISCO_BSP_BOARD_ID;
158 }
159 
171 {
172  int32_t ret = BSP_ERROR_NONE;
173  GPIO_InitTypeDef GPIO_InitStruct;
174 
175  /* Enable the GPIO_LED clock */
177 
178  /* Configure the GPIO_LED pin */
179  GPIO_InitStruct.Pin = LED_PIN[Led];
180  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
181  GPIO_InitStruct.Pull = GPIO_PULLUP;
182  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
183 
184  HAL_GPIO_Init(LED_PORT[Led], &GPIO_InitStruct);
185 
186  /* By default, turn off LED */
188  return ret;
189 }
190 
202 {
203  int32_t ret = BSP_ERROR_NONE;
204  GPIO_InitTypeDef gpio_init_structure;
205 
206  /* DeInit the GPIO_LED pin */
207  gpio_init_structure.Pin = LED_PIN [Led];
208  /* Turn off LED */
209  HAL_GPIO_WritePin (LED_PORT [Led], (uint16_t)LED_PIN[Led], GPIO_PIN_SET);
210  HAL_GPIO_DeInit (LED_PORT [Led], gpio_init_structure.Pin);
211  return ret;
212 }
213 
225 {
226  int32_t ret = BSP_ERROR_NONE;
227 
228  HAL_GPIO_WritePin (LED_PORT [Led], (uint16_t)LED_PIN [Led], GPIO_PIN_RESET);
229  return ret;
230 }
231 
243 {
244  int32_t ret = BSP_ERROR_NONE;
245  HAL_GPIO_WritePin (LED_PORT [Led], (uint16_t)LED_PIN [Led], GPIO_PIN_SET);
246  return ret;
247 }
248 
260 {
261  int32_t ret = BSP_ERROR_NONE;
262  HAL_GPIO_TogglePin(LED_PORT[Led], (uint16_t)LED_PIN[Led]);
263  return ret;
264 }
276 {
277  int32_t ret = BSP_ERROR_NONE;
278  ret = (int32_t)HAL_GPIO_ReadPin (LED_PORT [Led], (uint16_t)LED_PIN [Led]);
279  return ret;
280 }
293 int32_t BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
294 {
295  GPIO_InitTypeDef gpio_init_structure;
297  static uint32_t BSP_BUTTON_PRIO [BUTTONn] ={BSP_BUTTON_WAKEUP_IT_PRIORITY};
298  static const uint32_t BUTTON_EXTI_LINE[BUTTONn] ={BUTTON_WAKEUP_EXTI_LINE};
299  /* Enable the BUTTON clock*/
301  gpio_init_structure.Pin = BUTTON_PIN [Button];
302  gpio_init_structure.Pull = GPIO_NOPULL;
303  gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
304 
305  if(ButtonMode == BUTTON_MODE_GPIO)
306  {
307  /* Configure Button pin as input */
308  gpio_init_structure.Mode = GPIO_MODE_INPUT;
309  HAL_GPIO_Init(BUTTON_PORT [Button], &gpio_init_structure);
310  }
311  else /* (ButtonMode == BUTTON_MODE_EXTI) */
312  {
313  /* Configure Button pin as input with External interrupt */
314  gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
315 
316  HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
317 
318  (void)HAL_EXTI_GetHandle(&hpb_exti[Button], BUTTON_EXTI_LINE[Button]);
319  (void)HAL_EXTI_RegisterCallback(&hpb_exti[Button], HAL_EXTI_COMMON_CB_ID, ButtonCallback[Button]);
320 
321  /* Enable and set Button EXTI Interrupt to the lowest priority */
322  HAL_NVIC_SetPriority((BUTTON_IRQn[Button]), BSP_BUTTON_PRIO[Button], 0x00);
323  HAL_NVIC_EnableIRQ((BUTTON_IRQn[Button]));
324  }
325  return BSP_ERROR_NONE;
326 }
327 
337 {
338  GPIO_InitTypeDef gpio_init_structure;
339 
340  gpio_init_structure.Pin = BUTTON_PIN[Button];
342  HAL_GPIO_DeInit(BUTTON_PORT[Button], gpio_init_structure.Pin);
343 
344  return BSP_ERROR_NONE;
345 }
346 
355 {
356  return HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
357 }
358 
365 {
366  HAL_EXTI_IRQHandler(&hpb_exti[Button]);
367 }
368 
374 {
376 }
382 __weak void BSP_PB_Callback(Button_TypeDef Button)
383 {
384  /* Prevent unused argument(s) compilation warning */
385  UNUSED(Button);
386  /* This function should be implemented by the user application.
387  It is called into this driver when an event on Button is triggered. */
388 }
389 
390 #if (USE_BSP_COM_FEATURE > 0)
391 
399 int32_t BSP_COM_Init(COM_TypeDef COM, COM_InitTypeDef *COM_Init)
400 {
401  int32_t ret = BSP_ERROR_NONE;
402 
403  if(COM >= COMn)
404  {
405  ret = BSP_ERROR_WRONG_PARAM;
406  }
407  else
408  {
409  /* Init the UART Msp */
410 #if (USE_HAL_UART_REGISTER_CALLBACKS == 0)
411  USART1_MspInit(&hcom_uart[COM]);
412 #else
413  if(IsComMspCbValid[COM] == 0U)
414  {
415  if(BSP_COM_RegisterDefaultMspCallbacks(COM) != BSP_ERROR_NONE)
416  {
417  return BSP_ERROR_MSP_FAILURE;
418  }
419  }
420 #endif
421 
422  if(MX_USART1_Init(&hcom_uart[COM], COM_Init) != HAL_OK)
423  {
425  }
426  }
427 
428  return ret;
429 }
430 
437 int32_t BSP_COM_DeInit(COM_TypeDef COM)
438 {
439  int32_t ret = BSP_ERROR_NONE;
440 
441  if(COM >= COMn)
442  {
443  ret = BSP_ERROR_WRONG_PARAM;
444  }
445  else
446  {
447  /* USART configuration */
448  hcom_uart[COM].Instance = COM_USART[COM];
449 
450 #if (USE_HAL_UART_REGISTER_CALLBACKS == 0)
451  USART1_MspDeInit(&hcom_uart[COM]);
452 #endif /* (USE_HAL_UART_REGISTER_CALLBACKS == 0) */
453 
454  if(HAL_UART_DeInit(&hcom_uart[COM]) != HAL_OK)
455  {
457  }
458  }
459 
460  return ret;
461 }
462 
470 __weak HAL_StatusTypeDef MX_USART1_Init(UART_HandleTypeDef *huart, MX_UART_InitTypeDef *COM_Init)
471 {
472  /* USART configuration */
473  huart->Instance = COM_USART[COM1];
474  huart->Init.BaudRate = (uint32_t)COM_Init->BaudRate;
476  huart->Init.Parity = (uint32_t)COM_Init->Parity;
477  huart->Init.WordLength = (uint32_t)COM_Init->WordLength;
478  huart->Init.StopBits = (uint32_t)COM_Init->StopBits;
479  huart->Init.HwFlowCtl = (uint32_t)COM_Init->HwFlowCtl;
481 
482  return HAL_UART_Init(huart);
483 }
484 
485 #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
486 
491 int32_t BSP_COM_RegisterDefaultMspCallbacks(COM_TypeDef COM)
492 {
493  int32_t ret = BSP_ERROR_NONE;
494 
495  if(COM >= COMn)
496  {
497  ret = BSP_ERROR_WRONG_PARAM;
498  }
499  else
500  {
502 
503  /* Register default MspInit/MspDeInit Callback */
504  if(HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPINIT_CB_ID, USART1_MspInit) != HAL_OK)
505  {
507  }
508  else if(HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPDEINIT_CB_ID, USART1_MspDeInit) != HAL_OK)
509  {
511  }
512  else
513  {
514  IsComMspCbValid[COM] = 1U;
515  }
516  }
517 
518  /* BSP status */
519  return ret;
520 }
521 
528 int32_t BSP_COM_RegisterMspCallbacks(COM_TypeDef COM, BSP_COM_Cb_t *Callback)
529 {
530  int32_t ret = BSP_ERROR_NONE;
531 
532  if(COM >= COMn)
533  {
534  ret = BSP_ERROR_WRONG_PARAM;
535  }
536  else
537  {
539 
540  /* Register MspInit/MspDeInit Callbacks */
541  if(HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPINIT_CB_ID, Callback->pMspInitCb) != HAL_OK)
542  {
544  }
545  else if(HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPDEINIT_CB_ID, Callback->pMspDeInitCb) != HAL_OK)
546  {
548  }
549  else
550  {
551  IsComMspCbValid[COM] = 1U;
552  }
553  }
554 
555  /* BSP status */
556  return ret;
557 }
558 #endif /* USE_HAL_UART_REGISTER_CALLBACKS */
559 
560 #if (USE_COM_LOG > 0)
561 
567 int32_t BSP_COM_SelectLogPort(COM_TypeDef COM)
568 {
569  if(COM_ActiveLogPort != COM)
570  {
571  COM_ActiveLogPort = COM;
572  }
573  return BSP_ERROR_NONE;
574 }
575 
576  #ifdef __GNUC__
577  int __io_putchar (int ch)
578  #else
579  int fputc (int ch, FILE *f)
580  #endif /* __GNUC__ */
581 {
582  (void)HAL_UART_Transmit (&hcom_uart [COM_ActiveLogPort], (uint8_t *) &ch, 1, COM_POLL_TIMEOUT);
583  return ch;
584 }
585 #endif /* USE_COM_LOG */
586 #endif /* USE_BSP_COM_FEATURE */
587 
600 {
601  int32_t ret = BSP_ERROR_NONE;
602  uint32_t joykey, key_pressed;
603  GPIO_InitTypeDef gpio_init_structure;
604 
610  };
611  static const uint32_t JOY_EXTI_LINE[JOY_KEY_NUMBER] = {JOY1_SEL_EXTI_LINE,
616  };
617  static uint32_t BSP_JOY_PRIO [JOY_KEY_NUMBER] ={BSP_JOY1_SEL_IT_PRIORITY,
622  };
623 
624  /* Store Joystick pins initialized */
625  JoyPinsMask |= (uint32_t)JoyPins;
626 
627  /* Initialized the Joystick. */
628  for(joykey = 0U; joykey < JOY_KEY_NUMBER ; joykey++)
629  {
630  key_pressed = 1UL << joykey;
631  if((key_pressed & (uint32_t)JoyPins) == key_pressed)
632  {
633  if(JOY == JOY1)
634  {
635  /* Enable the JOY clock */
636  if(key_pressed == (uint32_t)JOY_SEL)
637  {
639  }
640  else if(key_pressed == (uint32_t)JOY_DOWN)
641  {
643  }
644  else if(key_pressed == (uint32_t) JOY_LEFT)
645  {
647  }
648  else if(key_pressed == (uint32_t) JOY_RIGHT)
649  {
651  }
652  else
653  {
654  if(key_pressed == (uint32_t) JOY_UP)
655  {
657  }
658  }
659 
660  gpio_init_structure.Pin = JOY1_PIN[joykey];
661  gpio_init_structure.Pull = GPIO_PULLUP;
662  gpio_init_structure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
663 
664  if (JoyMode == JOY_MODE_GPIO)
665  {
666  /* Configure Joy pin as input */
667  gpio_init_structure.Mode = GPIO_MODE_INPUT;
668  HAL_GPIO_Init(JOY1_PORT[joykey], &gpio_init_structure);
669  }
670  else /*(JoyMode == JOY_MODE_EXTI)*/
671  {
672  /* Configure Joy pin as input with External interrupt */
673  gpio_init_structure.Mode = GPIO_MODE_IT_RISING_FALLING;
674  HAL_GPIO_Init(JOY1_PORT[joykey], &gpio_init_structure);
675 
676  (void)HAL_EXTI_GetHandle(&hjoy_exti[joykey], JOY_EXTI_LINE[joykey]);
677  (void)HAL_EXTI_RegisterCallback(&hjoy_exti[joykey], HAL_EXTI_COMMON_CB_ID, JoyCallback[joykey]);
678 
679  /* Enable and set Joy EXTI Interrupt to the lowest priority */
680  HAL_NVIC_SetPriority((IRQn_Type)(JOY1_IRQn[joykey]), BSP_JOY_PRIO[joykey], 0x00);
682  }
683  }
684  }
685  }
686 
687  return ret;
688 }
697 {
698  uint32_t joykey, key_pressed;
699 
700  /* Store Joystick pins initialized */
701  JoyPinsMask &= (uint32_t)JoyPins;
702 
703  /* Initialized the Joystick. */
704  for(joykey = 0U; joykey < JOY_KEY_NUMBER ; joykey++)
705  {
706  key_pressed = 1UL << joykey;
707  if((key_pressed & (uint32_t)JoyPins) == key_pressed)
708  {
709  if(JOY == JOY1)
710  {
711  /* Disable the JOY clock */
712  switch(key_pressed)
713  {
714  case JOY_SEL:
716  break;
717 
718  case JOY_DOWN:
720  break;
721 
722  case JOY_LEFT:
724  break;
725 
726  case JOY_RIGHT:
728  break;
729 
730  case JOY_UP:
732  break;
733  default:
734  break;
735  }
736  HAL_GPIO_DeInit(JOY1_PORT[joykey], JOY1_PIN[joykey]);
737  }
738  }
739  }
740  return BSP_ERROR_NONE;
741 }
753 int32_t BSP_JOY_GetState(JOY_TypeDef JOY,uint32_t JoyPin)
754 {
755 
756  uint32_t joykey, key_pressed;
757  for (joykey = 0U; joykey < JOY_KEY_NUMBER ; joykey++)
758  {
759  key_pressed = 1UL << joykey;
760  if((key_pressed & JoyPinsMask) == key_pressed)
761  {
762  if(JOY == JOY1)
763  {
764  if (HAL_GPIO_ReadPin(JOY1_PORT[joykey], JOY1_PIN[joykey]) != GPIO_PIN_RESET)
765  {
766  /* Return Code Joystick key pressed */
767  return (int32_t)key_pressed;
768  }
769  }
770  }
771  }
772  /* No Joystick key pressed */
773  return (int32_t)JOY_NONE;
774 
775 }
776 
777 
785 {
786  if(JOY == JOY1)
787  {
789  }
790 }
791 
798 __weak void BSP_JOY_Callback(JOY_TypeDef JOY, uint32_t JoyPin)
799 {
800  /* Prevent unused argument(s) compilation warning */
801  UNUSED(JOY);
802  UNUSED(JoyPin);
803 
804  /* This function should be implemented by the user application.
805  It is called into this driver when an event on JoyPin is triggered. */
806 }
818 static void JOY1_UP_EXTI_Callback(void)
819 {
821 }
822 
827 static void JOY1_DOWN_EXTI_Callback(void)
828 {
830 }
831 
836 static void JOY1_SEL_EXTI_Callback(void)
837 {
839 }
840 
845 static void JOY1_LEFT_EXTI_Callback(void)
846 {
848 }
849 
854 static void JOY1_RIGHT_EXTI_Callback(void)
855 {
857 }
858 
859 
860 
861 #if (USE_BSP_COM_FEATURE > 0)
862 
867 static void USART1_MspInit(UART_HandleTypeDef *huart)
868 {
869  GPIO_InitTypeDef gpio_init_structure;
870 
871  /* Prevent unused argument(s) compilation warning */
872  UNUSED(huart);
873 
874  /* Enable GPIO clock */
875  COM1_TX_GPIO_CLK_ENABLE();
876  COM1_RX_GPIO_CLK_ENABLE();
877 
878  /* Enable USART clock */
879  COM1_CLK_ENABLE();
880 
881  /* Configure USART Tx as alternate function */
882  gpio_init_structure.Pin = COM1_TX_PIN;
883  gpio_init_structure.Mode = GPIO_MODE_AF_PP;
884  gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
885  gpio_init_structure.Pull = GPIO_PULLUP;
886  gpio_init_structure.Alternate = COM1_TX_AF;
887  HAL_GPIO_Init(COM1_TX_GPIO_PORT, &gpio_init_structure);
888 
889  /* Configure USART Rx as alternate function */
890  gpio_init_structure.Pin = COM1_RX_PIN;
891  gpio_init_structure.Mode = GPIO_MODE_AF_PP;
892  gpio_init_structure.Alternate = COM1_RX_AF;
893  HAL_GPIO_Init(COM1_RX_GPIO_PORT, &gpio_init_structure);
894 }
895 
901 static void USART1_MspDeInit(UART_HandleTypeDef *huart)
902 {
903  GPIO_InitTypeDef gpio_init_structure;
904 
905  /* Prevent unused argument(s) compilation warning */
906  UNUSED(huart);
907 
908  /* COM GPIO pin configuration */
909  gpio_init_structure.Pin = COM1_TX_PIN;
910  HAL_GPIO_DeInit(COM1_TX_GPIO_PORT, gpio_init_structure.Pin);
911 
912  gpio_init_structure.Pin = COM1_RX_PIN;
913  HAL_GPIO_DeInit(COM1_RX_GPIO_PORT, gpio_init_structure.Pin);
914 
915  /* Disable USART clock */
916  COM1_CLK_DISABLE();
917 }
918 #endif /* USE_BSP_COM_FEATURE */
919 
936 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
937 
BSP_JOY1_DOWN_IT_PRIORITY
#define BSP_JOY1_DOWN_IT_PRIORITY
Definition: stm32h747i_discovery_conf.h:69
COM_USART
USART_TypeDef * COM_USART[]
JOY1_SEL_GPIO_CLK_DISABLE
#define JOY1_SEL_GPIO_CLK_DISABLE()
Definition: stm32h747i_discovery.h:266
BSP_LED_Init
int32_t BSP_LED_Init(Led_TypeDef Led)
Configures LED on GPIO.
Definition: stm32h747i_discovery.c:170
JOY1_DOWN_EXTI_IRQn
#define JOY1_DOWN_EXTI_IRQn
Definition: stm32h747i_discovery.h:274
BSP_LED_Toggle
int32_t BSP_LED_Toggle(Led_TypeDef Led)
Toggles the selected LED.
Definition: stm32h747i_discovery.c:259
LED1_PIN
#define LED1_PIN
Definition: stm32469i_discovery.h:156
GPIO_MODE_AF_PP
#define GPIO_MODE_AF_PP
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:122
LED2_GPIO_PORT
#define LED2_GPIO_PORT
Definition: stm32469i_discovery.h:143
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
JOY1_SEL_GPIO_PORT
#define JOY1_SEL_GPIO_PORT
Definition: stm32h747i_discovery.h:264
JOY1_IRQn
static const IRQn_Type JOY1_IRQn[JOY_KEY_NUMBER]
Definition: stm32h747i_discovery.c:118
JOY1_SEL_EXTI_Callback
static void JOY1_SEL_EXTI_Callback(void)
JOY1 SEL EXTI line detection callbacks.
Definition: stm32h747i_discovery.c:836
__UART_HandleTypeDef::Init
UART_InitTypeDef Init
Definition: stm32f4xx_hal_uart.h:145
BSP_EXTI_LineCallback
void(* BSP_EXTI_LineCallback)(void)
Definition: stm32h747i_discovery.c:42
JOY_TypeDef
JOY_TypeDef
Definition: stm32h747i_discovery.h:143
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
__io_putchar
int __io_putchar(uint8_t ch)
Definition: pv_st_f407.c:95
HAL_NVIC_EnableIRQ
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
JOY1_DOWN_GPIO_CLK_DISABLE
#define JOY1_DOWN_GPIO_CLK_DISABLE()
Definition: stm32h747i_discovery.h:273
BUTTON_MODE_GPIO
@ BUTTON_MODE_GPIO
Definition: stm32f4_discovery.h:78
HAL_UART_Transmit
HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout)
JOY1_RIGHT_EXTI_IRQn
#define JOY1_RIGHT_EXTI_IRQn
Definition: stm32h747i_discovery.h:288
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
JOY1_SEL_PIN
#define JOY1_SEL_PIN
Definition: stm32h747i_discovery.h:263
GPIO_SPEED_FREQ_HIGH
#define GPIO_SPEED_FREQ_HIGH
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:144
GPIO_InitTypeDef
GPIO Init structure definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:47
JOY1_UP_PIN
#define JOY1_UP_PIN
Definition: stm32h747i_discovery.h:291
__HAL_UART_RESET_HANDLE_STATE
#define __HAL_UART_RESET_HANDLE_STATE(__HANDLE__)
Reset UART handle gstate & RxState.
Definition: stm32f4xx_hal_uart.h:395
LEDx_GPIO_CLK_ENABLE
#define LEDx_GPIO_CLK_ENABLE(__INDEX__)
Definition: stm32f4_discovery.h:121
stm32h747i_discovery.h
This file contains definitions for STM32H747I_DISCO: LEDs push-buttons COM ports hardware resources.
huart
UART_HandleTypeDef huart
Definition: pv_stm32f469.c:31
GPIO_InitTypeDef::Alternate
uint32_t Alternate
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:61
UART_InitTypeDef::OverSampling
uint32_t OverSampling
Definition: stm32f4xx_hal_uart.h:74
LED4_PIN
#define LED4_PIN
Definition: stm32f4_discovery.h:101
HAL_NVIC_DisableIRQ
void HAL_NVIC_DisableIRQ(IRQn_Type IRQn)
BSP_LED_On
int32_t BSP_LED_On(Led_TypeDef Led)
Turns selected LED On.
Definition: stm32h747i_discovery.c:224
JOY1_UP_EXTI_IRQn
#define JOY1_UP_EXTI_IRQn
Definition: stm32h747i_discovery.h:295
GPIO_PIN_SET
@ GPIO_PIN_SET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:71
JOYMode_TypeDef
JOYMode_TypeDef
Definition: stm32h747i_discovery.h:137
UART_InitTypeDef::WordLength
uint32_t WordLength
Definition: stm32f4xx_hal_uart.h:55
__UART_HandleTypeDef
UART handle Structure definition.
Definition: stm32f4xx_hal_uart.h:141
EXTI_HandleTypeDef
EXTI Handle structure definition.
Definition: stm32f7xx_hal_exti.h:53
BSP_ERROR_NONE
#define BSP_ERROR_NONE
Definition: stm32h747i_discovery_errno.h:30
UART_InitTypeDef::BaudRate
uint32_t BaudRate
Definition: stm32f4xx_hal_uart.h:49
BSP_JOY1_UP_IT_PRIORITY
#define BSP_JOY1_UP_IT_PRIORITY
Definition: stm32h747i_discovery_conf.h:72
JOY1_LEFT_PIN
#define JOY1_LEFT_PIN
Definition: stm32h747i_discovery.h:277
JOY1_UP_GPIO_CLK_ENABLE
#define JOY1_UP_GPIO_CLK_ENABLE()
Definition: stm32h747i_discovery.h:293
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
JOY1_UP_EXTI_Callback
static void JOY1_UP_EXTI_Callback(void)
JOY1 UP EXTI line detection callbacks.
Definition: stm32h747i_discovery.c:818
POSITION_VAL
#define POSITION_VAL(VAL)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:226
BSP_JOY1_RIGHT_IT_PRIORITY
#define BSP_JOY1_RIGHT_IT_PRIORITY
Definition: stm32h747i_discovery_conf.h:71
hjoy_exti
static EXTI_HandleTypeDef hjoy_exti[JOY_KEY_NUMBER]
Definition: stm32h747i_discovery.c:124
JOY1_RIGHT_GPIO_PORT
#define JOY1_RIGHT_GPIO_PORT
Definition: stm32h747i_discovery.h:285
JOY_DOWN
@ JOY_DOWN
Definition: stm32h747i_discovery.h:153
LED1_GPIO_PORT
#define LED1_GPIO_PORT
Definition: stm32469i_discovery.h:142
JOY_RIGHT
@ JOY_RIGHT
Definition: stm32h747i_discovery.h:155
STM32H747I_DISCO_BSP_BOARD_NAME
#define STM32H747I_DISCO_BSP_BOARD_NAME
Definition: stm32h747i_discovery.h:184
BUTTON_IRQn
static const IRQn_Type BUTTON_IRQn[BUTTONn]
Definition: stm32h747i_discovery.c:92
HAL_GPIO_ReadPin
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
ButtonMode_TypeDef
ButtonMode_TypeDef
Definition: stm32f4_discovery.h:76
LED4_GPIO_PORT
#define LED4_GPIO_PORT
Definition: stm32f4_discovery.h:102
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
LED2_PIN
#define LED2_PIN
Definition: stm32469i_discovery.h:157
JOY_SEL
@ JOY_SEL
Definition: stm32h747i_discovery.h:152
UART_InitTypeDef::StopBits
uint32_t StopBits
Definition: stm32f4xx_hal_uart.h:58
LED3_GPIO_PORT
#define LED3_GPIO_PORT
Definition: stm32f4_discovery.h:107
UART_OVERSAMPLING_8
#define UART_OVERSAMPLING_8
Definition: stm32f4xx_hal_uart.h:306
BSP_LED_Off
int32_t BSP_LED_Off(Led_TypeDef Led)
Turns selected LED Off.
Definition: stm32h747i_discovery.c:242
JOY1_SEL_EXTI_LINE
#define JOY1_SEL_EXTI_LINE
Definition: stm32h747i_discovery.h:268
HAL_GPIO_Init
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
UNUSED
#define UNUSED(x)
Definition: porcupine/demo/c/dr_libs/old/dr.h:92
BSP_PB_GetState
int32_t BSP_PB_GetState(Button_TypeDef Button)
Returns the selected button state.
Definition: stm32h747i_discovery.c:354
GPIO_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:52
BUTTON_WAKEUP_EXTI_LINE
#define BUTTON_WAKEUP_EXTI_LINE
Definition: stm32h747i_discovery.h:222
BUTTON_WAKEUP_EXTI_IRQn
#define BUTTON_WAKEUP_EXTI_IRQn
Definition: stm32h747i_discovery.h:221
GPIO_InitTypeDef::Pull
uint32_t Pull
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:55
GPIO_NOPULL
#define GPIO_NOPULL
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:154
JOY_KEY_NUMBER
#define JOY_KEY_NUMBER
Definition: stm32h747i_discovery.h:261
JOY1_DOWN_EXTI_Callback
static void JOY1_DOWN_EXTI_Callback(void)
JOY1 DOWN EXTI line detection callbacks.
Definition: stm32h747i_discovery.c:827
JOY1_LEFT_EXTI_LINE
#define JOY1_LEFT_EXTI_LINE
Definition: stm32h747i_discovery.h:282
JoyPinsMask
static uint32_t JoyPinsMask
Definition: stm32h747i_discovery.c:103
JOY1_RIGHT_GPIO_CLK_ENABLE
#define JOY1_RIGHT_GPIO_CLK_ENABLE()
Definition: stm32h747i_discovery.h:286
GPIO_MODE_IT_RISING_FALLING
#define GPIO_MODE_IT_RISING_FALLING
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:129
JOY1_RIGHT_PIN
#define JOY1_RIGHT_PIN
Definition: stm32h747i_discovery.h:284
GPIO_SPEED_FREQ_VERY_HIGH
#define GPIO_SPEED_FREQ_VERY_HIGH
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:145
HAL_UART_Init
HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart)
UART_MODE_TX_RX
#define UART_MODE_TX_RX
Definition: stm32f4xx_hal_uart.h:288
BUTTON_WAKEUP_GPIO_CLK_ENABLE
#define BUTTON_WAKEUP_GPIO_CLK_ENABLE()
Definition: stm32h747i_discovery.h:219
HAL_GPIO_DeInit
void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
IRQn_Type
IRQn_Type
STM32F4XX Interrupt Number Definition, according to the selected device in Library_configuration_sect...
Definition: stm32f407xx.h:66
JOY1_SEL_GPIO_CLK_ENABLE
#define JOY1_SEL_GPIO_CLK_ENABLE()
Definition: stm32h747i_discovery.h:265
JOY1_UP_GPIO_CLK_DISABLE
#define JOY1_UP_GPIO_CLK_DISABLE()
Definition: stm32h747i_discovery.h:294
GPIO_InitTypeDef::Speed
uint32_t Speed
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:58
STM32H747I_DISCO_BSP_VERSION
#define STM32H747I_DISCO_BSP_VERSION
Definition: stm32h747i_discovery.h:180
JOY_LEFT
@ JOY_LEFT
Definition: stm32h747i_discovery.h:154
JOY_MODE_GPIO
@ JOY_MODE_GPIO
Definition: stm32h747i_discovery.h:139
GPIO_PULLUP
#define GPIO_PULLUP
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:155
JOY1_PIN
static const uint16_t JOY1_PIN[JOY_KEY_NUMBER]
Definition: stm32h747i_discovery.c:111
BSP_LED_GetState
int32_t BSP_LED_GetState(Led_TypeDef Led)
Get the selected LED state.
Definition: stm32h747i_discovery.c:275
LED3_PIN
#define LED3_PIN
Definition: stm32f4_discovery.h:106
GPIO_PIN_RESET
@ GPIO_PIN_RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:70
LED_PORT
static GPIO_TypeDef * LED_PORT[LEDn]
Definition: stm32h747i_discovery.c:80
JOY1_LEFT_EXTI_Callback
static void JOY1_LEFT_EXTI_Callback(void)
JOY1 LEFT EXTI line detection callbacks.
Definition: stm32h747i_discovery.c:845
BSP_JOY1_SEL_IT_PRIORITY
#define BSP_JOY1_SEL_IT_PRIORITY
Definition: stm32h747i_discovery_conf.h:68
BSP_PB_Init
int32_t BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
Configures button GPIO and EXTI Line.
Definition: stm32h747i_discovery.c:293
BSP_JOY1_LEFT_IT_PRIORITY
#define BSP_JOY1_LEFT_IT_PRIORITY
Definition: stm32h747i_discovery_conf.h:70
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
BSP_LED_DeInit
int32_t BSP_LED_DeInit(Led_TypeDef Led)
DeInit LEDs.
Definition: stm32h747i_discovery.c:201
GPIO_TypeDef
General Purpose I/O.
Definition: stm32f407xx.h:527
HAL_EXTI_IRQHandler
void HAL_EXTI_IRQHandler(EXTI_HandleTypeDef *hexti)
BUTTON_PIN
static const uint16_t BUTTON_PIN[BUTTONn]
Definition: stm32h747i_discovery.c:91
BSP_PB_DeInit
int32_t BSP_PB_DeInit(Button_TypeDef Button)
Push Button DeInit.
Definition: stm32h747i_discovery.c:336
HAL_EXTI_RegisterCallback
HAL_StatusTypeDef HAL_EXTI_RegisterCallback(EXTI_HandleTypeDef *hexti, EXTI_CallbackIDTypeDef CallbackID, void(*pPendingCbfn)(void))
BSP_GetVersion
int32_t BSP_GetVersion(void)
This method returns the STM32H747I DISCO BSP Driver revision.
Definition: stm32h747i_discovery.c:137
JOY1_SEL_EXTI_IRQn
#define JOY1_SEL_EXTI_IRQn
Definition: stm32h747i_discovery.h:267
BUTTON_PORT
static GPIO_TypeDef * BUTTON_PORT[BUTTONn]
Definition: stm32h747i_discovery.c:90
BSP_JOY_DeInit
int32_t BSP_JOY_DeInit(JOY_TypeDef JOY, JOYPin_TypeDef JoyPins)
DeInit joystick GPIOs.
Definition: stm32h747i_discovery.c:696
BUTTON_WAKEUP_EXTI_Callback
static void BUTTON_WAKEUP_EXTI_Callback(void)
KEY EXTI line detection callbacks.
Definition: stm32h747i_discovery.c:373
JOY1_PORT
static GPIO_TypeDef * JOY1_PORT[JOY_KEY_NUMBER]
Definition: stm32h747i_discovery.c:104
JOY1_UP_GPIO_PORT
#define JOY1_UP_GPIO_PORT
Definition: stm32h747i_discovery.h:292
JOY1
@ JOY1
Definition: stm32h747i_discovery.h:145
Led_TypeDef
Led_TypeDef
Definition: stm32f4_discovery.h:63
BUTTON_WAKEUP_PIN
#define BUTTON_WAKEUP_PIN
Wakeup push-button.
Definition: stm32h747i_discovery.h:217
JOY1_LEFT_GPIO_CLK_DISABLE
#define JOY1_LEFT_GPIO_CLK_DISABLE()
Definition: stm32h747i_discovery.h:280
JOY1_UP_EXTI_LINE
#define JOY1_UP_EXTI_LINE
Definition: stm32h747i_discovery.h:296
GPIO_MODE_IT_RISING
#define GPIO_MODE_IT_RISING
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:127
JOY1_DOWN_PIN
#define JOY1_DOWN_PIN
Definition: stm32h747i_discovery.h:270
UART_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f4xx_hal_uart.h:68
BUTTONn
@ BUTTONn
Definition: stm32h747i_discovery.h:75
JOY_UP
@ JOY_UP
Definition: stm32h747i_discovery.h:156
JOY1_LEFT_EXTI_IRQn
#define JOY1_LEFT_EXTI_IRQn
Definition: stm32h747i_discovery.h:281
JOY1_DOWN_EXTI_LINE
#define JOY1_DOWN_EXTI_LINE
Definition: stm32h747i_discovery.h:275
HAL_EXTI_COMMON_CB_ID
@ HAL_EXTI_COMMON_CB_ID
Definition: stm32f7xx_hal_exti.h:47
hpb_exti
EXTI_HandleTypeDef hpb_exti[BUTTONn]
Definition: stm32h747i_discovery.c:67
HAL_EXTI_GetHandle
HAL_StatusTypeDef HAL_EXTI_GetHandle(EXTI_HandleTypeDef *hexti, uint32_t ExtiLine)
BUTTON_WAKEUP_GPIO_PORT
#define BUTTON_WAKEUP_GPIO_PORT
Definition: stm32h747i_discovery.h:218
UART_InitTypeDef::HwFlowCtl
uint32_t HwFlowCtl
Definition: stm32f4xx_hal_uart.h:71
JOY1_LEFT_GPIO_PORT
#define JOY1_LEFT_GPIO_PORT
Definition: stm32h747i_discovery.h:278
JOY1_RIGHT_EXTI_LINE
#define JOY1_RIGHT_EXTI_LINE
Definition: stm32h747i_discovery.h:289
BSP_ERROR_MSP_FAILURE
#define BSP_ERROR_MSP_FAILURE
Definition: stm32h747i_discovery_errno.h:40
HAL_NVIC_SetPriority
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
JOY1_LEFT_GPIO_CLK_ENABLE
#define JOY1_LEFT_GPIO_CLK_ENABLE()
Definition: stm32h747i_discovery.h:279
HAL_UART_DeInit
HAL_StatusTypeDef HAL_UART_DeInit(UART_HandleTypeDef *huart)
JOYPin_TypeDef
JOYPin_TypeDef
Definition: stm32h747i_discovery.h:149
GPIO_MODE_OUTPUT_PP
#define GPIO_MODE_OUTPUT_PP
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:120
JOY1_RIGHT_EXTI_Callback
static void JOY1_RIGHT_EXTI_Callback(void)
JOY1 RIGHT EXTI line detection callbacks.
Definition: stm32h747i_discovery.c:854
BSP_ERROR_WRONG_PARAM
#define BSP_ERROR_WRONG_PARAM
Definition: stm32h747i_discovery_errno.h:32
HAL_GPIO_TogglePin
void HAL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
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
JOY1_DOWN_GPIO_CLK_ENABLE
#define JOY1_DOWN_GPIO_CLK_ENABLE()
Definition: stm32h747i_discovery.h:272
__UART_HandleTypeDef::Instance
USART_TypeDef * Instance
Definition: stm32f4xx_hal_uart.h:143
LED_PIN
static const uint32_t LED_PIN[LEDn]
Definition: stm32h747i_discovery.c:85
BSP_ERROR_PERIPH_FAILURE
#define BSP_ERROR_PERIPH_FAILURE
Definition: stm32h747i_discovery_errno.h:34
BUTTON_WAKEUP
@ BUTTON_WAKEUP
Definition: stm32469i_discovery.h:86
GPIO_MODE_INPUT
#define GPIO_MODE_INPUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:119
hcom_uart
UART_HandleTypeDef hcom_uart[]
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_BUTTON_WAKEUP_IT_PRIORITY
#define BSP_BUTTON_WAKEUP_IT_PRIORITY
Definition: stm32h747i_discovery_conf.h:61
JOY1_RIGHT_GPIO_CLK_DISABLE
#define JOY1_RIGHT_GPIO_CLK_DISABLE()
Definition: stm32h747i_discovery.h:287
HAL_GPIO_WritePin
void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
UART_InitTypeDef::Parity
uint32_t Parity
Definition: stm32f4xx_hal_uart.h:61
STM32H747I_DISCO_BSP_BOARD_ID
#define STM32H747I_DISCO_BSP_BOARD_ID
Definition: stm32h747i_discovery.h:185
JOY1_DOWN_GPIO_PORT
#define JOY1_DOWN_GPIO_PORT
Definition: stm32h747i_discovery.h:271
GPIO_InitTypeDef::Pin
uint32_t Pin
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:49


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