mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 09:43:34 +08:00
Port CRSF RC driver to new Serial UART API (#22917)
* Added implementations of Rx Tx swap and single wire for new UART API needed by CRSF driver * Added inverted mode to Serial interface API
This commit is contained in:
@@ -64,6 +64,8 @@ public:
|
||||
|
||||
ssize_t write(const void *buffer, size_t buffer_size);
|
||||
|
||||
void flush();
|
||||
|
||||
const char *getPort() const;
|
||||
static bool validatePort(const char *port);
|
||||
bool setPort(const char *port);
|
||||
@@ -83,6 +85,15 @@ public:
|
||||
FlowControl getFlowcontrol() const;
|
||||
bool setFlowcontrol(FlowControl flowcontrol);
|
||||
|
||||
bool getSingleWireMode() const;
|
||||
bool setSingleWireMode();
|
||||
|
||||
bool getSwapRxTxMode() const;
|
||||
bool setSwapRxTxMode();
|
||||
|
||||
bool getInvertedMode() const;
|
||||
bool setInvertedMode(bool enable);
|
||||
|
||||
private:
|
||||
|
||||
int _serial_fd{-1};
|
||||
@@ -100,6 +111,10 @@ private:
|
||||
|
||||
bool validateBaudrate(uint32_t baudrate);
|
||||
bool configure();
|
||||
|
||||
bool _single_wire_mode{false};
|
||||
bool _swap_rx_tx_mode{false};
|
||||
bool _inverted_mode{false};
|
||||
};
|
||||
|
||||
} // namespace device
|
||||
|
||||
Reference in New Issue
Block a user