APM:Libraries
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Linux::RCInput Class Reference

#include <RCInput.h>

Inheritance diagram for Linux::RCInput:
[legend]
Collaboration diagram for Linux::RCInput:
[legend]

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)
 
- Public Member Functions inherited from AP_HAL::RCInput
virtual void teardown ()
 
virtual bool rc_bind (int dsmMode)
 

Static Public Member Functions

static RCInputfrom (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
 

Detailed Description

Definition at line 11 of file RCInput.h.

Constructor & Destructor Documentation

◆ RCInput()

RCInput::RCInput ( )

Definition at line 28 of file RCInput.cpp.

Member Function Documentation

◆ _process_dsm_pulse()

void RCInput::_process_dsm_pulse ( uint16_t  width_s0,
uint16_t  width_s1 
)
protected

Definition at line 227 of file RCInput.cpp.

Referenced by _process_rc_pulse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _process_ppmsum_pulse()

void RCInput::_process_ppmsum_pulse ( uint16_t  width)
protected

Definition at line 95 of file RCInput.cpp.

Referenced by _process_rc_pulse().

Here is the caller graph for this function:

◆ _process_rc_pulse()

void RCInput::_process_rc_pulse ( uint16_t  width_s0,
uint16_t  width_s1 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _process_sbus_pulse()

void RCInput::_process_sbus_pulse ( uint16_t  width_s0,
uint16_t  width_s1 
)
protected

Definition at line 144 of file RCInput.cpp.

Referenced by _process_rc_pulse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _timer_tick()

virtual void Linux::RCInput::_timer_tick ( void  )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _update_periods()

void RCInput::_update_periods ( uint16_t *  periods,
uint8_t  len 
)
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().

Here is the caller graph for this function:

◆ add_dsm_input()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_sbus_input()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_srxl_input()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_st24_input()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_sumd_input()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear_overrides()

void RCInput::clear_overrides ( )
virtual

Implements AP_HAL::RCInput.

Definition at line 84 of file RCInput.cpp.

Referenced by get_rssi().

Here is the caller graph for this function:

◆ from()

static RCInput* Linux::RCInput::from ( AP_HAL::RCInput rcinput)
inlinestatic

Definition at line 15 of file RCInput.h.

Referenced by Linux::Scheduler::_rcin_task().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_rssi()

int16_t Linux::RCInput::get_rssi ( void  )
inlineoverridevirtual

Reimplemented from AP_HAL::RCInput.

Definition at line 25 of file RCInput.h.

Here is the call graph for this function:

◆ init()

void RCInput::init ( )
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().

Here is the caller graph for this function:

◆ new_input()

bool RCInput::new_input ( )
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().

Here is the caller graph for this function:

◆ num_channels()

uint8_t RCInput::num_channels ( )
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().

Here is the caller graph for this function:

◆ read() [1/2]

uint16_t RCInput::read ( uint8_t  ch)
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().

Here is the caller graph for this function:

◆ read() [2/2]

uint8_t RCInput::read ( uint16_t *  periods,
uint8_t  len 
)
virtual

Implements AP_HAL::RCInput.

Definition at line 62 of file RCInput.cpp.

Here is the call graph for this function:

◆ set_override()

bool RCInput::set_override ( uint8_t  channel,
int16_t  override 
)
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().

Here is the caller graph for this function:

Member Data Documentation

◆ _channel_counter

int8_t Linux::RCInput::_channel_counter

Definition at line 70 of file RCInput.h.

◆ _num_channels

uint8_t Linux::RCInput::_num_channels
protected

◆ _override

uint16_t Linux::RCInput::_override[LINUX_RC_INPUT_NUM_CHANNELS]
protected

Definition at line 66 of file RCInput.h.

Referenced by clear_overrides(), read(), and set_override().

◆ _pulse_capt

uint16_t Linux::RCInput::_pulse_capt[LINUX_RC_INPUT_NUM_CHANNELS]

Definition at line 71 of file RCInput.h.

◆ _pwm_values

uint16_t Linux::RCInput::_pwm_values[LINUX_RC_INPUT_NUM_CHANNELS]
protected

◆ _rssi

int16_t Linux::RCInput::_rssi = -1
protected

Definition at line 100 of file RCInput.h.

Referenced by add_st24_input(), add_sumd_input(), and get_rssi().

◆ bit_ofs

uint16_t Linux::RCInput::bit_ofs

Definition at line 77 of file RCInput.h.

Referenced by _process_dsm_pulse(), and _process_sbus_pulse().

◆ bytes

uint16_t Linux::RCInput::bytes[16]

◆ dsm

struct { ... } Linux::RCInput::dsm

Referenced by add_dsm_input().

◆ dsm_state

struct { ... } Linux::RCInput::dsm_state

Referenced by _process_dsm_pulse().

◆ frame

uint8_t Linux::RCInput::frame[25]

Definition at line 88 of file RCInput.h.

◆ last_input_ms

uint32_t Linux::RCInput::last_input_ms

Definition at line 90 of file RCInput.h.

◆ last_rc_input_count

std::atomic<unsigned int> Linux::RCInput::last_rc_input_count
protected

Definition at line 56 of file RCInput.h.

Referenced by new_input().

◆ partial_frame_count

uint8_t Linux::RCInput::partial_frame_count

Definition at line 89 of file RCInput.h.

◆ ppm_state

struct { ... } Linux::RCInput::ppm_state

Referenced by _process_ppmsum_pulse(), and RCInput().

◆ rc_input_count

std::atomic<unsigned int> Linux::RCInput::rc_input_count
protected

◆ sbus

struct { ... } Linux::RCInput::sbus

Referenced by add_sbus_input().

◆ sbus_state

struct { ... } Linux::RCInput::sbus_state

Referenced by _process_sbus_pulse().


The documentation for this class was generated from the following files: