HAL EXTI How to Use ¶
- group EXTI_How_To_Use
-
How to use the EXTI HAL module driver ¶
The EXTI HAL driver can be used as follows: ¶
When a configurable EXTI line is used as an event input: ¶
Instantiate an EXTI handle and associate it to a configurable EXTI line using HAL_EXTI_Init().
Configure the configurable EXTI line identified by the given handle using HAL_EXTI_SetConfig().
Register a user-defined callback for the configurable EXTI line identified by the handle using HAL_EXTI_RegisterTriggerCallback(), or use the default callback function HAL_EXTI_TriggerCallback().
Enable the configurable EXTI line for interrupt, event, or both modes using HAL_EXTI_Enable().
Retrieve pending events for the configurable EXTI line using HAL_EXTI_GetPending() and clear them using HAL_EXTI_ClearPending().
Disable EXTI modes using HAL_EXTI_Disable().
When a direct EXTI line is used as an event input: ¶
Instantiate an EXTI handle and associate it to a direct EXTI line using HAL_EXTI_Init().
Enable the direct EXTI line for interrupt, event, or both modes using HAL_EXTI_Enable().
Disable EXTI modes using HAL_EXTI_Disable().
When generating a software interrupt on an EXTI line: ¶
Instantiate an EXTI handle and associate it to an EXTI line using HAL_EXTI_Init().
Register a user-defined callback for an EXTI line identified by the handle using HAL_EXTI_RegisterTriggerCallback(), or use the default callback function HAL_EXTI_TriggerCallback()
Generate the software interrupt using HAL_EXTI_GenerateSWI().
Retrieve pending software interrupt events using HAL_EXTI_GetPending() and clear them using HAL_EXTI_ClearPending().
The HAL EXTI driver allows management of EXTI security attributes: ¶
Set the privilege access level attribute for EXTI line(s) using HAL_EXTI_SetPrivAttr().
Get the privilege access level attribute for an EXTI line using HAL_EXTI_GetPrivAttr().