InPlay API
hal_cnt_pwm.h
1 
12 #ifndef HAL_CNT_PWM_H
13 #define HAL_CNT_PWM_H
14 
23 #include <stdio.h>
24 #include <stdint.h>
25 #include <stdbool.h>
26 #include <string.h>
27 
28 #include "./hal/hal_counter.h"
29 enum cnt_pwm_err {
30  CNT_PWM_ERR_OK = 0,
31  CNT_PWM_ERR_INVALID_PARAM = -1,
32  CNT_PWM_ERR_IN_USE = -2,
33  CNT_PWM_ERR_BAD_STATE = -3,
34 };
35 
36 enum cnt_pwm_id_t {
37  CNT_PWM0 = 0,
38  CNT_PWM1,
39  CNT_PWM2,
40  CNT_PWM3,
41  CNT_PWM_MAX,
42 };
43 
52 void *hal_cnt_pwm_open(int id, int port, int pin, int prio);
53 
59 void hal_cnt_pwm_close(void *hdl);
60 
71 int hal_cnt_pwm_enable(void *hdl, uint32_t period_usec, uint32_t high_usec);
80 int hal_cnt_pwm_disable(void *hdl);
82 
83 
84 #endif
int hal_cnt_pwm_disable(void *hdl)
Disable PWM.
void * hal_cnt_pwm_open(int id, int port, int pin, int prio)
Open counter PWM.
void hal_cnt_pwm_close(void *hdl)
Close counter PWM.
int hal_cnt_pwm_enable(void *hdl, uint32_t period_usec, uint32_t high_usec)
Enable PWM.