PDK API Guide for J7200
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_Handle HwiP_createDirect (int32_t interruptNum, HwiP_DirectFxn hwiFxn, const HwiP_Params *hwipParams)
 Function to create an interrupt using VIM direct registration. 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...
 
typedef void(* HwiP_DirectFxn) (void)
 Prototype for the entry function for a hardware interrupt registered using HwiP_createDirect. 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

◆ HWIP_USE_DEFAULT_PRIORITY

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

Typedef Documentation

◆ HwiP_Handle

typedef void* HwiP_Handle

Opaque client reference to an instance of a HwiP.

A HwiP_Handle returned from the HwiP_create represents that instance.

◆ HwiP_Fxn

typedef void(* HwiP_Fxn) (uintptr_t arg)

Prototype for the entry function for a hardware interrupt.

◆ HwiP_DirectFxn

typedef void(* HwiP_DirectFxn) (void)

Prototype for the entry function for a hardware interrupt registered using HwiP_createDirect.

Enumeration Type Documentation

◆ HwiP_Status

Status codes for HwiP APIs.

Enumerator
HwiP_OK 
HwiP_FAILURE 

◆ OSAL_armGicTrigType_t

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

OSAL_ARM_GIC_TRIG_TYPE_EDGE 

Corresponding interrupt is edge sensitive

OSAL_ARM_GIC_TRIG_TYPE_HIGH_LEVEL 

Coressponding interrupt is high level sensitive

OSAL_ARM_GIC_TRIG_TYPE_LOW_LEVEL 

Coressponding interrupt is low level sensitive

OSAL_ARM_GIC_TRIG_TYPE_RISING_EDGE 

Coressponding interrupt is rising edge sensitive

OSAL_ARM_GIC_TRIG_TYPE_FALLING_EDGE 

Coressponding interrupt is falling edge sensitive

Function Documentation

◆ HwiP_clearInterrupt()

void HwiP_clearInterrupt ( int32_t  interruptNum)

Function to clear a single interrupt.

Parameters
interruptNuminterrupt number to clear

◆ HwiP_create()

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_createDirect()

HwiP_Handle HwiP_createDirect ( int32_t  interruptNum,
HwiP_DirectFxn  hwiFxn,
const HwiP_Params hwipParams 
)

Function to create an interrupt using VIM direct registration.

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.

◆ HwiP_delete()

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

◆ HwiP_disable()

uintptr_t HwiP_disable ( void  )

Function to disable interrupts to enter a critical region.

This function can be called multiple times.

For Non-OS case, it must unwound in the reverse order. For example

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

For FreeRTOS case, after the schedular had started the kernel keeps track of critical nesting count. So here the return key will be NULL.

Returns
A key that must be passed to HwiP_restore to re-enable interrupts.

◆ HwiP_disableInterrupt()

void HwiP_disableInterrupt ( int32_t  interruptNum)

Function to disable a single interrupt.

Parameters
interruptNuminterrupt number to disable

◆ HwiP_enableInterrupt()

void HwiP_enableInterrupt ( int32_t  interruptNum)

Function to enable a single interrupt.

Parameters
interruptNuminterrupt number to enable

◆ HwiP_Params_init()

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.

◆ HwiP_restore()

void HwiP_restore ( uintptr_t  key)

Function to restore interrupts to exit a critical region.

Parameters
keyreturn from HwiP_disable

◆ HwiP_getHandle()

HwiP_Handle HwiP_getHandle ( int32_t  interruptNum)

Function to get HwiP Handle from an interrupt number.

Parameters
interruptNumthe interrupt number

◆ HwiP_getEventId()

int32_t HwiP_getEventId ( int32_t  interruptNum)

Function to get the eventId associated with an interrupt number.

Parameters
interruptNumthe interrupt number

◆ HwiP_post()

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