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 | drivers/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... | |
#define ESM_ERRNO_BASE (-3000) |
ESM driver error base.
#define ESM_MAX_NOTIFIERS (4U) |
Maximum number of notify callbacks supported.
#define ESM_MAX_ISR_COUNT (4U) |
Maximum ISR supported.
typedef void* ESM_Handle |
A handle that is returned from a ESM_open() call.
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.
arg | Argument passed back when the Notify function is invoked. |
Not | applicable |
enum ESM_IntrPriorityLvl |
enum ESM_OperationMode |
void ESM_init | ( | void | ) |
The functions initializes the ESM module.
void ESM_deinit | ( | void | ) |
The functions de-initializes the ESM module.
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.
index | Logical peripheral number for the ESM indexed into the ESM_Config table |
params | Pointer to an parameter block, if NULL it will use default values. |
void ESM_close | ( | ESM_Handle | handle | ) |
The function closes a ESM peripheral specified by the ESM handle.
handle | ESM Handle |
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.
[in] | handle | Handle to the ESM Driver. |
[in] | params | Notifier error number and callback function. |
[out] | errCode | Error code populated on error. |
int32_t ESM_deregisterNotifier | ( | ESM_Handle | handle, |
int32_t | notifyIndex, | ||
int32_t * | errCode | ||
) |
Deregister the ESM notifers.
[in] | handle | Handle to the ESM Driver. |
[in] | notifyIndex | Notifier index returned when the notifier was registered. |
[out] | errCode | Error code populated on error. |
void ESM_setMode | ( | uint32_t | baseAddr, |
uint32_t | mode | ||
) |
This API is used to configure operation mode of ESM module.
baseAddr | Base Address of the ESM Registers. |
mode | Channel number for which reset is to be done. Refer enum ESM_OperationMode. |
int32_t ESM_setErrPinLowTimePreload | ( | uint32_t | baseAddr, |
uint32_t | lowTime | ||
) |
This API is used to configure the low time counter pre-load value.
baseAddr | Base Address of the ESM Registers. |
lowTime | Time to be configured as LTCP. |
uint32_t ESM_getCurrErrPinLowTimeCnt | ( | uint32_t | baseAddr | ) |
This API is used to get the current value of low time counter.
baseAddr | Base Address of the ESM Registers. |
uint32_t ESM_getErrPinStatus | ( | uint32_t | baseAddr | ) |
This API is used to get the current status of nERROR pin.
baseAddr | Base Address of the ESM Registers. |
void ESM_resetErrPin | ( | uint32_t | baseAddr | ) |
This API is used to reset the nERROR pin. This will set the nERROR pin to high.
baseAddr | Base Address of the ESM Registers. |
uint32_t ESM_getIntrStatus | ( | uint32_t | baseAddr, |
uint32_t | intrSrc | ||
) |
This API is used to get the interrupt status.
baseAddr | Base Address of the ESM Registers. |
intrSrc | Interrupt for which status to return. |
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.
baseAddr | Base Address of the ESM Registers. |
grpNum | Group for which status to return. It Starts from 1 and should not be more than ESM_NUM_GROUP_MAX. |
intrstatus | Interrupt status. Refer struct ESM_GroupIntrStatus. |
|
inlinestatic |
|
extern |
Externally defined driver configuration array.
|
extern |
Externally defined driver configuration array size.