1 /**
2   ******************************************************************************
3   * @file    stm32h5xx_hal_mmc_ex.h
4   * @author  MCD Application Team
5   * @brief   Header file of SD HAL extended module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2022 STMicroelectronics.
10   * All rights reserved.
11   *
12   * This software is licensed under terms that can be found in the LICENSE file
13   * in the root directory of this software component.
14   * If no LICENSE file comes with this software, it is provided AS-IS.
15   *
16   ******************************************************************************
17   */
18 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef STM32H5xx_HAL_MMC_EX_H
21 #define STM32H5xx_HAL_MMC_EX_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32h5xx_hal_def.h"
29 
30 /** @addtogroup STM32H5xx_HAL_Driver
31   * @{
32   */
33 #if defined (SDMMC1) || defined (SDMMC2)
34 /** @addtogroup MMCEx
35   * @brief SD HAL extended module driver
36   * @{
37   */
38 
39 /* Exported types ------------------------------------------------------------*/
40 /** @defgroup MMCEx_Exported_Types MMCEx Exported Types
41   * @{
42   */
43 
44 /** @defgroup MMCEx_Exported_Types_Group1 Linked List Wrapper
45   * @{
46   */
47 /* Exported constants --------------------------------------------------------*/
48 /* Exported macro ------------------------------------------------------------*/
49 /* -----------------Linked List Wrapper --------------------------------------*/
50 
51 #define MMC_DMALinkNodeTypeDef        SDMMC_DMALinkNodeTypeDef
52 #define MMC_DMALinkNodeConfTypeDef    SDMMC_DMALinkNodeConfTypeDef
53 #define MMC_DMALinkedListTypeDef      SDMMC_DMALinkedListTypeDef
54 /* ----------------- Linked Aliases ------------------------------------------*/
55 #define HAL_MMCx_DMALinkedList_WriteCpltCallback HAL_MMC_TxCpltCallback
56 #define HAL_MMCx_DMALinkedList_ReadCpltCallback  HAL_MMC_RxCpltCallback
57 /**
58   * @}
59   */
60 
61 /**
62   * @}
63   */
64 /* Exported functions --------------------------------------------------------*/
65 /** @defgroup MMCEx_Exported_Functions MMCEx Exported Functions
66   * @{
67   */
68 
69 /** @defgroup MMCEx_Exported_Functions_Group1 MultiBuffer functions
70   * @{
71   */
72 HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_ReadBlocks(MMC_HandleTypeDef *hmmc, SDMMC_DMALinkedListTypeDef *pLinkedList,
73                                                      uint32_t BlockAdd, uint32_t NumberOfBlocks);
74 HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_WriteBlocks(MMC_HandleTypeDef *hmmc, SDMMC_DMALinkedListTypeDef *pLinkedList,
75                                                       uint32_t BlockAdd, uint32_t NumberOfBlocks);
76 
77 HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_BuildNode(MMC_DMALinkNodeTypeDef *pNode,
78                                                     MMC_DMALinkNodeConfTypeDef *pNodeConf);
79 HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_InsertNode(MMC_DMALinkedListTypeDef *pLinkedList,
80                                                      MMC_DMALinkNodeTypeDef *pPrevNode,
81                                                      MMC_DMALinkNodeTypeDef *pNewNode);
82 HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_RemoveNode(MMC_DMALinkedListTypeDef *pLinkedList,
83                                                      MMC_DMALinkNodeTypeDef *pNode);
84 HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_LockNode(MMC_DMALinkNodeTypeDef *pNode);
85 HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_UnlockNode(MMC_DMALinkNodeTypeDef *pNode);
86 HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_EnableCircularMode(SDMMC_DMALinkedListTypeDef *pLinkedList);
87 HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_DisableCircularMode(SDMMC_DMALinkedListTypeDef *pLinkedList);
88 
89 void HAL_MMCEx_Read_DMALnkLstBufCpltCallback(MMC_HandleTypeDef *hmmc);
90 void HAL_MMCEx_Write_DMALnkLstBufCpltCallback(MMC_HandleTypeDef *hmmc);
91 
92 
93 /**
94   * @}
95   */
96 
97 /**
98   * @}
99   */
100 
101 /* Private types -------------------------------------------------------------*/
102 /* Private defines -----------------------------------------------------------*/
103 /* Private variables ---------------------------------------------------------*/
104 /* Private constants ---------------------------------------------------------*/
105 /* Private macros ------------------------------------------------------------*/
106 /* Private functions prototypes ----------------------------------------------*/
107 /* Private functions ---------------------------------------------------------*/
108 
109 /**
110   * @}
111   */
112 #endif /* SDMMC1 || SDMMC2 */
113 
114 /**
115   * @}
116   */
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 
122 #endif /* STM32H5xx_HAL_MMCEx_H */
123