|
Synopsis
int sub_fpwm_config( sub_handle hndl, double freq_hz, int flags )
Configure fast PWM module.
Parameters
| • | freq_hz - Desired fast PWM frequency in Hz. Frequency can be in a range 8MHz .. 0.238Hz |
| • | flags - Set of configuration flags listed below |
FPWM_ENABLE
|
General fast PWM enable. If this flag is not set fast PWM module will be disabled and FPWM outputs will go to HiZ.
|
FPWM_EN0
|
Enable FPWM_0 output. Otherwise FPWM_0 will stay low.
|
FPWM_EN1
|
Enable FPWM_1 output. Otherwise FPWM_1 will stay low.
|
FPWM_EN2
|
Enable FPWM_2 output. Otherwise FPWM_2 will stay low.
|
Return value
On success function returns 0. Otherwise error code.
Example
/*
Enable fast PWM module with FPWM_0 and FPWM_2 outputs.
PWM frequency 10.6Hz
*/
sub_fpwm_config( hndl, 10.6, FPWM_ENABLE|FPWM_EN0FPWM_EN2 );
See also
sub_fpwm_set
Error Codes
|