PDK API Guide for J721E
HwiP

Introduction

HWIP interface

Files

file  HwiP.h
 Hardware Interrupt module for the RTOS Porting Interface.
 

Data Structures

struct  HwiP_Params
 Basic HwiP Parameters. More...
 

Functions

void HwiP_clearInterrupt (int32_t interruptNum)
 Function to clear a single interrupt. More...
 
HwiP_Handle HwiP_create (int32_t interruptNum, HwiP_Fxn hwiFxn, const HwiP_Params *hwipParams)
 Function to create an interrupt on CortexM devices. More...
 
HwiP_Status HwiP_delete (HwiP_Handle hwiPhandle)
 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 (int32_t interruptNum)
 Function to disable a single interrupt. More...
 
void HwiP_enableInterrupt (int32_t interruptNum)
 Function to enable a single interrupt. More...
 
void HwiP_Params_init (HwiP_Params *hwipParams)
 Initialize params structure to default values. More...
 
void HwiP_restore (uintptr_t key)
 Function to restore interrupts to exit a critical region. More...
 
HwiP_Handle HwiP_getHandle (int32_t interruptNum)
 Function to get HwiP Handle from an interrupt number. More...
 
int32_t HwiP_getEventId (int32_t interruptNum)
 Function to get the eventId associated with an interrupt number. More...
 
int32_t HwiP_post (uint32_t interruptNum)
 Function to post the Hwi interrupt by software. More...
 

Typedefs

typedef void * HwiP_Handle
 Opaque client reference to an instance of a HwiP. More...
 
typedef void(* HwiP_Fxn) (uintptr_t arg)
 Prototype for the entry function for a hardware interrupt. More...
 

Enumerations

enum  HwiP_Status { HwiP_OK = 0, HwiP_FAILURE = (-(int32_t)1) }
 Status codes for HwiP APIs. More...
 
enum  OSAL_armGicTrigType_t {
  OSAL_ARM_GIC_TRIG_TYPE_LEVEL = 1, OSAL_ARM_GIC_TRIG_TYPE_EDGE = 2, OSAL_ARM_GIC_TRIG_TYPE_HIGH_LEVEL = 3, OSAL_ARM_GIC_TRIG_TYPE_LOW_LEVEL = 4,
  OSAL_ARM_GIC_TRIG_TYPE_RISING_EDGE = 5, OSAL_ARM_GIC_TRIG_TYPE_FALLING_EDGE = 6
}
 Enumerates the types different trigger types. Please refer to Section 4.3.13 Interrupt Configuration Registers, GICD_ICFGRn of ARMŽ Generic Interrupt Controller Architecture version 2.0 Architecture Specification document for details. More...
 

Macros

#define HWIP_USE_DEFAULT_PRIORITY   (~((uint32_t)0))
 

Macro Definition Documentation

#define HWIP_USE_DEFAULT_PRIORITY   (~((uint32_t)0))

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 void(* HwiP_Fxn) (uintptr_t arg)

Prototype for the entry function for a hardware interrupt.

Enumeration Type Documentation

Status codes for HwiP APIs.

Enumerator
HwiP_OK 
HwiP_FAILURE 

Enumerates the types different trigger types. Please refer to Section 4.3.13 Interrupt Configuration Registers, GICD_ICFGRn of ARMŽ Generic Interrupt Controller Architecture version 2.0 Architecture Specification document for details.

Enumerator
OSAL_ARM_GIC_TRIG_TYPE_LEVEL 

Corresponding interrupt is level-sensitive Corresponding interrupt is edge

OSAL_ARM_GIC_TRIG_TYPE_EDGE 

Coressponding interrupt is high level sensitive

OSAL_ARM_GIC_TRIG_TYPE_HIGH_LEVEL 

Coressponding interrupt is low level sensitive

OSAL_ARM_GIC_TRIG_TYPE_LOW_LEVEL 

Coressponding interrupt is rising edge sensitive

OSAL_ARM_GIC_TRIG_TYPE_RISING_EDGE 

Coressponding interrupt is falling edge sensitive

OSAL_ARM_GIC_TRIG_TYPE_FALLING_EDGE 

Function Documentation

void HwiP_clearInterrupt ( int32_t  interruptNum)

Function to clear a single interrupt.

Parameters
interruptNuminterrupt number to clear
HwiP_Handle HwiP_create ( int32_t  interruptNum,
HwiP_Fxn  hwiFxn,
const HwiP_Params hwipParams 
)

Function to create an interrupt on CortexM devices.

Parameters
interruptNumInterrupt Vector Id
hwiFxnentry function of the hardware interrupt
hwipParamsPointer to the instance configuration parameters. NULL denotes to use the default parameters. The HwiP default parameters are noted in HwiP_Params_init.
Returns
HwiP_Status HwiP_delete ( HwiP_Handle  hwiPhandle)

Function to delete an interrupt on CortexM devices.

Parameters
hwiPhandlereturned from the HwiP_create call
Returns
A HwiP_Handle on success or a NULL
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 ( int32_t  interruptNum)

Function to disable a single interrupt.

Parameters
interruptNuminterrupt number to disable
void HwiP_enableInterrupt ( int32_t  interruptNum)

Function to enable a single interrupt.

Parameters
interruptNuminterrupt number to enable
void HwiP_Params_init ( HwiP_Params hwipParams)

Initialize params structure to default values.

The default parameters are:

  • name: NULL
  • arg: 0
  • priority: ~0
Parameters
hwipParamsPointer 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
HwiP_Handle HwiP_getHandle ( int32_t  interruptNum)

Function to get HwiP Handle from an interrupt number.

Parameters
interruptNumthe interrupt number
int32_t HwiP_getEventId ( int32_t  interruptNum)

Function to get the eventId associated with an interrupt number.

Parameters
interruptNumthe interrupt number
int32_t HwiP_post ( uint32_t  interruptNum)

Function to post the Hwi interrupt by software.

Parameters
interruptNumthe interrupt number
Returns
osal_OK if successfull, osal_UNSUPPORTED if not supported by SOC