MAV'RIC
Classes | Public Types | Public Member Functions | Static Public Member Functions
Pwm_chibios Class Reference

Wrapper class for PWM using ChibiOS/HAL. More...

#include <pwm_chibios.hpp>

Inheritance diagram for Pwm_chibios:
Inheritance graph
[legend]
Collaboration diagram for Pwm_chibios:
Collaboration graph
[legend]

List of all members.

Classes

struct  conf_t
 Configuration structure. More...

Public Types

enum  channel_id_t { CHANNEL_1 = 0, CHANNEL_2 = 1, CHANNEL_3 = 2, CHANNEL_4 = 3 }
 Enumeration of PWM channels. More...

Public Member Functions

 Pwm_chibios (conf_t config=default_config())
 Constructor.
bool init (void)
 Initialize the hardware line for servos.
bool set_pulse_width_us (uint16_t pulse_us)
 Set pulse width.
bool set_period_us (uint16_t period_us)
 Set pulse period.

Static Public Member Functions

static conf_t default_config (void)
 Default configuration structure.

Detailed Description

Wrapper class for PWM using ChibiOS/HAL.


Member Enumeration Documentation

Enumeration of PWM channels.

Enumerator:
CHANNEL_1 

Channel 1.

CHANNEL_2 

Channel 2.

CHANNEL_3 

Channel 3.

CHANNEL_4 

Channel 4.


Constructor & Destructor Documentation

Constructor.

Parameters:
configConfiguration structure

Member Function Documentation

Pwm_chibios::conf_t Pwm_chibios::default_config ( void  ) [inline, static]

Default configuration structure.

Returns:
Config
bool Pwm_chibios::init ( void  ) [virtual]

Initialize the hardware line for servos.

Returns:
Success

Implements Pwm.

Here is the caller graph for this function:

bool Pwm_chibios::set_period_us ( uint16_t  period_us) [virtual]

Set pulse period.

Parameters:
period_usPulse period in us
Returns:
Success

Implements Pwm.

bool Pwm_chibios::set_pulse_width_us ( uint16_t  pulse_us) [virtual]

Set pulse width.

Parameters:
pulse_usPulse length in us
Returns:
Success

Implements Pwm.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines