UART refactored (#236)
`Uart` is now an abstract class with a `UartEsp` and a `UartPosix` implementation.
This commit is contained in:
committed by
GitHub
parent
de46401d85
commit
b85ef7a2e7
@@ -0,0 +1,40 @@
|
||||
#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
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user