20#ifndef STM32H7xx_HAL_RAMECC_H
21#define STM32H7xx_HAL_RAMECC_H
61#if (USE_HAL_RAMECC_REGISTER_CALLBACKS == 1)
62typedef struct __RAMECC_HandleTypeDef
71#if (USE_HAL_RAMECC_REGISTER_CALLBACKS == 1)
72 void (* DetectErrorCallback)(
struct __RAMECC_HandleTypeDef *hramecc);
90#define HAL_RAMECC_ERROR_NONE 0x00000000U
91#define HAL_RAMECC_ERROR_TIMEOUT 0x00000001U
92#define HAL_RAMECC_ERROR_BUSY 0x00000002U
93#if (USE_HAL_RAMECC_REGISTER_CALLBACKS == 1)
94#define HAL_RAMECC_ERROR_INVALID_CALLBACK 0x00000003U
104#define HAL_RAMECC_NO_ERROR 0x00000000U
105#define HAL_RAMECC_SINGLEERROR_DETECTED 0x00000001U
106#define HAL_RAMECC_DOUBLEERROR_DETECTED 0x00000002U
115#define RAMECC_IT_GLOBAL_ID 0x10000000UL
116#define RAMECC_IT_MONITOR_ID 0x20000000UL
118#define RAMECC_IT_GLOBAL_ENABLE (RAMECC_IT_GLOBAL_ID | RAMECC_IER_GIE)
119#define RAMECC_IT_GLOBAL_SINGLEERR_R (RAMECC_IT_GLOBAL_ID | RAMECC_IER_GECCSEIE)
120#define RAMECC_IT_GLOBAL_DOUBLEERR_R (RAMECC_IT_GLOBAL_ID | RAMECC_IER_GECCDEIE)
121#define RAMECC_IT_GLOBAL_DOUBLEERR_W (RAMECC_IT_GLOBAL_ID | RAMECC_IER_GECCDEBWIE)
122#define RAMECC_IT_GLOBAL_ALL (RAMECC_IT_GLOBAL_ID | RAMECC_IER_GIE | RAMECC_IER_GECCSEIE | RAMECC_IER_GECCDEIE | RAMECC_IER_GECCDEBWIE)
125#define RAMECC_IT_MONITOR_SINGLEERR_R (RAMECC_IT_MONITOR_ID | RAMECC_CR_ECCSEIE)
126#define RAMECC_IT_MONITOR_DOUBLEERR_R (RAMECC_IT_MONITOR_ID | RAMECC_CR_ECCDEIE)
127#define RAMECC_IT_MONITOR_DOUBLEERR_W (RAMECC_IT_MONITOR_ID | RAMECC_CR_ECCDEBWIE)
128#define RAMECC_IT_MONITOR_ALL (RAMECC_IT_MONITOR_ID | RAMECC_CR_ECCDEBWIE | RAMECC_CR_ECCDEIE | RAMECC_CR_ECCSEIE)
137#define RAMECC_FLAG_SINGLEERR_R RAMECC_SR_SEDCF
138#define RAMECC_FLAG_DOUBLEERR_R RAMECC_SR_DEDF
139#define RAMECC_FLAG_DOUBLEERR_W RAMECC_SR_DEBWDF
140#define RAMECC_FLAGS_ALL (RAMECC_SR_SEDCF | RAMECC_SR_DEDF | RAMECC_SR_DEBWDF)
155#define __HAL_RAMECC_ENABLE_GLOBAL_IT(__HANDLE__, __INTERRUPT__) ((((RAMECC_TypeDef *)((uint32_t)(__HANDLE__)->Instance & 0xFFFFFF00U))->IER) |= ((__INTERRUPT__) & ~RAMECC_IT_GLOBAL_ID))
156#define __HAL_RAMECC_ENABLE_MONITOR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= ((__INTERRUPT__) & ~RAMECC_IT_MONITOR_ID))
174#define __HAL_RAMECC_ENABLE_IT(__HANDLE__, __INTERRUPT__) ( \
175(IS_RAMECC_GLOBAL_INTERRUPT(__INTERRUPT__)) ? (__HAL_RAMECC_ENABLE_GLOBAL_IT((__HANDLE__), (__INTERRUPT__))) :\
176(__HAL_RAMECC_ENABLE_MONITOR_IT((__HANDLE__), (__INTERRUPT__))))
179#define __HAL_RAMECC_DISABLE_GLOBAL_IT(__HANDLE__, __INTERRUPT__) ((((RAMECC_TypeDef *)((uint32_t)(__HANDLE__)->Instance & 0xFFFFFF00U))->IER) &= ~((__INTERRUPT__) & ~RAMECC_IT_GLOBAL_ID))
180#define __HAL_RAMECC_DISABLE_MONITOR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~((__INTERRUPT__) & ~RAMECC_IT_MONITOR_ID))
198#define __HAL_RAMECC_DISABLE_IT(__HANDLE__, __INTERRUPT__) ( \
199(IS_RAMECC_GLOBAL_INTERRUPT(__INTERRUPT__)) ? (__HAL_RAMECC_DISABLE_GLOBAL_IT((__HANDLE__), (__INTERRUPT__))) :\
200(__HAL_RAMECC_DISABLE_MONITOR_IT((__HANDLE__), (__INTERRUPT__))))
203#define __HAL_RAMECC_GET_GLOBAL_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((RAMECC_TypeDef *)((uint32_t)(__HANDLE__)->Instance & 0xFFFFFF00U))->IER) & ((__INTERRUPT__) & ~RAMECC_IT_GLOBAL_ID)) ? SET : RESET)
204#define __HAL_RAMECC_GET_MONITOR_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR) & ((__INTERRUPT__) & ~RAMECC_IT_GLOBAL_ID)) ? SET : RESET)
222#define __HAL_RAMECC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ( \
223(IS_RAMECC_GLOBAL_INTERRUPT(__INTERRUPT__)) ? (__HAL_RAMECC_GET_GLOBAL_IT_SOURCE((__HANDLE__), (__INTERRUPT__))) :\
224(__HAL_RAMECC_GET_MONITOR_IT_SOURCE((__HANDLE__), (__INTERRUPT__))))
238#define __HAL_RAMECC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR &= (__FLAG__))
252#define __HAL_RAMECC_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR &= ~(__FLAG__))
259#define __HAL_RAMECC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_RAMECC_STATE_RESET)
304#if (USE_HAL_RAMECC_REGISTER_CALLBACKS == 1)
359#define IS_RAMECC_GLOBAL_INTERRUPT(INTERRUPT) (((INTERRUPT) == RAMECC_IT_GLOBAL_ENABLE) || \
360 ((INTERRUPT) == RAMECC_IT_GLOBAL_SINGLEERR_R) || \
361 ((INTERRUPT) == RAMECC_IT_GLOBAL_DOUBLEERR_R) || \
362 ((INTERRUPT) == RAMECC_IT_GLOBAL_DOUBLEERR_W) || \
363 ((INTERRUPT) == RAMECC_IT_GLOBAL_ALL))
366#define IS_RAMECC_MONITOR_INTERRUPT(INTERRUPT) (((INTERRUPT) == RAMECC_IT_MONITOR_SINGLEERR_R) || \
367 ((INTERRUPT) == RAMECC_IT_MONITOR_DOUBLEERR_R) || \
368 ((INTERRUPT) == RAMECC_IT_MONITOR_DOUBLEERR_W) || \
369 ((INTERRUPT) == RAMECC_IT_MONITOR_ALL))
371#define IS_RAMECC_INTERRUPT(INTERRUPT) ((IS_RAMECC_GLOBAL_INTERRUPT(INTERRUPT)) || \
372 (IS_RAMECC_MONITOR_INTERRUPT(INTERRUPT)))
#define __IO
Definition: core_cm4.h:239
HAL_RAMECC_StateTypeDef
HAL RAMECC State structures definition.
Definition: stm32h7xx_hal_ramecc.h:50
@ HAL_RAMECC_STATE_RESET
Definition: stm32h7xx_hal_ramecc.h:51
@ HAL_RAMECC_STATE_READY
Definition: stm32h7xx_hal_ramecc.h:52
@ HAL_RAMECC_STATE_ERROR
Definition: stm32h7xx_hal_ramecc.h:54
@ HAL_RAMECC_STATE_BUSY
Definition: stm32h7xx_hal_ramecc.h:53
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32h7xx_hal_def.h:47
RAMECC handle Structure definition.
Definition: stm32h7xx_hal_ramecc.h:66
__IO uint32_t RAMECCErrorCode
Definition: stm32h7xx_hal_ramecc.h:70
RAMECC_MonitorTypeDef * Instance
Definition: stm32h7xx_hal_ramecc.h:67
__IO HAL_RAMECC_StateTypeDef State
Definition: stm32h7xx_hal_ramecc.h:68
__IO uint32_t ErrorCode
Definition: stm32h7xx_hal_ramecc.h:69
RAM_ECC_Specific_Registers.
Definition: stm32h723xx.h:1644