Ken Van Hoeylandt b85ef7a2e7
UART refactored (#236)
`Uart` is now an abstract class with a `UartEsp` and a `UartPosix` implementation.
2025-02-26 17:13:37 +01:00

40 lines
822 B
C++

#pragma once
namespace tt::hal::uart {
#ifdef ESP_PLATFORM
struct Configuration {
/** The unique name for this UART */
std::string name;
/** The port idenitifier (e.g. UART_NUM_0) */
uart_port_t port;
/** Receive GPIO pin */
gpio_num_t rxPin;
/** Transmit GPIO pin */
gpio_num_t txPin;
/** Read-To-Send GPIO pin */
gpio_num_t rtsPin;
/** Clear-To-Send Send GPIO pin */
gpio_num_t ctsPin;
/** Receive buffer size in bytes */
unsigned int rxBufferSize;
/** Transmit buffer size in bytes */
unsigned int txBufferSize;
/** Native configuration */
uart_config_t config;
};
#else
struct Configuration {
/** The unique name for this UART */
std::string name;
/** Initial baud rate in bits per second */
uint32_t baudRate;
};
#endif
}