PX4 Firmware
PX4 Autopilot Software http://px4.io
rpi_rc_in::RcInput Class Reference

#include <rpi_rc_in.h>

Inheritance diagram for rpi_rc_in::RcInput:
Collaboration diagram for rpi_rc_in::RcInput:

Public Member Functions

 RcInput ()
 
 ~RcInput ()
 
int start ()
 
void stop ()
 
bool is_running ()
 

Private Member Functions

void Run () override
 
void _measure ()
 
int rpi_rc_init ()
 

Private Attributes

bool _should_exit = false
 
bool _is_running = false
 
orb_advert_t _rcinput_pub = nullptr
 
int _channels = 8
 
struct input_rc_s _data = {}
 
int * _mem = nullptr
 
key_t _key = 4096
 shared memory key (matches the ppmdecode program's key) More...
 
int _shmid = 0
 

Detailed Description

Definition at line 64 of file rpi_rc_in.h.

Constructor & Destructor Documentation

◆ RcInput()

rpi_rc_in::RcInput::RcInput ( )
inline

Definition at line 67 of file rpi_rc_in.h.

References start(), stop(), and ~RcInput().

Referenced by rpi_rc_in_main().

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

◆ ~RcInput()

RcInput::~RcInput ( )

Definition at line 38 of file rpi_rc_in.cpp.

References _is_running, and _mem.

Referenced by RcInput().

Here is the caller graph for this function:

Member Function Documentation

◆ _measure()

void RcInput::_measure ( void  )
private

Definition at line 104 of file rpi_rc_in.cpp.

References _channels, _data, _mem, _rcinput_pub, input_rc_s::channel_count, hrt_absolute_time(), input_rc_s::input_source, ll40ls::instance, orb_advertise_multi(), ORB_ID, ORB_PRIO_DEFAULT, orb_publish(), input_rc_s::rc_failsafe, input_rc_s::rc_lost, input_rc_s::rc_lost_frame_count, input_rc_s::rc_ppm_frame_length, input_rc_s::rc_total_frame_count, input_rc_s::rssi, input_rc_s::timestamp, input_rc_s::timestamp_last_signal, rpi_rc_in::usage(), and input_rc_s::values.

Referenced by is_running(), and Run().

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

◆ is_running()

bool rpi_rc_in::RcInput::is_running ( )
inline

Definition at line 77 of file rpi_rc_in.h.

References _is_running, _measure(), rpi_rc_init(), and Run().

Referenced by rpi_rc_in_main().

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

◆ rpi_rc_init()

int RcInput::rpi_rc_init ( )
private

Definition at line 49 of file rpi_rc_in.cpp.

References _channels, _data, _key, _mem, _shmid, and input_rc_s::values.

Referenced by is_running(), and start().

Here is the caller graph for this function:

◆ Run()

void RcInput::Run ( )
overrideprivate

Definition at line 95 of file rpi_rc_in.cpp.

References _measure(), _should_exit, and RCINPUT_MEASURE_INTERVAL_US.

Referenced by is_running().

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

◆ start()

int RcInput::start ( )
Returns
0 on success, -errno on failure

Definition at line 72 of file rpi_rc_in.cpp.

References _is_running, and rpi_rc_init().

Referenced by RcInput(), and rpi_rc_in_main().

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

◆ stop()

void RcInput::stop ( )
Returns
0 on success, -errno on failure

Definition at line 90 of file rpi_rc_in.cpp.

References _should_exit.

Referenced by RcInput(), and rpi_rc_in_main().

Here is the caller graph for this function:

Member Data Documentation

◆ _channels

int rpi_rc_in::RcInput::_channels = 8
private

Definition at line 91 of file rpi_rc_in.h.

Referenced by _measure(), and rpi_rc_init().

◆ _data

struct input_rc_s rpi_rc_in::RcInput::_data = {}
private

Definition at line 92 of file rpi_rc_in.h.

Referenced by _measure(), and rpi_rc_init().

◆ _is_running

bool rpi_rc_in::RcInput::_is_running = false
private

Definition at line 89 of file rpi_rc_in.h.

Referenced by is_running(), start(), and ~RcInput().

◆ _key

key_t rpi_rc_in::RcInput::_key = 4096
private

shared memory key (matches the ppmdecode program's key)

Definition at line 95 of file rpi_rc_in.h.

Referenced by rpi_rc_init().

◆ _mem

int* rpi_rc_in::RcInput::_mem = nullptr
private

Definition at line 94 of file rpi_rc_in.h.

Referenced by _measure(), rpi_rc_init(), and ~RcInput().

◆ _rcinput_pub

orb_advert_t rpi_rc_in::RcInput::_rcinput_pub = nullptr
private

Definition at line 90 of file rpi_rc_in.h.

Referenced by _measure().

◆ _shmid

int rpi_rc_in::RcInput::_shmid = 0
private

Definition at line 96 of file rpi_rc_in.h.

Referenced by rpi_rc_init().

◆ _should_exit

bool rpi_rc_in::RcInput::_should_exit = false
private

Definition at line 88 of file rpi_rc_in.h.

Referenced by Run(), and stop().


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