-
Notifications
You must be signed in to change notification settings - Fork 0
/
stm32_extmem_type.h
116 lines (97 loc) · 3.07 KB
/
stm32_extmem_type.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/**
******************************************************************************
* @file stm32_extmem_type.h
* @author MCD Application Team
* @brief This file contains the external memory type definition.
******************************************************************************
* @attention
*
* Copyright (c) 2022 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef EXTMEM_TYPE_H_
#define EXTMEM_TYPE_H_
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup EXTMEM
* @{
*/
/* Includes ------------------------------------------------------------------*/
#if EXTMEM_SAL_XSPI == 1
#include "sal/stm32_sal_xspi_type.h"
#endif /* EXTMEM_SAL_XSPI */
#if EXTMEM_SAL_SD == 1
#include "sal/stm32_sal_sd_type.h"
#endif /* EXTMEM_SAL_SD */
#if EXTMEM_SAL_MMC == 1
#include "sal/stm32_sal_mmc_type.h"
#endif /* EXTMEM_SAL_MMC */
#if EXTMEM_DRIVER_NOR_SFDP == 1
#include "nor_sfdp/stm32_sfdp_driver_type.h"
#endif /* DRIVER_SFDP_ENABLED */
#if EXTMEM_DRIVER_SDCARD == 1
#include "sdcard/stm32_sdcard_driver_type.h"
#endif /* DRIVER_PSRAM_ENABLED */
#if EXTMEM_DRIVER_PSRAM == 1
#include "psram/stm32_psram_driver_type.h"
#endif /* DRIVER_PSRAM_ENABLED */
#if EXTMEM_DRIVER_USER == 1
#include "user/stm32_user_driver_type.h"
#endif /* DRIVER_USER_ENABLED */
/* Exported constants --------------------------------------------------------*/
/** @defgroup EXTMEN_Exported_Macro External Memory Exported Macro
* @{
*/
/**
* @brief macro to get the minimum value
*/
#define EXTMEM_MIN(_A_,_B_) ((_A_)>(_B_))?(_B_):(_A_);
/**
* @}
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup EXTMEN_Exported_Typedef External Memory Exported type definition
* @{
*/
/**
* @brief Definition of the memory
*/
typedef struct
{
EXTMEM_TypeTypeDef MemType; /*!< memory driver type */
void *Handle; /*!< HAL handle */
EXTMEM_LinkConfig_TypeDef ConfigType; /*!< physical link config */
union
{
#if EXTMEM_DRIVER_NOR_SFDP == 1
EXTMEM_DRIVER_NOR_SFDP_ObjectTypeDef NorSfdpObject; /*!< NorSfdp object */
#endif /* EXTMEM_DRIVER_NOR_SFDP == 1 */
#if EXTMEM_DRIVER_SDCARD == 1
EXTMEM_DRIVER_SDCARD_ObjectTypeDef SdCardObject; /*!< SdCard object */
#endif /* EXTMEM_DRIVER_PSRAM == 1 */
#if EXTMEM_DRIVER_PSRAM == 1
EXTMEM_DRIVER_PSRAM_ObjectTypeDef PsramObject; /*!< Psram object */
#endif /* EXTMEM_DRIVER_PSRAM == 1 */
#if EXTMEM_DRIVER_USER == 1
EXTMEM_DRIVER_USER_ObjectTypeDef UserObject; /*!< User object */
#endif /* EXTMEM_DRIVER_CUSTOM == 1 */
};
} EXTMEM_DefinitionTypeDef;
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* EXTMEM_TYPE_H_ */