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

#include <RCOutput.h>

Inheritance diagram for F4Light::RCOutput:
[legend]
Collaboration diagram for F4Light::RCOutput:
[legend]

Public Member Functions

void init () override
 
void set_freq (uint32_t chmask, uint16_t freq_hz) override
 
uint16_t get_freq (uint8_t ch) override
 
void enable_ch (uint8_t ch) override
 
void disable_ch (uint8_t ch) override
 
void write (uint8_t ch, uint16_t period_us) override
 
void write (uint8_t ch, uint16_t *period_us, uint8_t len)
 
uint16_t read (uint8_t ch) override
 
void read (uint16_t *period_us, uint8_t len) override
 
void cork () override
 
void push () override
 
void set_output_mode (uint16_t mask, enum output_mode mode) override
 
- Public Member Functions inherited from AP_HAL::RCOutput
virtual uint16_t read_last_sent (uint8_t ch)
 
virtual void read_last_sent (uint16_t *period_us, uint8_t len)
 
virtual void set_safety_pwm (uint32_t chmask, uint16_t period_us)
 
virtual void set_failsafe_pwm (uint32_t chmask, uint16_t period_us)
 
virtual bool force_safety_on (void)
 
virtual void force_safety_off (void)
 
virtual void force_safety_no_wait (void)
 
virtual void set_esc_scaling (uint16_t min_pwm, uint16_t max_pwm)
 
virtual bool get_esc_scaling (uint16_t &min_pwm, uint16_t &max_pwm)
 
virtual float scale_esc_to_unity (uint16_t pwm)
 
virtual bool enable_px4io_sbus_out (uint16_t rate_hz)
 
virtual void timer_tick (void)
 
virtual bool serial_setup_output (uint8_t chan, uint32_t baudrate)
 
virtual bool serial_write_bytes (const uint8_t *bytes, uint16_t len)
 
virtual uint16_t serial_read_bytes (uint8_t *buf, uint16_t len)
 
virtual void serial_end (void)
 
virtual void set_default_rate (uint16_t rate_hz)
 
virtual void set_telem_request_mask (uint16_t mask)
 

Static Public Member Functions

static void lateInit ()
 
static void _set_output_mode (enum output_mode mode)
 
static void do_4way_if (AP_HAL::UARTDriver *uart)
 
static uint32_t _timer_period (uint16_t speed_hz, const timer_dev *dev)
 

Static Private Member Functions

static void InitPWM (void)
 
static void set_pwm (uint8_t ch, uint16_t pwm)
 
static void _set_pin_output_mode (uint8_t ch)
 
static bool is_servo_enabled (uint8_t ch)
 
static void init_channel (uint8_t ch)
 
static void init_channels ()
 
static void _init_alt_channels ()
 
static void _timer3_isr_event (TIM_TypeDef *)
 
static void fill_timers ()
 

Static Private Attributes

static uint16_t _period [F4Light_MAX_OUTPUT_CHANNELS]
 
static uint16_t _freq [F4Light_MAX_OUTPUT_CHANNELS]
 
static uint16_t _enabled_channels =0
 
static bool _sbus_enabled =0
 
static bool _corked =0
 
static uint8_t _used_channels =0
 
static enum BOARD_PWM_MODES _mode
 
static bool _once_mode = false
 
static uint8_t _servo_mask =0
 
static uint8_t _initialized [F4Light_MAX_OUTPUT_CHANNELS]
 
static uint32_t _timer2_preload
 
static uint16_t _timer3_preload
 
static uint8_t _pwm_type =0
 
static const timer_devout_timers [16]
 
static uint8_t num_out_timers
 

Additional Inherited Members

- Public Types inherited from AP_HAL::RCOutput
enum  output_mode {
  MODE_PWM_NONE, MODE_PWM_NORMAL, MODE_PWM_ONESHOT, MODE_PWM_ONESHOT125,
  MODE_PWM_BRUSHED, MODE_PWM_DSHOT150, MODE_PWM_DSHOT300, MODE_PWM_DSHOT600,
  MODE_PWM_DSHOT1200
}
 

Detailed Description

Definition at line 42 of file RCOutput.h.

Member Function Documentation

◆ _init_alt_channels()

static void F4Light::RCOutput::_init_alt_channels ( )
inlinestaticprivate

Definition at line 99 of file RCOutput.h.

◆ _set_output_mode()

void RCOutput::_set_output_mode ( enum output_mode  mode)
static

Definition at line 245 of file RCOutput.cpp.

Referenced by InitPWM(), and set_output_mode().

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

◆ _set_pin_output_mode()

void RCOutput::_set_pin_output_mode ( uint8_t  ch)
staticprivate

Definition at line 389 of file RCOutput.cpp.

Referenced by enable_ch().

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

◆ _timer3_isr_event()

static void F4Light::RCOutput::_timer3_isr_event ( TIM_TypeDef *  )
staticprivate

◆ _timer_period()

static uint32_t F4Light::RCOutput::_timer_period ( uint16_t  speed_hz,
const timer_dev dev 
)
inlinestatic

Definition at line 79 of file RCOutput.h.

Referenced by init_channel(), set_freq(), and F4Light::GPIO::write().

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

◆ cork()

void RCOutput::cork ( void  )
inlineoverridevirtual

Implements AP_HAL::RCOutput.

Definition at line 54 of file RCOutput.h.

Here is the call graph for this function:

◆ disable_ch()

void RCOutput::disable_ch ( uint8_t  ch)
overridevirtual

Implements AP_HAL::RCOutput.

Definition at line 619 of file RCOutput.cpp.

Here is the call graph for this function:

◆ do_4way_if()

void RCOutput::do_4way_if ( AP_HAL::UARTDriver uart)
static

Definition at line 184 of file RCOutput.cpp.

Referenced by set_output_mode().

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

◆ enable_ch()

void RCOutput::enable_ch ( uint8_t  ch)
overridevirtual

Implements AP_HAL::RCOutput.

Definition at line 587 of file RCOutput.cpp.

Here is the call graph for this function:

◆ fill_timers()

void RCOutput::fill_timers ( )
staticprivate

Definition at line 224 of file RCOutput.cpp.

Referenced by disable_ch(), enable_ch(), and InitPWM().

Here is the caller graph for this function:

◆ get_freq()

uint16_t RCOutput::get_freq ( uint8_t  ch)
overridevirtual

Implements AP_HAL::RCOutput.

Definition at line 214 of file RCOutput.cpp.

Here is the call graph for this function:

◆ init()

void RCOutput::init ( void  )
overridevirtual

Implements AP_HAL::RCOutput.

Definition at line 174 of file RCOutput.cpp.

◆ init_channel()

void RCOutput::init_channel ( uint8_t  ch)
staticprivate

Definition at line 480 of file RCOutput.cpp.

Referenced by enable_ch(), and init_channels().

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

◆ init_channels()

void RCOutput::init_channels ( )
staticprivate

Definition at line 500 of file RCOutput.cpp.

Referenced by _set_output_mode().

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

◆ InitPWM()

void RCOutput::InitPWM ( void  )
staticprivate

Definition at line 202 of file RCOutput.cpp.

Referenced by _timer_period(), and lateInit().

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

◆ is_servo_enabled()

bool RCOutput::is_servo_enabled ( uint8_t  ch)
staticprivate

Definition at line 445 of file RCOutput.cpp.

Referenced by disable_ch(), enable_ch(), and set_pwm().

Here is the caller graph for this function:

◆ lateInit()

void RCOutput::lateInit ( )
static

Definition at line 190 of file RCOutput.cpp.

Referenced by cork().

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

◆ push()

void RCOutput::push ( void  )
overridevirtual

Implements AP_HAL::RCOutput.

Definition at line 641 of file RCOutput.cpp.

Referenced by cork().

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

◆ read() [1/2]

uint16_t RCOutput::read ( uint8_t  ch)
overridevirtual

Implements AP_HAL::RCOutput.

Definition at line 573 of file RCOutput.cpp.

Referenced by read().

Here is the caller graph for this function:

◆ read() [2/2]

void RCOutput::read ( uint16_t *  period_us,
uint8_t  len 
)
overridevirtual

Implements AP_HAL::RCOutput.

Definition at line 580 of file RCOutput.cpp.

Here is the call graph for this function:

◆ set_freq()

void RCOutput::set_freq ( uint32_t  chmask,
uint16_t  freq_hz 
)
overridevirtual

Implements AP_HAL::RCOutput.

Definition at line 459 of file RCOutput.cpp.

Here is the call graph for this function:

◆ set_output_mode()

void F4Light::RCOutput::set_output_mode ( uint16_t  mask,
enum output_mode  mode 
)
inlineoverridevirtual

Reimplemented from AP_HAL::RCOutput.

Definition at line 59 of file RCOutput.h.

Here is the call graph for this function:

◆ set_pwm()

void RCOutput::set_pwm ( uint8_t  ch,
uint16_t  pwm 
)
staticprivate

Definition at line 513 of file RCOutput.cpp.

Referenced by _timer_period(), push(), and write().

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

◆ write() [1/2]

void RCOutput::write ( uint8_t  ch,
uint16_t  period_us 
)
overridevirtual

Implements AP_HAL::RCOutput.

Definition at line 545 of file RCOutput.cpp.

Referenced by write().

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

◆ write() [2/2]

void RCOutput::write ( uint8_t  ch,
uint16_t *  period_us,
uint8_t  len 
)

Definition at line 564 of file RCOutput.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _corked

bool RCOutput::_corked =0
staticprivate

Definition at line 98 of file RCOutput.h.

Referenced by cork(), push(), and write().

◆ _enabled_channels

uint16_t RCOutput::_enabled_channels =0
staticprivate

Definition at line 96 of file RCOutput.h.

Referenced by _set_output_mode(), disable_ch(), enable_ch(), fill_timers(), push(), set_freq(), and set_pwm().

◆ _freq

uint16_t RCOutput::_freq
staticprivate

Definition at line 88 of file RCOutput.h.

Referenced by _set_output_mode(), init_channel(), InitPWM(), and set_freq().

◆ _initialized

uint8_t RCOutput::_initialized
staticprivate

Definition at line 105 of file RCOutput.h.

Referenced by enable_ch(), and init().

◆ _mode

enum BOARD_PWM_MODES F4Light::RCOutput::_mode
staticprivate

Definition at line 101 of file RCOutput.h.

Referenced by _set_output_mode(), _set_pin_output_mode(), and set_pwm().

◆ _once_mode

bool RCOutput::_once_mode = false
staticprivate

Definition at line 102 of file RCOutput.h.

Referenced by _set_output_mode(), init_channel(), push(), and set_freq().

◆ _period

uint16_t F4Light::RCOutput::_period[F4Light_MAX_OUTPUT_CHANNELS]
staticprivate

Definition at line 87 of file RCOutput.h.

Referenced by disable_ch(), enable_ch(), init(), push(), read(), and write().

◆ _pwm_type

uint8_t RCOutput::_pwm_type =0
staticprivate

Definition at line 114 of file RCOutput.h.

Referenced by _set_output_mode(), and lateInit().

◆ _sbus_enabled

bool RCOutput::_sbus_enabled =0
staticprivate

Definition at line 97 of file RCOutput.h.

◆ _servo_mask

uint8_t RCOutput::_servo_mask =0
staticprivate

Definition at line 103 of file RCOutput.h.

Referenced by is_servo_enabled(), and lateInit().

◆ _timer2_preload

uint32_t RCOutput::_timer2_preload
staticprivate

Definition at line 111 of file RCOutput.h.

◆ _timer3_preload

uint16_t RCOutput::_timer3_preload
staticprivate

Definition at line 112 of file RCOutput.h.

◆ _used_channels

uint8_t RCOutput::_used_channels =0
staticprivate

Definition at line 100 of file RCOutput.h.

Referenced by init(), push(), and write().

◆ num_out_timers

uint8_t F4Light::RCOutput::num_out_timers
staticprivate

Definition at line 118 of file RCOutput.h.

Referenced by _set_output_mode(), fill_timers(), and push().

◆ out_timers

const timer_dev * RCOutput::out_timers
staticprivate

Definition at line 117 of file RCOutput.h.

Referenced by _set_output_mode(), fill_timers(), and push().


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