@@ -86,6 +86,15 @@ struct serial_s {
86
86
/* Exported constants --------------------------------------------------------*/
87
87
#define TX_TIMEOUT 1000
88
88
89
+ #if defined(USART2_BASE ) && !defined(USART2_IRQn )
90
+ #if defined(STM32G0xx )
91
+ #if defined(LPUART2_BASE )
92
+ #define USART2_IRQn USART2_LPUART2_IRQn
93
+ #define USART2_IRQHandler USART2_LPUART2_IRQHandler
94
+ #endif
95
+ #endif /* STM32G0xx */
96
+ #endif
97
+
89
98
#if defined(USART3_BASE ) && !defined(USART3_IRQn )
90
99
#if defined(STM32F0xx )
91
100
#if defined(STM32F091xC ) || defined (STM32F098xx )
@@ -98,17 +107,18 @@ struct serial_s {
98
107
#define USART3_IRQn USART3_4_IRQn
99
108
#define USART3_IRQHandler USART3_4_IRQHandler
100
109
#endif /* STM32F091xC || STM32F098xx */
101
- #endif /* STM32F0xx */
102
-
103
- #if defined(STM32G0xx )
104
- #if defined(LPUART1_BASE )
110
+ #elif defined(STM32G0xx )
111
+ #if defined(LPUART2_BASE )
112
+ #define USART3_IRQn USART3_4_5_6_LPUART1_IRQn
113
+ #define USART3_IRQHandler USART3_4_5_6_LPUART1_IRQHandler
114
+ #elif defined(LPUART1_BASE )
105
115
#define USART3_IRQn USART3_4_LPUART1_IRQn
106
116
#define USART3_IRQHandler USART3_4_LPUART1_IRQHandler
107
117
#else
108
118
#define USART3_IRQn USART3_4_IRQn
109
119
#define USART3_IRQHandler USART3_4_IRQHandler
110
120
#endif
111
- #endif /* STM32G0xx */
121
+ #endif /* STM32F0xx */
112
122
#endif
113
123
114
124
#if defined(USART4_BASE ) && !defined(USART4_IRQn )
@@ -123,15 +133,15 @@ struct serial_s {
123
133
#endif /* STM32F091xC || STM32F098xx */
124
134
#elif defined(STM32L0xx )
125
135
#define USART4_IRQn USART4_5_IRQn
126
- #endif /* STM32F0xx */
127
- #if defined(STM32G0xx )
128
- #if defined(LPUART1_BASE )
136
+ #elif defined(STM32G0xx )
137
+ #if defined(LPUART2_BASE )
138
+ #define USART4_IRQn USART3_4_5_6_LPUART1_IRQn
139
+ #elif defined(LPUART1_BASE )
129
140
#define USART4_IRQn USART3_4_LPUART1_IRQn
130
141
#else
131
142
#define USART4_IRQn USART3_4_IRQn
132
143
#endif
133
144
#endif /* STM32G0xx */
134
-
135
145
#endif
136
146
137
147
#if defined(USART5_BASE ) && !defined(USART5_IRQn )
@@ -142,40 +152,63 @@ struct serial_s {
142
152
#elif defined(STM32F030xC )
143
153
#define USART5_IRQn USART3_6_IRQn
144
154
#endif /* STM32F091xC || STM32F098xx */
155
+ #elif defined(STM32G0xx )
156
+ #if defined(LPUART2_BASE )
157
+ #define USART5_IRQn USART3_4_5_6_LPUART1_IRQn
158
+ #endif
145
159
#elif defined(STM32L0xx )
146
160
#define USART5_IRQn USART4_5_IRQn
147
161
#endif /* STM32F0xx */
148
162
#endif
149
163
150
- #if defined (STM32F0xx )
151
164
/* IRQHandler is mapped on USART3_IRQHandler for STM32F0xx */
152
165
#if defined(USART6_BASE ) && !defined(USART6_IRQn )
166
+ #if defined (STM32F0xx )
153
167
#if defined(STM32F091xC ) || defined (STM32F098xx )
154
168
#define USART6_IRQn USART3_8_IRQn
155
169
#elif defined(STM32F030xC )
156
170
#define USART6_IRQn USART3_6_IRQn
157
171
#endif /* STM32F091xC || STM32F098xx */
172
+ #elif defined(STM32G0xx )
173
+ #if defined(LPUART2_BASE )
174
+ #define USART6_IRQn USART3_4_5_6_LPUART1_IRQn
175
+ #endif
176
+ #endif /* STM32F0xx */
158
177
#endif
159
178
160
179
#if defined(USART7_BASE ) && !defined(USART7_IRQn )
180
+ #if defined (STM32F0xx )
161
181
#if defined(STM32F091xC ) || defined (STM32F098xx )
162
182
#define USART7_IRQn USART3_8_IRQn
163
183
#endif /* STM32F091xC || STM32F098xx */
184
+ #endif /* STM32F0xx */
164
185
#endif
165
186
166
187
#if defined(USART8_BASE ) && !defined(USART8_IRQn )
188
+ #if defined (STM32F0xx )
167
189
#if defined(STM32F091xC ) || defined (STM32F098xx )
168
190
#define USART8_IRQn USART3_8_IRQn
169
191
#endif /* STM32F091xC || STM32F098xx */
170
- #endif
171
192
#endif /* STM32F0xx */
193
+ #endif
172
194
173
195
#if defined(LPUART1_BASE ) && !defined(LPUART1_IRQn )
174
- #if defined(STM32G0xx ) && defined(USART3_BASE )
196
+ #if defined(STM32G0xx )
197
+ #if defined(LPUART2_BASE )
198
+ #define LPUART1_IRQn USART3_4_5_6_LPUART1_IRQn
199
+ #elif defined(USART3_BASE )
175
200
#define LPUART1_IRQn USART3_4_LPUART1_IRQn
201
+ #endif
176
202
#endif /* STM32G0xx */
177
203
#endif
178
204
205
+ #if defined(LPUART2_BASE ) && !defined(LPUART2_IRQn )
206
+ #if defined(STM32G0xx )
207
+ #if defined(LPUART2_BASE )
208
+ #define LPUART2_IRQn USART2_LPUART2_IRQn
209
+ #endif
210
+ #endif /* STM32G0xx */
211
+ #endif
179
212
180
213
/* Exported macro ------------------------------------------------------------*/
181
214
/* Exported functions ------------------------------------------------------- */
0 commit comments