UART configuration and control.
More...
UART configuration and control.
◆ sd_uart_dev_init()
#include <Src/sd_uart.c>
UART Device Initialization Initialize UART device structure.
- Parameters
-
uart_dev | Device structure to initialize |
- Return values
-
SD_UART_SUCCESS | on success, error state otherwise |
UART_HandleTypeDef * uart
Definition: sd_uart.h:140
UART device structure.
Definition: sd_uart.h:139
Definition: sd_uart.h:117
Definition: sd_uart.h:121
◆ sd_uart_err_cb()
#include <Src/sd_uart.c>
Handle UART errors.
- Parameters
-
huart | UART handle with error triggered error interrupt |
- Return values
-
◆ sd_uart_rx_isr()
#include <Src/sd_uart.c>
Receive Interrupt Routine.
- Note
- This function is called from within the interrupt handler when the the RXNE interrupt is enabled and set.
- Parameters
-
dev | The UART peripheral that triggered interrupt |
- Return values
-
SD_UART_SUCCESS | on success, error status otherwise |
Put the character in the current buffer
407 UART_HandleTypeDef *huart = dev->
uart;
408 uint16_t mask = huart->Mask;
411 rx_buff->
buff[rx_buff->
in++] = (uint8_t)(huart->Instance->RDR & (uint8_t)mask);
414 if (rx_buff->
in >= rx_buff->
size)
417 if (++rx_buff->
len >= rx_buff->
size) {
uint32_t size
Definition: sd_buffer.h:107
struct sd_cbuf * rx_buff
Definition: sd_uart.h:142
uint8_t * buff
Definition: sd_buffer.h:103
uint32_t in
Definition: sd_buffer.h:104
enum sd_buff_state state
Definition: sd_buffer.h:108
Character buffer structure.
Definition: sd_buffer.h:102
UART_HandleTypeDef * uart
Definition: sd_uart.h:140
Definition: sd_uart.h:117
Definition: sd_uart.h:121
Definition: sd_buffer.h:82
uint32_t len
Definition: sd_buffer.h:106