APM:Libraries
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
RC_Channel Class Reference

Object managing one RC channel. More...

#include <RC_Channel.h>

Collaboration diagram for RC_Channel:
[legend]

Public Types

enum  LimitValue { RC_CHANNEL_LIMIT_TRIM, RC_CHANNEL_LIMIT_MIN, RC_CHANNEL_LIMIT_MAX }
 

Public Member Functions

 RC_Channel (void)
 
void load_eeprom (void)
 
void save_eeprom (void)
 
void save_trim (void)
 
void set_range (uint16_t high)
 
void set_angle (uint16_t angle)
 
bool get_reverse (void) const
 
void set_default_dead_zone (int16_t dzone)
 
uint16_t get_dead_zone (void) const
 
int16_t get_control_mid () const
 
void set_pwm (int16_t pwm)
 
void recompute_pwm_no_deadzone ()
 
int16_t pwm_to_angle_dz_trim (uint16_t dead_zone, uint16_t trim)
 
float norm_input ()
 
float norm_input_dz ()
 
uint8_t percent_input ()
 
int16_t pwm_to_range ()
 
int16_t pwm_to_range_dz (uint16_t dead_zone)
 
uint16_t read () const
 
void input ()
 
bool in_trim_dz ()
 
int16_t get_radio_in () const
 
void set_radio_in (int16_t val)
 
int16_t get_control_in () const
 
void set_control_in (int16_t val)
 
int16_t get_control_in_zero_dz (void)
 
int16_t get_radio_min () const
 
void set_radio_min (int16_t val)
 
int16_t get_radio_max () const
 
void set_radio_max (int16_t val)
 
int16_t get_radio_trim () const
 
void set_radio_trim (int16_t val)
 
void save_radio_trim ()
 
void set_and_save_trim ()
 
void set_and_save_radio_trim (int16_t val)
 
bool min_max_configured () const
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Member Functions

int16_t pwm_to_angle ()
 
int16_t pwm_to_angle_dz (uint16_t dead_zone)
 

Private Attributes

int16_t radio_in
 
int16_t control_in
 
AP_Int16 radio_min
 
AP_Int16 radio_trim
 
AP_Int16 radio_max
 
AP_Int8 reversed
 
AP_Int16 dead_zone
 
uint8_t type_in
 
int16_t high_in
 
uint8_t ch_in
 

Static Private Attributes

static uint32_t configured_mask
 

Friends

class SRV_Channels
 
class RC_Channels
 

Detailed Description

Object managing one RC channel.

Definition at line 15 of file RC_Channel.h.

Member Enumeration Documentation

◆ LimitValue

Enumerator
RC_CHANNEL_LIMIT_TRIM 
RC_CHANNEL_LIMIT_MIN 
RC_CHANNEL_LIMIT_MAX 

Definition at line 23 of file RC_Channel.h.

Constructor & Destructor Documentation

◆ RC_Channel()

RC_Channel::RC_Channel ( void  )

Definition at line 80 of file RC_Channel.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ get_control_in()

int16_t RC_Channel::get_control_in ( ) const
inline

Definition at line 82 of file RC_Channel.h.

◆ get_control_in_zero_dz()

int16_t RC_Channel::get_control_in_zero_dz ( void  )

Definition at line 253 of file RC_Channel.cpp.

Referenced by set_control_in().

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

◆ get_control_mid()

int16_t RC_Channel::get_control_mid ( ) const

Definition at line 143 of file RC_Channel.cpp.

Referenced by get_dead_zone().

Here is the caller graph for this function:

◆ get_dead_zone()

uint16_t RC_Channel::get_dead_zone ( void  ) const
inline

Definition at line 39 of file RC_Channel.h.

Here is the call graph for this function:

◆ get_radio_in()

int16_t RC_Channel::get_radio_in ( ) const
inline

Definition at line 79 of file RC_Channel.h.

Referenced by AP_Mount_Backend::angle_input(), AP_Tuning::check_input(), AP_Tuning::check_selector_switch(), SRV_Channels::copy_radio_in_out(), SRV_Channels::copy_radio_in_out_mask(), RC_Channels::get_radio_in(), SRV_Channel::output_ch(), and RC_Channels::rc_channel().

Here is the caller graph for this function:

◆ get_radio_max()

int16_t RC_Channel::get_radio_max ( ) const
inline

Definition at line 91 of file RC_Channel.h.

Referenced by AP_Mount_Backend::angle_input(), AP_Arming::rc_calibration_checks(), and AP_Arming::rc_checks_copter_sub().

Here is the caller graph for this function:

◆ get_radio_min()

int16_t RC_Channel::get_radio_min ( ) const
inline

Definition at line 88 of file RC_Channel.h.

Referenced by AP_Mount_Backend::angle_input(), AP_Arming::rc_calibration_checks(), and AP_Arming::rc_checks_copter_sub().

Here is the caller graph for this function:

◆ get_radio_trim()

int16_t RC_Channel::get_radio_trim ( ) const
inline

Definition at line 94 of file RC_Channel.h.

Referenced by SRV_Channel::output_ch(), AP_Arming::rc_calibration_checks(), and AP_Arming::rc_checks_copter_sub().

Here is the caller graph for this function:

◆ get_reverse()

bool RC_Channel::get_reverse ( void  ) const

Definition at line 106 of file RC_Channel.cpp.

Referenced by AP_Mount_Backend::angle_input().

Here is the caller graph for this function:

◆ in_trim_dz()

bool RC_Channel::in_trim_dz ( )

Definition at line 333 of file RC_Channel.cpp.

Here is the call graph for this function:

◆ input()

void RC_Channel::input ( )

Definition at line 319 of file RC_Channel.cpp.

Referenced by get_dead_zone().

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

◆ load_eeprom()

void RC_Channel::load_eeprom ( void  )

Definition at line 162 of file RC_Channel.cpp.

◆ min_max_configured()

bool RC_Channel::min_max_configured ( ) const

Definition at line 339 of file RC_Channel.cpp.

Referenced by AP_Arming::rc_checks_copter_sub(), and set_and_save_radio_trim().

Here is the caller graph for this function:

◆ norm_input()

float RC_Channel::norm_input ( )

Definition at line 264 of file RC_Channel.cpp.

Referenced by get_dead_zone().

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

◆ norm_input_dz()

float RC_Channel::norm_input_dz ( )

Definition at line 283 of file RC_Channel.cpp.

Referenced by get_dead_zone().

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

◆ percent_input()

uint8_t RC_Channel::percent_input ( )

Definition at line 303 of file RC_Channel.cpp.

Referenced by get_dead_zone().

Here is the caller graph for this function:

◆ pwm_to_angle()

int16_t RC_Channel::pwm_to_angle ( )
private

Definition at line 215 of file RC_Channel.cpp.

Referenced by set_pwm().

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

◆ pwm_to_angle_dz()

int16_t RC_Channel::pwm_to_angle_dz ( uint16_t  dead_zone)
private

Definition at line 205 of file RC_Channel.cpp.

Referenced by get_control_in_zero_dz(), pwm_to_angle(), and recompute_pwm_no_deadzone().

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

◆ pwm_to_angle_dz_trim()

int16_t RC_Channel::pwm_to_angle_dz_trim ( uint16_t  dead_zone,
uint16_t  trim 
)

Definition at line 185 of file RC_Channel.cpp.

Referenced by get_dead_zone(), and pwm_to_angle_dz().

Here is the caller graph for this function:

◆ pwm_to_range()

int16_t RC_Channel::pwm_to_range ( )

Definition at line 247 of file RC_Channel.cpp.

Referenced by get_dead_zone(), and set_pwm().

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

◆ pwm_to_range_dz()

int16_t RC_Channel::pwm_to_range_dz ( uint16_t  dead_zone)

Definition at line 226 of file RC_Channel.cpp.

Referenced by get_control_in_zero_dz(), get_dead_zone(), pwm_to_range(), and recompute_pwm_no_deadzone().

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

◆ read()

uint16_t RC_Channel::read ( void  ) const

Definition at line 325 of file RC_Channel.cpp.

Referenced by AnalogIn_ADS1115::_update(), SRV_Channels::copy_radio_in_out(), and get_dead_zone().

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

◆ recompute_pwm_no_deadzone()

void RC_Channel::recompute_pwm_no_deadzone ( )

Definition at line 129 of file RC_Channel.cpp.

Referenced by get_dead_zone().

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

◆ save_eeprom()

void RC_Channel::save_eeprom ( void  )

Definition at line 171 of file RC_Channel.cpp.

◆ save_radio_trim()

void RC_Channel::save_radio_trim ( )
inline

Definition at line 96 of file RC_Channel.h.

◆ save_trim()

void RC_Channel::save_trim ( void  )

◆ set_and_save_radio_trim()

void RC_Channel::set_and_save_radio_trim ( int16_t  val)
inline

Definition at line 101 of file RC_Channel.h.

Here is the call graph for this function:

◆ set_and_save_trim()

void RC_Channel::set_and_save_trim ( )
inline

Definition at line 98 of file RC_Channel.h.

◆ set_angle()

void RC_Channel::set_angle ( uint16_t  angle)

Definition at line 93 of file RC_Channel.cpp.

Referenced by setup().

Here is the caller graph for this function:

◆ set_control_in()

void RC_Channel::set_control_in ( int16_t  val)
inline

Definition at line 83 of file RC_Channel.h.

Here is the call graph for this function:

◆ set_default_dead_zone()

void RC_Channel::set_default_dead_zone ( int16_t  dzone)

Definition at line 100 of file RC_Channel.cpp.

Referenced by setup().

Here is the caller graph for this function:

◆ set_pwm()

void RC_Channel::set_pwm ( int16_t  pwm)

Definition at line 113 of file RC_Channel.cpp.

Referenced by get_dead_zone(), and RC_Channels::read_input().

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

◆ set_radio_in()

void RC_Channel::set_radio_in ( int16_t  val)
inline

Definition at line 80 of file RC_Channel.h.

Referenced by SRV_Channels::set_output_limit().

Here is the caller graph for this function:

◆ set_radio_max()

void RC_Channel::set_radio_max ( int16_t  val)
inline

Definition at line 92 of file RC_Channel.h.

◆ set_radio_min()

void RC_Channel::set_radio_min ( int16_t  val)
inline

Definition at line 89 of file RC_Channel.h.

◆ set_radio_trim()

void RC_Channel::set_radio_trim ( int16_t  val)
inline

Definition at line 95 of file RC_Channel.h.

◆ set_range()

void RC_Channel::set_range ( uint16_t  high)

Definition at line 86 of file RC_Channel.cpp.

Referenced by setup().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ RC_Channels

friend class RC_Channels
friend

Definition at line 18 of file RC_Channel.h.

◆ SRV_Channels

friend class SRV_Channels
friend

Definition at line 17 of file RC_Channel.h.

Member Data Documentation

◆ ch_in

uint8_t RC_Channel::ch_in
private

Definition at line 124 of file RC_Channel.h.

Referenced by input(), min_max_configured(), RC_Channels::RC_Channels(), and read().

◆ configured_mask

uint32_t RC_Channel::configured_mask
staticprivate

Definition at line 127 of file RC_Channel.h.

Referenced by min_max_configured().

◆ control_in

int16_t RC_Channel::control_in
private

Definition at line 111 of file RC_Channel.h.

Referenced by get_control_in(), recompute_pwm_no_deadzone(), set_control_in(), and set_pwm().

◆ dead_zone

AP_Int16 RC_Channel::dead_zone
private

◆ high_in

int16_t RC_Channel::high_in
private

◆ radio_in

int16_t RC_Channel::radio_in
private

◆ radio_max

AP_Int16 RC_Channel::radio_max
private

◆ radio_min

AP_Int16 RC_Channel::radio_min
private

◆ radio_trim

AP_Int16 RC_Channel::radio_trim
private

◆ reversed

AP_Int8 RC_Channel::reversed
private

◆ type_in

uint8_t RC_Channel::type_in
private

◆ var_info

const AP_Param::GroupInfo RC_Channel::var_info
static

Definition at line 74 of file RC_Channel.h.

Referenced by RC_Channel().


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