diff options
| author | guozhanxin <[email protected]> | 2018-09-26 17:29:31 +0800 |
|---|---|---|
| committer | guozhanxin <[email protected]> | 2018-09-26 17:29:39 +0800 |
| commit | 12b7634c6242561117fd3abe2a8d522d48ac5a0b (patch) | |
| tree | a79fc0346a7588b38bca6e93b64c0ddeb38f1041 /components/drivers/include | |
| parent | bc42d5baaa615e458b34b717327c5e08fc5f4af3 (diff) | |
[components][drivers][pwm] Add rt_pwm_disable function and API Interface
Diffstat (limited to 'components/drivers/include')
| -rw-r--r-- | components/drivers/include/drivers/rt_drv_pwm.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/components/drivers/include/drivers/rt_drv_pwm.h b/components/drivers/include/drivers/rt_drv_pwm.h index ffd08edabb..0aa2f56656 100644 --- a/components/drivers/include/drivers/rt_drv_pwm.h +++ b/components/drivers/include/drivers/rt_drv_pwm.h @@ -25,6 +25,9 @@ #ifndef __DRV_PWM_H_INCLUDE__ #define __DRV_PWM_H_INCLUDE__ +#include <rtthread.h> +#include <rtdevice.h> + #define PWM_CMD_ENABLE (128 + 0) #define PWM_CMD_DISABLE (128 + 1) #define PWM_CMD_SET (128 + 2) @@ -49,6 +52,10 @@ struct rt_device_pwm const struct rt_pwm_ops *ops; }; -extern 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_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_set(struct rt_device_pwm *device, int channel, rt_uint32_t period, rt_uint32_t pulse); #endif /* __DRV_PWM_H_INCLUDE__ */ |
