This module implements some utility functions for using PWM functionality in the application.
More...
|
struct | pwm_utils_contex_t |
| Context structure for defining application specific instance of PWM peripheral to be used with this module. More...
|
|
This module implements some utility functions for using PWM functionality in the application.
◆ pwm_utils_enable()
Enables the PWM channel.
- Parameters
-
◆ pwm_utils_level_set()
Set the PWM duty cycle corresponding to given int16 value.
This function maps the range [INT16_MIN, INT16_MAX] to [0, PWM max], where PWM max is the tick value for the 100% PWM duty cycle.
- Parameters
-
[in] | p_ctx | Pointer to a PWM utils context structure pwm_utils_contex_t. |
[in] | level | Desired PWM duty cycle represented in the form of int16 value. |
◆ pwm_utils_level_get()
Get the int16 value corresponding to the PWM duty cycle.
This function maps the range [0, PWM max] to [INT16_MIN, INT16_MAX], where PWM max is the tick value for the 100% PWM duty cycle.
- Parameters
-
- Returns
- int16 representation of the current PWM duty cycle.