1 /**
2   ******************************************************************************
3   * @file    stm32h5xx_hal_sd_ex.h
4   * @author  MCD Application Team
5   * @brief   Header file of SD HAL extended module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2023 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_SD_EX_H
21 #define STM32H5xx_HAL_SD_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 
35 /** @addtogroup SDEx
36   * @brief SD HAL extended module driver
37   * @{
38   */
39 
40 /* Exported types ------------------------------------------------------------*/
41 /** @defgroup SDEx_Exported_Types SDEx Exported Types
42   * @{
43   */
44 
45 /** @defgroup SDEx_Exported_Types_Group1 Linked List Wrapper
46   * @{
47   */
48 /* Exported constants --------------------------------------------------------*/
49 /* Exported macro ------------------------------------------------------------*/
50 /* -----------------Linked List Wrapper --------------------------------------*/
51 
52 #define SD_DMALinkNodeTypeDef        SDMMC_DMALinkNodeTypeDef
53 #define SD_DMALinkNodeConfTypeDef    SDMMC_DMALinkNodeConfTypeDef
54 #define SD_DMALinkedListTypeDef      SDMMC_DMALinkedListTypeDef
55 /* ----------------- Linked Aliases ------------------------------------------*/
56 #define HAL_SDEx_DMALinkedList_WriteCpltCallback HAL_SD_TxCpltCallback
57 #define HAL_SDEx_DMALinkedList_ReadCpltCallback  HAL_SD_RxCpltCallback
58 /**
59   * @}
60   */
61 /**
62   * @}
63   */
64 
65 /* Exported functions --------------------------------------------------------*/
66 /** @defgroup SDEx_Exported_Functions SDEx Exported Functions
67   * @{
68   */
69 /** @defgroup SDEx_Exported_Functions_Group1 Linked List functions
70   * @{
71   */
72 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_ReadBlocks(SD_HandleTypeDef *hsd, SD_DMALinkedListTypeDef *pLinkedList,
73                                                     uint32_t BlockAdd, uint32_t NumberOfBlocks);
74 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_WriteBlocks(SD_HandleTypeDef *hsd, SD_DMALinkedListTypeDef *pLinkedList,
75                                                      uint32_t BlockAdd, uint32_t NumberOfBlocks);
76 
77 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_BuildNode(SD_DMALinkNodeTypeDef *pNode, SD_DMALinkNodeConfTypeDef *pNodeConf);
78 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_InsertNode(SD_DMALinkedListTypeDef *pLinkedList,
79                                                     SD_DMALinkNodeTypeDef *pPrevNode, SD_DMALinkNodeTypeDef *pNewNode);
80 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_RemoveNode(SD_DMALinkedListTypeDef *pLinkedList, SD_DMALinkNodeTypeDef *pNode);
81 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_LockNode(SD_DMALinkNodeTypeDef *pNode);
82 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_UnlockNode(SD_DMALinkNodeTypeDef *pNode);
83 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_EnableCircularMode(SD_DMALinkedListTypeDef *pLinkedList);
84 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_DisableCircularMode(SD_DMALinkedListTypeDef *pLinkedList);
85 
86 void HAL_SDEx_Read_DMALnkLstBufCpltCallback(SD_HandleTypeDef *hsd);
87 void HAL_SDEx_Write_DMALnkLstBufCpltCallback(SD_HandleTypeDef *hsd);
88 
89 
90 /**
91   * @}
92   */
93 
94 /**
95   * @}
96   */
97 
98 /* Private types -------------------------------------------------------------*/
99 /* Private defines -----------------------------------------------------------*/
100 /* Private variables ---------------------------------------------------------*/
101 /* Private constants ---------------------------------------------------------*/
102 /* Private macros ------------------------------------------------------------*/
103 /* Private functions prototypes ----------------------------------------------*/
104 /* Private functions ---------------------------------------------------------*/
105 
106 /**
107   * @}
108   */
109 #endif /* SDMMC1 || SDMMC2 */
110 
111 /**
112   * @}
113   */
114 #ifdef __cplusplus
115 }
116 #endif
117 
118 
119 #endif /* stm32h5xx_HAL_SD_EX_H */
120