mikroSDK Reference Manual
drv_pwm.h File Reference

Go to the source code of this file.

Data Structures

struct  pwm_config_t
 PWM driver config structure, consisted of the following fields: More...
 
struct  pwm_t
 PWM driver context structure. More...
 

Enumerations

enum  pwm_err_t
 

Functions

void pwm_configure_default (pwm_config_t *config)
 Configure PWM config structure. More...
 
err_t pwm_open (pwm_t *obj, pwm_config_t *config)
 Open the PWM driver object on selected pin. More...
 
err_t pwm_set_freq (pwm_t *obj, uint32_t freq_hz)
 Set PWM frequency in Hertz. More...
 
err_t pwm_start (pwm_t *obj)
 Enable counter and start PWM module. More...
 
err_t pwm_set_duty (pwm_t *obj, float duty_ratio)
 Set PWM duty cycle in percentages. More...
 
err_t pwm_stop (pwm_t *obj)
 Stop PWM module. More...
 
err_t pwm_close (pwm_t *obj)
 Close PWM driver context object. More...
 

Enumeration Type Documentation

◆ pwm_err_t

enum pwm_err_t

Return values.

Enumerator
PWM_SUCCESS 

Success.

PWM_ERROR 

Error.