feat(gateway): add support for KNX TP UART 9-bit mode and enhance UART pin configuration

Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
Tony
2026-05-14 22:39:14 +08:00
parent 39ef630608
commit 4553ed32e7
10 changed files with 144 additions and 23 deletions
@@ -14,7 +14,8 @@ namespace gateway::openknx {
class TpuartUartInterface : public TPUart::Interface::Abstract {
public:
TpuartUartInterface(uart_port_t uart_port, int tx_pin, int rx_pin,
size_t rx_buffer_size = 512, size_t tx_buffer_size = 512);
size_t rx_buffer_size = 512, size_t tx_buffer_size = 512,
bool nine_bit_mode = true);
~TpuartUartInterface();
void begin(int baud) override;
@@ -34,6 +35,7 @@ class TpuartUartInterface : public TPUart::Interface::Abstract {
int rx_pin_;
size_t rx_buffer_size_;
size_t tx_buffer_size_;
bool nine_bit_mode_;
std::atomic_bool overflow_{false};
std::function<bool()> callback_;
};