ChibiOS/HAL 9.0.0
hal_mmcsd.c
Go to the documentation of this file.
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file hal_mmcsd.c
19 * @brief MMC/SD cards common code.
20 *
21 * @addtogroup MMCSD
22 * @{
23 */
24
25#include "hal.h"
26
27#if (HAL_USE_MMC_SPI == TRUE) || (HAL_USE_SDC == TRUE) || defined(__DOXYGEN__)
28
29/*===========================================================================*/
30/* Driver local definitions. */
31/*===========================================================================*/
32
33/*===========================================================================*/
34/* Driver exported variables. */
35/*===========================================================================*/
36
37/*===========================================================================*/
38/* Driver local variables and types. */
39/*===========================================================================*/
40
41/*===========================================================================*/
42/* Driver local functions. */
43/*===========================================================================*/
44
45/*===========================================================================*/
46/* Driver exported functions. */
47/*===========================================================================*/
48
49/**
50 * @brief Gets a bit field from a words array.
51 * @note The bit zero is the LSb of the first word.
52 *
53 * @param[in] data pointer to the words array
54 * @param[in] end bit offset of the last bit of the field, inclusive
55 * @param[in] start bit offset of the first bit of the field, inclusive
56 *
57 * @return The bits field value, left aligned.
58 *
59 * @notapi
60 */
61uint32_t _mmcsd_get_slice(const uint32_t *data,
62 uint32_t end,
63 uint32_t start) {
64 unsigned startidx, endidx, startoff;
65 uint32_t endmask;
66
67 osalDbgCheck((end >= start) && ((end - start) < 32U));
68
69 startidx = start / 32U;
70 startoff = start % 32U;
71 endidx = end / 32U;
72 endmask = ((uint32_t)1U << ((end % 32U) + 1U)) - 1U;
73
74 /* One or two pieces?*/
75 if (startidx < endidx) {
76 return (data[startidx] >> startoff) | /* Two pieces case. */
77 ((data[endidx] & endmask) << (32U - startoff));
78 }
79 return (data[startidx] & endmask) >> startoff; /* One piece case. */
80}
81
82/**
83 * @brief Extract card capacity from a CSD.
84 * @details The capacity is returned as number of available blocks.
85 *
86 * @param[in] csd the CSD record
87 *
88 * @return The card capacity.
89 * @retval 0 CSD format error
90 *
91 * @notapi
92 */
93uint32_t _mmcsd_get_capacity(const uint32_t *csd) {
94 uint32_t a, b, c;
95
96 osalDbgCheck(NULL != csd);
97
99 case 0:
100 /* CSD version 1.0 */
104 return ((a + 1U) << (b + 2U)) << (c - 9U); /* 2^9 == MMCSD_BLOCK_SIZE. */
105 case 1:
106 /* CSD version 2.0.*/
107 return 1024U * (_mmcsd_get_slice(csd, MMCSD_CSD_20_C_SIZE_SLICE) + 1U);
108 default:
109 /* Reserved value detected.*/
110 break;
111 }
112 return 0U;
113}
114
115/**
116 * @brief Extract MMC card capacity from EXT_CSD.
117 * @details The capacity is returned as number of available blocks.
118 *
119 * @param[in] ext_csd the extended CSD record
120 *
121 * @return The card capacity.
122 *
123 * @notapi
124 */
125uint32_t _mmcsd_get_capacity_ext(const uint8_t *ext_csd) {
126
127 osalDbgCheck(NULL != ext_csd);
128
129 return ((uint32_t)ext_csd[215] << 24U) +
130 ((uint32_t)ext_csd[214] << 16U) +
131 ((uint32_t)ext_csd[213] << 8U) +
132 (uint32_t)ext_csd[212];
133}
134
135/**
136 * @brief Unpacks SDC CID array in structure.
137 *
138 * @param[in] sdcp pointer to the @p MMCSDBlockDevice object
139 * @param[out] cidsdc pointer to the @p unpacked_sdc_cid_t object
140 *
141 * @notapi
142 */
144 unpacked_sdc_cid_t *cidsdc) {
145 const uint32_t *cid;
146
147 osalDbgCheck((NULL != sdcp) && (NULL != cidsdc));
148
149 cid = sdcp->cid;
150 cidsdc->crc = (uint8_t) _mmcsd_get_slice(cid, MMCSD_CID_SDC_CRC_SLICE);
151 cidsdc->mdt_y = (uint16_t)_mmcsd_get_slice(cid, MMCSD_CID_SDC_MDT_Y_SLICE) +
152 2000U;
153 cidsdc->mdt_m = (uint8_t) _mmcsd_get_slice(cid, MMCSD_CID_SDC_MDT_M_SLICE);
154 cidsdc->mid = (uint8_t) _mmcsd_get_slice(cid, MMCSD_CID_SDC_MID_SLICE);
155 cidsdc->oid = (uint16_t)_mmcsd_get_slice(cid, MMCSD_CID_SDC_OID_SLICE);
156 cidsdc->pnm[4] = (char) _mmcsd_get_slice(cid, MMCSD_CID_SDC_PNM0_SLICE);
157 cidsdc->pnm[3] = (char) _mmcsd_get_slice(cid, MMCSD_CID_SDC_PNM1_SLICE);
158 cidsdc->pnm[2] = (char) _mmcsd_get_slice(cid, MMCSD_CID_SDC_PNM2_SLICE);
159 cidsdc->pnm[1] = (char) _mmcsd_get_slice(cid, MMCSD_CID_SDC_PNM3_SLICE);
160 cidsdc->pnm[0] = (char) _mmcsd_get_slice(cid, MMCSD_CID_SDC_PNM4_SLICE);
161 cidsdc->prv_n = (uint8_t) _mmcsd_get_slice(cid, MMCSD_CID_SDC_PRV_N_SLICE);
162 cidsdc->prv_m = (uint8_t) _mmcsd_get_slice(cid, MMCSD_CID_SDC_PRV_M_SLICE);
164}
165
166/**
167 * @brief Unpacks MMC CID array in structure.
168 *
169 * @param[in] sdcp pointer to the @p MMCSDBlockDevice object
170 * @param[out] cidmmc pointer to the @p unpacked_mmc_cid_t object
171 *
172 * @notapi
173 */
175 unpacked_mmc_cid_t *cidmmc) {
176 const uint32_t *cid;
177
178 osalDbgCheck((NULL != sdcp) && (NULL != cidmmc));
179
180 cid = sdcp->cid;
181 cidmmc->crc = (uint8_t) _mmcsd_get_slice(cid, MMCSD_CID_MMC_CRC_SLICE);
182 cidmmc->mdt_y = (uint16_t)_mmcsd_get_slice(cid, MMCSD_CID_MMC_MDT_Y_SLICE) +
183 1997U;
184 cidmmc->mdt_m = (uint8_t) _mmcsd_get_slice(cid, MMCSD_CID_MMC_MDT_M_SLICE);
185 cidmmc->mid = (uint8_t) _mmcsd_get_slice(cid, MMCSD_CID_MMC_MID_SLICE);
186 cidmmc->oid = (uint16_t)_mmcsd_get_slice(cid, MMCSD_CID_MMC_OID_SLICE);
187 cidmmc->pnm[5] = (char) _mmcsd_get_slice(cid, MMCSD_CID_MMC_PNM0_SLICE);
188 cidmmc->pnm[4] = (char) _mmcsd_get_slice(cid, MMCSD_CID_MMC_PNM1_SLICE);
189 cidmmc->pnm[3] = (char) _mmcsd_get_slice(cid, MMCSD_CID_MMC_PNM2_SLICE);
190 cidmmc->pnm[2] = (char) _mmcsd_get_slice(cid, MMCSD_CID_MMC_PNM3_SLICE);
191 cidmmc->pnm[1] = (char) _mmcsd_get_slice(cid, MMCSD_CID_MMC_PNM4_SLICE);
192 cidmmc->pnm[0] = (char) _mmcsd_get_slice(cid, MMCSD_CID_MMC_PNM5_SLICE);
193 cidmmc->prv_n = (uint8_t) _mmcsd_get_slice(cid, MMCSD_CID_MMC_PRV_N_SLICE);
194 cidmmc->prv_m = (uint8_t) _mmcsd_get_slice(cid, MMCSD_CID_MMC_PRV_M_SLICE);
196}
197
198/**
199 * @brief Unpacks MMC CSD array in structure.
200 *
201 * @param[in] sdcp pointer to the @p MMCSDBlockDevice object
202 * @param[out] csdmmc pointer to the @p unpacked_mmc_csd_t object
203 *
204 * @notapi
205 */
207 unpacked_mmc_csd_t *csdmmc) {
208 const uint32_t *csd;
209
210 osalDbgCheck((NULL != sdcp) && (NULL != csdmmc));
211
212 csd = sdcp->csd;
213 csdmmc->c_size = (uint16_t)_mmcsd_get_slice(csd, MMCSD_CSD_MMC_C_SIZE_SLICE);
215 csdmmc->ccc = (uint16_t)_mmcsd_get_slice(csd, MMCSD_CSD_MMC_CCC_SLICE);
216 csdmmc->copy = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_MMC_COPY_SLICE);
217 csdmmc->crc = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_MMC_CRC_SLICE);
219 csdmmc->dsr_imp = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_MMC_DSR_IMP_SLICE);
220 csdmmc->ecc = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_MMC_ECC_SLICE);
225 csdmmc->nsac = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_MMC_NSAC_SLICE);
232 csdmmc->taac = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_MMC_TAAC_SLICE);
244}
245
246/**
247 * @brief Unpacks SDC CSD v1.0 array in structure.
248 *
249 * @param[in] sdcp pointer to the @p MMCSDBlockDevice object
250 * @param[out] csd10 pointer to the @p unpacked_sdc_csd_10_t object
251 *
252 * @notapi
253 */
255 unpacked_sdc_csd_10_t *csd10) {
256 const uint32_t *csd;
257
258 osalDbgCheck(NULL != sdcp);
259
260 csd = sdcp->csd;
261 csd10->c_size = (uint16_t)_mmcsd_get_slice(csd, MMCSD_CSD_10_C_SIZE_SLICE);
263 csd10->ccc = (uint16_t)_mmcsd_get_slice(csd, MMCSD_CSD_10_CCC_SLICE);
264 csd10->copy = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_10_COPY_SLICE);
265 csd10->crc = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_10_CRC_SLICE);
267 csd10->dsr_imp = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_10_DSR_IMP_SLICE);
272 csd10->nsac = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_10_NSAC_SLICE);
278 csd10->taac = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_10_TAAC_SLICE);
286}
287
288/**
289 * @brief Unpacks SDC CSD v2.0 array in structure.
290 *
291 * @param[in] sdcp pointer to the @p MMCSDBlockDevice object
292 * @param[out] csd20 pointer to the @p unpacked_sdc_csd_20_t object
293 *
294 * @notapi
295 */
297 unpacked_sdc_csd_20_t *csd20) {
298 const uint32_t *csd;
299
300 osalDbgCheck(NULL != sdcp);
301
302 csd = sdcp->csd;
304 csd20->crc = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_20_CRC_SLICE);
305 csd20->ccc = (uint16_t)_mmcsd_get_slice(csd, MMCSD_CSD_20_CCC_SLICE);
306 csd20->copy = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_20_COPY_SLICE);
308 csd20->dsr_imp = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_20_DSR_IMP_SLICE);
312 csd20->nsac = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_20_NSAC_SLICE);
319 csd20->taac = (uint8_t) _mmcsd_get_slice(csd, MMCSD_CSD_20_TAAC_SLICE);
327}
328
329#endif /* (HAL_USE_MMC_SPI == TRUE) || (HAL_USE_SDC == TRUE) */
330
331/** @} */
#define MMCSD_CID_MMC_PNM4_SLICE
Definition hal_mmcsd.h:226
#define MMCSD_CID_MMC_CRC_SLICE
Definition hal_mmcsd.h:216
#define MMCSD_CID_MMC_PSN_SLICE
Definition hal_mmcsd.h:219
#define MMCSD_CSD_10_CRC_SLICE
Definition hal_mmcsd.h:165
#define MMCSD_CSD_20_WP_GRP_ENABLE_SLICE
Definition hal_mmcsd.h:148
#define MMCSD_CSD_10_COPY_SLICE
Definition hal_mmcsd.h:169
void _mmcsd_unpack_csd_v10(const MMCSDBlockDevice *sdcp, unpacked_sdc_csd_10_t *csd10)
Unpacks SDC CSD v1.0 array in structure.
Definition hal_mmcsd.c:254
#define MMCSD_CSD_MMC_R2W_FACTOR_SLICE
Definition hal_mmcsd.h:126
#define MMCSD_CSD_20_R2W_FACTOR_SLICE
Definition hal_mmcsd.h:147
#define MMCSD_CSD_20_WRITE_BL_PARTIAL_SLICE
Definition hal_mmcsd.h:145
#define MMCSD_CSD_10_ERASE_SECTOR_SIZE_SLICE
Definition hal_mmcsd.h:176
#define MMCSD_CSD_10_WRITE_BL_LEN_SLICE
Definition hal_mmcsd.h:172
#define MMCSD_CSD_10_READ_BLK_MISALIGN_SLICE
Definition hal_mmcsd.h:185
#define MMCSD_CSD_MMC_ERASE_GRP_SIZE_SLICE
Definition hal_mmcsd.h:121
#define MMCSD_CSD_20_ERASE_BLK_EN_SLICE
Definition hal_mmcsd.h:151
#define MMCSD_CSD_MMC_DSR_IMP_SLICE
Definition hal_mmcsd.h:114
#define MMCSD_CSD_MMC_CSD_STRUCTURE_SLICE
Definition hal_mmcsd.h:104
#define MMCSD_CSD_10_FILE_FORMAT_SLICE
Definition hal_mmcsd.h:166
void _mmcsd_unpack_mmc_cid(const MMCSDBlockDevice *sdcp, unpacked_mmc_cid_t *cidmmc)
Unpacks MMC CID array in structure.
Definition hal_mmcsd.c:174
void _mmcsd_unpack_sdc_cid(const MMCSDBlockDevice *sdcp, unpacked_sdc_cid_t *cidsdc)
Unpacks SDC CID array in structure.
Definition hal_mmcsd.c:143
#define MMCSD_CID_SDC_PRV_N_SLICE
Definition hal_mmcsd.h:206
#define MMCSD_CSD_MMC_VDD_W_CURR_MAX_SLICE
Definition hal_mmcsd.h:119
#define MMCSD_CSD_10_TAAC_SLICE
Definition hal_mmcsd.h:192
#define MMCSD_CSD_MMC_VDD_W_CURR_MIN_SLICE
Definition hal_mmcsd.h:118
#define MMCSD_CSD_MMC_FILE_FORMAT_GRP_SLICE
Definition hal_mmcsd.h:130
#define MMCSD_CID_MMC_MID_SLICE
Definition hal_mmcsd.h:229
#define MMCSD_CID_SDC_PNM0_SLICE
Definition hal_mmcsd.h:207
#define MMCSD_CID_SDC_PNM1_SLICE
Definition hal_mmcsd.h:208
#define MMCSD_CSD_MMC_READ_BLK_MISALIGN_SLICE
Definition hal_mmcsd.h:113
#define MMCSD_CSD_10_DSR_IMP_SLICE
Definition hal_mmcsd.h:184
#define MMCSD_CID_SDC_PRV_M_SLICE
Definition hal_mmcsd.h:205
#define MMCSD_CSD_20_NSAC_SLICE
Definition hal_mmcsd.h:160
#define MMCSD_CSD_MMC_CRC_SLICE
Definition hal_mmcsd.h:136
#define MMCSD_CSD_10_WRITE_BL_PARTIAL_SLICE
Definition hal_mmcsd.h:171
#define MMCSD_CSD_20_FILE_FORMAT_GRP_SLICE
Definition hal_mmcsd.h:144
#define MMCSD_CSD_10_TMP_WRITE_PROTECT_SLICE
Definition hal_mmcsd.h:167
void _mmcsd_unpack_csd_v20(const MMCSDBlockDevice *sdcp, unpacked_sdc_csd_20_t *csd20)
Unpacks SDC CSD v2.0 array in structure.
Definition hal_mmcsd.c:296
#define MMCSD_CSD_10_WRITE_BLK_MISALIGN_SLICE
Definition hal_mmcsd.h:186
#define MMCSD_CSD_MMC_WRITE_BL_PARTIAL_SLICE
Definition hal_mmcsd.h:128
#define MMCSD_CSD_MMC_SPEC_VERS_SLICE
Definition hal_mmcsd.h:105
#define MMCSD_CSD_10_ERASE_BLK_EN_SLICE
Definition hal_mmcsd.h:177
#define MMCSD_CID_SDC_OID_SLICE
Definition hal_mmcsd.h:212
#define MMCSD_CSD_10_R2W_FACTOR_SLICE
Definition hal_mmcsd.h:173
#define MMCSD_CSD_MMC_READ_BL_LEN_SLICE
Definition hal_mmcsd.h:110
#define MMCSD_CSD_10_FILE_FORMAT_GRP_SLICE
Definition hal_mmcsd.h:170
#define MMCSD_CSD_MMC_ECC_SLICE
Definition hal_mmcsd.h:135
#define MMCSD_CSD_MMC_VDD_R_CURR_MAX_SLICE
Definition hal_mmcsd.h:117
#define MMCSD_CSD_MMC_COPY_SLICE
Definition hal_mmcsd.h:131
#define MMCSD_CSD_MMC_FILE_FORMAT_SLICE
Definition hal_mmcsd.h:134
#define MMCSD_CSD_10_WP_GRP_SIZE_SLICE
Definition hal_mmcsd.h:175
#define MMCSD_CSD_MMC_WRITE_BLK_MISALIGN_SLICE
Definition hal_mmcsd.h:112
#define MMCSD_CSD_20_COPY_SLICE
Definition hal_mmcsd.h:143
#define MMCSD_CSD_20_READ_BLK_MISALIGN_SLICE
Definition hal_mmcsd.h:154
#define MMCSD_CSD_MMC_C_SIZE_MULT_SLICE
Definition hal_mmcsd.h:120
#define MMCSD_CSD_20_WRITE_BLK_MISALIGN_SLICE
Definition hal_mmcsd.h:155
#define MMCSD_CSD_20_DSR_IMP_SLICE
Definition hal_mmcsd.h:153
#define MMCSD_CSD_MMC_CCC_SLICE
Definition hal_mmcsd.h:109
#define MMCSD_CSD_MMC_READ_BL_PARTIAL_SLICE
Definition hal_mmcsd.h:111
#define MMCSD_CID_MMC_PNM1_SLICE
Definition hal_mmcsd.h:223
#define MMCSD_CSD_MMC_TRAN_SPEED_SLICE
Definition hal_mmcsd.h:108
#define MMCSD_CSD_MMC_TAAC_SLICE
Definition hal_mmcsd.h:106
#define MMCSD_CID_SDC_PNM2_SLICE
Definition hal_mmcsd.h:209
#define MMCSD_CSD_20_WP_GRP_SIZE_SLICE
Definition hal_mmcsd.h:149
#define MMCSD_CSD_10_C_SIZE_SLICE
Definition hal_mmcsd.h:183
#define MMCSD_CID_MMC_MDT_M_SLICE
Definition hal_mmcsd.h:218
#define MMCSD_CSD_MMC_PERM_WRITE_PROTECT_SLICE
Definition hal_mmcsd.h:132
#define MMCSD_CID_SDC_CRC_SLICE
Definition hal_mmcsd.h:201
#define MMCSD_CSD_20_WRITE_BL_LEN_SLICE
Definition hal_mmcsd.h:146
uint32_t _mmcsd_get_slice(const uint32_t *data, uint32_t end, uint32_t start)
Gets a bit field from a words array.
Definition hal_mmcsd.c:61
#define MMCSD_CSD_10_PERM_WRITE_PROTECT_SLICE
Definition hal_mmcsd.h:168
#define MMCSD_CSD_20_CCC_SLICE
Definition hal_mmcsd.h:158
#define MMCSD_CSD_20_PERM_WRITE_PROTECT_SLICE
Definition hal_mmcsd.h:142
#define MMCSD_CSD_10_NSAC_SLICE
Definition hal_mmcsd.h:191
#define MMCSD_CID_SDC_PNM3_SLICE
Definition hal_mmcsd.h:210
#define MMCSD_CSD_10_WP_GRP_ENABLE_SLICE
Definition hal_mmcsd.h:174
#define MMCSD_CSD_MMC_WP_GRP_SIZE_SLICE
Definition hal_mmcsd.h:123
#define MMCSD_CSD_MMC_NSAC_SLICE
Definition hal_mmcsd.h:107
uint32_t _mmcsd_get_capacity(const uint32_t *csd)
Extract card capacity from a CSD.
Definition hal_mmcsd.c:93
#define MMCSD_CID_MMC_PRV_M_SLICE
Definition hal_mmcsd.h:220
#define MMCSD_CID_MMC_PNM0_SLICE
Definition hal_mmcsd.h:222
#define MMCSD_CSD_MMC_WP_GRP_ENABLE_SLICE
Definition hal_mmcsd.h:124
#define MMCSD_CSD_MMC_TMP_WRITE_PROTECT_SLICE
Definition hal_mmcsd.h:133
#define MMCSD_CID_MMC_PRV_N_SLICE
Definition hal_mmcsd.h:221
void _mmcsd_unpack_csd_mmc(const MMCSDBlockDevice *sdcp, unpacked_mmc_csd_t *csdmmc)
Unpacks MMC CSD array in structure.
Definition hal_mmcsd.c:206
#define MMCSD_CSD_20_READ_BL_PARTIAL_SLICE
Definition hal_mmcsd.h:156
#define MMCSD_CSD_20_TMP_WRITE_PROTECT_SLICE
Definition hal_mmcsd.h:141
#define MMCSD_CID_SDC_PSN_SLICE
Definition hal_mmcsd.h:204
#define MMCSD_CSD_20_CSD_STRUCTURE_SLICE
Definition hal_mmcsd.h:162
#define MMCSD_CSD_MMC_VDD_R_CURR_MIN_SLICE
Definition hal_mmcsd.h:116
#define MMCSD_CSD_10_CCC_SLICE
Definition hal_mmcsd.h:189
#define MMCSD_CSD_10_READ_BL_LEN_SLICE
Definition hal_mmcsd.h:188
#define MMCSD_CSD_20_ERASE_SECTOR_SIZE_SLICE
Definition hal_mmcsd.h:150
#define MMCSD_CSD_10_C_SIZE_MULT_SLICE
Definition hal_mmcsd.h:178
#define MMCSD_CID_MMC_PNM3_SLICE
Definition hal_mmcsd.h:225
#define MMCSD_CID_MMC_PNM5_SLICE
Definition hal_mmcsd.h:227
#define MMCSD_CSD_20_CRC_SLICE
Definition hal_mmcsd.h:139
#define MMCSD_CSD_20_READ_BL_LEN_SLICE
Definition hal_mmcsd.h:157
#define MMCSD_CSD_MMC_WRITE_BL_LEN_SLICE
Definition hal_mmcsd.h:127
#define MMCSD_CSD_10_TRANS_SPEED_SLICE
Definition hal_mmcsd.h:190
#define MMCSD_CID_SDC_PNM4_SLICE
Definition hal_mmcsd.h:211
#define MMCSD_CSD_10_READ_BL_PARTIAL_SLICE
Definition hal_mmcsd.h:187
#define MMCSD_CID_MMC_PNM2_SLICE
Definition hal_mmcsd.h:224
uint32_t _mmcsd_get_capacity_ext(const uint8_t *ext_csd)
Extract MMC card capacity from EXT_CSD.
Definition hal_mmcsd.c:125
#define MMCSD_CID_MMC_MDT_Y_SLICE
Definition hal_mmcsd.h:217
#define MMCSD_CSD_10_CSD_STRUCTURE_SLICE
Definition hal_mmcsd.h:193
#define MMCSD_CSD_20_FILE_FORMAT_SLICE
Definition hal_mmcsd.h:140
#define MMCSD_CSD_MMC_ERASE_GRP_MULT_SLICE
Definition hal_mmcsd.h:122
#define MMCSD_CSD_20_TAAC_SLICE
Definition hal_mmcsd.h:161
#define MMCSD_CID_SDC_MDT_M_SLICE
Definition hal_mmcsd.h:202
#define MMCSD_CSD_MMC_C_SIZE_SLICE
Definition hal_mmcsd.h:115
#define MMCSD_CID_MMC_OID_SLICE
Definition hal_mmcsd.h:228
#define MMCSD_CID_SDC_MID_SLICE
Definition hal_mmcsd.h:213
#define MMCSD_CID_SDC_MDT_Y_SLICE
Definition hal_mmcsd.h:203
#define MMCSD_CSD_20_C_SIZE_SLICE
Definition hal_mmcsd.h:152
#define MMCSD_CSD_20_TRANS_SPEED_SLICE
Definition hal_mmcsd.h:159
#define osalDbgCheck(c)
Function parameters check.
Definition osal.h:284
HAL subsystem header.
MCC/SD block device class.
Definition hal_mmcsd.h:279
Unpacked CID register from MMC.
Definition hal_mmcsd.h:303
Unpacked CSD register from MMC.
Definition hal_mmcsd.h:383
uint8_t vdd_w_curr_max
Definition hal_mmcsd.h:399
uint8_t write_blk_misalign
Definition hal_mmcsd.h:392
uint8_t tmp_write_protect
Definition hal_mmcsd.h:413
uint8_t wp_grp_enable
Definition hal_mmcsd.h:404
uint8_t vdd_r_curr_max
Definition hal_mmcsd.h:397
uint8_t vdd_r_curr_min
Definition hal_mmcsd.h:396
uint8_t write_bl_partial
Definition hal_mmcsd.h:408
uint8_t read_bl_partial
Definition hal_mmcsd.h:391
uint8_t perm_write_protect
Definition hal_mmcsd.h:412
uint8_t file_format_grp
Definition hal_mmcsd.h:410
uint8_t erase_grp_size
Definition hal_mmcsd.h:401
uint8_t vdd_w_curr_min
Definition hal_mmcsd.h:398
uint8_t read_blk_misalign
Definition hal_mmcsd.h:393
uint8_t csd_structure
Definition hal_mmcsd.h:384
uint8_t erase_grp_mult
Definition hal_mmcsd.h:402
Unpacked CID register from SDC.
Definition hal_mmcsd.h:288
Unpacked CSD v1.0 register from SDC.
Definition hal_mmcsd.h:318
Unpacked CSD v2.0 register from SDC.
Definition hal_mmcsd.h:353