#include "stm32l4xx_hal.h"
#include <stdint.h>
Go to the source code of this file.
|
uint8_t | UART_set_baud_rate (UART_HandleTypeDef *port_handle, uint32_t new_baud_rate) |
| Set the STM32 UART peripheral's baud rate to a different value.
|
|
UART_HandleTypeDef * | UART_get_port_handle_by_name (const char port_name[]) |
| Get the UART port handle by its name.
|
|
◆ UART_get_port_handle_by_name()
UART_HandleTypeDef * UART_get_port_handle_by_name |
( |
const char | port_name[] | ) |
|
Get the UART port handle by its name.
- Parameters
-
port_name | Case-insensitive name of the UART port to retrieve the handle for. |
- Returns
- Pointer to the UART handle structure for the specified port name, or NULL if not found.
- Warning
- This function MUST be checked for NULL return value before use.
◆ UART_set_baud_rate()
uint8_t UART_set_baud_rate |
( |
UART_HandleTypeDef * | port_handle, |
|
|
uint32_t | new_baud_rate ) |
Set the STM32 UART peripheral's baud rate to a different value.
- Parameters
-
port_handle | Pointer to the UART handle structure for the port to change the baud rate of. |
new_baud_rate | The new baud rate to set the STM32 UART peripheral to (in bits per second). Common values are 9600, 115200, 230400, etc. |
- Returns
- 0 on success, >0 on error.