ARM/ST/STM32L4xx/STM32L4S9/exemples/UartStmPrbsTxTest/src/stm32l4xx_hal_msp.c
void HAL_UART_MspInit(UART_HandleTypeDef *huart)
{
  GPIO_InitTypeDef  GPIO_InitStruct;
  
  /*##-1- Enable peripherals and GPIO Clocks #################################*/
  /* Enable GPIO TX/RX clock */
  USARTx_TX_GPIO_CLK_ENABLE();
  USARTx_RX_GPIO_CLK_ENABLE();


  /* Enable USARTx clock */
  USARTx_CLK_ENABLE();
  
  /*##-2- Configure peripheral GPIO ##########################################*/
  /* UART TX GPIO pin configuration  */
  GPIO_InitStruct.Pin       = USARTx_TX_PIN;
  GPIO_InitStruct.Mode      = GPIO_MODE_AF_PP;
  GPIO_InitStruct.Pull      = GPIO_NOPULL;//GPIO_PULLUP;
  GPIO_InitStruct.Speed     = GPIO_SPEED_FREQ_HIGH;
  GPIO_InitStruct.Alternate = USARTx_TX_AF;

  HAL_GPIO_Init(USARTx_TX_GPIO_PORT, &GPIO_InitStruct);

  /* UART RX GPIO pin configuration  */
  GPIO_InitStruct.Pin = USARTx_RX_PIN;
  GPIO_InitStruct.Alternate = USARTx_RX_AF;

  HAL_GPIO_Init(USARTx_RX_GPIO_PORT, &GPIO_InitStruct);

  /*##-3- Configure the NVIC for UART ########################################*/
  /* NVIC for USART1 */
  HAL_NVIC_SetPriority(USARTx_IRQn, 0, 1);
  HAL_NVIC_EnableIRQ(USARTx_IRQn);
}
/**
  * @brief UART MSP Initialization 
  *        This function configures the hardware resources used in this example: 
  *           - Peripheral's clock enable
  *           - Peripheral's GPIO Configuration  
  *           - NVIC configuration for UART interrupt request enable
  * @param huart: UART handle pointer
  * @retval None
  */
@brief UART MSP Initialization
This function configures the hardware resources used in this example:
- Peripheral's clock enable
- Peripheral's GPIO Configuration
- NVIC configuration for UART interrupt request enable
@param huart: UART handle pointer
@retval None
@brief UART MSP Initialization This function configures the hardware resources used in this example : - Peripheral ' s clock enable - Peripheral ' s GPIO Configuration - NVIC configuration for UART interrupt request enable @param huart : UART handle pointer @retval None
void HAL_UART_MspInit(UART_HandleTypeDef *huart)
{
  GPIO_InitTypeDef  GPIO_InitStruct;
  USARTx_TX_GPIO_CLK_ENABLE();
  USARTx_RX_GPIO_CLK_ENABLE();
  USARTx_CLK_ENABLE();
  GPIO_InitStruct.Pin       = USARTx_TX_PIN;
  GPIO_InitStruct.Mode      = GPIO_MODE_AF_PP;
  GPIO_InitStruct.Pull      = GPIO_NOPULL;
  GPIO_InitStruct.Speed     = GPIO_SPEED_FREQ_HIGH;
  GPIO_InitStruct.Alternate = USARTx_TX_AF;
  HAL_GPIO_Init(USARTx_TX_GPIO_PORT, &GPIO_InitStruct);
  GPIO_InitStruct.Pin = USARTx_RX_PIN;
  GPIO_InitStruct.Alternate = USARTx_RX_AF;
  HAL_GPIO_Init(USARTx_RX_GPIO_PORT, &GPIO_InitStruct);
  HAL_NVIC_SetPriority(USARTx_IRQn, 0, 1);
  HAL_NVIC_EnableIRQ(USARTx_IRQn);
}
void HAL_UART_MspInit ( UART_HandleTypeDef * huart ) { GPIO_InitTypeDef GPIO_InitStruct ; USARTx_TX_GPIO_CLK_ENABLE ( ) ; USARTx_RX_GPIO_CLK_ENABLE ( ) ; USARTx_CLK_ENABLE ( ) ; GPIO_InitStruct . Pin = USARTx_TX_PIN ; GPIO_InitStruct . Mode = GPIO_MODE_AF_PP ; GPIO_InitStruct . Pull = GPIO_NOPULL ; GPIO_InitStruct . Speed = GPIO_SPEED_FREQ_HIGH ; GPIO_InitStruct . Alternate = USARTx_TX_AF ; HAL_GPIO_Init ( USARTx_TX_GPIO_PORT , & GPIO_InitStruct ) ; GPIO_InitStruct . Pin = USARTx_RX_PIN ; GPIO_InitStruct . Alternate = USARTx_RX_AF ; HAL_GPIO_Init ( USARTx_RX_GPIO_PORT , & GPIO_InitStruct ) ; HAL_NVIC_SetPriority ( USARTx_IRQn , 0 , 1 ) ; HAL_NVIC_EnableIRQ ( USARTx_IRQn ) ; }
@brief UART MSP Initialization
        This function configures the hardware resources used in this example:
           - Peripheral's clock enable
           - Peripheral's GPIO Configuration
           - NVIC configuration for UART interrupt request enable
 @param huart: UART handle pointer
 @retval None
@brief UART MSP Initialization This function configures the hardware resources used in this example : - Peripheral ' s clock enable - Peripheral ' s GPIO Configuration - NVIC configuration for UART interrupt request enable @param huart : UART handle pointer @retval None
/*##-1- Enable peripherals and GPIO Clocks #################################*/ /* Enable GPIO TX/RX clock */ /* Enable USARTx clock */ /*##-2- Configure peripheral GPIO ##########################################*/ /* UART TX GPIO pin configuration  */ //GPIO_PULLUP;
 /* UART RX GPIO pin configuration  */ /*##-3- Configure the NVIC for UART ########################################*/ /* NVIC for USART1 */