1 /**
2   ******************************************************************************
3   * @file    stm32u5xx_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) 2021 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 STM32U5xx_HAL_SD_EX_H
21 #define STM32U5xx_HAL_SD_EX_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32u5xx_hal_def.h"
29 
30 /** @addtogroup STM32U5xx_HAL_Driver
31   * @{
32   */
33 
34 /** @addtogroup SDEx
35   * @brief SD HAL extended module driver
36   * @{
37   */
38 
39 /* Exported types ------------------------------------------------------------*/
40 /** @defgroup SDEx_Exported_Types SDEx Exported Types
41   * @{
42   */
43 
44 /** @defgroup SDEx_Exported_Types_Group1 Linked List Wrapper
45   * @{
46   */
47 /* Exported constants --------------------------------------------------------*/
48 /* Exported macro ------------------------------------------------------------*/
49 /* -----------------Linked List Wrapper --------------------------------------*/
50 
51 #define SD_DMALinkNodeTypeDef        SDMMC_DMALinkNodeTypeDef
52 #define SD_DMALinkNodeConfTypeDef    SDMMC_DMALinkNodeConfTypeDef
53 #define SD_DMALinkedListTypeDef      SDMMC_DMALinkedListTypeDef
54 /* ----------------- Linked Aliases ------------------------------------------*/
55 #define HAL_SDEx_DMALinkedList_WriteCpltCallback HAL_SD_TxCpltCallback
56 #define HAL_SDEx_DMALinkedList_ReadCpltCallback  HAL_SD_RxCpltCallback
57 /**
58   * @}
59   */
60 /**
61   * @}
62   */
63 
64 /* Exported functions --------------------------------------------------------*/
65 /** @defgroup SDEx_Exported_Functions SDEx Exported Functions
66   * @{
67   */
68 /** @defgroup SDEx_Exported_Functions_Group1 Linked List functions
69   * @{
70   */
71 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_ReadBlocks(SD_HandleTypeDef *hsd, SD_DMALinkedListTypeDef *pLinkedList,
72                                                     uint32_t BlockAdd, uint32_t NumberOfBlocks);
73 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_WriteBlocks(SD_HandleTypeDef *hsd, SD_DMALinkedListTypeDef *pLinkedList,
74                                                      uint32_t BlockAdd, uint32_t NumberOfBlocks);
75 
76 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_BuildNode(SD_DMALinkNodeTypeDef *pNode, SD_DMALinkNodeConfTypeDef *pNodeConf);
77 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_InsertNode(SD_DMALinkedListTypeDef *pLinkedList,
78                                                     SD_DMALinkNodeTypeDef *pPrevNode, SD_DMALinkNodeTypeDef *pNewNode);
79 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_RemoveNode(SD_DMALinkedListTypeDef *pLinkedList, SD_DMALinkNodeTypeDef *pNode);
80 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_LockNode(SD_DMALinkNodeTypeDef *pNode);
81 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_UnlockNode(SD_DMALinkNodeTypeDef *pNode);
82 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_EnableCircularMode(SD_DMALinkedListTypeDef *pLinkedList);
83 HAL_StatusTypeDef HAL_SDEx_DMALinkedList_DisableCircularMode(SD_DMALinkedListTypeDef *pLinkedList);
84 
85 void HAL_SDEx_Read_DMALnkLstBufCpltCallback(SD_HandleTypeDef *hsd);
86 void HAL_SDEx_Write_DMALnkLstBufCpltCallback(SD_HandleTypeDef *hsd);
87 
88 
89 /**
90   * @}
91   */
92 
93 /**
94   * @}
95   */
96 
97 /* Private types -------------------------------------------------------------*/
98 /* Private defines -----------------------------------------------------------*/
99 /* Private variables ---------------------------------------------------------*/
100 /* Private constants ---------------------------------------------------------*/
101 /* Private macros ------------------------------------------------------------*/
102 /* Private functions prototypes ----------------------------------------------*/
103 /* Private functions ---------------------------------------------------------*/
104 
105 /**
106   * @}
107   */
108 
109 /**
110   * @}
111   */
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 
117 #endif /* stm32u5xx_HAL_SD_EX_H */
118