pwm.h
浏览该文件的文档.
1 /*
2  * Copyright (C) 2021 Alibaba Group Holding Limited
3  */
4 
5 #ifndef _AOS_PWM_H
6 #define _AOS_PWM_H
7 
8 #include <stdint.h>
9 #include <aos/kernel.h>
10 #include <aos/device.h>
11 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 typedef enum {
28 
29 typedef struct {
30  uint32_t period; /*in ns*/
31  uint32_t duty_cycle; /*in ns*/
33  bool enabled;
43 typedef aos_dev_ref_t aos_pwm_ref_t;
54 
63 
73 
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
90 #endif /* _AOS_PWM_H */
int32_t aos_status_t
Definition: kernel.h:185
uint32_t duty_cycle
Definition: pwm.h:31
void aos_pwm_put(aos_pwm_ref_t *ref)
aos_pwm_polarity_t polarity
Definition: pwm.h:32
uint32_t period
Definition: pwm.h:30
aos_status_t aos_pwm_set_attr(aos_pwm_ref_t *ref, aos_pwm_attr_t const *attr)
bool enabled
Definition: pwm.h:33
aos_status_t aos_pwm_get(aos_pwm_ref_t *ref, uint32_t id)
aos_status_t aos_pwm_get_attr(aos_pwm_ref_t *ref, aos_pwm_attr_t *attr)
aos_pwm_polarity_t
Definition: pwm.h:24
aos_dev_ref_t aos_pwm_ref_t
Definition: pwm.h:43
@ AOS_PWM_POLARITY_NORMAL
Definition: pwm.h:25
@ AOS_PWM_POLARITY_INVERSE
Definition: pwm.h:26