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

#include <RCInput_RPI.h>

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

Public Member Functions

void init ()
 
void _timer_tick (void)
 
 RCInput_RPI ()
 
 ~RCInput_RPI ()
 
- Public Member Functions inherited from Linux::RCInput
 RCInput ()
 
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 ()
 
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 bool rc_bind (int dsmMode)
 

Private Member Functions

void init_dma_cb (dma_cb_t **cbp, uint32_t mode, uint32_t source, uint32_t dest, uint32_t length, uint32_t stride, uint32_t next_cb)
 
void * map_peripheral (uint32_t base, uint32_t len)
 
void init_registers ()
 
void init_ctrl_data ()
 
void init_PCM ()
 
void init_DMA ()
 
void init_buffer ()
 
void set_sigaction ()
 
void set_physical_addresses (int version)
 
void teardown () override
 

Static Private Member Functions

static void stop_dma ()
 
static void termination_handler (int signum)
 

Private Attributes

uint32_t dma_base
 
uint32_t clk_base
 
uint32_t pcm_base
 
Memory_tablecircle_buffer
 
Memory_tablecon_blocks
 
uint64_t curr_tick
 
uint64_t prev_tick
 
uint64_t delta_time
 
uint32_t curr_tick_inc
 
uint32_t curr_pointer
 
uint32_t curr_channel
 
uint16_t width_s0
 
uint16_t width_s1
 
uint8_t curr_signal
 
uint8_t last_signal
 
bool _initialized = false
 
state_t state
 
AP_HAL::DigitalSourceenable_pin
 

Static Private Attributes

static volatile uint32_t * pcm_reg
 
static volatile uint32_t * clk_reg
 
static volatile uint32_t * dma_reg
 

Additional Inherited Members

- Static Public Member Functions inherited from Linux::RCInput
static RCInputfrom (AP_HAL::RCInput *rcinput)
 
- Protected Member Functions inherited from Linux::RCInput
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 inherited from Linux::RCInput
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 77 of file RCInput_RPI.h.

Constructor & Destructor Documentation

◆ RCInput_RPI()

RCInput_RPI::RCInput_RPI ( )

Definition at line 415 of file RCInput_RPI.cpp.

◆ ~RCInput_RPI()

RCInput_RPI::~RCInput_RPI ( )

Definition at line 430 of file RCInput_RPI.cpp.

Member Function Documentation

◆ _timer_tick()

void RCInput_RPI::_timer_tick ( void  )
virtual

Reimplemented from Linux::RCInput.

Definition at line 487 of file RCInput_RPI.cpp.

Here is the call graph for this function:

◆ init()

void RCInput_RPI::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.)

Reimplemented from Linux::RCInput.

Definition at line 449 of file RCInput_RPI.cpp.

Here is the call graph for this function:

◆ init_buffer()

void Linux::RCInput_RPI::init_buffer ( )
private

◆ init_ctrl_data()

void RCInput_RPI::init_ctrl_data ( )
private

Definition at line 271 of file RCInput_RPI.cpp.

Referenced by _timer_tick(), and init().

Here is the caller graph for this function:

◆ init_DMA()

void RCInput_RPI::init_DMA ( )
private

Definition at line 374 of file RCInput_RPI.cpp.

Referenced by _timer_tick(), and init().

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

◆ init_dma_cb()

void RCInput_RPI::init_dma_cb ( dma_cb_t **  cbp,
uint32_t  mode,
uint32_t  source,
uint32_t  dest,
uint32_t  length,
uint32_t  stride,
uint32_t  next_cb 
)
private

Definition at line 247 of file RCInput_RPI.cpp.

◆ init_PCM()

void RCInput_RPI::init_PCM ( )
private

Definition at line 346 of file RCInput_RPI.cpp.

Referenced by _timer_tick(), and init().

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

◆ init_registers()

void RCInput_RPI::init_registers ( )
private

Definition at line 442 of file RCInput_RPI.cpp.

Referenced by init().

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

◆ map_peripheral()

void * RCInput_RPI::map_peripheral ( uint32_t  base,
uint32_t  len 
)
private

Definition at line 228 of file RCInput_RPI.cpp.

Referenced by init_registers().

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

◆ set_physical_addresses()

void RCInput_RPI::set_physical_addresses ( int  version)
private

Definition at line 214 of file RCInput_RPI.cpp.

Referenced by init().

Here is the caller graph for this function:

◆ set_sigaction()

void RCInput_RPI::set_sigaction ( )
private

Definition at line 386 of file RCInput_RPI.cpp.

Referenced by init().

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

◆ stop_dma()

void RCInput_RPI::stop_dma ( )
staticprivate

Definition at line 257 of file RCInput_RPI.cpp.

Referenced by teardown().

Here is the caller graph for this function:

◆ teardown()

void RCInput_RPI::teardown ( )
overrideprivatevirtual

Reimplemented from AP_HAL::RCInput.

Definition at line 436 of file RCInput_RPI.cpp.

Here is the call graph for this function:

◆ termination_handler()

void RCInput_RPI::termination_handler ( int  signum)
staticprivate

Definition at line 263 of file RCInput_RPI.cpp.

Referenced by set_sigaction().

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

Member Data Documentation

◆ _initialized

bool Linux::RCInput_RPI::_initialized = false
private

Definition at line 114 of file RCInput_RPI.h.

Referenced by _timer_tick(), and init().

◆ circle_buffer

Memory_table* Linux::RCInput_RPI::circle_buffer
private

Definition at line 97 of file RCInput_RPI.h.

Referenced by _timer_tick(), init(), and ~RCInput_RPI().

◆ clk_base

uint32_t Linux::RCInput_RPI::clk_base
private

Definition at line 89 of file RCInput_RPI.h.

Referenced by init_registers().

◆ clk_reg

volatile uint32_t * RCInput_RPI::clk_reg
staticprivate

Definition at line 94 of file RCInput_RPI.h.

Referenced by init_registers().

◆ con_blocks

Memory_table* Linux::RCInput_RPI::con_blocks
private

Definition at line 98 of file RCInput_RPI.h.

Referenced by _timer_tick(), init(), RCInput_RPI(), and ~RCInput_RPI().

◆ curr_channel

uint32_t Linux::RCInput_RPI::curr_channel
private

Definition at line 106 of file RCInput_RPI.h.

Referenced by RCInput_RPI().

◆ curr_pointer

uint32_t Linux::RCInput_RPI::curr_pointer
private

Definition at line 105 of file RCInput_RPI.h.

Referenced by _timer_tick(), init(), and RCInput_RPI().

◆ curr_signal

uint8_t Linux::RCInput_RPI::curr_signal
private

Definition at line 111 of file RCInput_RPI.h.

Referenced by _timer_tick(), init(), and RCInput_RPI().

◆ curr_tick

uint64_t Linux::RCInput_RPI::curr_tick
private

Definition at line 100 of file RCInput_RPI.h.

Referenced by _timer_tick(), and init().

◆ curr_tick_inc

uint32_t Linux::RCInput_RPI::curr_tick_inc
private

Definition at line 104 of file RCInput_RPI.h.

Referenced by _timer_tick(), and RCInput_RPI().

◆ delta_time

uint64_t Linux::RCInput_RPI::delta_time
private

Definition at line 102 of file RCInput_RPI.h.

Referenced by _timer_tick(), and RCInput_RPI().

◆ dma_base

uint32_t Linux::RCInput_RPI::dma_base
private

Definition at line 88 of file RCInput_RPI.h.

Referenced by init_registers().

◆ dma_reg

volatile uint32_t * RCInput_RPI::dma_reg
staticprivate

Definition at line 95 of file RCInput_RPI.h.

Referenced by _timer_tick(), and init_registers().

◆ enable_pin

AP_HAL::DigitalSource* Linux::RCInput_RPI::enable_pin
private

Definition at line 118 of file RCInput_RPI.h.

Referenced by init().

◆ last_signal

uint8_t Linux::RCInput_RPI::last_signal
private

Definition at line 112 of file RCInput_RPI.h.

Referenced by _timer_tick(), init(), and RCInput_RPI().

◆ pcm_base

uint32_t Linux::RCInput_RPI::pcm_base
private

Definition at line 90 of file RCInput_RPI.h.

Referenced by init_registers().

◆ pcm_reg

volatile uint32_t * RCInput_RPI::pcm_reg
staticprivate

Definition at line 93 of file RCInput_RPI.h.

Referenced by init_registers().

◆ prev_tick

uint64_t Linux::RCInput_RPI::prev_tick
private

Definition at line 101 of file RCInput_RPI.h.

Referenced by _timer_tick(), init(), and RCInput_RPI().

◆ state

state_t Linux::RCInput_RPI::state
private

Definition at line 116 of file RCInput_RPI.h.

Referenced by _timer_tick(), and RCInput_RPI().

◆ width_s0

uint16_t Linux::RCInput_RPI::width_s0
private

Definition at line 108 of file RCInput_RPI.h.

Referenced by _timer_tick(), and RCInput_RPI().

◆ width_s1

uint16_t Linux::RCInput_RPI::width_s1
private

Definition at line 109 of file RCInput_RPI.h.

Referenced by _timer_tick().


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