UART refactored (#236)

`Uart` is now an abstract class with a `UartEsp` and a `UartPosix` implementation.
This commit is contained in:
Ken Van Hoeylandt
2025-02-26 17:13:37 +01:00
committed by GitHub
parent de46401d85
commit b85ef7a2e7
22 changed files with 867 additions and 592 deletions
@@ -2,6 +2,8 @@
#include "Tactility/hal/gps/GpsDevice.h"
namespace tt::hal::uart { class Uart; }
namespace tt::hal::gps {
/**
@@ -14,6 +16,6 @@ bool init(const std::vector<GpsDevice::Configuration>& configurations);
/**
* Init sequence on UART for a specific GPS model.
*/
bool init(uart_port_t port, GpsModel type);
bool init(uart::Uart& uart, GpsModel type);
}
@@ -5,8 +5,6 @@
namespace tt::hal::gps {
struct GpsInfo;
GpsModel probe(uart_port_t port);
GpsModel probe(uart::Uart& iart);
}
@@ -17,11 +17,11 @@ template<size_t DataSize>
inline void sendPacket(uart_port_t port, uint8_t type, uint8_t id, uint8_t data[DataSize], const char* errorMessage, TickType_t timeout) {
static uint8_t buffer[250] = {0};
size_t length = makePacket(type, id, data, DataSize, buffer);
hal::uart::writeBytes(port, buffer, length);
// hal::uart::writeBytes(port, buffer, length);
}
GpsModel probe(uart_port_t port);
GpsModel probe(uart::Uart& uart);
bool init(uart_port_t port, GpsModel model);
bool init(uart::Uart& uart, GpsModel model);
} // namespace tt::service::gps