Src/main.c
/**
  * @brief USART2 Initialization Function
  * @param None
  * @retval None
  */
@brief USART2 Initialization Function
@param None
@retval None
@brief USART2 Initialization Function @param None @retval None
static void MX_USART2_UART_Init(void)
{
  huart2.Instance = USART2;
  huart2.Init.BaudRate = 921600;
  huart2.Init.WordLength = UART_WORDLENGTH_8B;
  huart2.Init.StopBits = UART_STOPBITS_1;
  huart2.Init.Parity = UART_PARITY_NONE;
  huart2.Init.Mode = UART_MODE_TX_RX;
  huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
  huart2.Init.OverSampling = UART_OVERSAMPLING_16;
  huart2.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
  huart2.Init.ClockPrescaler = UART_PRESCALER_DIV1;
  huart2.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
  if (HAL_UART_Init(&huart2) != HAL_OK)
  {
    Error_Handler();
  }
  if (HAL_UARTEx_SetTxFifoThreshold(&huart2, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
  {
    Error_Handler();
  }
  if (HAL_UARTEx_SetRxFifoThreshold(&huart2, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
  {
    Error_Handler();
  }
  if (HAL_UARTEx_DisableFifoMode(&huart2) != HAL_OK)
  {
    Error_Handler();
  }
}
static void MX_USART2_UART_Init ( void ) { huart2 . Instance = USART2 ; huart2 . Init . BaudRate = 921600 ; huart2 . Init . WordLength = UART_WORDLENGTH_8B ; huart2 . Init . StopBits = UART_STOPBITS_1 ; huart2 . Init . Parity = UART_PARITY_NONE ; huart2 . Init . Mode = UART_MODE_TX_RX ; huart2 . Init . HwFlowCtl = UART_HWCONTROL_NONE ; huart2 . Init . OverSampling = UART_OVERSAMPLING_16 ; huart2 . Init . OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE ; huart2 . Init . ClockPrescaler = UART_PRESCALER_DIV1 ; huart2 . AdvancedInit . AdvFeatureInit = UART_ADVFEATURE_NO_INIT ; if ( HAL_UART_Init ( & huart2 ) != HAL_OK ) { Error_Handler ( ) ; } if ( HAL_UARTEx_SetTxFifoThreshold ( & huart2 , UART_TXFIFO_THRESHOLD_1_8 ) != HAL_OK ) { Error_Handler ( ) ; } if ( HAL_UARTEx_SetRxFifoThreshold ( & huart2 , UART_RXFIFO_THRESHOLD_1_8 ) != HAL_OK ) { Error_Handler ( ) ; } if ( HAL_UARTEx_DisableFifoMode ( & huart2 ) != HAL_OK ) { Error_Handler ( ) ; } }
@brief USART2 Initialization Function
 @param None
 @retval None
@brief USART2 Initialization Function @param None @retval None
/* USER CODE BEGIN USART2_Init 0 */ /* USER CODE END USART2_Init 0 */ /* USER CODE BEGIN USART2_Init 1 */ /* USER CODE END USART2_Init 1 */ /* USER CODE BEGIN USART2_Init 2 */ /* USER CODE END USART2_Init 2 */