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

#include <SRV_Channel.h>

Collaboration diagram for SRV_Channels:
[legend]

Classes

struct  srv_function
 

Public Member Functions

 SRV_Channels (void)
 
void set_esc_scaling_for (SRV_Channel::Aux_servo_function_t function)
 
bool auto_trim_enabled (void) const
 
void adjust_trim (SRV_Channel::Aux_servo_function_t function, float v)
 
void save_trim (void)
 
void set_reversible_throttle (void)
 
void disable_passthrough (bool disable)
 

Static Public Member Functions

static void set_default_function (uint8_t chan, SRV_Channel::Aux_servo_function_t function)
 
static void set_output_pwm (SRV_Channel::Aux_servo_function_t function, uint16_t value)
 
static void set_output_pwm_first (SRV_Channel::Aux_servo_function_t function, uint16_t value)
 
static void set_output_pwm_chan (uint8_t chan, uint16_t value)
 
static void set_output_scaled (SRV_Channel::Aux_servo_function_t function, int16_t value)
 
static int16_t get_output_scaled (SRV_Channel::Aux_servo_function_t function)
 
static bool get_output_pwm (SRV_Channel::Aux_servo_function_t function, uint16_t &value)
 
static float get_output_norm (SRV_Channel::Aux_servo_function_t function)
 
static uint16_t get_output_channel_mask (SRV_Channel::Aux_servo_function_t function)
 
static void limit_slew_rate (SRV_Channel::Aux_servo_function_t function, float slew_rate, float dt)
 
static void output_ch_all (void)
 
static void output_trim_all (void)
 
static void setup_failsafe_trim_all (void)
 
static void set_output_pwm_trimmed (SRV_Channel::Aux_servo_function_t function, int16_t value)
 
static void set_trim_to_servo_out_for (SRV_Channel::Aux_servo_function_t function)
 
static void set_trim_to_min_for (SRV_Channel::Aux_servo_function_t function)
 
static void set_trim_to_pwm_for (SRV_Channel::Aux_servo_function_t function, int16_t pwm)
 
static void set_output_to_min (SRV_Channel::Aux_servo_function_t function)
 
static void set_output_to_max (SRV_Channel::Aux_servo_function_t function)
 
static void set_output_to_trim (SRV_Channel::Aux_servo_function_t function)
 
static void copy_radio_in_out (SRV_Channel::Aux_servo_function_t function, bool do_input_output=false)
 
static void copy_radio_in_out_mask (uint16_t mask)
 
static void set_failsafe_pwm (SRV_Channel::Aux_servo_function_t function, uint16_t pwm)
 
static void set_failsafe_limit (SRV_Channel::Aux_servo_function_t function, SRV_Channel::LimitValue limit)
 
static void set_safety_limit (SRV_Channel::Aux_servo_function_t function, SRV_Channel::LimitValue limit)
 
static void set_output_limit (SRV_Channel::Aux_servo_function_t function, SRV_Channel::LimitValue limit)
 
static bool function_assigned (SRV_Channel::Aux_servo_function_t function)
 
static void move_servo (SRV_Channel::Aux_servo_function_t function, int16_t value, int16_t angle_min, int16_t angle_max)
 
static void enable_aux_servos (void)
 Should be called after the the servo functions have been initialized. More...
 
static void enable_by_mask (uint16_t mask)
 enable output channels using a channel mask More...
 
static SRV_Channel::Aux_servo_function_t channel_function (uint8_t channel)
 
static void update_aux_servo_function (void)
 setup the output range types of all functions More...
 
static bool set_aux_channel_default (SRV_Channel::Aux_servo_function_t function, uint8_t channel)
 
static bool find_channel (SRV_Channel::Aux_servo_function_t function, uint8_t &chan)
 
static SRV_Channelget_channel_for (SRV_Channel::Aux_servo_function_t function, int8_t default_chan=-1)
 
static void set_angle (SRV_Channel::Aux_servo_function_t function, uint16_t angle)
 
static void set_range (SRV_Channel::Aux_servo_function_t function, uint16_t range)
 
static void set_rc_frequency (SRV_Channel::Aux_servo_function_t function, uint16_t frequency)
 
static void constrain_pwm (SRV_Channel::Aux_servo_function_t function)
 
static void calc_pwm (void)
 
static SRV_Channelsrv_channel (uint8_t i)
 
static bool upgrade_parameters (const uint8_t old_keys[14], uint16_t aux_channel_mask, RCMapper *rcmap)
 
static void upgrade_motors_servo (uint8_t ap_motors_key, uint8_t ap_motors_idx, uint8_t new_channel)
 
static SRV_Channel::Aux_servo_function_t get_motor_function (uint8_t channel)
 
static void cork ()
 
static void push ()
 
static void set_disabled_channel_mask (uint16_t mask)
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Static Private Member Functions

static bool passthrough_disabled (void)
 

Private Attributes

struct {
   bool   k_throttle_reversible:1
 
flags
 
SRV_Channel::servo_mask_t trimmed_mask
 
AP_Volz_Protocol volz
 
AP_SBusOut sbus
 
SRV_Channel obj_channels [NUM_SERVO_CHANNELS]
 
AP_Int8 auto_trim
 
AP_Int16 default_rate
 

Static Private Attributes

static bool disabled_passthrough
 
static Bitmask function_mask {SRV_Channel::k_nr_aux_servo_functions}
 
static bool initialised
 
static SRV_Channelchannels
 
static SRV_Channelsinstance
 
static AP_Volz_Protocolvolz_ptr
 
static AP_SBusOutsbus_ptr
 
static uint16_t disabled_mask
 
static struct SRV_Channels::srv_function functions [SRV_Channel::k_nr_aux_servo_functions]
 

Friends

class SRV_Channel
 

Detailed Description

Definition at line 251 of file SRV_Channel.h.

Constructor & Destructor Documentation

◆ SRV_Channels()

SRV_Channels::SRV_Channels ( void  )

Definition at line 148 of file SRV_Channels.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ adjust_trim()

void SRV_Channels::adjust_trim ( SRV_Channel::Aux_servo_function_t  function,
float  v 
)

Definition at line 534 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ auto_trim_enabled()

bool SRV_Channels::auto_trim_enabled ( void  ) const
inline

Definition at line 299 of file SRV_Channel.h.

◆ calc_pwm()

void SRV_Channels::calc_pwm ( void  )
static

Definition at line 198 of file SRV_Channels.cpp.

Referenced by AP_MotorsTailsitter::output_to_motors().

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

◆ channel_function()

SRV_Channel::Aux_servo_function_t SRV_Channels::channel_function ( uint8_t  channel)
static

Definition at line 71 of file SRV_Channel_aux.cpp.

◆ constrain_pwm()

void SRV_Channels::constrain_pwm ( SRV_Channel::Aux_servo_function_t  function)
static

Definition at line 658 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ copy_radio_in_out()

void SRV_Channels::copy_radio_in_out ( SRV_Channel::Aux_servo_function_t  function,
bool  do_input_output = false 
)
static

Definition at line 241 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ copy_radio_in_out_mask()

void SRV_Channels::copy_radio_in_out_mask ( uint16_t  mask)
static

Definition at line 267 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ cork()

void SRV_Channels::cork ( void  )
static

Definition at line 216 of file SRV_Channels.cpp.

Here is the call graph for this function:

◆ disable_passthrough()

void SRV_Channels::disable_passthrough ( bool  disable)
inline

Definition at line 395 of file SRV_Channel.h.

Here is the call graph for this function:

◆ enable_aux_servos()

void SRV_Channels::enable_aux_servos ( void  )
static

Should be called after the the servo functions have been initialized.

Definition at line 154 of file SRV_Channel_aux.cpp.

Referenced by stability_test().

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

◆ enable_by_mask()

void SRV_Channels::enable_by_mask ( uint16_t  mask)
static

enable output channels using a channel mask

Definition at line 176 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ find_channel()

bool SRV_Channels::find_channel ( SRV_Channel::Aux_servo_function_t  function,
uint8_t &  chan 
)
static

Definition at line 425 of file SRV_Channel_aux.cpp.

Referenced by AP_Motors::add_motor_num(), Compass_PerMotor::scaled_output(), and SITL::XPlane::send_data().

Here is the caller graph for this function:

◆ function_assigned()

bool SRV_Channels::function_assigned ( SRV_Channel::Aux_servo_function_t  function)
static

Definition at line 364 of file SRV_Channel_aux.cpp.

Referenced by AP_Mount_Servo::check_servo_map(), AP_Mount::init(), AP_Winch_Servo::update(), AC_Sprayer::update(), and AP_Gripper_Servo::valid().

Here is the caller graph for this function:

◆ get_channel_for()

SRV_Channel * SRV_Channels::get_channel_for ( SRV_Channel::Aux_servo_function_t  function,
int8_t  default_chan = -1 
)
static

Definition at line 445 of file SRV_Channel_aux.cpp.

Referenced by AP_MotorsTri::init(), AP_MotorsHeli_Quad::init_outputs(), AP_MotorsHeli_Dual::init_outputs(), AP_MotorsHeli_Single::init_outputs(), AP_Landing_Deepstall::override_servos(), and AP_Landing_Deepstall::verify_land().

Here is the caller graph for this function:

◆ get_motor_function()

static SRV_Channel::Aux_servo_function_t SRV_Channels::get_motor_function ( uint8_t  channel)
inlinestatic

Definition at line 414 of file SRV_Channel.h.

Referenced by AP_Motors::add_motor_num(), AP_MotorsCoax::init(), AP_MotorsSingle::init(), AP_MotorsHeli_Quad::init_outputs(), AP_Motors::rc_map_mask(), AP_Motors::rc_write(), and AP_Motors::rc_write_angle().

Here is the caller graph for this function:

◆ get_output_channel_mask()

uint16_t SRV_Channels::get_output_channel_mask ( SRV_Channel::Aux_servo_function_t  function)
static

Definition at line 476 of file SRV_Channel_aux.cpp.

Referenced by AP_Motors::rc_map_mask().

Here is the caller graph for this function:

◆ get_output_norm()

float SRV_Channels::get_output_norm ( SRV_Channel::Aux_servo_function_t  function)
static

Definition at line 597 of file SRV_Channel_aux.cpp.

◆ get_output_pwm()

bool SRV_Channels::get_output_pwm ( SRV_Channel::Aux_servo_function_t  function,
uint16_t &  value 
)
static

Definition at line 561 of file SRV_Channel_aux.cpp.

Referenced by AP_Gripper_Servo::has_state_pwm().

Here is the caller graph for this function:

◆ get_output_scaled()

int16_t SRV_Channels::get_output_scaled ( SRV_Channel::Aux_servo_function_t  function)
static

Definition at line 465 of file SRV_Channel_aux.cpp.

Referenced by AP_Airspeed::setHIL().

Here is the caller graph for this function:

◆ limit_slew_rate()

void SRV_Channels::limit_slew_rate ( SRV_Channel::Aux_servo_function_t  function,
float  slew_rate,
float  dt 
)
static

Definition at line 611 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ move_servo()

void SRV_Channels::move_servo ( SRV_Channel::Aux_servo_function_t  function,
int16_t  value,
int16_t  angle_min,
int16_t  angle_max 
)
static

Definition at line 374 of file SRV_Channel_aux.cpp.

Referenced by AP_Mount_Servo::move_servo(), and AC_Sprayer::update().

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

◆ output_ch_all()

void SRV_Channels::output_ch_all ( void  )
static

Definition at line 61 of file SRV_Channel_aux.cpp.

Referenced by AP_MotorsTailsitter::output_to_motors().

Here is the caller graph for this function:

◆ output_trim_all()

void SRV_Channels::output_trim_all ( void  )
static

Definition at line 181 of file SRV_Channels.cpp.

Here is the call graph for this function:

◆ passthrough_disabled()

static bool SRV_Channels::passthrough_disabled ( void  )
inlinestaticprivate

Definition at line 473 of file SRV_Channel.h.

Referenced by SRV_Channel::output_ch().

Here is the caller graph for this function:

◆ push()

void SRV_Channels::push ( void  )
static

Definition at line 224 of file SRV_Channels.cpp.

Here is the call graph for this function:

◆ save_trim()

void SRV_Channels::save_trim ( void  )

Definition at line 171 of file SRV_Channels.cpp.

◆ set_angle()

void SRV_Channels::set_angle ( SRV_Channel::Aux_servo_function_t  function,
uint16_t  angle 
)
static

Definition at line 638 of file SRV_Channel_aux.cpp.

Referenced by AP_Winch_Servo::init(), AP_MotorsCoax::init(), and AP_MotorsSingle::init().

Here is the caller graph for this function:

◆ set_aux_channel_default()

bool SRV_Channels::set_aux_channel_default ( SRV_Channel::Aux_servo_function_t  function,
uint8_t  channel 
)
static

Definition at line 398 of file SRV_Channel_aux.cpp.

Referenced by AP_Motors::add_motor_num(), and AP_MotorsHeli_RSC::init_servo().

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

◆ set_default_function()

void SRV_Channels::set_default_function ( uint8_t  chan,
SRV_Channel::Aux_servo_function_t  function 
)
static

Definition at line 511 of file SRV_Channel_aux.cpp.

◆ set_disabled_channel_mask()

static void SRV_Channels::set_disabled_channel_mask ( uint16_t  mask)
inlinestatic

Definition at line 426 of file SRV_Channel.h.

◆ set_esc_scaling_for()

void SRV_Channels::set_esc_scaling_for ( SRV_Channel::Aux_servo_function_t  function)

Definition at line 522 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ set_failsafe_limit()

void SRV_Channels::set_failsafe_limit ( SRV_Channel::Aux_servo_function_t  function,
SRV_Channel::LimitValue  limit 
)
static

Definition at line 302 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ set_failsafe_pwm()

void SRV_Channels::set_failsafe_pwm ( SRV_Channel::Aux_servo_function_t  function,
uint16_t  pwm 
)
static

Definition at line 285 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ set_output_limit()

void SRV_Channels::set_output_limit ( SRV_Channel::Aux_servo_function_t  function,
SRV_Channel::LimitValue  limit 
)
static

Definition at line 338 of file SRV_Channel_aux.cpp.

Referenced by AC_Sprayer::stop_spraying(), AP_Winch_Servo::update(), AP_MotorsHeli_Quad::update_motor_control(), AP_MotorsHeli_Dual::update_motor_control(), and AP_MotorsHeli_Single::update_motor_control().

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

◆ set_output_pwm()

void SRV_Channels::set_output_pwm ( SRV_Channel::Aux_servo_function_t  function,
uint16_t  value 
)
static

◆ set_output_pwm_chan()

void SRV_Channels::set_output_pwm_chan ( uint8_t  chan,
uint16_t  value 
)
static

Definition at line 206 of file SRV_Channels.cpp.

Referenced by RCOutputRGBLed::hw_set_rgb().

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

◆ set_output_pwm_first()

void SRV_Channels::set_output_pwm_first ( SRV_Channel::Aux_servo_function_t  function,
uint16_t  value 
)
static

Definition at line 583 of file SRV_Channel_aux.cpp.

◆ set_output_pwm_trimmed()

void SRV_Channels::set_output_pwm_trimmed ( SRV_Channel::Aux_servo_function_t  function,
int16_t  value 
)
static

Definition at line 206 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ set_output_scaled()

void SRV_Channels::set_output_scaled ( SRV_Channel::Aux_servo_function_t  function,
int16_t  value 
)
static

Definition at line 457 of file SRV_Channel_aux.cpp.

Referenced by AP_MotorsMulticopter::output_boost_throttle(), AP_MotorsTailsitter::output_to_motors(), AP_Landing_Deepstall::override_servos(), AP_Motors::rc_write_angle(), AP_Winch_Servo::update(), and AP_MotorsHeli_RSC::write_rsc().

Here is the caller graph for this function:

◆ set_output_to_max()

static void SRV_Channels::set_output_to_max ( SRV_Channel::Aux_servo_function_t  function)
static

◆ set_output_to_min()

static void SRV_Channels::set_output_to_min ( SRV_Channel::Aux_servo_function_t  function)
static

◆ set_output_to_trim()

void SRV_Channels::set_output_to_trim ( SRV_Channel::Aux_servo_function_t  function)
static

Definition at line 573 of file SRV_Channel_aux.cpp.

◆ set_range()

void SRV_Channels::set_range ( SRV_Channel::Aux_servo_function_t  function,
uint16_t  range 
)
static

Definition at line 648 of file SRV_Channel_aux.cpp.

◆ set_rc_frequency()

void SRV_Channels::set_rc_frequency ( SRV_Channel::Aux_servo_function_t  function,
uint16_t  frequency 
)
static

Definition at line 848 of file SRV_Channel_aux.cpp.

Referenced by AP_MotorsTailsitter::AP_MotorsTailsitter().

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

◆ set_reversible_throttle()

void SRV_Channels::set_reversible_throttle ( void  )
inline

Definition at line 308 of file SRV_Channel.h.

Here is the call graph for this function:

◆ set_safety_limit()

void SRV_Channels::set_safety_limit ( SRV_Channel::Aux_servo_function_t  function,
SRV_Channel::LimitValue  limit 
)
static

Definition at line 320 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ set_trim_to_min_for()

void SRV_Channels::set_trim_to_min_for ( SRV_Channel::Aux_servo_function_t  function)
static

Definition at line 499 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ set_trim_to_pwm_for()

void SRV_Channels::set_trim_to_pwm_for ( SRV_Channel::Aux_servo_function_t  function,
int16_t  pwm 
)
static

Definition at line 489 of file SRV_Channel_aux.cpp.

◆ set_trim_to_servo_out_for()

void SRV_Channels::set_trim_to_servo_out_for ( SRV_Channel::Aux_servo_function_t  function)
static

Definition at line 225 of file SRV_Channel_aux.cpp.

◆ setup_failsafe_trim_all()

void SRV_Channels::setup_failsafe_trim_all ( void  )
static

Definition at line 188 of file SRV_Channels.cpp.

Here is the call graph for this function:

◆ srv_channel()

static SRV_Channel* SRV_Channels::srv_channel ( uint8_t  i)
inlinestatic

Definition at line 405 of file SRV_Channel.h.

Referenced by AP_ServoRelayEvents::do_set_servo(), GCS_MAVLINK::send_servo_output_raw(), AP_Arming::servo_checks(), setup(), stability_test(), AP_SBusOut::update(), AP_Volz_Protocol::update(), and AP_ServoRelayEvents::update_events().

Here is the caller graph for this function:

◆ update_aux_servo_function()

void SRV_Channels::update_aux_servo_function ( void  )
static

setup the output range types of all functions

Definition at line 131 of file SRV_Channel_aux.cpp.

◆ upgrade_motors_servo()

void SRV_Channels::upgrade_motors_servo ( uint8_t  ap_motors_key,
uint8_t  ap_motors_idx,
uint8_t  new_channel 
)
static

Definition at line 795 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

◆ upgrade_parameters()

bool SRV_Channels::upgrade_parameters ( const uint8_t  old_keys[14],
uint16_t  aux_channel_mask,
RCMapper rcmap 
)
static

Definition at line 686 of file SRV_Channel_aux.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ SRV_Channel

friend class SRV_Channel
friend

Definition at line 253 of file SRV_Channel.h.

Member Data Documentation

◆ auto_trim

AP_Int8 SRV_Channels::auto_trim
private

Definition at line 469 of file SRV_Channel.h.

◆ channels

SRV_Channel * SRV_Channels::channels
staticprivate

◆ default_rate

AP_Int16 SRV_Channels::default_rate
private

Definition at line 470 of file SRV_Channel.h.

◆ disabled_mask

uint16_t SRV_Channels::disabled_mask
staticprivate

Definition at line 457 of file SRV_Channel.h.

Referenced by SRV_Channel::output_ch().

◆ disabled_passthrough

bool SRV_Channels::disabled_passthrough
staticprivate

Definition at line 433 of file SRV_Channel.h.

◆ flags

struct { ... } SRV_Channels::flags

◆ function_mask

Bitmask SRV_Channels::function_mask {SRV_Channel::k_nr_aux_servo_functions}
staticprivate

Definition at line 437 of file SRV_Channel.h.

◆ functions

SRV_Channels::srv_function SRV_Channels::functions
staticprivate

Definition at line 46 of file SRV_Channels.cpp.

Referenced by calc_pwm().

◆ initialised

bool SRV_Channels::initialised
staticprivate

Definition at line 438 of file SRV_Channel.h.

◆ instance

SRV_Channels * SRV_Channels::instance
staticprivate

Definition at line 442 of file SRV_Channel.h.

Referenced by SRV_Channels().

◆ k_throttle_reversible

bool SRV_Channels::k_throttle_reversible

Definition at line 430 of file SRV_Channel.h.

◆ obj_channels

SRV_Channel SRV_Channels::obj_channels[NUM_SERVO_CHANNELS]
private

Definition at line 459 of file SRV_Channel.h.

Referenced by SRV_Channels().

◆ sbus

AP_SBusOut SRV_Channels::sbus
private

Definition at line 449 of file SRV_Channel.h.

Referenced by SRV_Channels().

◆ sbus_ptr

AP_SBusOut * SRV_Channels::sbus_ptr
staticprivate

Definition at line 450 of file SRV_Channel.h.

Referenced by push(), and SRV_Channels().

◆ trimmed_mask

SRV_Channel::servo_mask_t SRV_Channels::trimmed_mask
private

Definition at line 435 of file SRV_Channel.h.

Referenced by save_trim().

◆ var_info

const AP_Param::GroupInfo SRV_Channels::var_info
static

Definition at line 258 of file SRV_Channel.h.

Referenced by SRV_Channels().

◆ volz

AP_Volz_Protocol SRV_Channels::volz
private

Definition at line 445 of file SRV_Channel.h.

Referenced by SRV_Channels().

◆ volz_ptr

AP_Volz_Protocol * SRV_Channels::volz_ptr
staticprivate

Definition at line 446 of file SRV_Channel.h.

Referenced by push(), and SRV_Channels().


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