mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 16:23:33 +08:00
boards: simplify RC port configuration by using NuttX ioctl's
A board only needs to define: #define RC_SERIAL_PORT "/dev/ttyS4" Then it can optionally define one or more of the following: #define RC_SERIAL_SWAP_RXTX #define RC_SERIAL_SINGLEWIRE #define RC_INVERT_INPUT(_invert_true) px4_arch_gpiowrite(GPIO_SBUS_INV, _invert_true)
This commit is contained in:
@@ -63,7 +63,7 @@ class RCInput : public ModuleBase<RCInput>
|
||||
{
|
||||
public:
|
||||
|
||||
RCInput(bool run_as_task);
|
||||
RCInput(bool run_as_task, char *device);
|
||||
virtual ~RCInput();
|
||||
|
||||
/** @see ModuleBase */
|
||||
@@ -132,6 +132,7 @@ private:
|
||||
orb_advert_t _to_input_rc{nullptr};
|
||||
|
||||
int _rcs_fd{-1};
|
||||
char _device[20] {}; ///< device / serial port path
|
||||
|
||||
uint8_t _rcs_buf[SBUS_BUFFER_SIZE] {};
|
||||
|
||||
@@ -144,6 +145,7 @@ private:
|
||||
perf_counter_t _publish_interval_perf;
|
||||
|
||||
static void cycle_trampoline(void *arg);
|
||||
static void cycle_trampoline_init(void *arg);
|
||||
int start();
|
||||
|
||||
void fill_rc_in(uint16_t raw_rc_count_local,
|
||||
@@ -153,6 +155,6 @@ private:
|
||||
|
||||
void set_rc_scan_state(RC_SCAN _rc_scan_state);
|
||||
|
||||
void rc_io_invert(bool invert, uint32_t uxart_base);
|
||||
void rc_io_invert(bool invert);
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user