|
GPS Device
|
USART driver implementation for STM32F401RE. More...
#include "stm32f401re_usart.h"#include "common.h"#include "arm_cortex_m4_nvic.h"#include "stm32f401re.h"#include "stm32f401re_rcc.h"
Go to the source code of this file.
Functions | |
| static void | usart_set_pclk (USART_REGDEF_ts const *instance, EN_STATUS_te en_status) |
| Enables or disables the peripheral clock for a USART instance. | |
| static void | usart_set_baud_rate (USART_CFG_ts *usart_cfg) |
| Computes and writes the BRR register for the configured baud rate. | |
| void | usart_init (USART_CFG_ts *usart_cfg) |
| Initializes the USART peripheral with the given configuration. | |
| void | usart_deinit (USART_REGDEF_ts const *instance) |
| Deinitializes the USART peripheral, disables its NVIC interrupt, and disables its clock. | |
| void | usart_send (USART_REGDEF_ts *instance, uint8_t *tx_buffer, uint32_t len) |
| Blocking USART transmit. | |
| void | usart_receive (USART_REGDEF_ts const *instance, uint8_t *rx_buffer, uint32_t len) |
| Blocking USART receive. | |
| void | usart_set_transmission (USART_REGDEF_ts *instance, EN_STATUS_te en_status) |
| Enables or disables the USART transmitter. | |
| void | usart_set_reception (USART_REGDEF_ts *instance, EN_STATUS_te en_status) |
| Enables or disables the USART receiver. | |
| void | usart_get_name (USART_REGDEF_ts const *instance, char *name) |
| Returns the name string of a USART peripheral instance. | |
| void | USART1_IRQHandler (void) |
| USART1 interrupt handler. Dispatches RXNE events to usart1_irq_data_recv_callback. | |
| void | USART2_IRQHandler (void) |
| USART2 interrupt handler. Currently empty — no interrupt sources configured. | |
| void | USART6_IRQHandler (void) |
| USART6 interrupt handler. Dispatches RXNE events to usart6_irq_data_recv_callback. | |
| void | usart1_irq_data_recv_callback (uint8_t data) __attribute__((weak |
| Default weak implementation of usart1_irq_data_recv_callback. | |
| void | alias ("usart_irq_callback"))) |
| void | usart6_irq_data_recv_callback (uint8_t data) __attribute__((weak |
| Default weak implementation of usart6_irq_data_recv_callback. | |
| void | usart_irq_callback (uint8_t data) |
| Default fallback handler for unimplemented USART receive callbacks. | |
USART driver implementation for STM32F401RE.
Definition in file stm32f401re_usart.c.
| void USART1_IRQHandler | ( | void | ) |
USART1 interrupt handler. Dispatches RXNE events to usart1_irq_data_recv_callback.
Checks the RXNE flag and reads USART_DR to clear it, then passes the received byte to the application callback. Only RXNE is handled; other interrupt sources are not checked.
Definition at line 259 of file stm32f401re_usart.c.

| void USART2_IRQHandler | ( | void | ) |
USART2 interrupt handler. Currently empty — no interrupt sources configured.
Definition at line 269 of file stm32f401re_usart.c.
| void USART6_IRQHandler | ( | void | ) |
USART6 interrupt handler. Dispatches RXNE events to usart6_irq_data_recv_callback.
Checks the RXNE flag and reads USART_DR to clear it, then passes the received byte to the application callback.
Definition at line 279 of file stm32f401re_usart.c.

| void usart_irq_callback | ( | uint8_t | data | ) |
Default fallback handler for unimplemented USART receive callbacks.
Spins forever. Serves as the weak alias target for both usart1_irq_data_recv_callback and usart6_irq_data_recv_callback when no application override is provided.
Definition at line 312 of file stm32f401re_usart.c.