ChibiOS/RT Logo ChibiOS/RT

Architecture - Reference Manual - Guides

Modules | Typedefs | Enumerations | Functions

PWM Driver
[HAL]

Generic PWM Driver. More...

Collaboration diagram for PWM Driver:


Description

Generic PWM Driver.

This module implements a generic PWM driver. The driver implements a state machine internally:

inline_dotgraph_18.dot

Modules

 PWM Low Level Driver
 

PWM Driver low level driver template.


Typedefs

typedef void(* pwmcallback_t )(void)
 PWM notification callback type.

Enumerations

enum  pwmstate_t { PWM_UNINIT = 0, PWM_STOP = 1, PWM_READY = 2 }
 

Driver state machine possible states.

More...
enum  pwmmode_t { PWM_OUTPUT_DISABLED = 0, PWM_OUTPUT_ACTIVE_HIGH = 1, PWM_OUTPUT_ACTIVE_LOW = 2 }
 

PWM logic mode.

More...

Functions

void pwmInit (void)
 PWM Driver initialization.
void pwmObjectInit (PWMDriver *pwmp)
 Initializes the standard part of a PWMDriver structure.
void pwmStart (PWMDriver *pwmp, const PWMConfig *config)
 Configures and activates the PWM peripheral.
void pwmStop (PWMDriver *pwmp)
 Deactivates the PWM peripheral.
void pwmEnableChannel (PWMDriver *pwmp, pwmchannel_t channel, pwmcnt_t width)
 Enables a PWM channel.
void pwmDisableChannel (PWMDriver *pwmp, pwmchannel_t channel)
 Disables a PWM channel.

Typedef Documentation

typedef void(* pwmcallback_t)(void)

PWM notification callback type.

Parameters:
[in] active current channel output state

Definition at line 80 of file pwm.h.


Enumeration Type Documentation

enum pwmstate_t

Driver state machine possible states.

Enumerator:
PWM_UNINIT 

Not initialized.

PWM_STOP 

Stopped.

PWM_READY 

Ready.

Definition at line 59 of file pwm.h.

enum pwmmode_t

PWM logic mode.

Enumerator:
PWM_OUTPUT_DISABLED 

Output not driven, callback only.

PWM_OUTPUT_ACTIVE_HIGH 

Idle is logic level 0.

PWM_OUTPUT_ACTIVE_LOW 

Idle is logic level 1.

Definition at line 68 of file pwm.h.


Function Documentation

void pwmInit ( void   ) 

PWM Driver initialization.

Definition at line 58 of file pwm.c.

References pwm_lld_init().

Referenced by halInit().

Here is the call graph for this function:

void pwmObjectInit ( PWMDriver pwmp  ) 

Initializes the standard part of a PWMDriver structure.

Parameters:
[in] pwmp pointer to a PWMDriver object

Definition at line 68 of file pwm.c.

References PWMDriver::pd_config, and PWMDriver::pd_state.

void pwmStart ( PWMDriver pwmp,
const PWMConfig config 
)

Configures and activates the PWM peripheral.

Parameters:
[in] pwmp pointer to a PWMDriver object
[in] config pointer to a PWMConfig object

Definition at line 80 of file pwm.c.

References chDbgAssert, chDbgCheck, chSysLock, chSysUnlock, PWMDriver::pd_config, PWMDriver::pd_state, pwm_lld_start(), PWM_READY, and PWM_STOP.

Here is the call graph for this function:

void pwmStop ( PWMDriver pwmp  ) 

Deactivates the PWM peripheral.

Parameters:
[in] pwmp pointer to a PWMDriver object

Definition at line 99 of file pwm.c.

References chDbgAssert, chDbgCheck, chSysLock, chSysUnlock, PWMDriver::pd_state, pwm_lld_stop(), PWM_READY, and PWM_STOP.

Here is the call graph for this function:

void pwmEnableChannel ( PWMDriver pwmp,
pwmchannel_t  channel,
pwmcnt_t  width 
)

Enables a PWM channel.

Parameters:
[in] pwmp pointer to a PWMDriver object
[in] channel PWM channel identifier
[in] width PWM pulse width as clock pulses number

Definition at line 119 of file pwm.c.

References chDbgAssert, chDbgCheck, chSysLock, chSysUnlock, PWMDriver::pd_state, PWM_CHANNELS, pwm_lld_enable_channel(), and PWM_READY.

Here is the call graph for this function:

void pwmDisableChannel ( PWMDriver pwmp,
pwmchannel_t  channel 
)

Disables a PWM channel.

The channel is disabled and its output line returned to the idle state.

Parameters:
[in] pwmp pointer to a PWMDriver object
[in] channel PWM channel identifier

Definition at line 141 of file pwm.c.

References chDbgAssert, chDbgCheck, chSysLock, chSysUnlock, PWMDriver::pd_state, PWM_CHANNELS, pwm_lld_disable_channel(), and PWM_READY.

Here is the call graph for this function:


Generated on Sun Oct 24 2010 09:40:47 for ChibiOS/RT by doxygen 1.7.1