Go to the documentation of this file.
51 #if (USE_BSP_COM_FEATURE > 0)
68 #if (USE_BSP_COM_FEATURE > 0)
95 static COM_TypeDef COM_ActiveLogPort = COM1;
97 #if (USE_BSP_COM_FEATURE > 0)
98 #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
99 static uint32_t IsComMspCbValid[COMn] = {0};
390 #if (USE_BSP_COM_FEATURE > 0)
399 int32_t BSP_COM_Init(COM_TypeDef COM, COM_InitTypeDef *COM_Init)
410 #if (USE_HAL_UART_REGISTER_CALLBACKS == 0)
413 if(IsComMspCbValid[COM] == 0U)
437 int32_t BSP_COM_DeInit(COM_TypeDef COM)
450 #if (USE_HAL_UART_REGISTER_CALLBACKS == 0)
485 #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
491 int32_t BSP_COM_RegisterDefaultMspCallbacks(COM_TypeDef COM)
504 if(HAL_UART_RegisterCallback(&
hcom_uart[COM], HAL_UART_MSPINIT_CB_ID, USART1_MspInit) !=
HAL_OK)
508 else if(HAL_UART_RegisterCallback(&
hcom_uart[COM], HAL_UART_MSPDEINIT_CB_ID, USART1_MspDeInit) !=
HAL_OK)
514 IsComMspCbValid[COM] = 1U;
528 int32_t BSP_COM_RegisterMspCallbacks(COM_TypeDef COM, BSP_COM_Cb_t *Callback)
541 if(HAL_UART_RegisterCallback(&
hcom_uart[COM], HAL_UART_MSPINIT_CB_ID, Callback->pMspInitCb) !=
HAL_OK)
545 else if(HAL_UART_RegisterCallback(&
hcom_uart[COM], HAL_UART_MSPDEINIT_CB_ID, Callback->pMspDeInitCb) !=
HAL_OK)
551 IsComMspCbValid[COM] = 1U;
560 #if (USE_COM_LOG > 0)
567 int32_t BSP_COM_SelectLogPort(COM_TypeDef COM)
569 if(COM_ActiveLogPort != COM)
571 COM_ActiveLogPort = COM;
579 int fputc (
int ch, FILE *f)
602 uint32_t joykey, key_pressed;
630 key_pressed = 1UL << joykey;
631 if((key_pressed & (uint32_t)JoyPins) == key_pressed)
636 if(key_pressed == (uint32_t)
JOY_SEL)
640 else if(key_pressed == (uint32_t)
JOY_DOWN)
644 else if(key_pressed == (uint32_t)
JOY_LEFT)
648 else if(key_pressed == (uint32_t)
JOY_RIGHT)
654 if(key_pressed == (uint32_t)
JOY_UP)
698 uint32_t joykey, key_pressed;
706 key_pressed = 1UL << joykey;
707 if((key_pressed & (uint32_t)JoyPins) == key_pressed)
756 uint32_t joykey, key_pressed;
759 key_pressed = 1UL << joykey;
767 return (int32_t)key_pressed;
861 #if (USE_BSP_COM_FEATURE > 0)
875 COM1_TX_GPIO_CLK_ENABLE();
876 COM1_RX_GPIO_CLK_ENABLE();
882 gpio_init_structure.
Pin = COM1_TX_PIN;
886 gpio_init_structure.
Alternate = COM1_TX_AF;
890 gpio_init_structure.
Pin = COM1_RX_PIN;
892 gpio_init_structure.
Alternate = COM1_RX_AF;
909 gpio_init_structure.
Pin = COM1_TX_PIN;
912 gpio_init_structure.
Pin = COM1_RX_PIN;
#define BSP_JOY1_DOWN_IT_PRIORITY
USART_TypeDef * COM_USART[]
#define JOY1_SEL_GPIO_CLK_DISABLE()
int32_t BSP_LED_Init(Led_TypeDef Led)
Configures LED on GPIO.
#define JOY1_DOWN_EXTI_IRQn
int32_t BSP_LED_Toggle(Led_TypeDef Led)
Toggles the selected LED.
HAL_StatusTypeDef
HAL Status structures definition
#define JOY1_SEL_GPIO_PORT
static const IRQn_Type JOY1_IRQn[JOY_KEY_NUMBER]
static void JOY1_SEL_EXTI_Callback(void)
JOY1 SEL EXTI line detection callbacks.
void(* BSP_EXTI_LineCallback)(void)
Universal Synchronous Asynchronous Receiver Transmitter.
const uint8_t * BSP_GetBoardID(void)
This method returns the board ID.
int __io_putchar(uint8_t ch)
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
#define JOY1_DOWN_GPIO_CLK_DISABLE()
HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout)
#define JOY1_RIGHT_EXTI_IRQn
__weak void BSP_JOY_Callback(JOY_TypeDef JOY, uint32_t JoyPin)
BSP Joystick Callback.
#define GPIO_SPEED_FREQ_HIGH
GPIO Init structure definition
#define __HAL_UART_RESET_HANDLE_STATE(__HANDLE__)
Reset UART handle gstate & RxState.
#define LEDx_GPIO_CLK_ENABLE(__INDEX__)
This file contains definitions for STM32H747I_DISCO: LEDs push-buttons COM ports hardware resources.
void HAL_NVIC_DisableIRQ(IRQn_Type IRQn)
int32_t BSP_LED_On(Led_TypeDef Led)
Turns selected LED On.
#define JOY1_UP_EXTI_IRQn
UART handle Structure definition.
EXTI Handle structure definition.
#define BSP_JOY1_UP_IT_PRIORITY
#define JOY1_UP_GPIO_CLK_ENABLE()
__weak void BSP_PB_Callback(Button_TypeDef Button)
BSP Push Button callback.
void BSP_PB_IRQHandler(Button_TypeDef Button)
This function handles Push-Button interrupt requests.
static void JOY1_UP_EXTI_Callback(void)
JOY1 UP EXTI line detection callbacks.
#define POSITION_VAL(VAL)
#define BSP_JOY1_RIGHT_IT_PRIORITY
static EXTI_HandleTypeDef hjoy_exti[JOY_KEY_NUMBER]
#define JOY1_RIGHT_GPIO_PORT
#define STM32H747I_DISCO_BSP_BOARD_NAME
static const IRQn_Type BUTTON_IRQn[BUTTONn]
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
#define UART_OVERSAMPLING_8
int32_t BSP_LED_Off(Led_TypeDef Led)
Turns selected LED Off.
#define JOY1_SEL_EXTI_LINE
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
int32_t BSP_PB_GetState(Button_TypeDef Button)
Returns the selected button state.
static void JOY1_DOWN_EXTI_Callback(void)
JOY1 DOWN EXTI line detection callbacks.
#define JOY1_LEFT_EXTI_LINE
static uint32_t JoyPinsMask
#define JOY1_RIGHT_GPIO_CLK_ENABLE()
#define GPIO_MODE_IT_RISING_FALLING
#define GPIO_SPEED_FREQ_VERY_HIGH
HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart)
void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
IRQn_Type
STM32F4XX Interrupt Number Definition, according to the selected device in Library_configuration_sect...
#define JOY1_SEL_GPIO_CLK_ENABLE()
#define JOY1_UP_GPIO_CLK_DISABLE()
#define STM32H747I_DISCO_BSP_VERSION
static const uint16_t JOY1_PIN[JOY_KEY_NUMBER]
int32_t BSP_LED_GetState(Led_TypeDef Led)
Get the selected LED state.
static GPIO_TypeDef * LED_PORT[LEDn]
static void JOY1_LEFT_EXTI_Callback(void)
JOY1 LEFT EXTI line detection callbacks.
#define BSP_JOY1_SEL_IT_PRIORITY
int32_t BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
Configures button GPIO and EXTI Line.
#define BSP_JOY1_LEFT_IT_PRIORITY
int32_t BSP_JOY_Init(JOY_TypeDef JOY, JOYMode_TypeDef JoyMode, JOYPin_TypeDef JoyPins)
Configures joystick GPIO and EXTI modes.
int32_t BSP_LED_DeInit(Led_TypeDef Led)
DeInit LEDs.
void HAL_EXTI_IRQHandler(EXTI_HandleTypeDef *hexti)
static const uint16_t BUTTON_PIN[BUTTONn]
int32_t BSP_PB_DeInit(Button_TypeDef Button)
Push Button DeInit.
HAL_StatusTypeDef HAL_EXTI_RegisterCallback(EXTI_HandleTypeDef *hexti, EXTI_CallbackIDTypeDef CallbackID, void(*pPendingCbfn)(void))
int32_t BSP_GetVersion(void)
This method returns the STM32H747I DISCO BSP Driver revision.
#define JOY1_SEL_EXTI_IRQn
static GPIO_TypeDef * BUTTON_PORT[BUTTONn]
int32_t BSP_JOY_DeInit(JOY_TypeDef JOY, JOYPin_TypeDef JoyPins)
DeInit joystick GPIOs.
static void BUTTON_WAKEUP_EXTI_Callback(void)
KEY EXTI line detection callbacks.
static GPIO_TypeDef * JOY1_PORT[JOY_KEY_NUMBER]
#define JOY1_UP_GPIO_PORT
#define JOY1_LEFT_GPIO_CLK_DISABLE()
#define JOY1_UP_EXTI_LINE
#define GPIO_MODE_IT_RISING
#define JOY1_LEFT_EXTI_IRQn
#define JOY1_DOWN_EXTI_LINE
EXTI_HandleTypeDef hpb_exti[BUTTONn]
HAL_StatusTypeDef HAL_EXTI_GetHandle(EXTI_HandleTypeDef *hexti, uint32_t ExtiLine)
#define JOY1_LEFT_GPIO_PORT
#define JOY1_RIGHT_EXTI_LINE
#define BSP_ERROR_MSP_FAILURE
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
#define JOY1_LEFT_GPIO_CLK_ENABLE()
HAL_StatusTypeDef HAL_UART_DeInit(UART_HandleTypeDef *huart)
#define GPIO_MODE_OUTPUT_PP
static void JOY1_RIGHT_EXTI_Callback(void)
JOY1 RIGHT EXTI line detection callbacks.
#define BSP_ERROR_WRONG_PARAM
void HAL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
const uint8_t * BSP_GetBoardName(void)
This method returns the board name.
void BSP_JOY_IRQHandler(JOY_TypeDef JOY, JOYPin_TypeDef JoyPin)
This function handles JOY keys interrupt request.
#define JOY1_DOWN_GPIO_CLK_ENABLE()
static const uint32_t LED_PIN[LEDn]
#define BSP_ERROR_PERIPH_FAILURE
UART_HandleTypeDef hcom_uart[]
int32_t BSP_JOY_GetState(JOY_TypeDef JOY, uint32_t JoyPin)
Returns the current joystick status.
#define BSP_BUTTON_WAKEUP_IT_PRIORITY
#define JOY1_RIGHT_GPIO_CLK_DISABLE()
void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
#define STM32H747I_DISCO_BSP_BOARD_ID
#define JOY1_DOWN_GPIO_PORT