AM273x MCU+ SDK  08.02.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.

Sub Modules

 ESM Driver Error Codes
 

Files

file  esm/v0/esm.h
 ESM Driver API/interface file.
 

Data Structures

struct  ESM_GroupIntrStatus
 Structure to access the status of interrupts belonging to a group. More...
 
struct  ESM_NotifyParams
 Parameters used to register the ESM notify function to handle Group1 and Group2 errors. The notify function will be invoked post the ESM FIQ interrupt handler processing. More...
 
struct  ESM_OpenParams
 ESM Open Parameters. More...
 
struct  ESM_Attrs
 ESM Hardware Atrributes. More...
 
struct  ESM_Object
 ESM Driver Object. 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, int32_t *errCode)
 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, int32_t *errCode)
 Deregister the ESM notifers. More...
 
void 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 get the current value of low time counter. 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. This will set the nERROR pin to high. 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 grpNum, ESM_GroupIntrStatus *intrstatus)
 This API is used to get the interrupt/error status for a group. 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...
 

Enumerations

enum  ESM_IntrPriorityLvl { ESM_INTR_PRIORITY_LEVEL_LOW = 0x0U, ESM_INTR_PRIORITY_LEVEL_HIGH = 0x1U }
 Enum to select level for interrupt. More...
 
enum  ESM_OperationMode { ESM_OPERATION_MODE_NORMAL = ESM_ESMEKR_EKEY_NORMAL_MODE, ESM_OPERATION_MODE_ERROR_FORCE = ESM_ESMEKR_EKEY_ERROR_FORCE_MODE }
 Enum to select the ESM Operation Mode. More...
 

Macros

#define ESM_ERRNO_BASE   (-3000)
 ESM driver error base. More...
 
#define ESM_MAX_NOTIFIERS   (4U)
 Maximum number of notify callbacks supported. More...
 
#define ESM_MAX_ISR_COUNT   (4U)
 Maximum ISR supported. More...
 

Macro Definition Documentation

◆ ESM_ERRNO_BASE

#define ESM_ERRNO_BASE   (-3000)

ESM driver error base.

◆ 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.

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

Enumeration Type Documentation

◆ ESM_IntrPriorityLvl

Enum to select level for interrupt.

Enumerator
ESM_INTR_PRIORITY_LEVEL_LOW 

Configure interrupt to high level interrupt

ESM_INTR_PRIORITY_LEVEL_HIGH 

Configure interrupt to low level interrupt

◆ ESM_OperationMode

Enum to select the ESM Operation Mode.

Enumerator
ESM_OPERATION_MODE_NORMAL 

Configure ESM operation mode to normal mode

ESM_OPERATION_MODE_ERROR_FORCE 

Configure ESM operation mode to error force mode

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,
int32_t *  errCode 
)

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.
[out]errCodeError code populated on error.
Returns
On success returns SystemP_SUCCESS. Negative values indicate unsuccessful operations.

◆ ESM_deregisterNotifier()

int32_t ESM_deregisterNotifier ( ESM_Handle  handle,
int32_t  notifyIndex,
int32_t *  errCode 
)

Deregister the ESM notifers.

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

◆ ESM_setMode()

void 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. Refer enum ESM_OperationMode.

◆ 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 get the current value of low time counter.

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. This will set the nERROR pin to high.

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  grpNum,
ESM_GroupIntrStatus intrstatus 
)

This API is used to get the interrupt/error status for a group.

Parameters
baseAddrBase Address of the ESM Registers.
grpNumGroup for which status to return. It Starts from 1 and should not be more than ESM_NUM_GROUP_MAX.
intrstatusInterrupt status. Refer struct ESM_GroupIntrStatus.
Returns
status 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.