summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
authorTrisuborn <[email protected]>2021-01-19 17:14:32 +0800
committerTrisuborn <[email protected]>2021-01-19 17:14:32 +0800
commitaed3cc162fa83971c9cd1afe42809746de4246b0 (patch)
tree83797e7cf8c9d1a2a28780c6ea9c2757d8ff9fc5 /components/drivers/include
parent6742f9a3abd4f51d89406831c6b3a5cd0113644f (diff)
为stm32的PWM驱动添加对STM32H7的支持、添加互补PWM功能的支持,补全pwm_get命令
Diffstat (limited to 'components/drivers/include')
-rw-r--r--components/drivers/include/drivers/rt_drv_pwm.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/components/drivers/include/drivers/rt_drv_pwm.h b/components/drivers/include/drivers/rt_drv_pwm.h
index 16de4c6ab8..4b436758d9 100644
--- a/components/drivers/include/drivers/rt_drv_pwm.h
+++ b/components/drivers/include/drivers/rt_drv_pwm.h
@@ -21,9 +21,15 @@
struct rt_pwm_configuration
{
- rt_uint32_t channel; /* 0-n */
- rt_uint32_t period; /* unit:ns 1ns~4.29s:1Ghz~0.23hz */
- rt_uint32_t pulse; /* unit:ns (pulse<=period) */
+ rt_uint32_t channel; /* 0-n */
+ rt_uint32_t period; /* unit:ns 1ns~4.29s:1Ghz~0.23hz */
+ rt_uint32_t pulse; /* unit:ns (pulse<=period) */
+
+ /*
+ * RT_TRUE : The channel of pwm is complememtary.
+ * RT_FALSE : The channel of pwm is nomal.
+ */
+ rt_bool_t complementary;
};
struct rt_device_pwm;
@@ -40,8 +46,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_err_t rt_pwm_disable(struct rt_device_pwm *device, int channel);
+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_set(struct rt_device_pwm *device, int channel, rt_uint32_t period, rt_uint32_t pulse);
#endif /* __DRV_PWM_H_INCLUDE__ */