Atmel Software Framework

pwm.h File Reference
#include <avr32/io.h>

Data Structures

struct  pwm_opt_t
 Input parameters when initializing a PWM channel. More...
 

Macros

#define PWM_FAILURE   -1
 Value returned by function when it was unable to complete successfully for some unspecified reason. More...
 
#define PWM_INVALID_ARGUMENT   1
 Value returned by function when the channel number is invalid. More...
 
#define PWM_INVALID_INPUT   1
 Value returned by function when the input parameters are out of range. More...
 
#define PWM_MODE_CENTER_ALIGNED   1
 Operate PWM channel in center aligned mode. More...
 
#define PWM_MODE_LEFT_ALIGNED   0
 Operate PWM channel in left aligned mode. More...
 
#define PWM_POLARITY_HIGH   1
 PWM channel starts output high level. More...
 
#define PWM_POLARITY_LOW   0
 PWM channel starts output low level. More...
 
#define PWM_SUCCESS   0
 Value returned by function when it completed successfully. More...
 
#define PWM_UPDATE_DUTY   0
 PWM channel write in CUPDx updates duty cycle at the next period start event. More...
 
#define PWM_UPDATE_PERIOD   1
 PWM channel write in CUPDx updates period at the next period start event. More...
 

Functions

int pwm_async_update_channel (unsigned int channel_id, const avr32_pwm_channel_t *pwm_channel)
 Update channel register CPRDx or CDTYx without synchronizing with the PWM period. This function uses the CUPDx register as a double buffer for the period or the duty cycle. Only the first 20 bits of cupd are significant. More...
 
int pwm_channel_init (unsigned int channel_id, const avr32_pwm_channel_t *pwm_channel)
 Initialize a specific PWM channel. More...
 
int pwm_init (const pwm_opt_t *opt)
 This function initialize the PWM controller (mode register) and disable the interrupt. More...
 
int pwm_start_channels (unsigned long channels_bitmask)
 Start PWM channels. More...
 
int pwm_stop_channels (unsigned long channels_bitmask)
 Stop PWM channels. More...
 
int pwm_sync_update_channel (unsigned int channel_id, const avr32_pwm_channel_t *pwm_channel)
 Update channel register CPRDx or CDTYx by forcing synchronization with the PWM period. This function uses the CUPDx register as a double buffer for the period or the duty cycle. Only the first 20 bits of cupd are significant. More...