mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-23 01:48:50 +08:00
[rt_drv_pwm]增加API:增加单独设置PWM频率和脉宽的函数 (#6130)
* [rt_drv_pwm]增加API:增加单独设置PWM频率和脉宽的函数
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
#define PWM_CMD_GET (RT_DEVICE_CTRL_BASE(PWM) + 3)
|
||||
#define PWMN_CMD_ENABLE (RT_DEVICE_CTRL_BASE(PWM) + 4)
|
||||
#define PWMN_CMD_DISABLE (RT_DEVICE_CTRL_BASE(PWM) + 5)
|
||||
#define PWM_CMD_SET_PERIOD (RT_DEVICE_CTRL_BASE(PWM) + 6)
|
||||
#define PWM_CMD_SET_PULSE (RT_DEVICE_CTRL_BASE(PWM) + 7)
|
||||
|
||||
struct rt_pwm_configuration
|
||||
{
|
||||
@@ -50,5 +52,7 @@ rt_err_t rt_device_pwm_register(struct rt_device_pwm *device, const char *name,
|
||||
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);
|
||||
rt_err_t rt_pwm_set_period(struct rt_device_pwm *device, int channel, rt_uint32_t period);
|
||||
rt_err_t rt_pwm_set_pulse(struct rt_device_pwm *device, int channel, rt_uint32_t pulse);
|
||||
|
||||
#endif /* __DRV_PWM_H_INCLUDE__ */
|
||||
|
Reference in New Issue
Block a user