Functions for using Pulse-Width-Modulation (PWM) peripheral. More...

Functions

gos_result_t gos_pwm_update ( gos_gpio_t gpio, uint32_t duty_cycle, uint32_t frequency)
Enable/update PWM on specified GPIO. More...
gos_result_t gos_pwm_stop ( gos_gpio_t gpio)
Disable PWM on specified GPIO. More...

Detailed Description

Functions for using Pulse-Width-Modulation (PWM) peripheral.

Function Documentation

gos_pwm_stop()

gos_result_t gos_pwm_stop ( gos_gpio_t gpio )

Disable PWM on specified GPIO.

See Gecko OS Command API documentation: pwm_update .

Parameters
[in] gpio GPIO of corresponding PWM to disable
Returns
result of API, see gos_result_t

gos_pwm_update()

gos_result_t gos_pwm_update ( gos_gpio_t gpio,
uint32_t duty_cycle,
uint32_t frequency
)

Enable/update PWM on specified GPIO.

See Gecko OS Command API documentation: pwm_update .

Note
The duty_cycle argument is padded with 100 to enable finer resolution.

For example, a duty cycle of 34.78% would be 3478 .

Parameters
[in] gpio GPIO of corresponding PWM to enable/update
[in] duty_cycle duty cycle of PWM, padded with 100, 0-10000 (for 0.00 to 100.00%)
[in] frequency Frequency of PWM in Hz
Returns
result of API, see gos_result_t