优化互补PWM输出功能的实现逻辑,兼容原本API,增加互补PWM使能/失能命令

This commit is contained in:
Trisuborn
2021-01-20 23:47:18 +08:00
parent 63239801d9
commit 55402e19db
3 changed files with 26 additions and 18 deletions
@@ -18,6 +18,8 @@
#define PWM_CMD_DISABLE (128 + 1)
#define PWM_CMD_SET (128 + 2)
#define PWM_CMD_GET (128 + 3)
#define PWMN_CMD_ENABLE (128 + 4)
#define PWMN_CMD_DISABLE (128 + 5)/
struct rt_pwm_configuration
{
@@ -46,8 +48,8 @@ struct rt_device_pwm
rt_err_t rt_device_pwm_register(struct rt_device_pwm *device, const char *name, const struct rt_pwm_ops *ops, const void *user_data);
rt_err_t rt_pwm_enable(struct rt_device_pwm *device, int channel, rt_uint8_t complementary);
rt_err_t rt_pwm_disable(struct rt_device_pwm *device, int channel, rt_uint8_t complementary);
rt_err_t rt_pwm_enable(struct rt_device_pwm *device, int channel);
rt_err_t rt_pwm_disable(struct rt_device_pwm *device, int channel);
rt_err_t rt_pwm_set(struct rt_device_pwm *device, int channel, rt_uint32_t period, rt_uint32_t pulse);
#endif /* __DRV_PWM_H_INCLUDE__ */