Skip to content

Commit 24ba20b

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

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

components/drivers/include/drivers/dev_pwm.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ 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 get the PWM configuration
206+
* @param device the PWM device
207+
* @param cfg the configuration of PWM
208+
* @return rt_err_t error code
209+
*/
210+
rt_err_t rt_pwm_get(struct rt_device_pwm *device, struct rt_pwm_configuration *cfg);
211+
204212
/*! @}*/
205213

206214
#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)