PX4 Firmware
PX4 Autopilot Software http://px4.io
linux_pwm_out Namespace Reference

Classes

class  BBBlueRcPWMOut
 class BBBlueRcPWMOut PWM output class for BeagleBone Blue with Robotics Cape Library More...
 
class  NavioSysfsPWMOut
 class NavioSysfsPWMOut PWM output class for Navio Sysfs More...
 
class  OcpocMmapPWMOut
 class OcpocMmapPWMOut PWM output class for Aerotenna OcPoC via mmap More...
 
class  PCA9685
 Main class that exports features for PCA9685 chip. More...
 
class  PWMOutBase
 class PWMOutBase common abstract PWM output base class More...
 

Functions

static void usage ()
 
static void start ()
 
static void stop ()
 
static void task_main_trampoline (int argc, char *argv[])
 
static void subscribe ()
 
static void task_main (int argc, char *argv[])
 
static void update_params (Mixer::Airmode &airmode)
 
int initialize_mixer (const char *mixer_filename)
 
int mixer_control_callback (uintptr_t handle, uint8_t control_group, uint8_t control_index, float &input)
 

Variables

static px4_task_t _task_handle = -1
 
volatile bool _task_should_exit = false
 
static bool _is_running = false
 
static char _device [64] = "/sys/class/pwm/pwmchip0"
 
static char _protocol [64] = "navio"
 
static int _max_num_outputs = 8
 maximum number of outputs the driver should use More...
 
static char _mixer_filename [64] = "ROMFS/px4fmu_common/mixers/quad_x.main.mix"
 
int _controls_subs [actuator_controls_s::NUM_ACTUATOR_CONTROL_GROUPS]
 
int _armed_sub = -1
 
orb_advert_t _outputs_pub = nullptr
 
orb_advert_t _rc_pub = nullptr
 
perf_counter_t _perf_control_latency = nullptr
 
actuator_controls_s _controls [actuator_controls_s::NUM_ACTUATOR_CONTROL_GROUPS]
 
orb_id_t _controls_topics [actuator_controls_s::NUM_ACTUATOR_CONTROL_GROUPS]
 
actuator_outputs_s _outputs
 
actuator_armed_s _armed
 
uint8_t _poll_fds_num = 0
 
px4_pollfd_struct_t _poll_fds [actuator_controls_s::NUM_ACTUATOR_CONTROL_GROUPS]
 
uint32_t _groups_required = 0
 
uint32_t _groups_subscribed = 0
 
output_limit_t _pwm_limit
 
int32_t _pwm_disarmed
 
int32_t _pwm_min
 
int32_t _pwm_max
 
MixerGroup_mixer_group = nullptr
 

Function Documentation

◆ initialize_mixer()

int linux_pwm_out::initialize_mixer ( const char *  mixer_filename)

Definition at line 152 of file linux_pwm_out.cpp.

References MixerGroup::count(), MixerGroup::load_from_buf(), load_mixer_file(), and mixer_control_callback().

Referenced by task_main().

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

◆ mixer_control_callback()

int linux_pwm_out::mixer_control_callback ( uintptr_t  handle,
uint8_t  control_group,
uint8_t  control_index,
float &  input 
)

Definition at line 129 of file linux_pwm_out.cpp.

References actuator_controls_s::control.

Referenced by initialize_mixer().

Here is the caller graph for this function:

◆ start()

void linux_pwm_out::start ( )
static

Definition at line 460 of file linux_pwm_out.cpp.

References task_main_trampoline().

Referenced by linux_pwm_out_main().

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

◆ stop()

void linux_pwm_out::stop ( )
static

Definition at line 479 of file linux_pwm_out.cpp.

Referenced by linux_pwm_out_main().

Here is the caller graph for this function:

◆ subscribe()

void linux_pwm_out::subscribe ( )
static

Definition at line 184 of file linux_pwm_out.cpp.

References _poll_fds_num, ORB_ID, and orb_subscribe().

Referenced by TAP_ESC::cycle(), TAP_ESC::init(), and task_main().

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

◆ task_main()

◆ task_main_trampoline()

void linux_pwm_out::task_main_trampoline ( int  argc,
char *  argv[] 
)
static

Definition at line 455 of file linux_pwm_out.cpp.

References task_main().

Referenced by start().

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

◆ update_params()

void linux_pwm_out::update_params ( Mixer::Airmode airmode)
static

Definition at line 141 of file linux_pwm_out.cpp.

References param_find(), param_get(), and PARAM_INVALID.

Referenced by task_main().

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

◆ usage()

void linux_pwm_out::usage ( void  )
static

Definition at line 491 of file linux_pwm_out.cpp.

References linux_pwm_out_main().

Referenced by linux_pwm_out_main().

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

Variable Documentation

◆ _armed

actuator_armed_s linux_pwm_out::_armed

Definition at line 91 of file linux_pwm_out.cpp.

◆ _armed_sub

int linux_pwm_out::_armed_sub = -1

Definition at line 79 of file linux_pwm_out.cpp.

◆ _controls

actuator_controls_s linux_pwm_out::_controls[actuator_controls_s::NUM_ACTUATOR_CONTROL_GROUPS]

Definition at line 88 of file linux_pwm_out.cpp.

◆ _controls_subs

int linux_pwm_out::_controls_subs[actuator_controls_s::NUM_ACTUATOR_CONTROL_GROUPS]

Definition at line 78 of file linux_pwm_out.cpp.

◆ _controls_topics

orb_id_t linux_pwm_out::_controls_topics[actuator_controls_s::NUM_ACTUATOR_CONTROL_GROUPS]

Definition at line 89 of file linux_pwm_out.cpp.

◆ _device

char linux_pwm_out::_device[64] = "/sys/class/pwm/pwmchip0"
static

Definition at line 72 of file linux_pwm_out.cpp.

Referenced by linux_pwm_out_main().

◆ _groups_required

uint32_t linux_pwm_out::_groups_required = 0

Definition at line 98 of file linux_pwm_out.cpp.

◆ _groups_subscribed

uint32_t linux_pwm_out::_groups_subscribed = 0

Definition at line 99 of file linux_pwm_out.cpp.

◆ _is_running

bool linux_pwm_out::_is_running = false
static

Definition at line 70 of file linux_pwm_out.cpp.

Referenced by linux_pwm_out_main().

◆ _max_num_outputs

int linux_pwm_out::_max_num_outputs = 8
static

maximum number of outputs the driver should use

Definition at line 74 of file linux_pwm_out.cpp.

Referenced by linux_pwm_out_main().

◆ _mixer_filename

char linux_pwm_out::_mixer_filename[64] = "ROMFS/px4fmu_common/mixers/quad_x.main.mix"
static

Definition at line 75 of file linux_pwm_out.cpp.

Referenced by linux_pwm_out_main().

◆ _mixer_group

MixerGroup* linux_pwm_out::_mixer_group = nullptr

Definition at line 108 of file linux_pwm_out.cpp.

◆ _outputs

actuator_outputs_s linux_pwm_out::_outputs

Definition at line 90 of file linux_pwm_out.cpp.

◆ _outputs_pub

orb_advert_t linux_pwm_out::_outputs_pub = nullptr

Definition at line 82 of file linux_pwm_out.cpp.

◆ _perf_control_latency

perf_counter_t linux_pwm_out::_perf_control_latency = nullptr

Definition at line 85 of file linux_pwm_out.cpp.

◆ _poll_fds

px4_pollfd_struct_t linux_pwm_out::_poll_fds[actuator_controls_s::NUM_ACTUATOR_CONTROL_GROUPS]

Definition at line 95 of file linux_pwm_out.cpp.

◆ _poll_fds_num

uint8_t linux_pwm_out::_poll_fds_num = 0

Definition at line 94 of file linux_pwm_out.cpp.

Referenced by subscribe().

◆ _protocol

char linux_pwm_out::_protocol[64] = "navio"
static

◆ _pwm_disarmed

int32_t linux_pwm_out::_pwm_disarmed

Definition at line 104 of file linux_pwm_out.cpp.

Referenced by linux_pwm_out_main(), and task_main().

◆ _pwm_limit

output_limit_t linux_pwm_out::_pwm_limit

Definition at line 101 of file linux_pwm_out.cpp.

◆ _pwm_max

int32_t linux_pwm_out::_pwm_max

Definition at line 106 of file linux_pwm_out.cpp.

Referenced by linux_pwm_out_main(), and task_main().

◆ _pwm_min

int32_t linux_pwm_out::_pwm_min

Definition at line 105 of file linux_pwm_out.cpp.

Referenced by linux_pwm_out_main(), and task_main().

◆ _rc_pub

orb_advert_t linux_pwm_out::_rc_pub = nullptr

Definition at line 83 of file linux_pwm_out.cpp.

◆ _task_handle

px4_task_t linux_pwm_out::_task_handle = -1
static

Definition at line 68 of file linux_pwm_out.cpp.

◆ _task_should_exit

volatile bool linux_pwm_out::_task_should_exit = false

Definition at line 69 of file linux_pwm_out.cpp.