You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

693 lines
21 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx_hal_ramecc.c
  4. * @author MCD Application Team
  5. * @brief RAMECC HAL module driver.
  6. * This file provides firmware functions to manage the following
  7. * functionalities of the RAM ECC monitoring (RAMECC) peripheral:
  8. * + Initialization and de-initialization functions
  9. * + Monitoring operation functions
  10. * + Error informations functions
  11. * + State and error functions
  12. @verbatim
  13. ==============================================================================
  14. ##### How to use this driver #####
  15. ==============================================================================
  16. [..]
  17. (#) Enable and latch error informations through HAL_RAMECC_Init().
  18. (#) For a given Monitor, enable and disable interrupt through
  19. HAL_RAMECC_EnableNotifiaction().
  20. To enable a notification for a given RAMECC instance, use global
  21. interrupts.
  22. To enable a notification for only RAMECC monitor, use monitor interrupts.
  23. All possible notifications are defined in the driver header file under
  24. RAMECC_Interrupt group.
  25. *** Silent mode ***
  26. ===================
  27. [..]
  28. (+) Use HAL_RAMECC_StartMonitor() to start RAMECC latch failing
  29. information without enabling any notification.
  30. *** Interrupt mode ***
  31. ======================
  32. [..]
  33. (+) Use HAL_RAMECC_EnableNotifiaction() to enable interrupts for a
  34. given error.
  35. (+) Configure the RAMECC interrupt priority using
  36. HAL_NVIC_SetPriority().
  37. (+) Enable the RAMECC IRQ handler using HAL_NVIC_EnableIRQ().
  38. *** Failing informations ***
  39. ======================
  40. [..]
  41. (#) Use HAL_RAMECC_GetFailingAddress() function to return the RAMECC
  42. failing address.
  43. (#) Use HAL_RAMECC_GetFailingDataLow() function to return the RAMECC
  44. failing data low.
  45. (#) Use HAL_RAMECC_GetFailingDataHigh() function to return the RAMECC
  46. failing data high.
  47. (#) Use HAL_RAMECC_GetHammingErrorCode() function to return the RAMECC
  48. Hamming bits injected.
  49. (#) Use HAL_RAMECC_IsECCSingleErrorDetected() function to check if a single
  50. error was detected and corrected.
  51. (#) Use HAL_RAMECC_IsECCDoubleErrorDetected() function to check if a double
  52. error was dedetected.
  53. *** RAMECC HAL driver macros list ***
  54. =============================================
  55. [..]
  56. Below the list of used macros in RAMECC HAL driver.
  57. (+) __HAL_RAMECC_ENABLE_IT : Enable the specified ECCRAM Monitor
  58. interrupts.
  59. (+) __HAL_RAMECC_DISABLE_IT : Disable the specified ECCRAM Monitor
  60. interrupts.
  61. (+) __HAL_RAMECC_GET_FLAG : Return the current RAMECC Monitor selected
  62. flag.
  63. (+) __HAL_RAMECC_CLEAR_FLAG : Clear the current RAMECC Monitor selected
  64. flag.
  65. @endverbatim
  66. ******************************************************************************
  67. * @attention
  68. *
  69. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics.
  70. * All rights reserved.</center></h2>
  71. *
  72. * This software component is licensed by ST under BSD 3-Clause license,
  73. * the "License"; You may not use this file except in compliance with the
  74. * License. You may obtain a copy of the License at:
  75. * opensource.org/licenses/BSD-3-Clause
  76. *
  77. ******************************************************************************
  78. */
  79. /* Includes ------------------------------------------------------------------*/
  80. #include "stm32h7xx_hal.h"
  81. /** @addtogroup STM32H7xx_HAL_Driver
  82. * @{
  83. */
  84. /** @defgroup RAMECC RAMECC
  85. * @brief RAMECC HAL module driver
  86. * @{
  87. */
  88. #ifdef HAL_RAMECC_MODULE_ENABLED
  89. /* Private types -------------------------------------------------------------*/
  90. /* Private variables ---------------------------------------------------------*/
  91. /* Private constants ---------------------------------------------------------*/
  92. /* Private macros ------------------------------------------------------------*/
  93. /* Private functions ---------------------------------------------------------*/
  94. /* Exported functions --------------------------------------------------------*/
  95. /** @addtogroup RAMECC_Exported_Functions
  96. * @{
  97. */
  98. /** @addtogroup RAMECC_Exported_Functions_Group1
  99. *
  100. @verbatim
  101. ===============================================================================
  102. ##### Initialization and de-initialization functions #####
  103. ===============================================================================
  104. [..]
  105. This section provides functions allowing to initialize the RAMECC Monitor.
  106. [..]
  107. The HAL_RAMECC_Init() function follows the RAMECC configuration procedures
  108. as described in reference manual.
  109. The HAL_RAMECC_DeInit() function allows to deinitialize the RAMECC monitor.
  110. @endverbatim
  111. * @{
  112. */
  113. /**
  114. * @brief Initialize the RAMECC by clearing flags and disabling interrupts.
  115. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  116. * the configuration information for the specified RAMECC
  117. * Monitor.
  118. * @retval HAL status.
  119. */
  120. HAL_StatusTypeDef HAL_RAMECC_Init (RAMECC_HandleTypeDef *hramecc)
  121. {
  122. /* Check the RAMECC peripheral handle */
  123. if (hramecc == NULL)
  124. {
  125. /* Return HAL status */
  126. return HAL_ERROR;
  127. }
  128. /* Check the parameters */
  129. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  130. /* Change RAMECC peripheral state */
  131. hramecc->State = HAL_RAMECC_STATE_BUSY;
  132. /* Disable RAMECC monitor */
  133. hramecc->Instance->CR &= ~RAMECC_CR_ECCELEN;
  134. /* Disable all global interrupts */
  135. ((RAMECC_TypeDef *)((uint32_t)hramecc->Instance & 0xFFFFFF00U))->IER &= \
  136. ~(RAMECC_IER_GIE | RAMECC_IER_GECCSEIE | RAMECC_IER_GECCDEIE | RAMECC_IER_GECCDEBWIE);
  137. /* Disable all interrupts monitor */
  138. hramecc->Instance->CR &= ~(RAMECC_CR_ECCSEIE | RAMECC_CR_ECCDEIE | RAMECC_CR_ECCDEBWIE);
  139. /* Clear RAMECC monitor flags */
  140. __HAL_RAMECC_CLEAR_FLAG (hramecc, RAMECC_FLAGS_ALL);
  141. /* Initialise the RAMECC error code */
  142. hramecc->ErrorCode = HAL_RAMECC_ERROR_NONE;
  143. /* Update the RAMECC state */
  144. hramecc->State = HAL_RAMECC_STATE_READY;
  145. /* Return HAL status */
  146. return HAL_OK;
  147. }
  148. /**
  149. * @brief DeInitializes the RAMECC peripheral.
  150. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  151. * the configuration information for the specified RAMECC
  152. * Monitor.
  153. * @retval HAL status.
  154. */
  155. HAL_StatusTypeDef HAL_RAMECC_DeInit (RAMECC_HandleTypeDef *hramecc)
  156. {
  157. /* Check the RAMECC peripheral handle */
  158. if (hramecc == NULL)
  159. {
  160. /* Return HAL status */
  161. return HAL_ERROR;
  162. }
  163. /* Check the parameters */
  164. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  165. /* Disable RAMECC monitor */
  166. hramecc->Instance->CR &= ~RAMECC_CR_ECCELEN;
  167. /* Disable all global interrupts */
  168. ((RAMECC_TypeDef *)((uint32_t)hramecc->Instance & 0xFFFFFF00U))->IER &= \
  169. ~(RAMECC_IER_GIE | RAMECC_IER_GECCSEIE | RAMECC_IER_GECCDEIE | RAMECC_IER_GECCDEBWIE);
  170. /* Disable all interrupts monitor */
  171. hramecc->Instance->CR &= ~(RAMECC_CR_ECCSEIE | RAMECC_CR_ECCDEIE | RAMECC_CR_ECCDEBWIE);
  172. /* Clear RAMECC monitor flags */
  173. __HAL_RAMECC_CLEAR_FLAG (hramecc, RAMECC_FLAGS_ALL);
  174. /* Clean callback */
  175. hramecc->DetectErrorCallback = NULL;
  176. /* Initialise the RAMECC error code */
  177. hramecc->ErrorCode = HAL_RAMECC_ERROR_NONE;
  178. /* Change RAMECC peripheral state */
  179. hramecc->State = HAL_RAMECC_STATE_RESET;
  180. /* Return HAL status */
  181. return HAL_OK;
  182. }
  183. /**
  184. * @}
  185. */
  186. /**
  187. * @}
  188. */
  189. /** @addtogroup RAMECC_Exported_Functions_Group2
  190. *
  191. @verbatim
  192. ===============================================================================
  193. ##### Monitoring operation functions #####
  194. ===============================================================================
  195. [..] This section provides functions allowing to:
  196. (+) Configure latching error informations.
  197. (+) Configure RAMECC Global/Monitor interrupts.
  198. (+) Register and Unregister RAMECC callbacks
  199. (+) Handle RAMECC interrupt request
  200. @endverbatim
  201. * @{
  202. */
  203. /**
  204. * @brief Starts the RAMECC latching error information.
  205. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  206. * the configuration information for the specified RAMECC
  207. * Monitor.
  208. * @retval HAL status.
  209. */
  210. HAL_StatusTypeDef HAL_RAMECC_StartMonitor (RAMECC_HandleTypeDef *hramecc)
  211. {
  212. /* Check the parameters */
  213. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  214. /* Check RAMECC state */
  215. if (hramecc->State == HAL_RAMECC_STATE_READY)
  216. {
  217. /* Change RAMECC peripheral state */
  218. hramecc->State = HAL_RAMECC_STATE_BUSY;
  219. /* Enable RAMECC monitor */
  220. hramecc->Instance->CR |= RAMECC_CR_ECCELEN;
  221. /* Change RAMECC peripheral state */
  222. hramecc->State = HAL_RAMECC_STATE_READY;
  223. }
  224. else
  225. {
  226. /* Update the error code */
  227. hramecc->ErrorCode = HAL_RAMECC_ERROR_BUSY;
  228. /* Return HAL status */
  229. return HAL_ERROR;
  230. }
  231. /* Return HAL status */
  232. return HAL_OK;
  233. }
  234. /**
  235. * @brief Stop the RAMECC latching error informations.
  236. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  237. * the configuration information for the specified RAMECC
  238. * Monitor.
  239. * @retval HAL status.
  240. */
  241. HAL_StatusTypeDef HAL_RAMECC_StopMonitor (RAMECC_HandleTypeDef *hramecc)
  242. {
  243. /* Check the parameters */
  244. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  245. /* Check RAMECC state */
  246. if (hramecc->State == HAL_RAMECC_STATE_READY)
  247. {
  248. /* Change RAMECC peripheral state */
  249. hramecc->State = HAL_RAMECC_STATE_BUSY;
  250. /* Disable RAMECC monitor */
  251. hramecc->Instance->CR &= ~RAMECC_CR_ECCELEN;
  252. /* Change RAMECC peripheral state */
  253. hramecc->State = HAL_RAMECC_STATE_READY;
  254. }
  255. else
  256. {
  257. /* Update the error code */
  258. hramecc->ErrorCode = HAL_RAMECC_ERROR_BUSY;
  259. /* Return HAL status */
  260. return HAL_ERROR;
  261. }
  262. /* Return HAL status */
  263. return HAL_OK;
  264. }
  265. /**
  266. * @brief Enable the RAMECC error interrupts.
  267. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that
  268. * contains the configuration information for the
  269. * specified RAMECC Monitor.
  270. * @param Notifications Select the notification.
  271. * @retval HAL status.
  272. */
  273. HAL_StatusTypeDef HAL_RAMECC_EnableNotification (RAMECC_HandleTypeDef *hramecc, uint32_t Notifications)
  274. {
  275. /* Check the parameters */
  276. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  277. assert_param (IS_RAMECC_INTERRUPT (Notifications));
  278. /* Check RAMECC state */
  279. if (hramecc->State == HAL_RAMECC_STATE_READY)
  280. {
  281. /* Change RAMECC peripheral state */
  282. hramecc->State = HAL_RAMECC_STATE_BUSY;
  283. /* Enable RAMECC interrupts */
  284. __HAL_RAMECC_ENABLE_IT (hramecc, Notifications);
  285. /* Change RAMECC peripheral state */
  286. hramecc->State = HAL_RAMECC_STATE_READY;
  287. }
  288. else
  289. {
  290. /* Update the error code */
  291. hramecc->ErrorCode = HAL_RAMECC_ERROR_BUSY;
  292. /* Return HAL status */
  293. return HAL_ERROR;
  294. }
  295. /* Return HAL status */
  296. return HAL_OK;
  297. }
  298. /**
  299. * @brief Disable the RAMECC error interrupts.
  300. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that
  301. * contains the configuration information for the
  302. * specified RAMECC Monitor.
  303. * @param Notifications Select the notification.
  304. * @retval HAL status.
  305. */
  306. HAL_StatusTypeDef HAL_RAMECC_DisableNotification (RAMECC_HandleTypeDef *hramecc, uint32_t Notifications)
  307. {
  308. /* Check the parameters */
  309. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  310. assert_param (IS_RAMECC_INTERRUPT (Notifications));
  311. /* Check RAMECC state */
  312. if (hramecc->State == HAL_RAMECC_STATE_READY)
  313. {
  314. /* Change RAMECC peripheral state */
  315. hramecc->State = HAL_RAMECC_STATE_BUSY;
  316. /* Disable RAMECC interrupts */
  317. __HAL_RAMECC_DISABLE_IT (hramecc, Notifications);
  318. /* Change RAMECC peripheral state */
  319. hramecc->State = HAL_RAMECC_STATE_READY;
  320. }
  321. else
  322. {
  323. /* Update the error code */
  324. hramecc->ErrorCode = HAL_RAMECC_ERROR_BUSY;
  325. /* Return HAL status */
  326. return HAL_ERROR;
  327. }
  328. /* Return HAL status */
  329. return HAL_OK;
  330. }
  331. /**
  332. * @brief Register callbacks.
  333. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  334. * the configuration information for the specified RAMECC
  335. * Monitor.
  336. * @param pCallback pointer to private callbacsk function which has pointer to
  337. * a RAMECC_HandleTypeDef structure as parameter.
  338. * @retval HAL status.
  339. */
  340. HAL_StatusTypeDef HAL_RAMECC_RegisterCallback (RAMECC_HandleTypeDef *hramecc, void (* pCallback)(RAMECC_HandleTypeDef *_hramecc))
  341. {
  342. HAL_StatusTypeDef status = HAL_OK;
  343. if (pCallback == NULL)
  344. {
  345. /* Update the error code */
  346. hramecc->ErrorCode |= HAL_RAMECC_ERROR_INVALID_CALLBACK;
  347. /* Return HAL status */
  348. return HAL_ERROR;
  349. }
  350. /* Check the parameters */
  351. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  352. /* Check RAMECC state */
  353. if (hramecc->State == HAL_RAMECC_STATE_READY)
  354. {
  355. hramecc->DetectErrorCallback = pCallback;
  356. }
  357. else
  358. {
  359. /* Update the error code */
  360. hramecc->ErrorCode = HAL_RAMECC_ERROR_INVALID_CALLBACK;
  361. /* Update HAL status */
  362. status = HAL_ERROR;
  363. }
  364. /* Return HAL status */
  365. return status;
  366. }
  367. /**
  368. * @brief UnRegister callbacks.
  369. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  370. * the configuration information for the specified RAMECC
  371. * Monitor.
  372. * @retval HAL status.
  373. */
  374. HAL_StatusTypeDef HAL_RAMECC_UnRegisterCallback (RAMECC_HandleTypeDef *hramecc)
  375. {
  376. HAL_StatusTypeDef status = HAL_OK;
  377. /* Check the parameters */
  378. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  379. /* Check RAMECC state */
  380. if(hramecc->State == HAL_RAMECC_STATE_READY)
  381. {
  382. hramecc->DetectErrorCallback = NULL;
  383. }
  384. else
  385. {
  386. /* Update the error code */
  387. hramecc->ErrorCode = HAL_RAMECC_ERROR_INVALID_CALLBACK;
  388. /* Update HAL status */
  389. status = HAL_ERROR;
  390. }
  391. /* Return HAL status */
  392. return status;
  393. }
  394. /**
  395. * @brief Handles RAMECC interrupt request.
  396. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  397. * the configuration information for the specified RAMECC
  398. * Monitor.
  399. * @retval None.
  400. */
  401. void HAL_RAMECC_IRQHandler (RAMECC_HandleTypeDef *hramecc)
  402. {
  403. uint32_t ier_reg = ((RAMECC_TypeDef *)((uint32_t)hramecc->Instance & 0xFFFFFF00U))->IER;
  404. uint32_t cr_reg = hramecc->Instance->CR >> 1U;
  405. uint32_t sr_reg = hramecc->Instance->SR << 1U;
  406. /* Update global interrupt variables */
  407. if ((ier_reg & RAMECC_IER_GIE) == RAMECC_IER_GIE)
  408. {
  409. ier_reg = RAMECC_IT_GLOBAL_ALL;
  410. }
  411. /* Clear active flags */
  412. __HAL_RAMECC_CLEAR_FLAG (hramecc, (((ier_reg | cr_reg) & sr_reg) >> 1U));
  413. /* Check if a valid double error callback is registred */
  414. if (hramecc->DetectErrorCallback != NULL)
  415. {
  416. /* Error detection callback */
  417. hramecc->DetectErrorCallback(hramecc);
  418. }
  419. }
  420. /** @addtogroup RAMECC_Exported_Functions_Group3
  421. *
  422. @verbatim
  423. ===============================================================================
  424. ##### Error informations functions #####
  425. ===============================================================================
  426. [..] This section provides functions allowing to:
  427. (+) Get failing address.
  428. (+) Get failing data low.
  429. (+) Get failing data high.
  430. (+) Get hamming bits injected.
  431. (+) Check single error flag.
  432. (+) Check double error flag.
  433. @endverbatim
  434. * @{
  435. */
  436. /**
  437. * @brief Return the RAMECC failing address.
  438. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  439. * the configuration information for the specified RAMECC
  440. * Monitor.
  441. * @retval Failing address offset.
  442. */
  443. uint32_t HAL_RAMECC_GetFailingAddress (RAMECC_HandleTypeDef *hramecc)
  444. {
  445. /* Check the parameters */
  446. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  447. /* Return failing address */
  448. return hramecc->Instance->FAR;
  449. }
  450. /**
  451. * @brief Return the RAMECC data low.
  452. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  453. * the configuration information for the specified RAMECC
  454. * Monitor.
  455. * @retval Failing data low.
  456. */
  457. uint32_t HAL_RAMECC_GetFailingDataLow (RAMECC_HandleTypeDef *hramecc)
  458. {
  459. /* Check the parameters */
  460. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  461. /* Return failing data low */
  462. return hramecc->Instance->FDRL;
  463. }
  464. /**
  465. * @brief Return the RAMECC data high.
  466. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  467. * the configuration information for the specified RAMECC
  468. * Monitor.
  469. * @retval Failing data high.
  470. */
  471. uint32_t HAL_RAMECC_GetFailingDataHigh (RAMECC_HandleTypeDef *hramecc)
  472. {
  473. /* Check the parameters */
  474. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  475. /* Return failing data high */
  476. return hramecc->Instance->FDRH;
  477. }
  478. /**
  479. * @brief Return the RAMECC Hamming bits injected.
  480. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  481. * the configuration information for the specified RAMECC
  482. * Monitor.
  483. * @retval Hamming bits injected.
  484. */
  485. uint32_t HAL_RAMECC_GetHammingErrorCode (RAMECC_HandleTypeDef *hramecc)
  486. {
  487. /* Check the parameters */
  488. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  489. /* Return hamming bits injected */
  490. return hramecc->Instance->FECR;
  491. }
  492. /**
  493. * @brief Check if an ECC single error was occured.
  494. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  495. * the configuration information for the specified RAMECC
  496. * Monitor.
  497. * @retval State of bit (1 or 0).
  498. */
  499. uint32_t HAL_RAMECC_IsECCSingleErrorDetected (RAMECC_HandleTypeDef *hramecc)
  500. {
  501. /* Check the parameters */
  502. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  503. /* Return the state of SEDC flag */
  504. return ((READ_BIT(hramecc->Instance->SR, RAMECC_SR_SEDCF) == (RAMECC_SR_SEDCF)) ? 1UL : 0UL);
  505. }
  506. /**
  507. * @brief Check if an ECC double error was occured.
  508. * @param hramecc Pointer to a RAMECC_HandleTypeDef structure that contains
  509. * the configuration information for the specified RAMECC
  510. * Monitor.
  511. * @retval State of bit (1 or 0).
  512. */
  513. uint32_t HAL_RAMECC_IsECCDoubleErrorDetected (RAMECC_HandleTypeDef *hramecc)
  514. {
  515. /* Check the parameters */
  516. assert_param (IS_RAMECC_MONITOR_ALL_INSTANCE (hramecc->Instance));
  517. /* Return the state of DEDF | DEBWDF flags */
  518. return ((READ_BIT(hramecc->Instance->SR, (RAMECC_SR_DEDF | RAMECC_SR_DEBWDF)) != 0U) ? 1UL : 0UL);
  519. }
  520. /**
  521. * @}
  522. */
  523. /** @addtogroup RAMECC_Exported_Functions_Group4
  524. *
  525. @verbatim
  526. ===============================================================================
  527. ##### State and Error Functions #####
  528. ===============================================================================
  529. [..]
  530. This section provides functions allowing to check and get the RAMECC state
  531. and the error code .
  532. [..]
  533. The HAL_RAMECC_GetState() function allows to get the RAMECC peripheral
  534. state.
  535. The HAL_RAMECC_GetError() function allows to Get the RAMECC peripheral error
  536. code.
  537. @endverbatim
  538. * @{
  539. */
  540. /**
  541. * @brief Get the RAMECC peripheral state.
  542. * @param hramecc : Pointer to a RAMECC_HandleTypeDef structure that
  543. * contains the configuration information for the
  544. * specified RAMECC instance.
  545. * @retval RAMECC state.
  546. */
  547. HAL_RAMECC_StateTypeDef HAL_RAMECC_GetState (RAMECC_HandleTypeDef *hramecc)
  548. {
  549. /* Return the RAMECC state */
  550. return hramecc->State;
  551. }
  552. /**
  553. * @brief Get the RAMECC peripheral error code.
  554. * @param hramecc : Pointer to a RAMECC_HandleTypeDef structure that
  555. * contains the configuration information for the
  556. * specified RAMECC instance.
  557. * @retval RAMECC error code.
  558. */
  559. uint32_t HAL_RAMECC_GetError (RAMECC_HandleTypeDef *hramecc)
  560. {
  561. /* Return the RAMECC error code */
  562. return hramecc->ErrorCode;
  563. }
  564. /**
  565. * @}
  566. */
  567. #endif /* HAL_RAMECC_MODULE_ENABLED */
  568. /**
  569. * @}
  570. */
  571. /**
  572. * @}
  573. */
  574. /**
  575. * @}
  576. */
  577. /**
  578. * @}
  579. */
  580. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/