mikroSDK Reference Manual
hal_pwm.h File Reference

Go to the source code of this file.

Data Structures

struct  hal_pwm_handle_register_t
 PWM HAL level handle. More...
 
struct  hal_pwm_config_t
 PWM HAL config structure, consisted of the following fields: More...
 
struct  hal_pwm_t
 The PWM HAL context structure. More...
 

Macros

#define HAL_PWM_MIN_DUTY_RATIO   0
 
#define HAL_PWM_MAX_DUTY_RATIO   1
 

Enumerations

enum  hal_pwm_err_t
 

Functions

void hal_pwm_configure_default (hal_pwm_config_t *config)
 Configure PWM configuration structure. More...
 
err_t hal_pwm_open (handle_t *handle, bool hal_obj_open_state)
 Open the PWM HAL object on selected pin. More...
 
err_t hal_pwm_set_freq (handle_t *handle, hal_pwm_config_t *config)
 Set PWM frequency in Hertz. More...
 
err_t hal_pwm_start (handle_t *handle)
 Start PWM HAL context object. More...
 
err_t hal_pwm_set_duty (handle_t *handle, float duty_ratio)
 Set PWM duty cycle in percentages. More...
 
err_t hal_pwm_stop (handle_t *handle)
 Stop PWM module. More...
 
err_t hal_pwm_close (handle_t *handle)
 Close PWM HAL object. More...
 

Macro Definition Documentation

◆ HAL_PWM_MIN_DUTY_RATIO

#define HAL_PWM_MIN_DUTY_RATIO   0

Minimum duty ratio value.

◆ HAL_PWM_MAX_DUTY_RATIO

#define HAL_PWM_MAX_DUTY_RATIO   1

Maximum duty ratio value.

Enumeration Type Documentation

◆ hal_pwm_err_t

Return values.

Enumerator
HAL_PWM_SUCCESS 

Success.

HAL_PWM_MODULE_ERROR 

Module Error.

HAL_PWM_WRONG_PIN 

Wrong pin.

HAL_PWM_ERROR 

Error.