|
libxr
1.0
Want to be the best embedded framework
|
STM32 UART 驱动实现 / STM32 UART driver implementation. More...
#include <stm32_uart.hpp>
Public Member Functions | |
| STM32UART (UART_HandleTypeDef *uart_handle, RawData dma_buff_rx, RawData dma_buff_tx, uint32_t tx_queue_size=5) | |
| 构造 UART 对象 / Construct UART object | |
| ErrorCode | SetConfig (UART::Configuration config) |
| 设置 UART 配置 / Sets the UART configuration | |
| void | SetRxDMA () |
Public Member Functions inherited from LibXR::UART | |
| template<typename ReadPortType = ReadPort, typename WritePortType = WritePort> | |
| UART (ReadPortType *read_port, WritePortType *write_port) | |
| UART 构造函数 / UART constructor. | |
| template<typename OperationType , typename = std::enable_if_t<std::is_base_of_v< WriteOperation, std::decay_t<OperationType>>>> | |
| ErrorCode | Write (ConstRawData data, OperationType &&op, bool in_isr=false) |
| template<typename OperationType , typename = std::enable_if_t<std::is_base_of_v< ReadOperation, std::decay_t<OperationType>>>> | |
| ErrorCode | Read (RawData data, OperationType &&op, bool in_isr=false) |
Static Public Member Functions | |
| static ErrorCode | WriteFun (WritePort &port, bool in_isr) |
| static ErrorCode | ReadFun (ReadPort &port, bool in_isr) |
Data Fields | |
| ReadPort | _read_port |
| WritePort | _write_port |
| RawData | dma_buff_rx_ |
| DoubleBuffer | dma_buff_tx_ |
| WriteInfoBlock | write_info_active_ |
| size_t | last_rx_pos_ = 0 |
| UART_HandleTypeDef * | uart_handle_ |
| Flag::Plain | in_tx_isr |
| Flag::Plain | tx_busy_ |
| stm32_uart_id_t | id_ = STM32_UART_ID_ERROR |
Data Fields inherited from LibXR::UART | |
| ReadPort * | read_port_ |
| 读取端口 / Read port | |
| WritePort * | write_port_ |
| 写入端口 / Write port | |
Static Public Attributes | |
| static STM32UART * | map [STM32_UART_NUMBER] = {nullptr} |
Additional Inherited Members | |
Public Types inherited from LibXR::UART | |
| enum class | Parity : uint8_t { NO_PARITY = 0 , EVEN = 1 , ODD = 2 } |
| 奇偶校验模式 / Parity mode More... | |
STM32 UART 驱动实现 / STM32 UART driver implementation.
Definition at line 117 of file stm32_uart.hpp.
| STM32UART::STM32UART | ( | UART_HandleTypeDef * | uart_handle, |
| RawData | dma_buff_rx, | ||
| RawData | dma_buff_tx, | ||
| uint32_t | tx_queue_size = 5 ) |
构造 UART 对象 / Construct UART object
Definition at line 276 of file stm32_uart.cpp.
|
static |
Definition at line 274 of file stm32_uart.cpp.
|
virtual |
设置 UART 配置 / Sets the UART configuration
ErrorCode::OK,否则返回相应错误码 / Returns the operation status, ErrorCode::OK if successful, otherwise an error code该方法为纯虚函数,子类必须实现具体的 UART 配置逻辑。 This is a pure virtual function. Subclasses must implement the specific UART configuration logic.
Implements LibXR::UART.
Definition at line 299 of file stm32_uart.cpp.
| void STM32UART::SetRxDMA | ( | ) |
Definition at line 352 of file stm32_uart.cpp.
|
static |
Definition at line 195 of file stm32_uart.cpp.
| ReadPort LibXR::STM32UART::_read_port |
Definition at line 134 of file stm32_uart.hpp.
| WritePort LibXR::STM32UART::_write_port |
Definition at line 135 of file stm32_uart.hpp.
| RawData LibXR::STM32UART::dma_buff_rx_ |
Definition at line 137 of file stm32_uart.hpp.
| DoubleBuffer LibXR::STM32UART::dma_buff_tx_ |
Definition at line 138 of file stm32_uart.hpp.
| stm32_uart_id_t LibXR::STM32UART::id_ = STM32_UART_ID_ERROR |
Definition at line 147 of file stm32_uart.hpp.
| Flag::Plain LibXR::STM32UART::in_tx_isr |
Definition at line 145 of file stm32_uart.hpp.
| size_t LibXR::STM32UART::last_rx_pos_ = 0 |
Definition at line 141 of file stm32_uart.hpp.
|
static |
Definition at line 149 of file stm32_uart.hpp.
| Flag::Plain LibXR::STM32UART::tx_busy_ |
Definition at line 145 of file stm32_uart.hpp.
| UART_HandleTypeDef* LibXR::STM32UART::uart_handle_ |
Definition at line 143 of file stm32_uart.hpp.
| WriteInfoBlock LibXR::STM32UART::write_info_active_ |
Definition at line 139 of file stm32_uart.hpp.