UART initialization and I/O functions for STM32F4 UART1, UART2, and UART6. More...
Functions | |
void | uart_init (uint32_t baudrate, hal_uart_t uart) |
Initialize the specified UART peripheral. | |
void | uart_write_char (char c, hal_uart_t uart) |
Transmit a single character via the specified UART. | |
void | uart_write_int (int32_t num, hal_uart_t uart) |
Transmit a 32-bit signed integer via UART. | |
void | uart_write_float (float num, hal_uart_t uart) |
Transmit a floating-point number via UART. | |
void | uart_write_string (const char *s, hal_uart_t uart) |
Transmit a null-terminated string via UART. | |
void | uart1_init (uint32_t baudrate) |
Initialize USART1 peripheral. | |
void | uart6_init (uint32_t baudrate) |
Initialize USART6 peripheral. | |
void | uart2_init (uint32_t baudrate) |
Initialize USART2 peripheral. | |
void | uart2_write_char (char c) |
Transmit a single character via USART2. | |
void | uart1_write_char (char c) |
Transmit a single character via USART1. | |
void | uart6_write_char (char c) |
Transmit a single character via USART6. | |
void | uart2_write_int (int32_t num) |
Transmit a 32-bit signed integer via USART2. | |
void | uart1_write_int (int32_t num) |
Transmit a 32-bit signed integer via USART1. | |
void | uart6_write_int (int32_t num) |
Transmit a 32-bit signed integer via USART6. | |
void | uart2_write_float (float num) |
Transmit a floating-point number via USART2. | |
void | uart1_write_float (float num) |
Transmit a floating-point number via USART1. | |
void | uart6_write_float (float num) |
Transmit a floating-point number via USART6. | |
void | uart2_write_string (const char *s) |
Transmit a null-terminated string via USART2. | |
void | uart1_write_string (const char *s) |
Transmit a null-terminated string via USART1. | |
void | uart6_write_string (const char *s) |
Transmit a null-terminated string via USART6. | |
char | uart_read_char (hal_uart_t uart) |
Read a single character from the specified UART. | |
char | uart1_read_char (void) |
Read a single character from USART1. | |
char | uart2_read_char (void) |
Read a single character from USART2. | |
char | uart6_read_char (void) |
Read a single character from USART6. | |
int | uart_available (hal_uart_t uart) |
Check if data is available to read from specified UART. | |
int | uart1_available (void) |
Check if data is available to read from USART1. | |
int | uart2_available (void) |
Check if data is available to read from USART2. | |
int | uart6_available (void) |
Check if data is available to read from USART6. | |
uint32_t | uart2_read_until (char *buffer, uint32_t maxlen, char delimiter) |
Read characters from USART2 until delimiter or max length. |
UART initialization and I/O functions for STM32F4 UART1, UART2, and UART6.
This file provides the implementation of UART communication functions for STM32F401RE microcontroller. It supports USART1, USART2, and USART6 peripherals with the following features:
The implementation uses GPIO alternate functions for UART pins and provides both generic (UART instance parameter) and specific functions.