4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-04 08:04:33 +08:00

54 lines
1.2 KiB
C
Raw Normal View History

2019-02-15 10:43:09 +08:00
/*
2021-03-08 22:40:39 +08:00
* Copyright (c) 2006-2021, RT-Thread Development Team
2019-02-15 10:43:09 +08:00
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2018-01-05 zylx first version
* 2019-01-08 SummerGift clean up the code
*/
#ifndef __PWM_CONFIG_H__
#define __PWM_CONFIG_H__
#include <rtthread.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* .tim_handle.Instance = TIM1/2/3...,
* .name = "your pwm device name",
* .channel = 1/2/3/4
*/
2019-02-15 10:43:09 +08:00
#ifdef BSP_USING_PWM2
#ifndef PWM2_CONFIG
#define PWM2_CONFIG \
{ \
.tim_handle.Instance = TIM2, \
.name = "pwm2", \
.channel = 0 \
}
#endif /* PWM2_CONFIG */
#endif /* BSP_USING_PWM2 */
#ifdef BSP_USING_PWM3
#ifndef PWM3_CONFIG
#define PWM3_CONFIG \
{ \
.tim_handle.Instance = TIM3, \
.name = "pwm3", \
.channel = 0 \
}
#endif /* PWM2_CONFIG */
#endif /* BSP_USING_PWM2 */
#ifdef __cplusplus
}
#endif
#endif /* __PWM_CONFIG_H__ */