S32 SDK
erm_driver.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, Freescale Semiconductor, Inc.
3  * Copyright 2016 NXP
4  * All rights reserved.
5  *
6  * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
7  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
9  * IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
10  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
11  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
12  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
13  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
14  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
15  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
16  * THE POSSIBILITY OF SUCH DAMAGE.
17  */
18 
19 #ifndef ERM_DRIVER_H
20 #define ERM_DRIVER_H
21 
24 #include "erm_hal.h"
25 
33 /*******************************************************************************
34  * Variables
35  ******************************************************************************/
37 extern ERM_Type * const g_ermBase[ERM_INSTANCE_COUNT];
38 
39 /*******************************************************************************
40  * Definitions
41  ******************************************************************************/
46 typedef struct
47 {
51 
56 typedef struct
57 {
58  uint8_t channel;
61 
62 /*******************************************************************************
63  * API
64  ******************************************************************************/
70 #if defined(__cplusplus)
71 extern "C" {
72 #endif
73 
84 void ERM_DRV_Init(uint32_t instance,
85  uint8_t channelCnt,
86  const erm_user_config_t * userConfigArr);
87 
95 void ERM_DRV_Deinit(uint32_t instance);
96 
106 void ERM_DRV_SetInterruptConfig(uint32_t instance,
107  uint8_t channel,
108  erm_interrupt_config_t interruptCfg);
109 
120 void ERM_DRV_GetInterruptConfig(uint32_t instance,
121  uint8_t channel,
122  erm_interrupt_config_t * const interruptPtr);
123 
134 void ERM_DRV_ClearEvent(uint32_t instance,
135  uint8_t channel,
136  erm_ecc_event_t eccEvent);
137 
148 erm_ecc_event_t ERM_DRV_GetErrorDetail(uint32_t instance,
149  uint8_t channel,
150  uint32_t * addressPtr);
151 
154 #if defined(__cplusplus)
155 }
156 #endif
157 
160 #endif /* ERM_DRIVER_H */
161 /*******************************************************************************
162  * EOF
163  ******************************************************************************/
erm_ecc_event_t ERM_DRV_GetErrorDetail(uint32_t instance, uint8_t channel, uint32_t *addressPtr)
Gets the address of the last ECC event in Memory n and ECC event.
Definition: erm_driver.c:164
ERM interrupt notification configuration structure Implements : erm_interrupt_config_t_Class.
Definition: erm_driver.h:46
void ERM_DRV_GetInterruptConfig(uint32_t instance, uint8_t channel, erm_interrupt_config_t *const interruptPtr)
Gets interrupt notification.
Definition: erm_driver.c:122
ERM user configuration structure Implements : erm_user_config_t_Class.
Definition: erm_driver.h:56
erm_ecc_event_t
ERM types of ECC events Implements : erm_ecc_event_t_Class.
Definition: erm_hal.h:49
#define ERM_INSTANCE_COUNT
Definition: S32K144.h:3270
void ERM_DRV_ClearEvent(uint32_t instance, uint8_t channel, erm_ecc_event_t eccEvent)
Clears error event and the corresponding interrupt notification.
Definition: erm_driver.c:144
ERM_Type *const g_ermBase[ERM_INSTANCE_COUNT]
Table of base addresses for ERM instances.
Definition: erm_driver.c:43
void ERM_DRV_Init(uint32_t instance, uint8_t channelCnt, const erm_user_config_t *userConfigArr)
Initializes the ERM module.
Definition: erm_driver.c:56
const erm_interrupt_config_t * interruptCfg
Definition: erm_driver.h:59
void ERM_DRV_SetInterruptConfig(uint32_t instance, uint8_t channel, erm_interrupt_config_t interruptCfg)
Sets interrupt notification.
Definition: erm_driver.c:101
void ERM_DRV_Deinit(uint32_t instance)
Sets the default configuration.
Definition: erm_driver.c:84