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