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

class NavioSysfsPWMOut PWM output class for Navio Sysfs More...

#include <navio_sysfs.h>

Inheritance diagram for linux_pwm_out::NavioSysfsPWMOut:
Collaboration diagram for linux_pwm_out::NavioSysfsPWMOut:

Public Member Functions

 NavioSysfsPWMOut (const char *device, int max_num_outputs)
 
virtual ~NavioSysfsPWMOut ()
 
int init () override
 
int send_output_pwm (const uint16_t *pwm, int num_outputs) override
 
- Public Member Functions inherited from linux_pwm_out::PWMOutBase
virtual ~PWMOutBase ()
 

Private Member Functions

int pwm_write_sysfs (char *path, int value)
 

Private Attributes

int _pwm_fd [MAX_NUM_PWM]
 
int _pwm_num
 
const char * _device
 

Static Private Attributes

static const int MAX_NUM_PWM = 14
 
static const int FREQUENCY_PWM = 400
 

Detailed Description

class NavioSysfsPWMOut PWM output class for Navio Sysfs

Definition at line 45 of file navio_sysfs.h.

Constructor & Destructor Documentation

◆ NavioSysfsPWMOut()

NavioSysfsPWMOut::NavioSysfsPWMOut ( const char *  device,
int  max_num_outputs 
)

Definition at line 43 of file navio_sysfs.cpp.

References _pwm_fd, _pwm_num, and MAX_NUM_PWM.

◆ ~NavioSysfsPWMOut()

NavioSysfsPWMOut::~NavioSysfsPWMOut ( )
virtual

Definition at line 58 of file navio_sysfs.cpp.

References _pwm_fd, and MAX_NUM_PWM.

Member Function Documentation

◆ init()

int NavioSysfsPWMOut::init ( )
overridevirtual

Implements linux_pwm_out::PWMOutBase.

Definition at line 67 of file navio_sysfs.cpp.

References _device, _pwm_fd, _pwm_num, FREQUENCY_PWM, and pwm_write_sysfs().

Here is the call graph for this function:

◆ pwm_write_sysfs()

int NavioSysfsPWMOut::pwm_write_sysfs ( char *  path,
int  value 
)
private

Definition at line 132 of file navio_sysfs.cpp.

References data, fd, and write().

Referenced by init().

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

◆ send_output_pwm()

int NavioSysfsPWMOut::send_output_pwm ( const uint16_t *  pwm,
int  num_outputs 
)
overridevirtual

Implements linux_pwm_out::PWMOutBase.

Definition at line 109 of file navio_sysfs.cpp.

References _pwm_fd, _pwm_num, data, and write().

Here is the call graph for this function:

Member Data Documentation

◆ _device

const char* linux_pwm_out::NavioSysfsPWMOut::_device
private

Definition at line 64 of file navio_sysfs.h.

Referenced by init().

◆ _pwm_fd

int linux_pwm_out::NavioSysfsPWMOut::_pwm_fd[MAX_NUM_PWM]
private

Definition at line 61 of file navio_sysfs.h.

Referenced by init(), NavioSysfsPWMOut(), send_output_pwm(), and ~NavioSysfsPWMOut().

◆ _pwm_num

int linux_pwm_out::NavioSysfsPWMOut::_pwm_num
private

Definition at line 62 of file navio_sysfs.h.

Referenced by init(), NavioSysfsPWMOut(), and send_output_pwm().

◆ FREQUENCY_PWM

const int linux_pwm_out::NavioSysfsPWMOut::FREQUENCY_PWM = 400
staticprivate

Definition at line 59 of file navio_sysfs.h.

Referenced by init().

◆ MAX_NUM_PWM

const int linux_pwm_out::NavioSysfsPWMOut::MAX_NUM_PWM = 14
staticprivate

Definition at line 58 of file navio_sysfs.h.

Referenced by NavioSysfsPWMOut(), and ~NavioSysfsPWMOut().


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