Public Member Functions | Private Attributes
PwmDriver Class Reference

Driver to output a PWM on a supported serial device. More...

#include <pwm_driver.h>

Inheritance diagram for PwmDriver:
Inheritance graph
[legend]

List of all members.

Public Member Functions

uint8_t getDeviceAddress (void)
bool initialize ()
 Initializes the driver and the connected hardware.
 PwmDriver (bosch_hardware_interface *hw, uint32_t frequency, uint8_t pin)
 Constructor:
bool set (float value)
 Sends the duty cycle value to a supported serial device.
 ~PwmDriver ()

Private Attributes

uint32_t _frequency
uint8_t _pin

Detailed Description

Driver to output a PWM on a supported serial device.

This class lets the user access the PWM pins of any supported hardware to apply a PWM to supported hardware passing the duty cycle in as a value between 0 (constant low) and 1 (constant high)

Definition at line 57 of file pwm_driver.h.


Constructor & Destructor Documentation

PwmDriver::PwmDriver ( bosch_hardware_interface hw,
uint32_t  frequency,
uint8_t  pin 
)

Constructor:

Parameters:
frequencyPWM frequency
pinpin number on the hardware device to apply the PWM to

Definition at line 41 of file pwm_driver.cpp.

Definition at line 47 of file pwm_driver.cpp.


Member Function Documentation

uint8_t PwmDriver::getDeviceAddress ( void  ) [virtual]

Implements bosch_drivers_common::sensor_driver.

Definition at line 51 of file pwm_driver.cpp.

Initializes the driver and the connected hardware.

Returns:
a boolean indicating success

Definition at line 57 of file pwm_driver.cpp.

bool PwmDriver::set ( float  value)

Sends the duty cycle value to a supported serial device.

Parameters:
valueduty cycle as fraction [0..1] with 0 being constant LOW and 1 being constant HIGH
Returns:
true if write was successful or false if not

Definition at line 68 of file pwm_driver.cpp.


Member Data Documentation

uint32_t PwmDriver::_frequency [private]

Definition at line 89 of file pwm_driver.h.

uint8_t PwmDriver::_pin [private]

Definition at line 90 of file pwm_driver.h.


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


pwm_driver
Author(s): Kai Franke
autogenerated on Sat Dec 28 2013 16:49:44