![]() |
RUI3 (RAK Unified Interface 3) - RAK4631
|
Provide a hardware independent PWM driver layer for API layer to use. More...
Go to the source code of this file.
Macros | |
#define | PWM_NO_TIMEOUT UINT32_MAX |
Enumerations | |
enum | UDRV_PWM_RESOLUTION { UDRV_PWM_RESOLUTION_8BIT = (0UL), UDRV_PWM_RESOLUTION_10BIT = (1UL), UDRV_PWM_RESOLUTION_12BIT = (2UL), UDRV_PWM_RESOLUTION_14BIT = (3UL) } |
enum | udrv_pwm_port { UDRV_PWM_0 = 0x0, UDRV_PWM_1 = 0x1, UDRV_PWM_2 = 0x2, UDRV_PWM_MAX = 0x3 } |
Functions | |
void | udrv_pwm_init (udrv_pwm_port port, uint32_t freq_hz, uint8_t is_invert, uint32_t pin) |
void | udrv_pwm_deinit (udrv_pwm_port port) |
int32_t | udrv_pwm_set_duty (udrv_pwm_port port, uint32_t duty) |
int32_t | udrv_pwm_enable (udrv_pwm_port port, uint32_t duration) |
void | udrv_pwm_disable (udrv_pwm_port port) |
void | udrv_pwm_suspend (void) |
void | udrv_pwm_resume (void) |
UDRV_PWM_RESOLUTION | udrv_pwm_get_resolution (void) |
void | udrv_pwm_set_resolution (UDRV_PWM_RESOLUTION resolution) |
Provide a hardware independent PWM driver layer for API layer to use.
#define PWM_NO_TIMEOUT UINT32_MAX |
enum UDRV_PWM_RESOLUTION |
enum udrv_pwm_port |
void udrv_pwm_init | ( | udrv_pwm_port | port, |
uint32_t | freq_hz, | ||
uint8_t | is_invert, | ||
uint32_t | pin | ||
) |
Initilize PWM to ready operations.
port |
void udrv_pwm_deinit | ( | udrv_pwm_port | port | ) |
Deinitialize all PWM to disable operations
int32_t udrv_pwm_set_duty | ( | udrv_pwm_port | port, |
uint32_t | duty | ||
) |
Set the duty cycle for the PWM
port |
int32_t udrv_pwm_enable | ( | udrv_pwm_port | port, |
uint32_t | duration | ||
) |
Enables the PWM to start operation
port | |
duration |
void udrv_pwm_disable | ( | udrv_pwm_port | port | ) |
Disables the PWM to stop operation
port |
void udrv_pwm_suspend | ( | void | ) |
Disable and save all the active PWM for power saving
void udrv_pwm_resume | ( | void | ) |
Restore all the active PWM after power saving
UDRV_PWM_RESOLUTION udrv_pwm_get_resolution | ( | void | ) |
Get resolution for PWM
void udrv_pwm_set_resolution | ( | UDRV_PWM_RESOLUTION | resolution | ) |
Set resolution for PWM