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
31
32
33
34
37
38
39
40
41
42
45
46
47
48
51
52
53
57
58
61
62
63
64
65
68
69
72
73
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
104
105
106
107
108
109
110
111
112
113
170
171
177
178
179
180
185
192
193
196
197
200
201
204
205
206
207
210
211
212
/* ... */
#if defined(USE_FULL_LL_DRIVER)
#include "stm32f4xx_ll_exti.h"
#ifdef USE_FULL_ASSERT
#include "stm32_assert.h"
#else
#define assert_param(expr) ((void)0U)
#endif
/* ... */
#if defined (EXTI)
/* ... */
/* ... */
#define IS_LL_EXTI_LINE_0_31(__VALUE__) (((__VALUE__) & ~LL_EXTI_LINE_ALL_0_31) == 0x00000000U)
#define IS_LL_EXTI_MODE(__VALUE__) (((__VALUE__) == LL_EXTI_MODE_IT) \
|| ((__VALUE__) == LL_EXTI_MODE_EVENT) \
|| ((__VALUE__) == LL_EXTI_MODE_IT_EVENT))...
#define IS_LL_EXTI_TRIGGER(__VALUE__) (((__VALUE__) == LL_EXTI_TRIGGER_NONE) \
|| ((__VALUE__) == LL_EXTI_TRIGGER_RISING) \
|| ((__VALUE__) == LL_EXTI_TRIGGER_FALLING) \
|| ((__VALUE__) == LL_EXTI_TRIGGER_RISING_FALLING))...
/* ... */
Private macros
/* ... */
/* ... */
/* ... */
uint32_t LL_EXTI_DeInit(void)
{
LL_EXTI_WriteReg(IMR, 0x00000000U);
LL_EXTI_WriteReg(EMR, 0x00000000U);
LL_EXTI_WriteReg(RTSR, 0x00000000U);
LL_EXTI_WriteReg(FTSR, 0x00000000U);
LL_EXTI_WriteReg(SWIER, 0x00000000U);
LL_EXTI_WriteReg(PR, 0x00FFFFFFU);
return SUCCESS;
}{ ... }
/* ... */
uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct)
{
ErrorStatus status = SUCCESS;
assert_param(IS_LL_EXTI_LINE_0_31(EXTI_InitStruct->Line_0_31));
assert_param(IS_FUNCTIONAL_STATE(EXTI_InitStruct->LineCommand));
assert_param(IS_LL_EXTI_MODE(EXTI_InitStruct->Mode));
if (EXTI_InitStruct->LineCommand != DISABLE)
{
assert_param(IS_LL_EXTI_TRIGGER(EXTI_InitStruct->Trigger));
if (EXTI_InitStruct->Line_0_31 != LL_EXTI_LINE_NONE)
{
switch (EXTI_InitStruct->Mode)
{
case LL_EXTI_MODE_IT:
LL_EXTI_DisableEvent_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableIT_0_31(EXTI_InitStruct->Line_0_31);
break;case LL_EXTI_MODE_IT:
case LL_EXTI_MODE_EVENT:
LL_EXTI_DisableIT_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableEvent_0_31(EXTI_InitStruct->Line_0_31);
break;case LL_EXTI_MODE_EVENT:
case LL_EXTI_MODE_IT_EVENT:
LL_EXTI_EnableIT_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableEvent_0_31(EXTI_InitStruct->Line_0_31);
break;case LL_EXTI_MODE_IT_EVENT:
default:
status = ERROR;
break;default
}switch (EXTI_InitStruct->Mode) { ... }
if (EXTI_InitStruct->Trigger != LL_EXTI_TRIGGER_NONE)
{
switch (EXTI_InitStruct->Trigger)
{
case LL_EXTI_TRIGGER_RISING:
LL_EXTI_DisableFallingTrig_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableRisingTrig_0_31(EXTI_InitStruct->Line_0_31);
break;case LL_EXTI_TRIGGER_RISING:
case LL_EXTI_TRIGGER_FALLING:
LL_EXTI_DisableRisingTrig_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableFallingTrig_0_31(EXTI_InitStruct->Line_0_31);
break;case LL_EXTI_TRIGGER_FALLING:
case LL_EXTI_TRIGGER_RISING_FALLING:
LL_EXTI_EnableRisingTrig_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableFallingTrig_0_31(EXTI_InitStruct->Line_0_31);
break;case LL_EXTI_TRIGGER_RISING_FALLING:
default:
status = ERROR;
break;default
}switch (EXTI_InitStruct->Trigger) { ... }
}if (EXTI_InitStruct->Trigger != LL_EXTI_TRIGGER_NONE) { ... }
}if (EXTI_InitStruct->Line_0_31 != LL_EXTI_LINE_NONE) { ... }
}if (EXTI_InitStruct->LineCommand != DISABLE) { ... }
else
{
LL_EXTI_DisableIT_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_DisableEvent_0_31(EXTI_InitStruct->Line_0_31);
}else { ... }
return status;
}{ ... }
/* ... */
void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct)
{
EXTI_InitStruct->Line_0_31 = LL_EXTI_LINE_NONE;
EXTI_InitStruct->LineCommand = DISABLE;
EXTI_InitStruct->Mode = LL_EXTI_MODE_IT;
EXTI_InitStruct->Trigger = LL_EXTI_TRIGGER_FALLING;
}{ ... }
/* ... */
/* ... */
/* ... */
/* ... */
#endif
/* ... */
/* ... */
#endif