1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
32
33
34
35
39
40
41
42
43
44
45
46
51
54
55
60
67
68
73
80
81
86
93
94
99
106
107
112
115
116
121
124
125
130
133
134
139
142
143
148
149
150
155
166
167
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
201
202
208
209
210
215
216
217
218
219
220
221
222
223
224
225
226
227
232
233
234
239
240
241
242
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
271
272
273
274
275
276
281
282
287
288
289
294
299
300
303
304
/* ... */
#include "stm32f4xx_it.h"
/* ... */
/* ... */
Includes
extern __IO uint8_t ubNbDataToTransmit;
extern __IO uint8_t ubNbDataToReceive;
Private variables
/* ... */
void NMI_Handler(void)
{
}{ ... }
/* ... */
void HardFault_Handler(void)
{
while (1)
{
}while (1) { ... }
}{ ... }
/* ... */
void MemManage_Handler(void)
{
while (1)
{
}while (1) { ... }
}{ ... }
/* ... */
void BusFault_Handler(void)
{
while (1)
{
}while (1) { ... }
}{ ... }
/* ... */
void UsageFault_Handler(void)
{
while (1)
{
}while (1) { ... }
}{ ... }
/* ... */
void SVC_Handler(void)
{
}{ ... }
/* ... */
void DebugMon_Handler(void)
{
}{ ... }
/* ... */
void PendSV_Handler(void)
{
}{ ... }
/* ... */
void SysTick_Handler(void)
{
}{ ... }
...
...
/* ... */
void USER_BUTTON_IRQHANDLER(void)
{
if(LL_EXTI_IsActiveFlag_0_31(USER_BUTTON_EXTI_LINE) != RESET)
{
LL_EXTI_ClearFlag_0_31(USER_BUTTON_EXTI_LINE);
UserButton_Callback();
}if (LL_EXTI_IsActiveFlag_0_31(USER_BUTTON_EXTI_LINE) != RESET) { ... }
}{ ... }
/* ... */
void I2C1_EV_IRQHandler(void)
{
if(LL_I2C_IsActiveFlag_ADDR(I2C1))
{
if(LL_I2C_GetTransferDirection(I2C1) == LL_I2C_DIRECTION_WRITE)
{
LL_I2C_EnableIT_BUF(I2C1);
LL_I2C_ClearFlag_ADDR(I2C1);
}if (LL_I2C_GetTransferDirection(I2C1) == LL_I2C_DIRECTION_WRITE) { ... }
else
{
LL_I2C_ClearFlag_ADDR(I2C1);
Error_Callback();
}else { ... }
}if (LL_I2C_IsActiveFlag_ADDR(I2C1)) { ... }
else if(LL_I2C_IsActiveFlag_TXE(I2C1))
{
Slave_Ready_To_Transmit_Callback();
}else if (LL_I2C_IsActiveFlag_TXE(I2C1)) { ... }
else if(LL_I2C_IsActiveFlag_BTF(I2C1))
{
Slave_Ready_To_Transmit_Callback();
}else if (LL_I2C_IsActiveFlag_BTF(I2C1)) { ... }
}{ ... }
/* ... */
void I2C1_ER_IRQHandler(void)
{
if((ubNbDataToTransmit == 0) && (LL_I2C_IsActiveFlag_AF(I2C1)))
{
LL_I2C_ClearFlag_AF(I2C1);
Slave_Complete_Callback();
}if ((ubNbDataToTransmit == 0) && (LL_I2C_IsActiveFlag_AF(I2C1))) { ... }
else
{
Error_Callback();
}else { ... }
}{ ... }
/* ... */
void I2C2_EV_IRQHandler(void)
{
if(LL_I2C_IsActiveFlag_SB(I2C2))
{
LL_I2C_TransmitData8(I2C2, SLAVE_OWN_ADDRESS | I2C_REQUEST_READ);
}if (LL_I2C_IsActiveFlag_SB(I2C2)) { ... }
else if(LL_I2C_IsActiveFlag_ADDR(I2C2))
{
if(ubNbDataToReceive == 1)
{
LL_I2C_AcknowledgeNextData(I2C2, LL_I2C_NACK);
LL_I2C_EnableIT_BUF(I2C2);
}if (ubNbDataToReceive == 1) { ... }
else if(ubNbDataToReceive == 2)
{
LL_I2C_AcknowledgeNextData(I2C2, LL_I2C_NACK);
LL_I2C_EnableBitPOS(I2C2);
}else if (ubNbDataToReceive == 2) { ... }
else
{
LL_I2C_EnableIT_BUF(I2C2);
}else { ... }
LL_I2C_ClearFlag_ADDR(I2C2);
}else if (LL_I2C_IsActiveFlag_ADDR(I2C2)) { ... }
else if(LL_I2C_IsActiveFlag_BTF(I2C2))
{
Master_Complete_Callback();
}else if (LL_I2C_IsActiveFlag_BTF(I2C2)) { ... }
else if(LL_I2C_IsActiveFlag_RXNE(I2C2))
{
Master_Reception_Callback();
}else if (LL_I2C_IsActiveFlag_RXNE(I2C2)) { ... }
}{ ... }
/* ... */
void I2C2_ER_IRQHandler(void)
{
Error_Callback();
}{ ... }
/* ... */
/* ... */