14template <UartType TxType>
class UartTx;
15template <UartType RxType>
class UartRx;
19 UartTx(UART_HandleTypeDef *huart) : huart_{huart} {}
21 bool transmit(
const uint8_t *data,
size_t size, uint32_t timeout) {
22 return HAL_UART_Transmit(huart_, data, size, timeout) == HAL_OK;
26 UART_HandleTypeDef *huart_;
34 UartRx(UART_HandleTypeDef *huart,
size_t) : huart_{huart} {}
36 bool receive(uint8_t *data,
size_t size, uint32_t timeout) {
37 return HAL_UART_Receive(huart_, data, size, timeout);
45 UART_HandleTypeDef *huart_;
void flush()
Definition uart_poll.hpp:40
size_t available()
Definition uart_poll.hpp:42
bool receive(uint8_t *data, size_t size, uint32_t timeout)
Definition uart_poll.hpp:36
UartRx(UART_HandleTypeDef *huart, size_t)
Definition uart_poll.hpp:34
bool transmit(const uint8_t *data, size_t size, uint32_t timeout)
Definition uart_poll.hpp:21
UartTx(UART_HandleTypeDef *huart)
Definition uart_poll.hpp:19
UartType
Definition uart_type.hpp:6
@ POLL
Definition uart_type.hpp:7