APM:Libraries
|
Object managing one RC channel. More...
#include <RC_Channel.h>
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 |
Object managing one RC channel.
Definition at line 15 of file RC_Channel.h.
Enumerator | |
---|---|
RC_CHANNEL_LIMIT_TRIM | |
RC_CHANNEL_LIMIT_MIN | |
RC_CHANNEL_LIMIT_MAX |
Definition at line 23 of file RC_Channel.h.
RC_Channel::RC_Channel | ( | void | ) |
|
inline |
Definition at line 82 of file RC_Channel.h.
int16_t RC_Channel::get_control_in_zero_dz | ( | void | ) |
Definition at line 253 of file RC_Channel.cpp.
Referenced by set_control_in().
int16_t RC_Channel::get_control_mid | ( | ) | const |
Definition at line 143 of file RC_Channel.cpp.
Referenced by get_dead_zone().
|
inline |
|
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().
|
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().
|
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().
|
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().
bool RC_Channel::get_reverse | ( | void | ) | const |
Definition at line 106 of file RC_Channel.cpp.
Referenced by AP_Mount_Backend::angle_input().
bool RC_Channel::in_trim_dz | ( | ) |
void RC_Channel::input | ( | ) |
Definition at line 319 of file RC_Channel.cpp.
Referenced by get_dead_zone().
void RC_Channel::load_eeprom | ( | void | ) |
Definition at line 162 of file RC_Channel.cpp.
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().
float RC_Channel::norm_input | ( | ) |
Definition at line 264 of file RC_Channel.cpp.
Referenced by get_dead_zone().
float RC_Channel::norm_input_dz | ( | ) |
Definition at line 283 of file RC_Channel.cpp.
Referenced by get_dead_zone().
uint8_t RC_Channel::percent_input | ( | ) |
Definition at line 303 of file RC_Channel.cpp.
Referenced by get_dead_zone().
|
private |
Definition at line 215 of file RC_Channel.cpp.
Referenced by set_pwm().
|
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().
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().
int16_t RC_Channel::pwm_to_range | ( | ) |
Definition at line 247 of file RC_Channel.cpp.
Referenced by get_dead_zone(), and set_pwm().
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().
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().
void RC_Channel::recompute_pwm_no_deadzone | ( | ) |
Definition at line 129 of file RC_Channel.cpp.
Referenced by get_dead_zone().
void RC_Channel::save_eeprom | ( | void | ) |
Definition at line 171 of file RC_Channel.cpp.
|
inline |
Definition at line 96 of file RC_Channel.h.
void RC_Channel::save_trim | ( | void | ) |
|
inline |
|
inline |
Definition at line 98 of file RC_Channel.h.
void RC_Channel::set_angle | ( | uint16_t | angle | ) |
Definition at line 93 of file RC_Channel.cpp.
Referenced by setup().
|
inline |
void RC_Channel::set_default_dead_zone | ( | int16_t | dzone | ) |
Definition at line 100 of file RC_Channel.cpp.
Referenced by setup().
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().
|
inline |
Definition at line 80 of file RC_Channel.h.
Referenced by SRV_Channels::set_output_limit().
|
inline |
Definition at line 92 of file RC_Channel.h.
|
inline |
Definition at line 89 of file RC_Channel.h.
|
inline |
Definition at line 95 of file RC_Channel.h.
void RC_Channel::set_range | ( | uint16_t | high | ) |
Definition at line 86 of file RC_Channel.cpp.
Referenced by setup().
|
friend |
Definition at line 18 of file RC_Channel.h.
|
friend |
Definition at line 17 of file RC_Channel.h.
|
private |
Definition at line 124 of file RC_Channel.h.
Referenced by input(), min_max_configured(), RC_Channels::RC_Channels(), and read().
|
staticprivate |
Definition at line 127 of file RC_Channel.h.
Referenced by min_max_configured().
|
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().
|
private |
Definition at line 118 of file RC_Channel.h.
Referenced by get_control_mid(), get_dead_zone(), in_trim_dz(), load_eeprom(), norm_input_dz(), pwm_to_angle(), pwm_to_range(), save_eeprom(), and set_default_dead_zone().
|
private |
Definition at line 121 of file RC_Channel.h.
Referenced by get_control_mid(), pwm_to_angle_dz_trim(), pwm_to_range_dz(), set_angle(), and set_range().
|
private |
Definition at line 108 of file RC_Channel.h.
Referenced by get_radio_in(), in_trim_dz(), input(), norm_input(), norm_input_dz(), percent_input(), pwm_to_angle_dz_trim(), pwm_to_range_dz(), set_and_save_trim(), set_pwm(), and set_radio_in().
|
private |
Definition at line 115 of file RC_Channel.h.
Referenced by get_control_mid(), get_radio_max(), load_eeprom(), min_max_configured(), norm_input(), norm_input_dz(), percent_input(), pwm_to_angle_dz_trim(), pwm_to_range_dz(), save_eeprom(), set_radio_max(), and SRV_Channels::upgrade_parameters().
|
private |
Definition at line 113 of file RC_Channel.h.
Referenced by get_control_mid(), get_radio_min(), load_eeprom(), min_max_configured(), norm_input(), norm_input_dz(), percent_input(), pwm_to_angle_dz_trim(), pwm_to_range_dz(), save_eeprom(), set_radio_min(), and SRV_Channels::upgrade_parameters().
|
private |
Definition at line 114 of file RC_Channel.h.
Referenced by get_radio_trim(), in_trim_dz(), load_eeprom(), norm_input(), norm_input_dz(), pwm_to_angle_dz(), save_eeprom(), save_radio_trim(), set_and_save_radio_trim(), set_and_save_trim(), set_radio_trim(), and SRV_Channels::upgrade_parameters().
|
private |
Definition at line 117 of file RC_Channel.h.
Referenced by get_control_mid(), get_reverse(), load_eeprom(), norm_input(), norm_input_dz(), percent_input(), pwm_to_angle_dz_trim(), pwm_to_range_dz(), save_eeprom(), and SRV_Channels::upgrade_parameters().
|
private |
Definition at line 120 of file RC_Channel.h.
Referenced by get_control_in_zero_dz(), get_control_mid(), recompute_pwm_no_deadzone(), set_angle(), set_pwm(), and set_range().
|
static |
Definition at line 74 of file RC_Channel.h.
Referenced by RC_Channel().