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

class OcpocMmapPWMOut PWM output class for Aerotenna OcPoC via mmap More...

#include <ocpoc_mmap.h>

Inheritance diagram for linux_pwm_out::OcpocMmapPWMOut:
Collaboration diagram for linux_pwm_out::OcpocMmapPWMOut:

Classes

struct  pwm_cmd
 
struct  s_period_hi
 

Public Member Functions

 OcpocMmapPWMOut (int max_num_outputs)
 
virtual ~OcpocMmapPWMOut ()
 
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 ()
 

Static Private Member Functions

static unsigned long freq2tick (uint16_t freq_hz)
 

Private Attributes

volatile struct pwm_cmd_shared_mem_cmd = nullptr
 
int _num_outputs
 

Static Private Attributes

static constexpr int MAX_ZYNQ_PWMS = 8
 maximum number of pwm channels More...
 
static constexpr const char * _device = "/dev/mem"
 

Detailed Description

class OcpocMmapPWMOut PWM output class for Aerotenna OcPoC via mmap

Definition at line 45 of file ocpoc_mmap.h.

Constructor & Destructor Documentation

◆ OcpocMmapPWMOut()

OcpocMmapPWMOut::OcpocMmapPWMOut ( int  max_num_outputs)

Definition at line 49 of file ocpoc_mmap.cpp.

References _num_outputs, and MAX_ZYNQ_PWMS.

◆ ~OcpocMmapPWMOut()

OcpocMmapPWMOut::~OcpocMmapPWMOut ( )
virtual

Definition at line 59 of file ocpoc_mmap.cpp.

References _shared_mem_cmd.

Member Function Documentation

◆ freq2tick()

unsigned long OcpocMmapPWMOut::freq2tick ( uint16_t  freq_hz)
staticprivate

Definition at line 66 of file ocpoc_mmap.cpp.

References TICK_PER_S.

Referenced by init().

Here is the caller graph for this function:

◆ init()

int OcpocMmapPWMOut::init ( )
overridevirtual

Implements linux_pwm_out::PWMOutBase.

Definition at line 72 of file ocpoc_mmap.cpp.

References _device, _num_outputs, _shared_mem_cmd, freq2tick(), FREQUENCY_PWM, linux_pwm_out::OcpocMmapPWMOut::s_period_hi::hi, linux_pwm_out::OcpocMmapPWMOut::s_period_hi::period, linux_pwm_out::OcpocMmapPWMOut::pwm_cmd::periodhi, and RCOUT_ZYNQ_PWM_BASE.

Here is the call graph for this function:

◆ send_output_pwm()

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

Member Data Documentation

◆ _device

constexpr const char* linux_pwm_out::OcpocMmapPWMOut::_device = "/dev/mem"
staticprivate

Definition at line 71 of file ocpoc_mmap.h.

Referenced by init().

◆ _num_outputs

int linux_pwm_out::OcpocMmapPWMOut::_num_outputs
private

Definition at line 72 of file ocpoc_mmap.h.

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

◆ _shared_mem_cmd

volatile struct pwm_cmd* linux_pwm_out::OcpocMmapPWMOut::_shared_mem_cmd = nullptr
private

Definition at line 70 of file ocpoc_mmap.h.

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

◆ MAX_ZYNQ_PWMS

constexpr int linux_pwm_out::OcpocMmapPWMOut::MAX_ZYNQ_PWMS = 8
staticprivate

maximum number of pwm channels

Definition at line 58 of file ocpoc_mmap.h.

Referenced by OcpocMmapPWMOut().


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