2016-02-17 21:25:23 -04:00
|
|
|
#pragma once
|
2012-12-14 21:55:38 -04:00
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include "AP_HAL_Empty.h"
|
2012-12-14 21:55:38 -04:00
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
class Empty::UARTDriver : public AP_HAL::UARTDriver {
|
2012-12-14 21:55:38 -04:00
|
|
|
public:
|
2015-12-07 14:53:55 -04:00
|
|
|
UARTDriver();
|
2012-12-14 21:55:38 -04:00
|
|
|
/* Empty implementations of UARTDriver virtual methods */
|
2018-11-07 06:59:10 -04:00
|
|
|
bool is_initialized() override;
|
|
|
|
bool tx_pending() override;
|
2012-12-14 21:55:38 -04:00
|
|
|
|
|
|
|
/* Empty implementations of Stream virtual methods */
|
2016-08-02 10:42:50 -03:00
|
|
|
uint32_t txspace() override;
|
2012-12-14 21:55:38 -04:00
|
|
|
|
2021-06-05 00:50:28 -03:00
|
|
|
|
2022-01-08 06:56:52 -04:00
|
|
|
#if HAL_UART_STATS_ENABLED
|
2021-06-05 00:50:28 -03:00
|
|
|
// request information on uart I/O for one uart
|
2024-03-15 11:21:42 -03:00
|
|
|
void uart_info(ExpandingString &str, StatsTracker &stats, const uint32_t dt_ms) override;
|
2022-01-08 06:56:52 -04:00
|
|
|
#endif
|
2023-07-07 05:46:52 -03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void _begin(uint32_t b, uint16_t rxS, uint16_t txS) override;
|
|
|
|
size_t _write(const uint8_t *buffer, size_t size) override;
|
|
|
|
ssize_t _read(uint8_t *buffer, uint16_t size) override WARN_IF_UNUSED;
|
|
|
|
void _end() override;
|
|
|
|
void _flush() override;
|
|
|
|
uint32_t _available() override;
|
|
|
|
bool _discard_input() override;
|
2012-12-14 21:55:38 -04:00
|
|
|
};
|