Linux Kernel
3.7.1
|
#include <atmel_pwm.h>
Data Fields | |
void __iomem * | regs |
unsigned | index |
unsigned long | mck |
struct pwm_channel - driver handle to a PWM channel : base of this channel's registers : number of this channel (0..31) : base clock rate, which can be prescaled and maybe subdivided
Drivers initialize a pwm_channel structure using pwm_channel_alloc(). Then they configure its clock rate (derived from MCK), alignment, polarity, and duty cycle by writing directly to the channel registers, before enabling the channel by calling pwm_channel_enable().
After emitting a PWM signal for the desired length of time, drivers may then pwm_channel_disable() or pwm_channel_free(). Both of these disable the channel, but when it's freed the IRQ is deconfigured and the channel must later be re-allocated and reconfigured.
Note that if the period or duty cycle need to be changed while the PWM channel is operating, drivers must use the PWM_CUPD double buffer mechanism, either polling until they change or getting implicitly notified through a once-per-period interrupt handler.
Definition at line 25 of file atmel_pwm.h.
unsigned index |
Definition at line 27 of file atmel_pwm.h.
unsigned long mck |
Definition at line 28 of file atmel_pwm.h.
Definition at line 26 of file atmel_pwm.h.