This module contains APIs to program and use the ESM module. The APIs can be used by other drivers to get access to ESM.
◆ ESM_MAX_NOTIFIERS
#define ESM_MAX_NOTIFIERS (4U) |
Maximum number of notify callbacks supported.
◆ ESM_MAX_ISR_COUNT
#define ESM_MAX_ISR_COUNT (4U) |
◆ 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
◆ ESM_Handle
◆ 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
-
arg | Argument passed back when the Notify function is invoked. |
- Return values
-
◆ ESM_init()
The functions initializes the ESM module.
◆ ESM_deinit()
The functions de-initializes the ESM module.
◆ ESM_open()
Opens a ESM object with the index and parameters specified, and returns a ESM_Handle.
- Parameters
-
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. |
- Returns
- A ESM_Handle on success or a NULL on an error.
◆ ESM_close()
The function closes a ESM peripheral specified by the ESM handle.
- Precondition
- ESM_open() has to be called first.
- Parameters
-
◆ ESM_registerNotifier()
Register the notifers. The ESM module will call back if error interrupt is detected.
- Parameters
-
[in] | handle | Handle to the ESM Driver. |
[in] | params | Notifier 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] | handle | Handle to the ESM Driver. |
[in] | notifyIndex | Notifier 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
-
baseAddr | Base Address of the ESM Registers. |
mode | Channel 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
-
baseAddr | Base Address of the ESM Registers. |
lowTime | Time 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
-
baseAddr | Base 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
-
baseAddr | Base 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
-
baseAddr | Base 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
-
baseAddr | Base Address of the ESM Registers. |
intrSrc | Interrupt 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
-
baseAddr | Base Address of the ESM Registers. |
intrPrioType | Group for which status to return. |
pIntrstatus | pointer to Interrupt status. |
- Returns
- Success/failure.
◆ ESM_Params_init()
◆ gEsmConfig
Externally defined driver configuration array.
◆ gEsmConfigNum
Externally defined driver configuration array size.