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
|
/*
* Copyright (c) 2006-2024 RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-07-13 Rbb666 first version
*/
#ifndef __PWM_CONFIG_H__
#define __PWM_CONFIG_H__
#include <rtthread.h>
#include <board.h>
#ifdef __cplusplus
extern "C"
{
#endif
#define MAX_PERIOD 65535
#ifdef BSP_USING_PWM0
#ifndef PWM0_CH0_PORT0_CONFIG
#define PWM0_CH0_PORT0_CONFIG \
{ \
.name = "pwm0", \
.channel = 0, \
.gpio = GET_PIN(0, 0), \
}
#endif /* PWM0_CH0_PORT2_CONFIG */
#ifndef PWM0_CH2_PORT11_COMPL_CONFIG
#define PWM0_CH2_PORT11_COMPL_CONFIG \
{ \
.name = "pwm0", \
.channel = 2, \
.gpio = GET_PIN(11, 3), \
}
#endif /*PWM0_CH2_PORT11_COMPL_CONFIG*/
#ifndef PWM0_CH3_PORT11_CONFIG
#define PWM0_CH3_PORT11_CONFIG \
{ \
.name = "pwm0", \
.channel = 3, \
.gpio = GET_PIN(11, 4), \
}
#endif /*PWM0_CH3_PORT11_CONFIG*/
#ifndef PWM0_CH4_PORT5_COMPL_CONFIG
#define PWM0_CH4_PORT5_COMPL_CONFIG \
{ \
.name = "pwm0", \
.channel = 4, \
.gpio = GET_PIN(5, 1), \
}
#endif /*PWM0_CH4_PORT5_COMPL_CONFIG*/
#ifndef PWM0_CH7_PORT2_CONFIG
#define PWM0_CH7_PORT2_CONFIG \
{ \
.name = "pwm0", \
.channel = 7, \
.gpio = GET_PIN(2, 2), \
}
#endif /* PWM0_CH7_PORT2_CONFIG */
#ifndef PWM0_CH7_PORT5_CONFIG
#define PWM0_CH7_PORT5_CONFIG \
{ \
.name = "pwm0", \
.channel = 7, \
.gpio = GET_PIN(5, 6), \
}
#endif /* PWM0_CH7_PORT5_CONFIG */
#ifndef PWM0_CH7_PORT5_COMPL_CONFIG
#define PWM0_CH7_PORT5_COMPL_CONFIG \
{ \
.name = "pwm0", \
.channel = 7, \
.gpio = GET_PIN(5, 7), \
}
#endif /*PWM0_CH7_PORT5_COMPL_CONFIG*/
#ifndef PWM0_CH7_PORT7_CONFIG
#define PWM0_CH7_PORT7_CONFIG \
{ \
.name = "pwm0", \
.channel = 7, \
.gpio = GET_PIN(7, 7), \
}
#endif /* PWM0_CH7_PORT7_CONFIG */
#ifndef PWM0_CH7_PORT9_CONFIG
#define PWM0_CH7_PORT9_CONFIG \
{ \
.name = "pwm0", \
.channel = 7, \
.gpio = GET_PIN(9, 4), \
}
#endif /* PWM0_CH7_PORT9_CONFIG */
#ifndef PWM0_CH7_PORT10_CONFIG
#define PWM0_CH7_PORT10_CONFIG \
{ \
.name = "pwm0", \
.channel = 7, \
.gpio = GET_PIN(10, 2), \
}
#endif /* PWM0_CH7_PORT10_CONFIG */
#ifndef PWM0_CH7_PORT12_CONFIG
#define PWM0_CH7_PORT12_CONFIG \
{ \
.name = "pwm0", \
.channel = 7, \
.gpio = GET_PIN(12, 6), \
}
#endif /* PWM0_CH7_PORT12_CONFIG */
#ifndef PWM0_CH3_PORT13_CONFIG
#define PWM0_CH3_PORT13_CONFIG \
{ \
.name = "pwm0", \
.channel = 3, \
.gpio = GET_PIN(13, 7), \
}
#endif /* PWM0_CH3_PORT13_CONFIG */
#endif /* BSP_USING_PWM0 */
#ifdef __cplusplus
}
#endif
#endif
|