Little-Wire
 All Classes Functions Groups Pages
PWM

Pulse width modulation functions. More...

Functions

void pwm_init (littleWire *lwHandle)
 
void pwm_stop (littleWire *lwHandle)
 
void pwm_updateCompare (littleWire *lwHandle, unsigned char channelA, unsigned char channelB)
 
void pwm_updatePrescaler (littleWire *lwHandle, unsigned int value)
 

Detailed Description

Pulse width modulation functions.

Function Documentation

void pwm_init ( littleWire *  lwHandle)

Initialize the PWM module on the Little-Wire

Parameters
lwHandlelittleWire device pointer
Returns
(none)

Definition at line 217 of file littleWire.c.

void pwm_stop ( littleWire *  lwHandle)

Stop the PWM module on the Little-Wire

Parameters
lwHandlelittleWire device pointer
Returns
(none)

Definition at line 222 of file littleWire.c.

void pwm_updateCompare ( littleWire *  lwHandle,
unsigned char  channelA,
unsigned char  channelB 
)

Update the compare values of the PWM output pins. Resolution is 8 bit.

Parameters
lwHandlelittleWire device pointer
channelACompare value of PWMA pin
channelBCompare value of PWMB pin
Returns
(none)

Definition at line 227 of file littleWire.c.

void pwm_updatePrescaler ( littleWire *  lwHandle,
unsigned int  value 
)

Update the prescaler of the PWM module. Adjust this value according to your need for speed in PWM output. Default is 1024. Lower prescale means higher frequency PWM output.

Parameters
lwHandlelittleWire device pointer
valuePresecaler value (1024, 256, 64, 8 or 1)
Returns
(none)

Definition at line 232 of file littleWire.c.