Hardware Interrupt module for the RTOS Porting Interface.
============================================================================
The HwiP_disable/HwiP_restore APIs can be called recursively. The order of the HwiP_restore calls, must be in reversed order. For example:
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
Go to the source code of this file.
Opaque client reference to an instance of a HwiP.
A HwiP_Handle returned from the HwiP_create represents that instance.
Status codes for HwiP APIs.
typedef void(* HwiP_Fxn) (uintptr_t arg) |
Prototype for the entry function for a hardware interrupt.
Basic HwiP Parameters.
Structure that contains the parameters passed into HwiP_create when creating a HwiP instance. The HwiP_Params_init function should be used to initialize the fields to default values before the application sets the fields manually. The HwiP default parameters are noted in HwiP_Params_init.
Status codes for HwiP APIs.
Enumerator |
---|
HwiP_OK |
|
HwiP_FAILURE |
|
void HwiP_clearInterrupt |
( |
int |
interruptNum | ) |
|
Function to clear a single interrupt.
- Parameters
-
interruptNum | interrupt number to clear |
Function to create an interrupt on CortexM devices.
- Parameters
-
interruptNum | Interrupt Vector Id |
hwiFxn | entry function of the hardware interrupt |
params | Pointer to the instance configuration parameters. NULL denotes to use the default parameters. The HwiP default parameters are noted in HwiP_Params_init. |
- Returns
- A HwiP_Handle on success or a NULL on an error
Function to delete an interrupt on CortexM devices.
- Parameters
-
handle | returned from the HwiP_create call |
- Returns
uintptr_t HwiP_disable |
( |
void |
| ) |
|
Function to disable interrupts to enter a critical region.
This function can be called multiple times, but must unwound in the reverse order. For example
- Returns
- A key that must be passed to HwiP_restore to re-enable interrupts.
void HwiP_disableInterrupt |
( |
int |
interruptNum | ) |
|
Function to disable a single interrupt.
- Parameters
-
interruptNum | interrupt number to disable |
void HwiP_enableInterrupt |
( |
int |
interruptNum | ) |
|
Function to enable a single interrupt.
- Parameters
-
interruptNum | interrupt number to enable |
Initialize params structure to default values.
The default parameters are:
- name: NULL
- arg: 0
- priority: ~0
- Parameters
-
params | Pointer to the instance configuration parameters. |
void HwiP_restore |
( |
uintptr_t |
key | ) |
|
Function to restore interrupts to exit a critical region.
- Parameters
-
key | return from HwiP_disable |