RTEMS 6.1-rc2
Loading...
Searching...
No Matches
stm32h7xx_hal_ramecc.h
Go to the documentation of this file.
1
19/* Define to prevent recursive inclusion -------------------------------------*/
20#ifndef STM32H7xx_HAL_RAMECC_H
21#define STM32H7xx_HAL_RAMECC_H
22
23#ifdef __cplusplus
24 extern "C" {
25#endif
26
27/* Includes ------------------------------------------------------------------*/
28#include "stm32h7xx_hal_def.h"
29
38/* Exported types ------------------------------------------------------------*/
39
49typedef enum
50{
56
57
63{
66 __IO uint32_t ErrorCode;
67 void (* DetectErrorCallback)( struct __RAMECC_HandleTypeDef *hramecc);
69
75/* Exported constants --------------------------------------------------------*/
84#define HAL_RAMECC_ERROR_NONE 0x00000000U
85#define HAL_RAMECC_ERROR_TIMEOUT 0x00000001U
86#define HAL_RAMECC_ERROR_BUSY 0x00000002U
87#define HAL_RAMECC_ERROR_INVALID_CALLBACK 0x00000003U
96#define RAMECC_IT_GLOBAL_ID 0x10000000UL
97#define RAMECC_IT_MONITOR_ID 0x20000000UL
98
99#define RAMECC_IT_GLOBAL_ENABLE (RAMECC_IT_GLOBAL_ID | RAMECC_IER_GIE)
100#define RAMECC_IT_GLOBAL_SINGLEERR_R (RAMECC_IT_GLOBAL_ID | RAMECC_IER_GECCSEIE)
101#define RAMECC_IT_GLOBAL_DOUBLEERR_R (RAMECC_IT_GLOBAL_ID | RAMECC_IER_GECCDEIE)
102#define RAMECC_IT_GLOBAL_DOUBLEERR_W (RAMECC_IT_GLOBAL_ID | RAMECC_IER_GECCDEBWIE)
103#define RAMECC_IT_GLOBAL_ALL (RAMECC_IT_GLOBAL_ID | RAMECC_IER_GIE | RAMECC_IER_GECCSEIE | RAMECC_IER_GECCDEIE | RAMECC_IER_GECCDEBWIE)
104
105
106#define RAMECC_IT_MONITOR_SINGLEERR_R (RAMECC_IT_MONITOR_ID | RAMECC_CR_ECCSEIE)
107#define RAMECC_IT_MONITOR_DOUBLEERR_R (RAMECC_IT_MONITOR_ID | RAMECC_CR_ECCDEIE)
108#define RAMECC_IT_MONITOR_DOUBLEERR_W (RAMECC_IT_MONITOR_ID | RAMECC_CR_ECCDEBWIE)
109#define RAMECC_IT_MONITOR_ALL (RAMECC_IT_MONITOR_ID | RAMECC_CR_ECCDEBWIE | RAMECC_CR_ECCDEIE | RAMECC_CR_ECCSEIE)
118#define RAMECC_FLAG_SINGLEERR_R RAMECC_SR_SEDCF
119#define RAMECC_FLAG_DOUBLEERR_R RAMECC_SR_DEDF
120#define RAMECC_FLAG_DOUBLEERR_W RAMECC_SR_DEBWDF
121#define RAMECC_FLAGS_ALL (RAMECC_SR_SEDCF | RAMECC_SR_DEDF | RAMECC_SR_DEBWDF)
122
130/* Exported macro ------------------------------------------------------------*/
136#define __HAL_RAMECC_ENABLE_GLOBAL_IT(__HANDLE__, __INTERRUPT__) ((((RAMECC_TypeDef *)((uint32_t)(__HANDLE__)->Instance & 0xFFFFFF00U))->IER) |= ((__INTERRUPT__) & ~RAMECC_IT_GLOBAL_ID))
137#define __HAL_RAMECC_ENABLE_MONITOR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= ((__INTERRUPT__) & ~RAMECC_IT_MONITOR_ID))
138
155#define __HAL_RAMECC_ENABLE_IT(__HANDLE__, __INTERRUPT__) ( \
156(IS_RAMECC_GLOBAL_INTERRUPT(__INTERRUPT__)) ? (__HAL_RAMECC_ENABLE_GLOBAL_IT((__HANDLE__), (__INTERRUPT__))) :\
157(__HAL_RAMECC_ENABLE_MONITOR_IT((__HANDLE__), (__INTERRUPT__))))
158
159
160#define __HAL_RAMECC_DISABLE_GLOBAL_IT(__HANDLE__, __INTERRUPT__) ((((RAMECC_TypeDef *)((uint32_t)(__HANDLE__)->Instance & 0xFFFFFF00U))->IER) &= ~((__INTERRUPT__) & ~RAMECC_IT_GLOBAL_ID))
161#define __HAL_RAMECC_DISABLE_MONITOR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~((__INTERRUPT__) & ~RAMECC_IT_MONITOR_ID))
162
179#define __HAL_RAMECC_DISABLE_IT(__HANDLE__, __INTERRUPT__) ( \
180(IS_RAMECC_GLOBAL_INTERRUPT(__INTERRUPT__)) ? (__HAL_RAMECC_DISABLE_GLOBAL_IT((__HANDLE__), (__INTERRUPT__))) :\
181(__HAL_RAMECC_DISABLE_MONITOR_IT((__HANDLE__), (__INTERRUPT__))))
182
183
184#define __HAL_RAMECC_GET_GLOBAL_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((RAMECC_TypeDef *)((uint32_t)(__HANDLE__)->Instance & 0xFFFFFF00U))->IER) & ((__INTERRUPT__) & ~RAMECC_IT_GLOBAL_ID)) ? SET : RESET)
185#define __HAL_RAMECC_GET_MONITOR_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR) & ((__INTERRUPT__) & ~RAMECC_IT_GLOBAL_ID)) ? SET : RESET)
186
203#define __HAL_RAMECC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ( \
204(IS_RAMECC_GLOBAL_INTERRUPT(__INTERRUPT__)) ? (__HAL_RAMECC_GET_GLOBAL_IT_SOURCE((__HANDLE__), (__INTERRUPT__))) :\
205(__HAL_RAMECC_GET_MONITOR_IT_SOURCE((__HANDLE__), (__INTERRUPT__))))
206
207
219#define __HAL_RAMECC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR &= (__FLAG__))
220
221
233#define __HAL_RAMECC_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR &= ~(__FLAG__))
234
240#define __HAL_RAMECC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_RAMECC_STATE_RESET)
245/* Exported functions --------------------------------------------------------*/
246
258HAL_StatusTypeDef HAL_RAMECC_Init (RAMECC_HandleTypeDef *hramecc);
259HAL_StatusTypeDef HAL_RAMECC_DeInit (RAMECC_HandleTypeDef *hramecc);
269HAL_StatusTypeDef HAL_RAMECC_StartMonitor (RAMECC_HandleTypeDef *hramecc);
270HAL_StatusTypeDef HAL_RAMECC_StopMonitor (RAMECC_HandleTypeDef *hramecc);
271HAL_StatusTypeDef HAL_RAMECC_EnableNotification (RAMECC_HandleTypeDef *hramecc, uint32_t Notifications);
272HAL_StatusTypeDef HAL_RAMECC_DisableNotification (RAMECC_HandleTypeDef *hramecc, uint32_t Notifications);
273void HAL_RAMECC_IRQHandler (RAMECC_HandleTypeDef *hramecc);
274HAL_StatusTypeDef HAL_RAMECC_RegisterCallback (RAMECC_HandleTypeDef *hramecc, void (* pCallback)(RAMECC_HandleTypeDef *_hramecc));
275HAL_StatusTypeDef HAL_RAMECC_UnRegisterCallback (RAMECC_HandleTypeDef *hramecc);
285uint32_t HAL_RAMECC_GetFailingAddress (RAMECC_HandleTypeDef *hramecc);
286uint32_t HAL_RAMECC_GetFailingDataLow (RAMECC_HandleTypeDef *hramecc);
287uint32_t HAL_RAMECC_GetFailingDataHigh (RAMECC_HandleTypeDef *hramecc);
288uint32_t HAL_RAMECC_GetHammingErrorCode (RAMECC_HandleTypeDef *hramecc);
289uint32_t HAL_RAMECC_IsECCSingleErrorDetected (RAMECC_HandleTypeDef *hramecc);
290uint32_t HAL_RAMECC_IsECCDoubleErrorDetected (RAMECC_HandleTypeDef *hramecc);
300HAL_RAMECC_StateTypeDef HAL_RAMECC_GetState (RAMECC_HandleTypeDef *hramecc);
301uint32_t HAL_RAMECC_GetError (RAMECC_HandleTypeDef *hramecc);
309/* Private Constants -------------------------------------------------------------*/
319/* Private macros ------------------------------------------------------------*/
326#define IS_RAMECC_GLOBAL_INTERRUPT(INTERRUPT) (((INTERRUPT) == RAMECC_IT_GLOBAL_ENABLE) || \
327 ((INTERRUPT) == RAMECC_IT_GLOBAL_SINGLEERR_R) || \
328 ((INTERRUPT) == RAMECC_IT_GLOBAL_DOUBLEERR_R) || \
329 ((INTERRUPT) == RAMECC_IT_GLOBAL_DOUBLEERR_W) || \
330 ((INTERRUPT) == RAMECC_IT_GLOBAL_ALL))
331
332
333#define IS_RAMECC_MONITOR_INTERRUPT(INTERRUPT) (((INTERRUPT) == RAMECC_IT_MONITOR_SINGLEERR_R) || \
334 ((INTERRUPT) == RAMECC_IT_MONITOR_DOUBLEERR_R) || \
335 ((INTERRUPT) == RAMECC_IT_MONITOR_DOUBLEERR_W) || \
336 ((INTERRUPT) == RAMECC_IT_MONITOR_ALL))
337
338#define IS_RAMECC_INTERRUPT(INTERRUPT) ((IS_RAMECC_GLOBAL_INTERRUPT(INTERRUPT)) || \
339 (IS_RAMECC_MONITOR_INTERRUPT(INTERRUPT)))
340
345/* Private functions ---------------------------------------------------------*/
362#ifdef __cplusplus
363}
364#endif
365
366#endif /* STM32H7xx_HAL_RAMECC_H */
367
#define __IO
Definition: core_cm4.h:239
struct __RAMECC_HandleTypeDef RAMECC_HandleTypeDef
RAMECC handle Structure definition.
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
RAM_ECC_Specific_Registers.
Definition: stm32h723xx.h:1644
RAMECC handle Structure definition.
Definition: stm32h7xx_hal_ramecc.h:63
void(* DetectErrorCallback)(struct __RAMECC_HandleTypeDef *hramecc)
Definition: stm32h7xx_hal_ramecc.h:67
__IO uint32_t ErrorCode
Definition: stm32h7xx_hal_ramecc.h:66
__IO HAL_RAMECC_StateTypeDef State
Definition: stm32h7xx_hal_ramecc.h:65
RAMECC_MonitorTypeDef * Instance
Definition: stm32h7xx_hal_ramecc.h:64