5.11.0.0R3
Software Development Kit
 
Loading...
Searching...
No Matches

Functions

wiced_result_t wiced_pwm_init (wiced_pwm_t pwm, uint32_t frequency, float duty_cycle)
 
wiced_result_t wiced_pwm_start (wiced_pwm_t pwm)
 
wiced_result_t wiced_pwm_stop (wiced_pwm_t pwm)
 

Detailed Description

Pulse-Width Modulation (PWM) Functions

Example Usage // wiced_pwm_t is an enumeration of all available PWM interfaces // Defined in <WICED_SDK>/platforms/<platform_name>/platform.h // ranging from WICED_PWM_1 to WICED_PWM_MAX

wiced_pwm_init(WICED_PWM_1, frequency, duty_cycle);

wiced_pwm_start(WICED_PWM_1);

wiced_pwm_stop(WICED_PWM_1);

Function Documentation

◆ wiced_pwm_init()

wiced_result_t wiced_pwm_init ( wiced_pwm_t pwm,
uint32_t frequency,
float duty_cycle )

Initializes a PWM pin

Prepares a Pulse-Width Modulation pin for use. Does not start the PWM output (use wiced_pwm_start).

Parameters
[in]pwm: The PWM interface which should be initialized
[in]frequency: Output signal frequency in Hertz
[in]duty_cycle: Duty cycle of signal as a floating-point percentage (0.0 to 100.0)
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred with any step

◆ wiced_pwm_start()

wiced_result_t wiced_pwm_start ( wiced_pwm_t pwm)

Starts PWM output on a PWM interface

Starts Pulse-Width Modulation signal output on a PWM pin

Parameters
[in]pwm: The PWM interface which should be started
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred with any step

◆ wiced_pwm_stop()

wiced_result_t wiced_pwm_stop ( wiced_pwm_t pwm)

Stops output on a PWM pin

Stops Pulse-Width Modulation signal output on a PWM pin

Parameters
[in]pwm: The PWM interface which should be stopped
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred with any step