The Error Signaling Module (ESM) aggregates safety-related events and/or errors from throughout the device into one location. It can signal both low and high priority interrupts to a processor to deal with a safety event and/or manipulate an I/O error pin to signal an external hardware that an error has occurred. Therefore an external controller is able to reset the device or keep the system in a safe, known state.
The SDL APIs provide APIs to do the following functionalities.
|
int32_t | SDL_ESM_setMode (uint32_t baseAddr, esmOperationMode_t mode) |
| This API is used to configure operation mode of ESM module. More...
|
|
int32_t | SDL_ESM_getPinMode (uint32_t baseAddr, esmOperationMode_t *pMode) |
| This API is used to read operation mode of ESM module. More...
|
|
int32_t | SDL_ESM_setInfluenceOnErrPin (uint32_t baseAddr, uint32_t intrSrc, bool enable) |
| This API is used to set the influence of interrupt on nERROR pin. More...
|
|
int32_t | SDL_ESM_getInfluenceOnErrPin (uint32_t baseAddr, uint32_t intrSrc, uint32_t *pInfluence) |
| This API is used to get the influence of interrupt on nERROR pin. More...
|
|
int32_t | SDL_ESM_setErrPinLowTimePreload (uint32_t baseAddr, uint32_t lowTime) |
| This API is used to configure the low time counter pre-load value. More...
|
|
int32_t | SDL_ESM_getErrPinLowTimePreload (uint32_t baseAddr, uint32_t *pLowTime) |
| This API is used to read the low time counter pre-load value. More...
|
|
int32_t | SDL_ESM_getCurrErrPinLowTimeCnt (uint32_t baseAddr, uint32_t *pPinCntrPre) |
| This API is used to get the current value of low time counter. More...
|
|
int32_t | SDL_ESM_getErrPinStatus (uint32_t baseAddr, uint32_t *pStatus) |
| This API is used to get the current status of nERROR pin. More...
|
|
int32_t | SDL_ESM_resetErrPin (uint32_t baseAddr) |
| This API is used to reset the nERROR pin. More...
|
|
int32_t | SDL_ESM_isEnableIntr (uint32_t baseAddr, uint32_t intrSrc, uint32_t *pEnStatus) |
| This API is used check if interrupt is enabled/disabled. More...
|
|
int32_t | SDL_ESM_enableIntr (uint32_t baseAddr, uint32_t intrNum) |
| This API is used to enable interrupt. More...
|
|
int32_t | SDL_ESM_disableIntr (uint32_t baseAddr, uint32_t intrNum) |
| This API is used to disable interrupt. More...
|
|
int32_t | SDL_ESM_setIntrPriorityLvl (uint32_t baseAddr, uint32_t intrSrc, esmIntrPriorityLvl_t intrPriorityLvl) |
| This API is used to set interrupt level. More...
|
|
int32_t | SDL_ESM_getIntrStatus (uint32_t baseAddr, uint32_t intrSrc, uint32_t *pStaus) |
| This API is used to get the interrupt status. More...
|
|
int32_t | SDL_ESM_getGroupIntrStatus (uint32_t baseAddr, esmIntrPriorityLvl_t intrPrioType, SDL_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...
|
|
int32_t | SDL_ESM_clearIntrStatus (uint32_t baseAddr, uint32_t intrSrc) |
| This API is used to clear the interrupt status. More...
|
|
int32_t | SDL_ESM_clearGroupIntrStatus (uint32_t baseAddr, uint32_t grpNum) |
| This API is used to clear the interrupt/error status for a group. This will also return highest pending interrupt for pulse as well as for level interrupts. More...
|
|
int32_t | SDL_ESM_getLowPriorityLvlIntrStatus (uint32_t baseAddr, uint32_t *pstatus) |
| This API is used to get the low priority level interrupt status. More...
|
|
int32_t | SDL_ESM_getHighPriorityLvlIntrStatus (uint32_t baseAddr, uint32_t *pstatus) |
| This API is used to get the High priority level interrupt status. More...
|
|
int32_t | SDL_ESM_getIntrPriorityLvl (uint32_t baseAddr, uint32_t intrSrc, esmIntrPriorityLvl_t *pIntrPriorityLvl) |
| This API is used to get interrupt level. More...
|
|
int32_t SDL_ESM_setInfluenceOnErrPin |
( |
uint32_t |
baseAddr, |
|
|
uint32_t |
intrSrc, |
|
|
bool |
enable |
|
) |
| |
This API is used to set the influence of interrupt on nERROR pin.
- Parameters
-
baseAddr | Base Address of the ESM Registers. |
intrSrc | Interrupt source which will influence nERROR pin. |
enable | true: Enables influence on nERROR pin if it is TRUE. false:Disables influence on nERROR pin if it is FALSE. |
- Returns
- SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
- Precondition
ESM module is reset and initialized for desired operation
- Postcondition
None
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE;
uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL;
int32_t sdlRet;
sdlRet = SDL_ESM_setInfluenceOnErrPin (baseAddr, intrSrc, TRUE);
int32_t SDL_ESM_getInfluenceOnErrPin |
( |
uint32_t |
baseAddr, |
|
|
uint32_t |
intrSrc, |
|
|
uint32_t * |
pInfluence |
|
) |
| |
This API is used to get the influence of interrupt on nERROR pin.
- Parameters
-
baseAddr | Base Address of the ESM Registers. |
intrSrc | Interrupt source which will influence nERROR pin. |
pInfluence | pointer to read the influence value 1: enabled 0: disabled |
- Returns
- SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
- Precondition
ESM module is reset and initialized for desired operation
- Postcondition
None
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE;
uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL;
uint32_t influence;
int32_t sdlRet;
sdlRet = SDL_ESM_getInfluenceOnErrPin (baseAddr, intrSrc, &influence);
int32_t SDL_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
- SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Precondition
ESM module is reset and initialized for desired operation
This is the value that will be pre-loaded in to the counter field of the ESM_PIN_CNTR register whenever the ESM enters the ESM_ERROR state from ESM_IDLE. The default value is determined based on the ESM clock frequency, so that there is a minimum low time of 100 micro seconds. This field is only reset by a Power-On-Reset (not warm reset). A global soft reset will set this field to 0h.
- Postcondition
None
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE;
uint32_t pinCntrPre = 100;
int32_t sdlRet;
sdlRet = SDL_ESM_setErrPinLowTimePreload (baseAddr, pinCntrPre);
int32_t SDL_ESM_getErrPinLowTimePreload |
( |
uint32_t |
baseAddr, |
|
|
uint32_t * |
pLowTime |
|
) |
| |
This API is used to read the low time counter pre-load value.
- Parameters
-
baseAddr | Base Address of the ESM Registers. |
pLowTime | pointer to Time to be read as LTCP. |
- Returns
- SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Precondition
ESM module is reset and initialized for desired operation
This is the value that will be pre-loaded in to the counter field of the ESM_PIN_CNTR register whenever the ESM enters the ESM_ERROR state from ESM_IDLE. The default value is determined based on the ESM clock frequency, so that there is a minimum low time of 100 micro seconds. This field is only reset by a Power-On-Reset (not warm reset). A global soft reset will set this field to 0h.
- Postcondition
None
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE;
uint32_t inCntrPre;
int32_t sdlRet;
sdlRet = SDL_ESM_getErrPinLowTimePreload (baseAddr, &inCntrPre);
int32_t SDL_ESM_isEnableIntr |
( |
uint32_t |
baseAddr, |
|
|
uint32_t |
intrSrc, |
|
|
uint32_t * |
pEnStatus |
|
) |
| |
This API is used check if interrupt is enabled/disabled.
- Parameters
-
baseAddr | Base Address of the ESM Registers. |
intrSrc | Interrupt to enable. |
pEnStatus | Pointer to status of interrupt enable variable |
- Returns
- SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Precondition
ESM module is reset and initialized for desired operation
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
- Postcondition
None
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE;
uint32_t status, intrNum = 0u;
int32_t sdlRet;
sdlRet = SDL_ESM_isEnableIntr (baseAddr, intrNum, &status);
int32_t SDL_ESM_setIntrPriorityLvl |
( |
uint32_t |
baseAddr, |
|
|
uint32_t |
intrSrc, |
|
|
esmIntrPriorityLvl_t |
intrPriorityLvl |
|
) |
| |
This API is used to set interrupt level.
- Parameters
-
baseAddr | Base Address of the ESM Registers. |
intrSrc | Interrupt to set the level. |
intrPriorityLvl | Interrupt level to set. Refer enum esmIntrPriorityLvl_t. |
- Returns
- SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Precondition
ESM module is reset and initialized for desired operation
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
- Postcondition
None
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE;
uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL;
esmIntrPriorityLvl_t pri = ESM_INTR_PRIORITY_LEVEL_HIGH;
int32_t sdlRet;
sdlRet = SDL_ESM_setIntrPriorityLvl (baseAddr, intrSrc, pri);
int32_t SDL_ESM_getIntrStatus |
( |
uint32_t |
baseAddr, |
|
|
uint32_t |
intrSrc, |
|
|
uint32_t * |
pStaus |
|
) |
| |
This API is used to get the interrupt status.
- Parameters
-
baseAddr | Base Address of the ESM Registers. |
intrSrc | Interrupt for which status to return. |
pStaus | pointer to interrupt status |
- Returns
- SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Precondition
ESM module is reset and initialized for desired operation
- Postcondition
None
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE;
uint32_t status, intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL;
int32_t sdlRet;
sdlRet = SDL_ESM_getIntrStatus (baseAddr, intrSrc, &status);
int32_t SDL_ESM_clearIntrStatus |
( |
uint32_t |
baseAddr, |
|
|
uint32_t |
intrSrc |
|
) |
| |
This API is used to clear the interrupt status.
- Parameters
-
baseAddr | Base Address of the ESM Registers. |
intrSrc | Interrupt to clear status. |
- Returns
- SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Precondition
ESM module is reset and initialized for desired operation
- Postcondition
None
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE;
uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL;
int32_t sdlRet;
sdlRet = SDL_ESM_clearIntrStatus (baseAddr, intrSrc);
int32_t SDL_ESM_getLowPriorityLvlIntrStatus |
( |
uint32_t |
baseAddr, |
|
|
uint32_t * |
pstatus |
|
) |
| |
This API is used to get the low priority level interrupt status.
- Parameters
-
baseAddr | Base Address of the ESM Registers. |
pstatus | pointer to interrupt status |
- Returns
- SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Precondition
ESM module is reset and initialized for desired operation
- Postcondition
None
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE;
uint32_t status;
int32_t sdlRet;
sdlRet = SDL_ESM_getLowPriorityLvlIntrStatus (baseAddr, &status);
int32_t SDL_ESM_getHighPriorityLvlIntrStatus |
( |
uint32_t |
baseAddr, |
|
|
uint32_t * |
pstatus |
|
) |
| |
This API is used to get the High priority level interrupt status.
- Parameters
-
baseAddr | Base Address of the ESM Registers. |
pstatus | pointer to interrupt status |
- Returns
- SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Precondition
ESM module is reset and initialized for desired operation
- Postcondition
None
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE;
uint32_t status;
int32_t sdlRet;
sdlRet = SDL_ESM_getHighPriorityLvlIntrStatus (baseAddr, &status);
int32_t SDL_ESM_getIntrPriorityLvl |
( |
uint32_t |
baseAddr, |
|
|
uint32_t |
intrSrc, |
|
|
esmIntrPriorityLvl_t * |
pIntrPriorityLvl |
|
) |
| |
This API is used to get interrupt level.
- Parameters
-
baseAddr | Base Address of the ESM Registers. |
intrSrc | Interrupt to set the level. |
pIntrPriorityLvl | Pointer to Interrupt level to get. Refer enum esmIntrPriorityLvl_t. |
- Returns
- SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
- Precondition
ESM module is reset and initialized for desired operation
- Postcondition
None
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE;
uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL;
esmIntrPriorityLvl_t pri;
int32_t sdlRet;
sdlRet = SDL_ESM_getIntrPriorityLvl (baseAddr, intrSrc, &pri);