MT7697 API Reference  LinkIt SDK v4
EINT

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...

Overview

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

Functions

hal_eint_status_t hal_eint_init (hal_eint_number_t eint_number, const hal_eint_config_t *eint_config)
 This function initializes the EINT number, it sets the EINT trigger mode and debounce time. More...
 
hal_eint_status_t hal_eint_deinit (hal_eint_number_t eint_number)
 This function deinitializes the EINT number, it resets the EINT trigger mode and debounce time. More...
 
hal_eint_status_t hal_eint_register_callback (hal_eint_number_t eint_number, hal_eint_callback_t callback, void *user_data)
 This function registers a callback function for a specified EINT number. More...
 
hal_eint_status_t hal_eint_set_trigger_mode (hal_eint_number_t eint_number, hal_eint_trigger_mode_t trigger_mode)
 This function sets the EINT number to a trigger mode. More...
 
hal_eint_status_t hal_eint_set_debounce_time (hal_eint_number_t eint_number, uint32_t time_ms)
 This function sets the EINT debounce time. More...
 
hal_eint_status_t hal_eint_set_debounce_count (hal_eint_number_t eint_number, uint32_t count)
 This function sets the EINT debounce count. More...
 

Modules

 Enum
 
 Struct
 
 Typedef
 

Function Documentation

hal_eint_status_t hal_eint_deinit ( hal_eint_number_t  eint_number)

This function deinitializes the EINT number, it resets the EINT trigger mode and debounce time.

Parameters
[in]eint_numberis 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
hal_eint_status_t hal_eint_init ( hal_eint_number_t  eint_number,
const hal_eint_config_t eint_config 
)

This function initializes the EINT number, it sets the EINT trigger mode and debounce time.

Parameters
[in]eint_numberis the EINT number, the value is HAL_EINT_0~HAL_EINT_MAX-1.
[in]eint_configis 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
hal_eint_status_t hal_eint_register_callback ( hal_eint_number_t  eint_number,
hal_eint_callback_t  callback,
void *  user_data 
)

This function registers a callback function for a specified EINT number.

Parameters
[in]eint_numberis the EINT number, the value is HAL_EINT_0~HAL_EINT_MAX-1, please refer to hal_eint_number_t.
[in]callbackis the function given by the user, which will be called at EINT ISR routine.
[in]user_datais 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
hal_eint_status_t hal_eint_set_debounce_count ( hal_eint_number_t  eint_number,
uint32_t  count 
)

This function sets the EINT debounce count.

Parameters
[in]eint_numberis the EINT number, the value is from HAL_EINT_0 to HAL_EINT_MAX-1, please refer to hal_eint_number_t.
[in]countis 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
hal_eint_status_t hal_eint_set_debounce_time ( hal_eint_number_t  eint_number,
uint32_t  time_ms 
)

This function sets the EINT debounce time.

Parameters
[in]eint_numberis the EINT number, the value is from HAL_EINT_0 to HAL_EINT_MAX-1, please refer to hal_eint_number_t.
[in]time_msis 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
hal_eint_status_t hal_eint_set_trigger_mode ( hal_eint_number_t  eint_number,
hal_eint_trigger_mode_t  trigger_mode 
)

This function sets the EINT number to a trigger mode.

Parameters
[in]eint_numberis the EINT number, the value is from HAL_EINT_0 to HAL_EINT_MAX-1, please refer to hal_eint_number_t.
[in]trigger_modeis 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