AM64x MCU+ SDK  08.05.00

Introduction

This module contains APIs to program and use the ESM module. The APIs can be used by other drivers to get access to ESM.

Files

file  drivers/esm/v1/esm.h
 ESM Driver API/interface file.
 

Data Structures

struct  ESM_NotifyParams
 Parameters used to register the ESM notify function to handle errors. The function will the invoked from the ISR of low or high priority ESM interrupt. More...
 
struct  ESM_OpenParams
 ESM Open Parameters. More...
 
struct  ESM_Object
 ESM Driver Object. More...
 
struct  ESM_GroupIntrStatus
 Structure to access the status of interrupts belonging to a High or Low priority interrupt. More...
 
struct  ESM_Attrs
 ESM Hardware Atrributes. More...
 
struct  ESM_Config
 ESM Instance configuration. More...
 

Functions

void ESM_init (void)
 The functions initializes the ESM module. More...
 
void ESM_deinit (void)
 The functions de-initializes the ESM module. More...
 
ESM_Handle ESM_open (uint32_t index, ESM_OpenParams *params)
 Opens a ESM object with the index and parameters specified, and returns a ESM_Handle. More...
 
void ESM_close (ESM_Handle handle)
 The function closes a ESM peripheral specified by the ESM handle. More...
 
int32_t ESM_registerNotifier (ESM_Handle handle, ESM_NotifyParams *params)
 Register the notifers. The ESM module will call back if error interrupt is detected. More...
 
int32_t ESM_deregisterNotifier (ESM_Handle handle, int32_t notifyIndex)
 Deregister the ESM notifers. More...
 
int32_t ESM_setMode (uint32_t baseAddr, uint32_t mode)
 This API is used to configure operation mode of ESM module. More...
 
int32_t ESM_setErrPinLowTimePreload (uint32_t baseAddr, uint32_t lowTime)
 This API is used to configure the low time counter pre-load value. More...
 
uint32_t ESM_getCurrErrPinLowTimeCnt (uint32_t baseAddr)
 This API is used to read the low time counter pre-load value. More...
 
uint32_t ESM_getErrPinStatus (uint32_t baseAddr)
 This API is used to get the current status of nERROR pin. More...
 
void ESM_resetErrPin (uint32_t baseAddr)
 This API is used to reset the nERROR pin. More...
 
uint32_t ESM_getIntrStatus (uint32_t baseAddr, uint32_t intrSrc)
 This API is used to get the interrupt status. More...
 
int32_t ESM_getGroupIntrStatus (uint32_t baseAddr, uint32_t intrPrioType, ESM_GroupIntrStatus *pIntrstatus)
 This API is used to get the interrupt/error status for a group. This will also return highest pending interrupt for pulse as well as for level interrupts. More...
 
static void ESM_Params_init (ESM_OpenParams *openPrms)
 

Typedefs

typedef void * ESM_Handle
 A handle that is returned from a ESM_open() call. More...
 
typedef void(* ESM_CallBack) (void *arg)
 Callback function which is invoked by the ESM module if a notify function is registered using the ESM_registerNotifier() API. More...
 

Macros

#define ESM_MAX_NOTIFIERS   (4U)
 Maximum number of notify callbacks supported. More...
 
#define ESM_MAX_ISR_COUNT   (4U)
 Maximum ISR supported. More...
 
#define ESM_OPERATION_MODE_NORMAL   0x0U
 defines to select the ESM Operation Mode. More...
 
#define ESM_OPERATION_MODE_ERROR_FORCE   0xAU
 
#define ESM_INTRE_CONFIG_ERROR   (0x0u)
 Defines for ESM Hardware Requests for interrupt type. More...
 
#define ESM_INTR_PRIORITY_LEVEL_LOW   (0x1u)
 
#define ESM_INTR_PRIORITY_LEVEL_HIGH   (0x2u)
 

Macro Definition Documentation

◆ ESM_MAX_NOTIFIERS

#define ESM_MAX_NOTIFIERS   (4U)

Maximum number of notify callbacks supported.

◆ ESM_MAX_ISR_COUNT

#define ESM_MAX_ISR_COUNT   (4U)

Maximum ISR supported.

◆ ESM_OPERATION_MODE_NORMAL

#define ESM_OPERATION_MODE_NORMAL   0x0U

defines to select the ESM Operation Mode.

Configure ESM operation mode to normal mode

◆ ESM_OPERATION_MODE_ERROR_FORCE

#define ESM_OPERATION_MODE_ERROR_FORCE   0xAU

Configure ESM operation mode to error force mode

◆ ESM_INTRE_CONFIG_ERROR

#define ESM_INTRE_CONFIG_ERROR   (0x0u)

Defines for ESM Hardware Requests for interrupt type.

Configure interrupt to configuration interrupt

◆ ESM_INTR_PRIORITY_LEVEL_LOW

#define ESM_INTR_PRIORITY_LEVEL_LOW   (0x1u)

Configure interrupt to low priority interrupt

◆ ESM_INTR_PRIORITY_LEVEL_HIGH

#define ESM_INTR_PRIORITY_LEVEL_HIGH   (0x2u)

Configure interrupt to high priority interrupt

Typedef Documentation

◆ ESM_Handle

typedef void* ESM_Handle

A handle that is returned from a ESM_open() call.

◆ ESM_CallBack

typedef void(* ESM_CallBack) (void *arg)

Callback function which is invoked by the ESM module if a notify function is registered using the ESM_registerNotifier() API.

Parameters
argArgument passed back when the Notify function is invoked.
Return values
Notapplicable

Function Documentation

◆ ESM_init()

void ESM_init ( void  )

The functions initializes the ESM module.

◆ ESM_deinit()

void ESM_deinit ( void  )

The functions de-initializes the ESM module.

◆ ESM_open()

ESM_Handle ESM_open ( uint32_t  index,
ESM_OpenParams params 
)

Opens a ESM object with the index and parameters specified, and returns a ESM_Handle.

Parameters
indexLogical peripheral number for the ESM indexed into the ESM_Config table
paramsPointer to an parameter block, if NULL it will use default values.
Returns
A ESM_Handle on success or a NULL on an error.

◆ ESM_close()

void ESM_close ( ESM_Handle  handle)

The function closes a ESM peripheral specified by the ESM handle.

Precondition
ESM_open() has to be called first.
Parameters
handleESM Handle

◆ ESM_registerNotifier()

int32_t ESM_registerNotifier ( ESM_Handle  handle,
ESM_NotifyParams params 
)

Register the notifers. The ESM module will call back if error interrupt is detected.

Parameters
[in]handleHandle to the ESM Driver.
[in]paramsNotifier error number and callback function.
Returns
On success returns SystemP_SUCCESS. Negative values indicate unsuccessful operations.

◆ ESM_deregisterNotifier()

int32_t ESM_deregisterNotifier ( ESM_Handle  handle,
int32_t  notifyIndex 
)

Deregister the ESM notifers.

Parameters
[in]handleHandle to the ESM Driver.
[in]notifyIndexNotifier index returned when the notifier was registered.
Returns
On success returns SystemP_SUCCESS. Negative values indicate unsuccessful operations.

◆ ESM_setMode()

int32_t ESM_setMode ( uint32_t  baseAddr,
uint32_t  mode 
)

This API is used to configure operation mode of ESM module.

Parameters
baseAddrBase Address of the ESM Registers.
modeChannel number for which reset is to be done.
Returns
On success returns SystemP_SUCCESS. Negative values indicate unsuccessful operations.

◆ ESM_setErrPinLowTimePreload()

int32_t ESM_setErrPinLowTimePreload ( uint32_t  baseAddr,
uint32_t  lowTime 
)

This API is used to configure the low time counter pre-load value.

Parameters
baseAddrBase Address of the ESM Registers.
lowTimeTime to be configured as LTCP.
Returns
status Configuration status.

◆ ESM_getCurrErrPinLowTimeCnt()

uint32_t ESM_getCurrErrPinLowTimeCnt ( uint32_t  baseAddr)

This API is used to read the low time counter pre-load value.

Parameters
baseAddrBase Address of the ESM Registers.
Returns
Counter value Current low time count.

◆ ESM_getErrPinStatus()

uint32_t ESM_getErrPinStatus ( uint32_t  baseAddr)

This API is used to get the current status of nERROR pin.

Parameters
baseAddrBase Address of the ESM Registers.
Returns
status Current nERROR pin status.

◆ ESM_resetErrPin()

void ESM_resetErrPin ( uint32_t  baseAddr)

This API is used to reset the nERROR pin.

Parameters
baseAddrBase Address of the ESM Registers.

◆ ESM_getIntrStatus()

uint32_t ESM_getIntrStatus ( uint32_t  baseAddr,
uint32_t  intrSrc 
)

This API is used to get the interrupt status.

Parameters
baseAddrBase Address of the ESM Registers.
intrSrcInterrupt for which status to return.
Returns
status Interrupt status.

◆ ESM_getGroupIntrStatus()

int32_t ESM_getGroupIntrStatus ( uint32_t  baseAddr,
uint32_t  intrPrioType,
ESM_GroupIntrStatus pIntrstatus 
)

This API is used to get the interrupt/error status for a group. This will also return highest pending interrupt for pulse as well as for level interrupts.

Parameters
baseAddrBase Address of the ESM Registers.
intrPrioTypeGroup for which status to return.
pIntrstatuspointer to Interrupt status.
Returns
Success/failure.

◆ ESM_Params_init()

static void ESM_Params_init ( ESM_OpenParams openPrms)
inlinestatic

Variable Documentation

◆ gEsmConfig

ESM_Config gEsmConfig[]
extern

Externally defined driver configuration array.

◆ gEsmConfigNum

uint32_t gEsmConfigNum
extern

Externally defined driver configuration array size.