APM:Libraries
|
#include <RCOutput.h>
Classes | |
struct | irq_state |
struct | pwm_group |
Public Member Functions | |
void | init () |
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) |
uint16_t | read (uint8_t ch) |
void | read (uint16_t *period_us, uint8_t len) |
uint16_t | read_last_sent (uint8_t ch) override |
void | read_last_sent (uint16_t *period_us, uint8_t len) override |
void | set_esc_scaling (uint16_t min_pwm, uint16_t max_pwm) override |
bool | get_esc_scaling (uint16_t &min_pwm, uint16_t &max_pwm) override |
void | set_output_mode (uint16_t mask, enum output_mode mode) override |
float | scale_esc_to_unity (uint16_t pwm) override |
void | cork (void) override |
void | push (void) override |
bool | force_safety_on (void) override |
void | force_safety_off (void) override |
void | set_safety_pwm (uint32_t chmask, uint16_t period_us) override |
bool | enable_px4io_sbus_out (uint16_t rate_hz) override |
void | set_default_rate (uint16_t rate_hz) override |
void | timer_tick (void) override |
bool | setup_serial_output (uint16_t chan_mask, ByteBuffer *buffer, uint32_t baudrate) |
bool | serial_setup_output (uint8_t chan, uint32_t baudrate) override |
bool | serial_write_bytes (const uint8_t *bytes, uint16_t len) override |
uint16_t | serial_read_bytes (uint8_t *buf, uint16_t len) override |
void | serial_end (void) override |
void | set_telem_request_mask (uint16_t mask) |
AP_HAL::Util::safety_state | _safety_switch_state (void) |
![]() | |
virtual void | set_failsafe_pwm (uint32_t chmask, uint16_t period_us) |
virtual void | force_safety_no_wait (void) |
Private Member Functions | |
void | push_local (void) |
void | trigger_groups (void) |
void | set_freq_group (pwm_group &group) |
void | safety_update (void) |
void | dma_allocate (Shared_DMA *ctx) |
void | dma_deallocate (Shared_DMA *ctx) |
uint16_t | create_dshot_packet (const uint16_t value, bool telem_request) |
void | fill_DMA_buffer_dshot (uint32_t *buffer, uint8_t stride, uint16_t packet, uint16_t clockmul) |
void | dshot_send (pwm_group &group, bool blocking) |
bool | mode_requires_dma (enum output_mode mode) const |
bool | setup_group_DMA (pwm_group &group, uint32_t bitrate, uint32_t bit_width, bool active_high) |
void | send_pulses_DMAR (pwm_group &group, uint32_t buffer_length) |
void | set_group_mode (pwm_group &group) |
bool | serial_write_byte (uint8_t b) |
bool | serial_read_byte (uint8_t &b) |
void | fill_DMA_buffer_byte (uint32_t *buffer, uint8_t stride, uint8_t b, uint32_t bitval) |
Static Private Member Functions | |
static void | dma_irq_callback (void *p, uint32_t flags) |
static void | serial_bit_irq (void) |
Private Attributes | |
struct pwm_group * | serial_group |
thread_t * | serial_thread |
tprio_t | serial_priority |
uint16_t | _esc_pwm_min |
uint16_t | _esc_pwm_max |
uint8_t | chan_offset |
uint8_t | num_fmu_channels |
uint8_t | active_fmu_channels |
uint16_t | last_sent [max_channels] |
uint32_t | en_mask |
uint16_t | period [max_channels] |
uint16_t | safe_pwm [max_channels] |
bool | corked |
uint16_t | fast_channel_mask |
uint16_t | io_fast_channel_mask |
uint64_t | min_pulse_trigger_us |
mutex_t | trigger_mutex |
uint8_t | trigger_groupmask |
uint16_t | trigger_widest_pulse |
bool | iomcu_oneshot125 |
AP_HAL::Util::safety_state | safety_state |
uint32_t | safety_update_ms |
uint8_t | led_counter |
int8_t | safety_button_counter |
uint16_t | safety_mask |
const uint8_t | dshot_post = 6 |
const uint16_t | dshot_bit_length = 16 + dshot_post |
const uint16_t | dshot_buffer_length = dshot_bit_length*4*sizeof(uint32_t) |
uint32_t | dshot_pulse_time_us |
uint16_t | telem_request_mask |
Static Private Attributes | |
static struct ChibiOS::RCOutput::irq_state | irq |
static pwm_group | pwm_group_list [] |
static const uint8_t | max_channels = 16 |
static const eventmask_t | serial_event_mask = EVENT_MASK(1) |
Additional Inherited Members | |
![]() | |
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 } |
Definition at line 26 of file RCOutput.h.
AP_HAL::Util::safety_state RCOutput::_safety_switch_state | ( | void | ) |
Definition at line 1274 of file RCOutput.cpp.
Referenced by safety_update(), and set_telem_request_mask().
|
overridevirtual |
Implements AP_HAL::RCOutput.
Definition at line 677 of file RCOutput.cpp.
Referenced by scale_esc_to_unity().
|
private |
Definition at line 826 of file RCOutput.cpp.
Referenced by dshot_send().
|
virtual |
Implements AP_HAL::RCOutput.
Definition at line 280 of file RCOutput.cpp.
|
private |
Definition at line 800 of file RCOutput.cpp.
Referenced by setup_group_DMA().
|
private |
Definition at line 813 of file RCOutput.cpp.
Referenced by setup_group_DMA().
|
staticprivate |
Definition at line 954 of file RCOutput.cpp.
Referenced by dma_allocate().
|
private |
Definition at line 866 of file RCOutput.cpp.
Referenced by timer_tick(), and trigger_groups().
|
virtual |
Implements AP_HAL::RCOutput.
Definition at line 260 of file RCOutput.cpp.
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 704 of file RCOutput.cpp.
Referenced by scale_esc_to_unity().
|
private |
Definition at line 1041 of file RCOutput.cpp.
Referenced by serial_write_byte().
|
private |
Definition at line 851 of file RCOutput.cpp.
Referenced by dshot_send().
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 1303 of file RCOutput.cpp.
Referenced by scale_esc_to_unity().
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 1287 of file RCOutput.cpp.
Referenced by scale_esc_to_unity().
|
inlineoverridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 42 of file RCOutput.h.
|
virtual |
Implements AP_HAL::RCOutput.
Definition at line 236 of file RCOutput.cpp.
|
virtual |
Implements AP_HAL::RCOutput.
Definition at line 49 of file RCOutput.cpp.
|
private |
Definition at line 477 of file RCOutput.cpp.
Referenced by set_freq_group(), and set_output_mode().
|
overridevirtual |
Implements AP_HAL::RCOutput.
Definition at line 690 of file RCOutput.cpp.
Referenced by scale_esc_to_unity().
|
private |
Definition at line 344 of file RCOutput.cpp.
Referenced by push(), and write().
|
virtual |
Implements AP_HAL::RCOutput.
Definition at line 423 of file RCOutput.cpp.
|
virtual |
Implements AP_HAL::RCOutput.
Definition at line 437 of file RCOutput.cpp.
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 456 of file RCOutput.cpp.
Referenced by read_last_sent().
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 464 of file RCOutput.cpp.
|
private |
Definition at line 1335 of file RCOutput.cpp.
Referenced by timer_tick().
|
inlineoverridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 49 of file RCOutput.h.
|
private |
Definition at line 920 of file RCOutput.cpp.
Referenced by dshot_send(), and serial_write_byte().
|
staticprivate |
Definition at line 1111 of file RCOutput.cpp.
Referenced by serial_read_bytes().
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 1251 of file RCOutput.cpp.
Referenced by scale_esc_to_unity(), and serial_setup_output().
|
private |
Definition at line 1165 of file RCOutput.cpp.
Referenced by serial_read_bytes().
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 1192 of file RCOutput.cpp.
Referenced by scale_esc_to_unity().
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 977 of file RCOutput.cpp.
Referenced by scale_esc_to_unity().
|
private |
Definition at line 1063 of file RCOutput.cpp.
Referenced by serial_write_bytes().
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 1085 of file RCOutput.cpp.
Referenced by scale_esc_to_unity().
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 216 of file RCOutput.cpp.
Referenced by scale_esc_to_unity().
|
inlineoverridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 38 of file RCOutput.h.
|
virtual |
Implements AP_HAL::RCOutput.
Definition at line 163 of file RCOutput.cpp.
Referenced by init().
|
private |
Definition at line 92 of file RCOutput.cpp.
Referenced by serial_end(), set_freq(), and set_group_mode().
|
private |
Definition at line 573 of file RCOutput.cpp.
Referenced by serial_end(), and set_output_mode().
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 641 of file RCOutput.cpp.
Referenced by get_esc_scaling().
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 1318 of file RCOutput.cpp.
Referenced by scale_esc_to_unity().
|
inlinevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 128 of file RCOutput.h.
|
private |
Definition at line 497 of file RCOutput.cpp.
Referenced by serial_setup_output(), and set_group_mode().
bool ChibiOS::RCOutput::setup_serial_output | ( | uint16_t | chan_mask, |
ByteBuffer * | buffer, | ||
uint32_t | baudrate | ||
) |
|
overridevirtual |
Reimplemented from AP_HAL::RCOutput.
Definition at line 768 of file RCOutput.cpp.
Referenced by scale_esc_to_unity().
|
private |
Definition at line 717 of file RCOutput.cpp.
Referenced by push_local(), and timer_tick().
|
virtual |
Implements AP_HAL::RCOutput.
Definition at line 301 of file RCOutput.cpp.
Referenced by set_group_mode().
|
private |
Definition at line 212 of file RCOutput.h.
Referenced by dshot_send(), get_esc_scaling(), push_local(), scale_esc_to_unity(), and set_esc_scaling().
|
private |
Definition at line 211 of file RCOutput.h.
Referenced by dshot_send(), get_esc_scaling(), push_local(), scale_esc_to_unity(), and set_esc_scaling().
|
private |
Definition at line 221 of file RCOutput.h.
Referenced by push_local(), and write().
|
private |
Definition at line 215 of file RCOutput.h.
Referenced by disable_ch(), dshot_send(), enable_ch(), get_freq(), init(), push_local(), read(), serial_setup_output(), set_freq(), set_group_mode(), set_output_mode(), set_telem_request_mask(), and write().
|
private |
Definition at line 232 of file RCOutput.h.
|
private |
Definition at line 277 of file RCOutput.h.
Referenced by set_group_mode().
|
private |
Definition at line 278 of file RCOutput.h.
Referenced by dshot_send(), serial_write_bytes(), and setup_group_DMA().
|
private |
Definition at line 276 of file RCOutput.h.
|
private |
Definition at line 279 of file RCOutput.h.
Referenced by push_local(), and set_group_mode().
|
private |
Definition at line 229 of file RCOutput.h.
Referenced by disable_ch(), enable_ch(), and push_local().
|
private |
Definition at line 234 of file RCOutput.h.
Referenced by set_default_rate(), set_freq(), and set_output_mode().
|
private |
Definition at line 235 of file RCOutput.h.
Referenced by set_freq(), set_output_mode(), and write().
|
private |
Definition at line 250 of file RCOutput.h.
Referenced by set_output_mode(), and write().
|
staticprivate |
Referenced by dma_irq_callback(), dshot_send(), serial_bit_irq(), serial_end(), serial_read_byte(), serial_read_bytes(), serial_setup_output(), and trigger_groups().
|
private |
Definition at line 226 of file RCOutput.h.
Referenced by read_last_sent(), and write().
|
private |
Definition at line 264 of file RCOutput.h.
Referenced by safety_update().
|
staticprivate |
Definition at line 223 of file RCOutput.h.
Referenced by disable_ch(), enable_ch(), get_freq(), read(), read_last_sent(), and write().
|
private |
Definition at line 238 of file RCOutput.h.
Referenced by timer_tick(), and trigger_groups().
|
private |
Definition at line 218 of file RCOutput.h.
|
private |
Definition at line 230 of file RCOutput.h.
Referenced by dshot_send(), push_local(), read(), and write().
|
staticprivate |
Definition at line 210 of file RCOutput.h.
Referenced by disable_ch(), dma_allocate(), dma_deallocate(), enable_ch(), get_freq(), init(), push_local(), serial_setup_output(), set_default_rate(), set_freq(), set_output_mode(), timer_tick(), and trigger_groups().
|
private |
Definition at line 231 of file RCOutput.h.
Referenced by dshot_send(), push_local(), set_safety_pwm(), and write().
|
private |
Definition at line 265 of file RCOutput.h.
Referenced by safety_update().
|
private |
Definition at line 268 of file RCOutput.h.
Referenced by dshot_send(), push_local(), safety_update(), and write().
|
private |
Definition at line 262 of file RCOutput.h.
Referenced by _safety_switch_state(), force_safety_off(), force_safety_on(), init(), safety_update(), and write().
|
private |
Definition at line 263 of file RCOutput.h.
Referenced by safety_update().
|
staticprivate |
Definition at line 294 of file RCOutput.h.
Referenced by dma_irq_callback(), serial_bit_irq(), serial_read_byte(), serial_read_bytes(), and serial_write_byte().
|
private |
Definition at line 206 of file RCOutput.h.
Referenced by push_local(), serial_end(), serial_read_bytes(), serial_setup_output(), serial_write_byte(), serial_write_bytes(), timer_tick(), and trigger_groups().
|
private |
Definition at line 208 of file RCOutput.h.
Referenced by serial_end(), and serial_setup_output().
|
private |
Definition at line 207 of file RCOutput.h.
Referenced by serial_end(), and serial_setup_output().
|
private |
Definition at line 280 of file RCOutput.h.
Referenced by dshot_send(), and set_telem_request_mask().
|
private |
Definition at line 244 of file RCOutput.h.
Referenced by push_local(), and trigger_groups().
|
private |
Definition at line 241 of file RCOutput.h.
Referenced by init(), and trigger_groups().
|
private |
Definition at line 247 of file RCOutput.h.
Referenced by push_local(), and trigger_groups().