APM:Libraries
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Linux::RCOutput_PCA9685 Class Reference

#include <RCOutput_PCA9685.h>

Inheritance diagram for Linux::RCOutput_PCA9685:
[legend]
Collaboration diagram for Linux::RCOutput_PCA9685:
[legend]

Public Member Functions

 RCOutput_PCA9685 (AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev, bool external_clock, uint8_t channel_offset, int16_t oe_pin_number)
 
 ~RCOutput_PCA9685 ()
 
void init ()
 
void reset_all_channels ()
 
void set_freq (uint32_t chmask, uint16_t freq_hz)
 
uint16_t get_freq (uint8_t ch)
 
void enable_ch (uint8_t ch)
 
void disable_ch (uint8_t ch)
 
void write (uint8_t ch, uint16_t period_us)
 
void cork () override
 
void push () override
 
uint16_t read (uint8_t ch)
 
void read (uint16_t *period_us, uint8_t len)
 
- 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_output_mode (uint16_t mask, enum output_mode mode)
 
virtual void set_default_rate (uint16_t rate_hz)
 
virtual void set_telem_request_mask (uint16_t mask)
 

Private Member Functions

void reset ()
 

Private Attributes

AP_HAL::DigitalSource_enable_pin
 
AP_HAL::OwnPtr< AP_HAL::I2CDevice_dev
 
uint16_t _frequency
 
float _osc_clock
 
uint16_t * _pulses_buffer
 
bool _external_clock
 
bool _corking = false
 
uint8_t _channel_offset
 
int16_t _oe_pin_number
 
uint16_t _pending_write_mask
 

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 15 of file RCOutput_PCA9685.h.

Constructor & Destructor Documentation

◆ RCOutput_PCA9685()

RCOutput_PCA9685::RCOutput_PCA9685 ( AP_HAL::OwnPtr< AP_HAL::I2CDevice dev,
bool  external_clock,
uint8_t  channel_offset,
int16_t  oe_pin_number 
)

Definition at line 59 of file RCOutput_PCA9685.cpp.

◆ ~RCOutput_PCA9685()

RCOutput_PCA9685::~RCOutput_PCA9685 ( )

Definition at line 77 of file RCOutput_PCA9685.cpp.

Member Function Documentation

◆ cork()

void RCOutput_PCA9685::cork ( void  )
overridevirtual

Implements AP_HAL::RCOutput.

Definition at line 185 of file RCOutput_PCA9685.cpp.

◆ disable_ch()

void RCOutput_PCA9685::disable_ch ( uint8_t  ch)
virtual

Implements AP_HAL::RCOutput.

Definition at line 165 of file RCOutput_PCA9685.cpp.

Here is the call graph for this function:

◆ enable_ch()

void RCOutput_PCA9685::enable_ch ( uint8_t  ch)
virtual

Implements AP_HAL::RCOutput.

Definition at line 160 of file RCOutput_PCA9685.cpp.

◆ get_freq()

uint16_t RCOutput_PCA9685::get_freq ( uint8_t  ch)
virtual

Implements AP_HAL::RCOutput.

Definition at line 155 of file RCOutput_PCA9685.cpp.

◆ init()

void RCOutput_PCA9685::init ( void  )
virtual

Implements AP_HAL::RCOutput.

Definition at line 82 of file RCOutput_PCA9685.cpp.

Here is the call graph for this function:

◆ push()

void RCOutput_PCA9685::push ( void  )
overridevirtual

Implements AP_HAL::RCOutput.

Definition at line 190 of file RCOutput_PCA9685.cpp.

Referenced by write().

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

◆ read() [1/2]

uint16_t RCOutput_PCA9685::read ( uint8_t  ch)
virtual

Implements AP_HAL::RCOutput.

Definition at line 241 of file RCOutput_PCA9685.cpp.

Referenced by read().

Here is the caller graph for this function:

◆ read() [2/2]

void RCOutput_PCA9685::read ( uint16_t *  period_us,
uint8_t  len 
)
virtual

Implements AP_HAL::RCOutput.

Definition at line 246 of file RCOutput_PCA9685.cpp.

Here is the call graph for this function:

◆ reset()

void Linux::RCOutput_PCA9685::reset ( )
private

◆ reset_all_channels()

void RCOutput_PCA9685::reset_all_channels ( )

Definition at line 97 of file RCOutput_PCA9685.cpp.

Referenced by init().

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

◆ set_freq()

void RCOutput_PCA9685::set_freq ( uint32_t  chmask,
uint16_t  freq_hz 
)
virtual

Implements AP_HAL::RCOutput.

Definition at line 112 of file RCOutput_PCA9685.cpp.

Referenced by init().

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

◆ write()

void RCOutput_PCA9685::write ( uint8_t  ch,
uint16_t  period_us 
)
virtual

Implements AP_HAL::RCOutput.

Definition at line 170 of file RCOutput_PCA9685.cpp.

Referenced by disable_ch(), and set_freq().

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

Member Data Documentation

◆ _channel_offset

uint8_t Linux::RCOutput_PCA9685::_channel_offset
private

Definition at line 47 of file RCOutput_PCA9685.h.

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

◆ _corking

bool Linux::RCOutput_PCA9685::_corking = false
private

Definition at line 46 of file RCOutput_PCA9685.h.

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

◆ _dev

AP_HAL::OwnPtr<AP_HAL::I2CDevice> Linux::RCOutput_PCA9685::_dev
private

Definition at line 39 of file RCOutput_PCA9685.h.

Referenced by push(), reset_all_channels(), and set_freq().

◆ _enable_pin

AP_HAL::DigitalSource* Linux::RCOutput_PCA9685::_enable_pin
private

Definition at line 38 of file RCOutput_PCA9685.h.

Referenced by init().

◆ _external_clock

bool Linux::RCOutput_PCA9685::_external_clock
private

Definition at line 45 of file RCOutput_PCA9685.h.

Referenced by RCOutput_PCA9685(), and set_freq().

◆ _frequency

uint16_t Linux::RCOutput_PCA9685::_frequency
private

Definition at line 40 of file RCOutput_PCA9685.h.

Referenced by get_freq(), push(), and set_freq().

◆ _oe_pin_number

int16_t Linux::RCOutput_PCA9685::_oe_pin_number
private

Definition at line 48 of file RCOutput_PCA9685.h.

Referenced by init().

◆ _osc_clock

float Linux::RCOutput_PCA9685::_osc_clock
private

Definition at line 41 of file RCOutput_PCA9685.h.

Referenced by RCOutput_PCA9685(), and set_freq().

◆ _pending_write_mask

uint16_t Linux::RCOutput_PCA9685::_pending_write_mask
private

Definition at line 49 of file RCOutput_PCA9685.h.

Referenced by push(), and write().

◆ _pulses_buffer

uint16_t* Linux::RCOutput_PCA9685::_pulses_buffer
private

Definition at line 43 of file RCOutput_PCA9685.h.

Referenced by push(), read(), set_freq(), write(), and ~RCOutput_PCA9685().


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