This section introduces the External Interrupt Controller(EINT) APIs including terms and acronyms, supported features, software architecture, details on how to use this driver, EINT function groups, enums, structures and functions.
More...
This section introduces the External Interrupt Controller(EINT) APIs including terms and acronyms, supported features, software architecture, details on how to use this driver, EINT function groups, enums, structures and functions.
Terms and acronyms
| Terms | Details |
| EINT | External Interrupt Controller. Process the interrupt request from an external source or peripheral. |
| GPIO | General Purpose Inputs-Outputs. For more information, please refer to GPIO module in HAL. |
| ISR | Interrupt service routine. |
| NVIC | Nested Vectored Interrupt Controller. NVIC is the interrupt controller of ARM Cortex-M4. For more details, please refer to NVIC introduction in ARM Cortex-M4 Processor Technical Reference Manual . |
Supported features
The EINT controller has been designed to process interrupts from an external source or peripheral.
Software architecture of EINT
For the architecture diagram please refer HAL Driver Model.
How to use this driver
This function deinitializes the EINT number, it resets the EINT trigger mode and debounce time.
- Parameters
-
| [in] | eint_number | is the EINT number, the value is HAL_EINT_0~HAL_EINT_MAX-1. |
- Returns
- To indicate whether this function call is successful. If the return value is HAL_EINT_STATUS_OK, the operation completed successfully; If the return value is HAL_EINT_STATUS_INVALID_PARAMETER, a wrong parameter is given, the parameter must be verified.
- See also
- hal_eint_deinit()
- Example
- Sample code please refer to How to use this driver
This function initializes the EINT number, it sets the EINT trigger mode and debounce time.
- Parameters
-
| [in] | eint_number | is the EINT number, the value is HAL_EINT_0~HAL_EINT_MAX-1. |
| [in] | eint_config | is the initial configuration parameter. EINT debounce is disabled when debounce time is set to zero. For more details, please refer to hal_eint_config_t. |
- Returns
- To indicate whether this function call is successful. If the return value is HAL_EINT_STATUS_OK, the operation completed successfully; If the return value is HAL_EINT_STATUS_INVALID_PARAMETER, a wrong parameter is given, the parameter must be verified.
- See also
- hal_eint_deinit()
- Example
- Sample code please refer to How to use this driver
This function masks the dedicated EINT source.
- Parameters
-
| [in] | eint_number | is the EINT number, the value is from HAL_EINT_0 to HAL_EINT_MAX-1, please refer to hal_eint_number_t. |
- Returns
- To indicate whether this function call is successful. If the return value is HAL_EINT_STATUS_OK, the operation completed successfully; If the return value is HAL_EINT_STATUS_INVALID_PARAMETER, a wrong parameter is given, the parameter must be verified.
- See also
- hal_eint_unmask
This function registers a callback function for a specified EINT number.
- Parameters
-
| [in] | eint_number | is the EINT number, the value is HAL_EINT_0~HAL_EINT_MAX-1, please refer to hal_eint_number_t. |
| [in] | callback | is the function given by the user, which will be called at EINT ISR routine. |
| [in] | user_data | is a reserved parameter for user. |
- Returns
- To indicate whether this function call is successful. If the return value is HAL_EINT_STATUS_OK, the operation completed successfully; If the return value is HAL_EINT_STATUS_INVALID_PARAMETER, a wrong parameter is given, the parameter must be verified.
- See also
- hal_eint_init()
- Example
- Sample code please refer to How to use this driver
This function sets the EINT debounce count.
- Parameters
-
| [in] | eint_number | is the EINT number, the value is from HAL_EINT_0 to HAL_EINT_MAX-1, please refer to hal_eint_number_t. |
| [in] | count | is the EINT number's hardware debounce count in 32768 Hz. EINT debounce is disabled when count is set to zero. |
- Returns
- To indicate whether this function call is successful. If the return value is HAL_EINT_STATUS_OK, the operation completed successfully; If the return value is HAL_EINT_STATUS_INVALID_PARAMETER, a wrong parameter is given, the parameter must be verified.
- Example
- Sample code please refer to How to use this driver
This function sets the EINT debounce time.
- Parameters
-
| [in] | eint_number | is the EINT number, the value is from HAL_EINT_0 to HAL_EINT_MAX-1, please refer to hal_eint_number_t. |
| [in] | time_ms | is the EINT number's hardware debounce time in milliseconds. EINT debounce is disabled when time_ms is set to zero. |
- Returns
- To indicate whether this function call is successful. If the return value is HAL_EINT_STATUS_OK, the operation completed successfully; If the return value is HAL_EINT_STATUS_INVALID_PARAMETER, a wrong parameter is given, the parameter must be verified.
- Example
- Sample code please refer to How to use this driver
This function sets the EINT number to a trigger mode.
- Parameters
-
| [in] | eint_number | is the EINT number, the value is from HAL_EINT_0 to HAL_EINT_MAX-1, please refer to hal_eint_number_t. |
| [in] | trigger_mode | is EINT number trigger mode. For more details, please refer to hal_eint_trigger_mode_t. |
- Returns
- To indicate whether this function call is successful. If the return value is HAL_EINT_STATUS_OK, the operation completed successfully; If the return value is HAL_EINT_STATUS_INVALID_PARAMETER, a wrong parameter is given, the parameter must be verified.
- Example
- Sample code please refer to How to use this driver
This function unmasks the dedicated EINT source.
- Parameters
-
| [in] | eint_number | is the EINT number, the value is HAL_EINT_0~HAL_EINT_MAX-1, please refer to hal_eint_number_t. |
- Returns
- To indicate whether this function call is successful. If the return value is HAL_EINT_STATUS_OK, the operation completed successfully; If the return value is HAL_EINT_STATUS_INVALID_PARAMETER, a wrong parameter is given, the parameter must be verified.
- See also
- hal_eint_mask()