MT7687 API Reference  LinkIt SDK v4
NVIC

This section introduces the NVIC HAL APIs including terms and acronyms, details on how to use this driver, supported features, enums, structures and functions. More...

Overview

This section introduces the NVIC HAL APIs including terms and acronyms, details on how to use this driver, supported features, enums, structures and functions.

NVIC usage follows the CMSIS except it doesn't support direct registration of ISR in the vector table, but it uses hal_nvic_register_isr_handler function to improve software efficiency and debugging.

Terms and acronyms

Terms Details
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 .
ISR Interrupt service routine.
IRQ Interrupt request.

How to use this driver

Functions

hal_nvic_status_t hal_nvic_register_isr_handler (hal_nvic_irq_t irq_number, hal_nvic_isr_t isr_handler)
 This function is used to register a callback (an ISR) for NVIC IRQ. More...
 
hal_nvic_status_t hal_nvic_init (void)
 This function initializes the NVIC IRQ with default priority. More...
 
hal_nvic_status_t hal_nvic_save_and_set_interrupt_mask (uint32_t *mask)
 This function saves the current IRQ settings in an variable, and then disables the IRQ by setting the IRQ mask. More...
 
hal_nvic_status_t hal_nvic_restore_interrupt_mask (uint32_t mask)
 This function restores the IRQ settings as specified in the mask. More...
 

Modules

 Define
 
 Enums
 
 Typedef
 

Function Documentation

hal_nvic_status_t hal_nvic_init ( void  )

This function initializes the NVIC IRQ with default priority.

By default the exception number is lower and the priority is higher.

hal_nvic_status_t hal_nvic_register_isr_handler ( hal_nvic_irq_t  irq_number,
hal_nvic_isr_t  isr_handler 
)

This function is used to register a callback (an ISR) for NVIC IRQ.

Parameters
[in]irq_numberis the NVIC IRQ number.
[in]isr_handleris the NVIC IRQ's ISR.
Returns
To indicate whether this function call is successful. If the return value is HAL_NVIC_STATUS_OK, the operation completed successfully; If the return value is HAL_NVIC_STATUS_INVALID_PARAMETER, a wrong parameter is given, the parameter must be verified.
hal_nvic_status_t hal_nvic_restore_interrupt_mask ( uint32_t  mask)

This function restores the IRQ settings as specified in the mask.

It should be used in conjunction with hal_nvic_save_and_set_interrupt_mask() to protect critical resources.

Parameters
[in]maskis an unsigned integer to specify the IRQ settings.
Returns
Indicates whether this function call is successful. If the return value is HAL_NVIC_STATUS_OK, the operation completed successfully; If the return value is HAL_NVIC_STATUS_INVALID_PARAMETER, a wrong parameter is given, the parameter must be verified.
hal_nvic_status_t hal_nvic_save_and_set_interrupt_mask ( uint32_t *  mask)

This function saves the current IRQ settings in an variable, and then disables the IRQ by setting the IRQ mask.

It should be used in conjunction with hal_nvic_restore_interrupt_mask() to protect the critical resources.

Parameters
[out]maskis used to store the current IRQ setting, upon the return of this function.
Returns
To indicate whether this function call is successful. If the return value is HAL_NVIC_STATUS_OK, the operation completed successfully. If the return value is HAL_NVIC_STATUS_INVALID_PARAMETER, a wrong parameter is given, the parameter must be verified.