TI-RTOS Drivers  tidrivers_full_2_20_00_08
Data Structures | Typedefs | Enumerations | Functions
HwiP.h File Reference

Detailed Description

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:

uintptr_t key1, key2;
key1 = HwiP_disable();
key2 = HwiP_disable();

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for HwiP.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  HwiP_Params
 Basic HwiP Parameters. More...
 

Typedefs

typedef void * HwiP_Handle
 Opaque client reference to an instance of a HwiP. More...
 
typedef enum HwiP_Status HwiP_Status
 Status codes for HwiP APIs. More...
 
typedef void(* HwiP_Fxn) (uintptr_t arg)
 Prototype for the entry function for a hardware interrupt. More...
 
typedef struct HwiP_Params HwiP_Params
 Basic HwiP Parameters. More...
 

Enumerations

enum  HwiP_Status {
  HwiP_OK = 0,
  HwiP_FAILURE = -1
}
 Status codes for HwiP APIs. More...
 

Functions

void HwiP_clearInterrupt (int interruptNum)
 Function to clear a single interrupt. More...
 
HwiP_Handle HwiP_create (int interruptNum, HwiP_Fxn hwiFxn, HwiP_Params *params)
 Function to create an interrupt on CortexM devices. More...
 
HwiP_Status HwiP_delete (HwiP_Handle handle)
 Function to delete an interrupt on CortexM devices. More...
 
uintptr_t HwiP_disable (void)
 Function to disable interrupts to enter a critical region. More...
 
void HwiP_disableInterrupt (int interruptNum)
 Function to disable a single interrupt. More...
 
void HwiP_enableInterrupt (int interruptNum)
 Function to enable a single interrupt. More...
 
void HwiP_Params_init (HwiP_Params *params)
 Initialize params structure to default values. More...
 
void HwiP_restore (uintptr_t key)
 Function to restore interrupts to exit a critical region. More...
 

Typedef Documentation

typedef void* HwiP_Handle

Opaque client reference to an instance of a HwiP.

A HwiP_Handle returned from the HwiP_create represents that instance.

typedef enum HwiP_Status HwiP_Status

Status codes for HwiP APIs.

typedef void(* HwiP_Fxn) (uintptr_t arg)

Prototype for the entry function for a hardware interrupt.

typedef struct HwiP_Params HwiP_Params

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.

Enumeration Type Documentation

Status codes for HwiP APIs.

Enumerator
HwiP_OK 
HwiP_FAILURE 

Function Documentation

void HwiP_clearInterrupt ( int  interruptNum)

Function to clear a single interrupt.

Parameters
interruptNuminterrupt number to clear
HwiP_Handle HwiP_create ( int  interruptNum,
HwiP_Fxn  hwiFxn,
HwiP_Params params 
)

Function to create an interrupt on CortexM devices.

Parameters
interruptNumInterrupt Vector Id
hwiFxnentry function of the hardware interrupt
paramsPointer 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
HwiP_Status HwiP_delete ( HwiP_Handle  handle)

Function to delete an interrupt on CortexM devices.

Parameters
handlereturned 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

1 uintptr_t key1, key2;
2 key1 = HwiP_disable();
3 key2 = HwiP_disable();
4 HwiP_restore(key2);
5 HwiP_restore(key1);
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
interruptNuminterrupt number to disable
void HwiP_enableInterrupt ( int  interruptNum)

Function to enable a single interrupt.

Parameters
interruptNuminterrupt number to enable
void HwiP_Params_init ( HwiP_Params params)

Initialize params structure to default values.

The default parameters are:

  • name: NULL
  • arg: 0
  • priority: ~0
Parameters
paramsPointer to the instance configuration parameters.
void HwiP_restore ( uintptr_t  key)

Function to restore interrupts to exit a critical region.

Parameters
keyreturn from HwiP_disable
Copyright 2016, Texas Instruments Incorporated