For more details and example usage, see HW Interrupts
◆ HwiP_OBJECT_SIZE_MAX
#define HwiP_OBJECT_SIZE_MAX (32u) |
Max size of Hwi object across no-RTOS and all OS's.
◆ HwiP_FxnCallback
typedef void(* HwiP_FxnCallback) (void *args) |
Callback that is called when a HW interrupt is received.
- Parameters
-
◆ HwiP_Params_init()
Set default values to HwiP_Params.
Strongly recommended to be called before seting values in HwiP_Params
- Parameters
-
params | [out] parameter structure to set to default |
◆ HwiP_construct()
◆ HwiP_setArgs()
int32_t HwiP_setArgs |
( |
HwiP_Object * |
obj, |
|
|
void * |
args |
|
) |
| |
Set argument to pass to the ISR.
- Parameters
-
obj | [out] created object |
args | [in] argument to pass to the ISR |
- Returns
- SystemP_SUCCESS on success, SystemP_FAILURE on error
◆ HwiP_destruct()
Cleanup, delete, destruct a Hwi object.
- Parameters
-
◆ HwiP_enableInt()
void HwiP_enableInt |
( |
uint32_t |
intNum | ) |
|
Enable a specific interrupt.
- Parameters
-
intNum | [in] Interrupt number |
◆ HwiP_disableInt()
uint32_t HwiP_disableInt |
( |
uint32_t |
intNum | ) |
|
Disable a specific interrupt.
The return value is typically used with HwiP_restoreInt to restore the interrupt state to old value.
- Parameters
-
intNum | [in] Interrupt number |
- Returns
- old interrupt state,
0: interrupt was disabled previously,
1: interrupt was enabled previously
◆ HwiP_restoreInt()
void HwiP_restoreInt |
( |
uint32_t |
intNum, |
|
|
uint32_t |
oldIntState |
|
) |
| |
Restore a specific interrupt.
The oldIntState value typically returned by HwiP_disableInt is used to restore the interrupt state to old value.
- Parameters
-
intNum | [in] Interrupt number |
oldIntState | [in] 0: disable interrupt, 1: enable interrupt |
◆ HwiP_clearInt()
void HwiP_clearInt |
( |
uint32_t |
intNum | ) |
|
Clear a pending specific interrupt.
- Parameters
-
intNum | [in] Interrupt number |
◆ HwiP_post()
void HwiP_post |
( |
uint32_t |
intNum | ) |
|
Force trigger a specific interrupt.
- Parameters
-
intNum | [in] Interrupt number |
◆ HwiP_disable()
uintptr_t HwiP_disable |
( |
void |
| ) |
|
Disable all interrupts.
- Note
- In case of ARM R5F, ARM M4F, this only disables IRQ.
FIQ is not disabled.
In case of ARM M4F, this only disables interrupts which has priority between 1-7.
- Returns
- interrupt state before disable, typically used by HwiP_restore later
◆ HwiP_enable()
void HwiP_enable |
( |
void |
| ) |
|
Enable all interrupts.
- Note
- In case of ARM R5F, ARM M4F, this only enables IRQ.
FIQ is not enabled.
◆ HwiP_restore()
void HwiP_restore |
( |
uintptr_t |
oldIntState | ) |
|
Restores all interrupts to a given state.
- Note
- In case of ARM R5F, ARM M4F, this only restores IRQ state.
FIQ state is not changed.
- Parameters
-
oldIntState | [in] interrupt state, typically returned by HwiP_disable earlier |
◆ HwiP_inISR()
uint32_t HwiP_inISR |
( |
void |
| ) |
|
Check if the caller of this function is inside a ISR or not.
In some cases, like with freertos, some functions cannot be called from within the OS ISR handler, this API allows the user and some driver porting layer (DPL) APIs to check and call the appropiate ISR safe API when in ISR handler mode.
To get the exact CPU mode of the executing CPU, use the low level CPU specific system calls/registers.
- Note
- In case of ARM R5F, this only checks if caller is inside IRQ or not. This means when HwiP_inISR returns 1, CPU is in IRQ mode and when HwiP_inISR return 0, CPU could be in system mode or FIQ or abort mode and so on
- Returns
- 0 not in interrupt mode, 1 in interrupt mode
◆ HwiP_init()
Initialize Hwi module.
- Disables all individual interrupts
- Clears all individual interrupts
- Enables global interrupts
- Note
- MUST be called during system intialization before any HwiP_construct API calls.
-
In case of ARM R5F, ARM M4F, this initializes and enables both FIQ and IRQ
◆ HwiP_registerNmiHandler()
This API registers the NMI handler.
- Parameters
-
nmiHandler | [in] Callback function to be called for NMI |
args | [in] Args passed for the NMI callback |
- Returns
- SystemP_SUCCESS on success, SystemP_FAILURE on error
◆ HwiP_unregisterNmiHandler()
int32_t HwiP_unregisterNmiHandler |
( |
void |
| ) |
|