Skip to content

Commit b29c389

Browse files
committed
[Driver][MISC][PWM] Enable rt_pwm_get API
Signed-off-by: GuEe-GUI <2991707448@qq.com>
1 parent 46b0b49 commit b29c389

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

components/drivers/include/drivers/dev_pwm.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ rt_err_t rt_pwm_set_dead_time(struct rt_device_pwm *device, int channel, rt_uint
201201
*/
202202
rt_err_t rt_pwm_set_phase(struct rt_device_pwm *device, int channel, rt_uint32_t phase);
203203

204+
/**
205+
* @brief set the PWM channel
206+
* @param device the PWM device
207+
* @param cfg the configuration of PWM
208+
*/
209+
rt_err_t rt_pwm_get(struct rt_device_pwm *device, struct rt_pwm_configuration *cfg);
210+
204211
/*! @}*/
205212

206213
#endif /* __DEV_PWM_H__ */

components/drivers/misc/rt_drv_pwm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ rt_err_t rt_pwm_set_phase(struct rt_device_pwm *device, int channel, rt_uint32_t
285285
return result;
286286
}
287287

288-
static rt_err_t rt_pwm_get(struct rt_device_pwm *device, struct rt_pwm_configuration *cfg)
288+
rt_err_t rt_pwm_get(struct rt_device_pwm *device, struct rt_pwm_configuration *cfg)
289289
{
290290
rt_err_t result = RT_EOK;
291291

0 commit comments

Comments
 (0)