天嵌二次封装库使用手册  V2.1.2
lib_pwm.h
浏览该文件的文档.
1 
7 #ifndef LINUX_LIBV2_SOURCE_PWM_LIB_PWM_H_
8 #define LINUX_LIBV2_SOURCE_PWM_LIB_PWM_H_
9 
10 // Copyright 2024
11 
12 #ifdef __cplusplus
13 #define PWM_API extern "C"
14 #else
15 #define PWM_API
16 #endif
17 
23  PWM_API int pwm_enable(int node, int enable);
24 
32  PWM_API int set_pwm(int node, unsigned long period, unsigned long duty_cycle);
33 
38  PWM_API int pwm_test();
39 
40 #endif
#define PWM_API
Definition: lib_pwm.h:15
PWM_API int pwm_enable(int node, int enable)
PWM 开启/关闭
PWM_API int pwm_test()
测试pwm_enable()和set_pwm()这两个函数
PWM_API int set_pwm(int node, unsigned long period, unsigned long duty_cycle)
设置 PWM 的周期、占空比