1 /*
2  * Copyright (c) 2006-2023, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2018-01-05     zylx         first version
9  * 2019-01-08     SummerGift   clean up the code
10  * 2023-04-08     Wangyuqiang  complete PWM defination
11  */
12 
13 #ifndef __PWM_CONFIG_H__
14 #define __PWM_CONFIG_H__
15 
16 #include <rtthread.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #ifdef BSP_USING_PWM1
23 #define PWM1_CONFIG                             \
24     {                                           \
25        .tim_handle.Instance     = TIM1,         \
26        .name                    = "pwm1",       \
27        .channel                 = RT_NULL       \
28     }
29 #endif /* BSP_USING_PWM1 */
30 
31 #ifdef BSP_USING_PWM2
32 #define PWM2_CONFIG                             \
33     {                                           \
34        .tim_handle.Instance     = TIM2,         \
35        .name                    = "pwm2",       \
36        .channel                 = RT_NULL       \
37     }
38 #endif /* BSP_USING_PWM2 */
39 
40 #ifdef BSP_USING_PWM3
41 #define PWM3_CONFIG                             \
42     {                                           \
43        .tim_handle.Instance     = TIM3,         \
44        .name                    = "pwm3",       \
45        .channel                 = RT_NULL       \
46     }
47 #endif /* BSP_USING_PWM3 */
48 
49 #ifdef BSP_USING_PWM4
50 #define PWM4_CONFIG                             \
51     {                                           \
52        .tim_handle.Instance     = TIM4,         \
53        .name                    = "pwm4",       \
54        .channel                 = RT_NULL       \
55     }
56 #endif /* BSP_USING_PWM4 */
57 
58 #ifdef BSP_USING_PWM5
59 #define PWM5_CONFIG                             \
60     {                                           \
61        .tim_handle.Instance     = TIM5,         \
62        .name                    = "pwm5",       \
63        .channel                 = RT_NULL       \
64     }
65 #endif /* BSP_USING_PWM5 */
66 
67 #ifdef BSP_USING_PWM6
68 #define PWM6_CONFIG                             \
69     {                                           \
70        .tim_handle.Instance     = TIM6,         \
71        .name                    = "pwm6",       \
72        .channel                 = RT_NULL       \
73     }
74 #endif /* BSP_USING_PWM6 */
75 
76 #ifdef BSP_USING_PWM7
77 #define PWM7_CONFIG                             \
78     {                                           \
79        .tim_handle.Instance     = TIM7,         \
80        .name                    = "pwm7",       \
81        .channel                 = RT_NULL       \
82     }
83 #endif /* BSP_USING_PWM7 */
84 
85 #ifdef BSP_USING_PWM8
86 #define PWM8_CONFIG                             \
87     {                                           \
88        .tim_handle.Instance     = TIM8,         \
89        .name                    = "pwm8",       \
90        .channel                 = RT_NULL       \
91     }
92 #endif /* BSP_USING_PWM8 */
93 
94 #ifdef BSP_USING_PWM9
95 #define PWM9_CONFIG                             \
96     {                                           \
97        .tim_handle.Instance     = TIM9,         \
98        .name                    = "pwm9",       \
99        .channel                 = RT_NULL       \
100     }
101 #endif /* BSP_USING_PWM9 */
102 
103 #ifdef BSP_USING_PWM10
104 #define PWM10_CONFIG                            \
105     {                                           \
106        .tim_handle.Instance     = TIM10,        \
107        .name                    = "pwm10",      \
108        .channel                 = RT_NULL       \
109     }
110 #endif /* BSP_USING_PWM10 */
111 
112 #ifdef BSP_USING_PWM11
113 #define PWM11_CONFIG                            \
114     {                                           \
115        .tim_handle.Instance     = TIM11,        \
116        .name                    = "pwm11",      \
117        .channel                 = RT_NULL       \
118     }
119 #endif /* BSP_USING_PWM11 */
120 
121 #ifdef BSP_USING_PWM12
122 #define PWM12_CONFIG                            \
123     {                                           \
124        .tim_handle.Instance     = TIM12,        \
125        .name                    = "pwm12",      \
126        .channel                 = RT_NULL       \
127     }
128 #endif /* BSP_USING_PWM12 */
129 
130 #ifdef BSP_USING_PWM13
131 #define PWM13_CONFIG                            \
132     {                                           \
133        .tim_handle.Instance     = TIM13,        \
134        .name                    = "pwm13",      \
135        .channel                 = RT_NULL       \
136     }
137 #endif /* BSP_USING_PWM13 */
138 
139 #ifdef BSP_USING_PWM14
140 #define PWM14_CONFIG                            \
141     {                                           \
142        .tim_handle.Instance     = TIM14,        \
143        .name                    = "pwm14",      \
144        .channel                 = RT_NULL       \
145     }
146 #endif /* BSP_USING_PWM14 */
147 
148 #ifdef BSP_USING_PWM15
149 #define PWM15_CONFIG                            \
150     {                                           \
151        .tim_handle.Instance     = TIM15,        \
152        .name                    = "pwm15",      \
153        .channel                 = RT_NULL       \
154     }
155 #endif /* BSP_USING_PWM15 */
156 
157 #ifdef BSP_USING_PWM16
158 #define PWM16_CONFIG                            \
159     {                                           \
160        .tim_handle.Instance     = TIM16,        \
161        .name                    = "pwm16",      \
162        .channel                 = RT_NULL       \
163     }
164 #endif /* BSP_USING_PWM16 */
165 
166 #ifdef BSP_USING_PWM17
167 #define PWM17_CONFIG                            \
168     {                                           \
169        .tim_handle.Instance     = TIM17,        \
170        .name                    = "pwm17",      \
171        .channel                 = RT_NULL       \
172     }
173 #endif /* BSP_USING_PWM17 */
174 
175 #ifdef BSP_USING_PWM18
176 #define PWM18_CONFIG                            \
177     {                                           \
178        .tim_handle.Instance     = TIM18,        \
179        .name                    = "pwm18",      \
180        .channel                 = RT_NULL       \
181     }
182 #endif /* BSP_USING_PWM18 */
183 
184 #ifdef BSP_USING_PWM19
185 #define PWM19_CONFIG                            \
186     {                                           \
187        .tim_handle.Instance     = TIM19,        \
188        .name                    = "pwm19",      \
189        .channel                 = RT_NULL       \
190     }
191 #endif /* BSP_USING_PWM19 */
192 
193 #ifdef __cplusplus
194 }
195 #endif
196 
197 #endif /* __PWM_CONFIG_H__ */
198