APM:Libraries
|
#include <RCInput.h>
Public Member Functions | |
RCInput () | |
virtual void | init () |
bool | new_input () |
uint8_t | num_channels () |
uint16_t | read (uint8_t ch) |
uint8_t | read (uint16_t *periods, uint8_t len) |
int16_t | get_rssi (void) override |
bool | set_override (uint8_t channel, int16_t override) |
void | clear_overrides () |
virtual void | _timer_tick () |
bool | add_dsm_input (const uint8_t *bytes, size_t nbytes) |
void | add_sbus_input (const uint8_t *bytes, size_t nbytes) |
bool | add_sumd_input (const uint8_t *bytes, size_t nbytes) |
bool | add_st24_input (const uint8_t *bytes, size_t nbytes) |
bool | add_srxl_input (const uint8_t *bytes, size_t nbytes) |
![]() | |
virtual void | teardown () |
virtual bool | rc_bind (int dsmMode) |
Static Public Member Functions | |
static RCInput * | from (AP_HAL::RCInput *rcinput) |
Protected Member Functions | |
void | _process_rc_pulse (uint16_t width_s0, uint16_t width_s1) |
void | _update_periods (uint16_t *periods, uint8_t len) |
void | _process_ppmsum_pulse (uint16_t width) |
void | _process_sbus_pulse (uint16_t width_s0, uint16_t width_s1) |
void | _process_dsm_pulse (uint16_t width_s0, uint16_t width_s1) |
Protected Attributes | |
std::atomic< unsigned int > | rc_input_count |
std::atomic< unsigned int > | last_rc_input_count |
uint16_t | _pwm_values [LINUX_RC_INPUT_NUM_CHANNELS] |
uint8_t | _num_channels |
uint16_t | _override [LINUX_RC_INPUT_NUM_CHANNELS] |
struct { | |
int8_t _channel_counter | |
uint16_t _pulse_capt [LINUX_RC_INPUT_NUM_CHANNELS] | |
} | ppm_state |
struct { | |
uint16_t bytes [25] | |
uint16_t bit_ofs | |
} | sbus_state |
struct { | |
uint16_t bytes [16] | |
uint16_t bit_ofs | |
} | dsm_state |
struct { | |
uint8_t frame [16] | |
uint8_t partial_frame_count | |
uint32_t last_input_ms | |
} | dsm |
struct { | |
uint8_t frame [25] | |
uint8_t partial_frame_count | |
uint32_t last_input_ms | |
} | sbus |
int16_t | _rssi = -1 |
RCInput::RCInput | ( | ) |
Definition at line 28 of file RCInput.cpp.
|
protected |
Definition at line 227 of file RCInput.cpp.
Referenced by _process_rc_pulse().
|
protected |
Definition at line 95 of file RCInput.cpp.
Referenced by _process_rc_pulse().
|
protected |
Definition at line 308 of file RCInput.cpp.
Referenced by Linux::RCInput_ZYNQ::_timer_tick(), Linux::RCInput_PRU::_timer_tick(), Linux::RCInput_AioPRU::_timer_tick(), _timer_tick(), and Linux::RCInput_RPI::_timer_tick().
|
protected |
Definition at line 144 of file RCInput.cpp.
Referenced by _process_rc_pulse().
|
inlinevirtual |
Reimplemented in Linux::RCInput_RPI, Linux::RCInput_AioPRU, Linux::RCInput_SoloLink, Linux::RCInput_115200, Linux::RCInput_Multi, Linux::RCInput_SBUS, Linux::RCInput_UART, Linux::RCInput_PRU, Linux::RCInput_UDP, Linux::RCInput_ZYNQ, and Linux::RCInput_Navio2.
Definition at line 34 of file RCInput.h.
Referenced by Linux::Scheduler::_rcin_task(), and Linux::RCInput_Multi::_timer_tick().
|
protected |
Definition at line 333 of file RCInput.cpp.
Referenced by Linux::RCInput_Navio2::_timer_tick(), Linux::RCInput_UDP::_timer_tick(), Linux::RCInput_UART::_timer_tick(), Linux::RCInput_SoloLink::_timer_tick(), and _timer_tick().
bool RCInput::add_dsm_input | ( | const uint8_t * | bytes, |
size_t | nbytes | ||
) |
Definition at line 349 of file RCInput.cpp.
Referenced by Linux::RCInput_115200::_timer_tick(), and _timer_tick().
void RCInput::add_sbus_input | ( | const uint8_t * | bytes, |
size_t | nbytes | ||
) |
Definition at line 511 of file RCInput.cpp.
Referenced by Linux::RCInput_SBUS::_timer_tick(), and _timer_tick().
bool RCInput::add_srxl_input | ( | const uint8_t * | bytes, |
size_t | nbytes | ||
) |
Definition at line 480 of file RCInput.cpp.
Referenced by Linux::RCInput_115200::_timer_tick(), and _timer_tick().
bool RCInput::add_st24_input | ( | const uint8_t * | bytes, |
size_t | nbytes | ||
) |
Definition at line 449 of file RCInput.cpp.
Referenced by Linux::RCInput_115200::_timer_tick(), and _timer_tick().
bool RCInput::add_sumd_input | ( | const uint8_t * | bytes, |
size_t | nbytes | ||
) |
Definition at line 418 of file RCInput.cpp.
Referenced by Linux::RCInput_115200::_timer_tick(), and _timer_tick().
|
virtual |
Implements AP_HAL::RCInput.
Definition at line 84 of file RCInput.cpp.
Referenced by get_rssi().
|
inlinestatic |
Definition at line 15 of file RCInput.h.
Referenced by Linux::Scheduler::_rcin_task().
|
inlineoverridevirtual |
Reimplemented from AP_HAL::RCInput.
Definition at line 25 of file RCInput.h.
|
virtual |
Call init from the platform hal instance init, so that both the type of the RCInput implementation and init argument (e.g. ISRRegistry) are known to the programmer. (It's too difficult to describe this dependency in the C++ type system.)
Implements AP_HAL::RCInput.
Reimplemented in Linux::RCInput_RPI, Linux::RCInput_AioPRU, Linux::RCInput_SoloLink, Linux::RCInput_115200, Linux::RCInput_Multi, Linux::RCInput_SBUS, Linux::RCInput_UART, Linux::RCInput_PRU, Linux::RCInput_UDP, Linux::RCInput_ZYNQ, and Linux::RCInput_Navio2.
Definition at line 33 of file RCInput.cpp.
Referenced by from(), and Linux::RCInput_Multi::init().
|
virtual |
Return true if there has been new input since the last call to new_input()
Implements AP_HAL::RCInput.
Definition at line 37 of file RCInput.cpp.
Referenced by Linux::RCInput_Multi::_timer_tick(), and from().
|
virtual |
Return the number of valid channels in the last read
Implements AP_HAL::RCInput.
Definition at line 46 of file RCInput.cpp.
Referenced by Linux::RCInput_Multi::_timer_tick(), and from().
|
virtual |
Implements AP_HAL::RCInput.
Definition at line 51 of file RCInput.cpp.
Referenced by Linux::RCInput_UART::_timer_tick(), Linux::RCInput_Multi::_timer_tick(), Linux::RCInput_SBUS::_timer_tick(), Linux::RCInput_115200::_timer_tick(), from(), and read().
|
virtual |
Implements AP_HAL::RCInput.
Definition at line 62 of file RCInput.cpp.
|
virtual |
Overrides: these are really grody and don't belong here but we need them at the moment to make the port work. case v of: v == -1 -> no change to this channel v == 0 -> do not override this channel v > 0 -> set v as override.
Implements AP_HAL::RCInput.
Definition at line 71 of file RCInput.cpp.
Referenced by get_rssi().
|
protected |
Definition at line 59 of file RCInput.h.
Referenced by _process_dsm_pulse(), _process_ppmsum_pulse(), _process_sbus_pulse(), Linux::RCInput_Multi::_timer_tick(), _update_periods(), add_dsm_input(), add_sbus_input(), add_srxl_input(), add_st24_input(), add_sumd_input(), num_channels(), and read().
|
protected |
Definition at line 66 of file RCInput.h.
Referenced by clear_overrides(), read(), and set_override().
uint16_t Linux::RCInput::_pulse_capt[LINUX_RC_INPUT_NUM_CHANNELS] |
|
protected |
Definition at line 58 of file RCInput.h.
Referenced by _process_dsm_pulse(), _process_ppmsum_pulse(), _process_sbus_pulse(), Linux::RCInput_Multi::_timer_tick(), _update_periods(), add_dsm_input(), add_sbus_input(), add_srxl_input(), add_st24_input(), add_sumd_input(), and read().
|
protected |
Definition at line 100 of file RCInput.h.
Referenced by add_st24_input(), add_sumd_input(), and get_rssi().
uint16_t Linux::RCInput::bit_ofs |
Definition at line 77 of file RCInput.h.
Referenced by _process_dsm_pulse(), and _process_sbus_pulse().
uint16_t Linux::RCInput::bytes[16] |
Definition at line 76 of file RCInput.h.
Referenced by _process_dsm_pulse(), _process_sbus_pulse(), Linux::RCInput_115200::_timer_tick(), Linux::RCInput_SBUS::_timer_tick(), and _timer_tick().
struct { ... } Linux::RCInput::dsm |
Referenced by add_dsm_input().
struct { ... } Linux::RCInput::dsm_state |
Referenced by _process_dsm_pulse().
|
protected |
Definition at line 56 of file RCInput.h.
Referenced by new_input().
struct { ... } Linux::RCInput::ppm_state |
Referenced by _process_ppmsum_pulse(), and RCInput().
|
protected |
Definition at line 55 of file RCInput.h.
Referenced by _process_dsm_pulse(), _process_ppmsum_pulse(), _process_sbus_pulse(), Linux::RCInput_Multi::_timer_tick(), _update_periods(), add_dsm_input(), add_sbus_input(), add_srxl_input(), add_st24_input(), add_sumd_input(), new_input(), and set_override().
struct { ... } Linux::RCInput::sbus |
Referenced by add_sbus_input().
struct { ... } Linux::RCInput::sbus_state |
Referenced by _process_sbus_pulse().