]> git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/device/device/MK64F12/MK64F12_sdhc.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[tmk_keyboard.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / hal / TARGET_Freescale / TARGET_KPSDK_MCUS / TARGET_MCU_K64F / device / device / MK64F12 / MK64F12_sdhc.h
1 /*
2 ** ###################################################################
3 ** Compilers: Keil ARM C/C++ Compiler
4 ** Freescale C/C++ for Embedded ARM
5 ** GNU C Compiler
6 ** IAR ANSI C/C++ Compiler for ARM
7 **
8 ** Reference manual: K64P144M120SF5RM, Rev.2, January 2014
9 ** Version: rev. 2.5, 2014-02-10
10 ** Build: b140604
11 **
12 ** Abstract:
13 ** Extension to the CMSIS register access layer header.
14 **
15 ** Copyright (c) 2014 Freescale Semiconductor, Inc.
16 ** All rights reserved.
17 **
18 ** Redistribution and use in source and binary forms, with or without modification,
19 ** are permitted provided that the following conditions are met:
20 **
21 ** o Redistributions of source code must retain the above copyright notice, this list
22 ** of conditions and the following disclaimer.
23 **
24 ** o Redistributions in binary form must reproduce the above copyright notice, this
25 ** list of conditions and the following disclaimer in the documentation and/or
26 ** other materials provided with the distribution.
27 **
28 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
29 ** contributors may be used to endorse or promote products derived from this
30 ** software without specific prior written permission.
31 **
32 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
36 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
39 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 **
43 ** http: www.freescale.com
44 ** mail: support@freescale.com
45 **
46 ** Revisions:
47 ** - rev. 1.0 (2013-08-12)
48 ** Initial version.
49 ** - rev. 2.0 (2013-10-29)
50 ** Register accessor macros added to the memory map.
51 ** Symbols for Processor Expert memory map compatibility added to the memory map.
52 ** Startup file for gcc has been updated according to CMSIS 3.2.
53 ** System initialization updated.
54 ** MCG - registers updated.
55 ** PORTA, PORTB, PORTC, PORTE - registers for digital filter removed.
56 ** - rev. 2.1 (2013-10-30)
57 ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
58 ** - rev. 2.2 (2013-12-09)
59 ** DMA - EARS register removed.
60 ** AIPS0, AIPS1 - MPRA register updated.
61 ** - rev. 2.3 (2014-01-24)
62 ** Update according to reference manual rev. 2
63 ** ENET, MCG, MCM, SIM, USB - registers updated
64 ** - rev. 2.4 (2014-02-10)
65 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
66 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
67 ** - rev. 2.5 (2014-02-10)
68 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
69 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
70 ** Module access macro module_BASES replaced by module_BASE_PTRS.
71 **
72 ** ###################################################################
73 */
74
75 /*
76 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
77 *
78 * This file was generated automatically and any changes may be lost.
79 */
80 #ifndef __HW_SDHC_REGISTERS_H__
81 #define __HW_SDHC_REGISTERS_H__
82
83 #include "MK64F12.h"
84 #include "fsl_bitaccess.h"
85
86 /*
87 * MK64F12 SDHC
88 *
89 * Secured Digital Host Controller
90 *
91 * Registers defined in this header file:
92 * - HW_SDHC_DSADDR - DMA System Address register
93 * - HW_SDHC_BLKATTR - Block Attributes register
94 * - HW_SDHC_CMDARG - Command Argument register
95 * - HW_SDHC_XFERTYP - Transfer Type register
96 * - HW_SDHC_CMDRSP0 - Command Response 0
97 * - HW_SDHC_CMDRSP1 - Command Response 1
98 * - HW_SDHC_CMDRSP2 - Command Response 2
99 * - HW_SDHC_CMDRSP3 - Command Response 3
100 * - HW_SDHC_DATPORT - Buffer Data Port register
101 * - HW_SDHC_PRSSTAT - Present State register
102 * - HW_SDHC_PROCTL - Protocol Control register
103 * - HW_SDHC_SYSCTL - System Control register
104 * - HW_SDHC_IRQSTAT - Interrupt Status register
105 * - HW_SDHC_IRQSTATEN - Interrupt Status Enable register
106 * - HW_SDHC_IRQSIGEN - Interrupt Signal Enable register
107 * - HW_SDHC_AC12ERR - Auto CMD12 Error Status Register
108 * - HW_SDHC_HTCAPBLT - Host Controller Capabilities
109 * - HW_SDHC_WML - Watermark Level Register
110 * - HW_SDHC_FEVT - Force Event register
111 * - HW_SDHC_ADMAES - ADMA Error Status register
112 * - HW_SDHC_ADSADDR - ADMA System Addressregister
113 * - HW_SDHC_VENDOR - Vendor Specific register
114 * - HW_SDHC_MMCBOOT - MMC Boot register
115 * - HW_SDHC_HOSTVER - Host Controller Version
116 *
117 * - hw_sdhc_t - Struct containing all module registers.
118 */
119
120 #define HW_SDHC_INSTANCE_COUNT (1U) /*!< Number of instances of the SDHC module. */
121
122 /*******************************************************************************
123 * HW_SDHC_DSADDR - DMA System Address register
124 ******************************************************************************/
125
126 /*!
127 * @brief HW_SDHC_DSADDR - DMA System Address register (RW)
128 *
129 * Reset value: 0x00000000U
130 *
131 * This register contains the physical system memory address used for DMA
132 * transfers.
133 */
134 typedef union _hw_sdhc_dsaddr
135 {
136 uint32_t U;
137 struct _hw_sdhc_dsaddr_bitfields
138 {
139 uint32_t RESERVED0 : 2; /*!< [1:0] */
140 uint32_t DSADDR : 30; /*!< [31:2] DMA System Address */
141 } B;
142 } hw_sdhc_dsaddr_t;
143
144 /*!
145 * @name Constants and macros for entire SDHC_DSADDR register
146 */
147 /*@{*/
148 #define HW_SDHC_DSADDR_ADDR(x) ((x) + 0x0U)
149
150 #define HW_SDHC_DSADDR(x) (*(__IO hw_sdhc_dsaddr_t *) HW_SDHC_DSADDR_ADDR(x))
151 #define HW_SDHC_DSADDR_RD(x) (HW_SDHC_DSADDR(x).U)
152 #define HW_SDHC_DSADDR_WR(x, v) (HW_SDHC_DSADDR(x).U = (v))
153 #define HW_SDHC_DSADDR_SET(x, v) (HW_SDHC_DSADDR_WR(x, HW_SDHC_DSADDR_RD(x) | (v)))
154 #define HW_SDHC_DSADDR_CLR(x, v) (HW_SDHC_DSADDR_WR(x, HW_SDHC_DSADDR_RD(x) & ~(v)))
155 #define HW_SDHC_DSADDR_TOG(x, v) (HW_SDHC_DSADDR_WR(x, HW_SDHC_DSADDR_RD(x) ^ (v)))
156 /*@}*/
157
158 /*
159 * Constants & macros for individual SDHC_DSADDR bitfields
160 */
161
162 /*!
163 * @name Register SDHC_DSADDR, field DSADDR[31:2] (RW)
164 *
165 * Contains the 32-bit system memory address for a DMA transfer. Because the
166 * address must be word (4 bytes) align, the least 2 bits are reserved, always 0.
167 * When the SDHC stops a DMA transfer, this register points to the system address
168 * of the next contiguous data position. It can be accessed only when no
169 * transaction is executing, that is, after a transaction has stopped. Read operation
170 * during transfers may return an invalid value. The host driver shall initialize
171 * this register before starting a DMA transaction. After DMA has stopped, the
172 * system address of the next contiguous data position can be read from this register.
173 * This register is protected during a data transfer. When data lines are
174 * active, write to this register is ignored. The host driver shall wait, until
175 * PRSSTAT[DLA] is cleared, before writing to this register. The SDHC internal DMA does
176 * not support a virtual memory system. It supports only continuous physical
177 * memory access. And due to AHB burst limitations, if the burst must cross the 1 KB
178 * boundary, SDHC will automatically change SEQ burst type to NSEQ. Because this
179 * register supports dynamic address reflecting, when IRQSTAT[TC] bit is set, it
180 * automatically alters the value of internal address counter, so SW cannot
181 * change this register when IRQSTAT[TC] is set.
182 */
183 /*@{*/
184 #define BP_SDHC_DSADDR_DSADDR (2U) /*!< Bit position for SDHC_DSADDR_DSADDR. */
185 #define BM_SDHC_DSADDR_DSADDR (0xFFFFFFFCU) /*!< Bit mask for SDHC_DSADDR_DSADDR. */
186 #define BS_SDHC_DSADDR_DSADDR (30U) /*!< Bit field size in bits for SDHC_DSADDR_DSADDR. */
187
188 /*! @brief Read current value of the SDHC_DSADDR_DSADDR field. */
189 #define BR_SDHC_DSADDR_DSADDR(x) (HW_SDHC_DSADDR(x).B.DSADDR)
190
191 /*! @brief Format value for bitfield SDHC_DSADDR_DSADDR. */
192 #define BF_SDHC_DSADDR_DSADDR(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_DSADDR_DSADDR) & BM_SDHC_DSADDR_DSADDR)
193
194 /*! @brief Set the DSADDR field to a new value. */
195 #define BW_SDHC_DSADDR_DSADDR(x, v) (HW_SDHC_DSADDR_WR(x, (HW_SDHC_DSADDR_RD(x) & ~BM_SDHC_DSADDR_DSADDR) | BF_SDHC_DSADDR_DSADDR(v)))
196 /*@}*/
197
198 /*******************************************************************************
199 * HW_SDHC_BLKATTR - Block Attributes register
200 ******************************************************************************/
201
202 /*!
203 * @brief HW_SDHC_BLKATTR - Block Attributes register (RW)
204 *
205 * Reset value: 0x00000000U
206 *
207 * This register is used to configure the number of data blocks and the number
208 * of bytes in each block.
209 */
210 typedef union _hw_sdhc_blkattr
211 {
212 uint32_t U;
213 struct _hw_sdhc_blkattr_bitfields
214 {
215 uint32_t BLKSIZE : 13; /*!< [12:0] Transfer Block Size */
216 uint32_t RESERVED0 : 3; /*!< [15:13] */
217 uint32_t BLKCNT : 16; /*!< [31:16] Blocks Count For Current Transfer
218 * */
219 } B;
220 } hw_sdhc_blkattr_t;
221
222 /*!
223 * @name Constants and macros for entire SDHC_BLKATTR register
224 */
225 /*@{*/
226 #define HW_SDHC_BLKATTR_ADDR(x) ((x) + 0x4U)
227
228 #define HW_SDHC_BLKATTR(x) (*(__IO hw_sdhc_blkattr_t *) HW_SDHC_BLKATTR_ADDR(x))
229 #define HW_SDHC_BLKATTR_RD(x) (HW_SDHC_BLKATTR(x).U)
230 #define HW_SDHC_BLKATTR_WR(x, v) (HW_SDHC_BLKATTR(x).U = (v))
231 #define HW_SDHC_BLKATTR_SET(x, v) (HW_SDHC_BLKATTR_WR(x, HW_SDHC_BLKATTR_RD(x) | (v)))
232 #define HW_SDHC_BLKATTR_CLR(x, v) (HW_SDHC_BLKATTR_WR(x, HW_SDHC_BLKATTR_RD(x) & ~(v)))
233 #define HW_SDHC_BLKATTR_TOG(x, v) (HW_SDHC_BLKATTR_WR(x, HW_SDHC_BLKATTR_RD(x) ^ (v)))
234 /*@}*/
235
236 /*
237 * Constants & macros for individual SDHC_BLKATTR bitfields
238 */
239
240 /*!
241 * @name Register SDHC_BLKATTR, field BLKSIZE[12:0] (RW)
242 *
243 * Specifies the block size for block data transfers. Values ranging from 1 byte
244 * up to the maximum buffer size can be set. It can be accessed only when no
245 * transaction is executing, that is, after a transaction has stopped. Read
246 * operations during transfers may return an invalid value, and write operations will be
247 * ignored.
248 *
249 * Values:
250 * - 0 - No data transfer.
251 * - 1 - 1 Byte
252 * - 10 - 2 Bytes
253 * - 11 - 3 Bytes
254 * - 100 - 4 Bytes
255 * - 111111111 - 511 Bytes
256 * - 1000000000 - 512 Bytes
257 * - 100000000000 - 2048 Bytes
258 * - 1000000000000 - 4096 Bytes
259 */
260 /*@{*/
261 #define BP_SDHC_BLKATTR_BLKSIZE (0U) /*!< Bit position for SDHC_BLKATTR_BLKSIZE. */
262 #define BM_SDHC_BLKATTR_BLKSIZE (0x00001FFFU) /*!< Bit mask for SDHC_BLKATTR_BLKSIZE. */
263 #define BS_SDHC_BLKATTR_BLKSIZE (13U) /*!< Bit field size in bits for SDHC_BLKATTR_BLKSIZE. */
264
265 /*! @brief Read current value of the SDHC_BLKATTR_BLKSIZE field. */
266 #define BR_SDHC_BLKATTR_BLKSIZE(x) (HW_SDHC_BLKATTR(x).B.BLKSIZE)
267
268 /*! @brief Format value for bitfield SDHC_BLKATTR_BLKSIZE. */
269 #define BF_SDHC_BLKATTR_BLKSIZE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_BLKATTR_BLKSIZE) & BM_SDHC_BLKATTR_BLKSIZE)
270
271 /*! @brief Set the BLKSIZE field to a new value. */
272 #define BW_SDHC_BLKATTR_BLKSIZE(x, v) (HW_SDHC_BLKATTR_WR(x, (HW_SDHC_BLKATTR_RD(x) & ~BM_SDHC_BLKATTR_BLKSIZE) | BF_SDHC_BLKATTR_BLKSIZE(v)))
273 /*@}*/
274
275 /*!
276 * @name Register SDHC_BLKATTR, field BLKCNT[31:16] (RW)
277 *
278 * This register is enabled when XFERTYP[BCEN] is set to 1 and is valid only for
279 * multiple block transfers. For single block transfer, this register will
280 * always read as 1. The host driver shall set this register to a value between 1 and
281 * the maximum block count. The SDHC decrements the block count after each block
282 * transfer and stops when the count reaches zero. Setting the block count to 0
283 * results in no data blocks being transferred. This register must be accessed
284 * only when no transaction is executing, that is, after transactions are stopped.
285 * During data transfer, read operations on this register may return an invalid
286 * value and write operations are ignored. When saving transfer content as a result
287 * of a suspend command, the number of blocks yet to be transferred can be
288 * determined by reading this register. The reading of this register must be applied
289 * after transfer is paused by stop at block gap operation and before sending the
290 * command marked as suspend. This is because when suspend command is sent out,
291 * SDHC will regard the current transfer as aborted and change BLKCNT back to its
292 * original value instead of keeping the dynamical indicator of remained block
293 * count. When restoring transfer content prior to issuing a resume command, the
294 * host driver shall restore the previously saved block count. Although the BLKCNT
295 * field is 0 after reset, the read of reset value is 0x1. This is because when
296 * XFERTYP[MSBSEL] is 0, indicating a single block transfer, the read value of
297 * BLKCNT is always 1.
298 *
299 * Values:
300 * - 0 - Stop count.
301 * - 1 - 1 block
302 * - 10 - 2 blocks
303 * - 1111111111111111 - 65535 blocks
304 */
305 /*@{*/
306 #define BP_SDHC_BLKATTR_BLKCNT (16U) /*!< Bit position for SDHC_BLKATTR_BLKCNT. */
307 #define BM_SDHC_BLKATTR_BLKCNT (0xFFFF0000U) /*!< Bit mask for SDHC_BLKATTR_BLKCNT. */
308 #define BS_SDHC_BLKATTR_BLKCNT (16U) /*!< Bit field size in bits for SDHC_BLKATTR_BLKCNT. */
309
310 /*! @brief Read current value of the SDHC_BLKATTR_BLKCNT field. */
311 #define BR_SDHC_BLKATTR_BLKCNT(x) (HW_SDHC_BLKATTR(x).B.BLKCNT)
312
313 /*! @brief Format value for bitfield SDHC_BLKATTR_BLKCNT. */
314 #define BF_SDHC_BLKATTR_BLKCNT(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_BLKATTR_BLKCNT) & BM_SDHC_BLKATTR_BLKCNT)
315
316 /*! @brief Set the BLKCNT field to a new value. */
317 #define BW_SDHC_BLKATTR_BLKCNT(x, v) (HW_SDHC_BLKATTR_WR(x, (HW_SDHC_BLKATTR_RD(x) & ~BM_SDHC_BLKATTR_BLKCNT) | BF_SDHC_BLKATTR_BLKCNT(v)))
318 /*@}*/
319
320 /*******************************************************************************
321 * HW_SDHC_CMDARG - Command Argument register
322 ******************************************************************************/
323
324 /*!
325 * @brief HW_SDHC_CMDARG - Command Argument register (RW)
326 *
327 * Reset value: 0x00000000U
328 *
329 * This register contains the SD/MMC command argument.
330 */
331 typedef union _hw_sdhc_cmdarg
332 {
333 uint32_t U;
334 struct _hw_sdhc_cmdarg_bitfields
335 {
336 uint32_t CMDARG : 32; /*!< [31:0] Command Argument */
337 } B;
338 } hw_sdhc_cmdarg_t;
339
340 /*!
341 * @name Constants and macros for entire SDHC_CMDARG register
342 */
343 /*@{*/
344 #define HW_SDHC_CMDARG_ADDR(x) ((x) + 0x8U)
345
346 #define HW_SDHC_CMDARG(x) (*(__IO hw_sdhc_cmdarg_t *) HW_SDHC_CMDARG_ADDR(x))
347 #define HW_SDHC_CMDARG_RD(x) (HW_SDHC_CMDARG(x).U)
348 #define HW_SDHC_CMDARG_WR(x, v) (HW_SDHC_CMDARG(x).U = (v))
349 #define HW_SDHC_CMDARG_SET(x, v) (HW_SDHC_CMDARG_WR(x, HW_SDHC_CMDARG_RD(x) | (v)))
350 #define HW_SDHC_CMDARG_CLR(x, v) (HW_SDHC_CMDARG_WR(x, HW_SDHC_CMDARG_RD(x) & ~(v)))
351 #define HW_SDHC_CMDARG_TOG(x, v) (HW_SDHC_CMDARG_WR(x, HW_SDHC_CMDARG_RD(x) ^ (v)))
352 /*@}*/
353
354 /*
355 * Constants & macros for individual SDHC_CMDARG bitfields
356 */
357
358 /*!
359 * @name Register SDHC_CMDARG, field CMDARG[31:0] (RW)
360 *
361 * The SD/MMC command argument is specified as bits 39-8 of the command format
362 * in the SD or MMC specification. This register is write protected when
363 * PRSSTAT[CDIHB0] is set.
364 */
365 /*@{*/
366 #define BP_SDHC_CMDARG_CMDARG (0U) /*!< Bit position for SDHC_CMDARG_CMDARG. */
367 #define BM_SDHC_CMDARG_CMDARG (0xFFFFFFFFU) /*!< Bit mask for SDHC_CMDARG_CMDARG. */
368 #define BS_SDHC_CMDARG_CMDARG (32U) /*!< Bit field size in bits for SDHC_CMDARG_CMDARG. */
369
370 /*! @brief Read current value of the SDHC_CMDARG_CMDARG field. */
371 #define BR_SDHC_CMDARG_CMDARG(x) (HW_SDHC_CMDARG(x).U)
372
373 /*! @brief Format value for bitfield SDHC_CMDARG_CMDARG. */
374 #define BF_SDHC_CMDARG_CMDARG(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_CMDARG_CMDARG) & BM_SDHC_CMDARG_CMDARG)
375
376 /*! @brief Set the CMDARG field to a new value. */
377 #define BW_SDHC_CMDARG_CMDARG(x, v) (HW_SDHC_CMDARG_WR(x, v))
378 /*@}*/
379
380 /*******************************************************************************
381 * HW_SDHC_XFERTYP - Transfer Type register
382 ******************************************************************************/
383
384 /*!
385 * @brief HW_SDHC_XFERTYP - Transfer Type register (RW)
386 *
387 * Reset value: 0x00000000U
388 *
389 * This register is used to control the operation of data transfers. The host
390 * driver shall set this register before issuing a command followed by a data
391 * transfer, or before issuing a resume command. To prevent data loss, the SDHC
392 * prevents writing to the bits that are involved in the data transfer of this
393 * register, when data transfer is active. These bits are DPSEL, MBSEL, DTDSEL, AC12EN,
394 * BCEN, and DMAEN. The host driver shall check PRSSTAT[CDIHB] and PRSSTAT[CIHB]
395 * before writing to this register. When PRSSTAT[CDIHB] is set, any attempt to
396 * send a command with data by writing to this register is ignored; when
397 * PRSSTAT[CIHB] bit is set, any write to this register is ignored. On sending commands with
398 * data transfer involved, it is mandatory that the block size is nonzero.
399 * Besides, block count must also be nonzero, or indicated as single block transfer
400 * (bit 5 of this register is 0 when written), or block count is disabled (bit 1 of
401 * this register is 0 when written), otherwise SDHC will ignore the sending of
402 * this command and do nothing. For write command, with all above restrictions, it
403 * is also mandatory that the write protect switch is not active (WPSPL bit of
404 * Present State Register is 1), otherwise SDHC will also ignore the command. If
405 * the commands with data transfer does not receive the response in 64 clock
406 * cycles, that is, response time-out, SDHC will regard the external device does not
407 * accept the command and abort the data transfer. In this scenario, the driver
408 * must issue the command again to retry the transfer. It is also possible that,
409 * for some reason, the card responds to the command but SDHC does not receive the
410 * response, and if it is internal DMA (either simple DMA or ADMA) read
411 * operation, the external system memory is over-written by the internal DMA with data
412 * sent back from the card. The following table shows the summary of how register
413 * settings determine the type of data transfer. Transfer Type register setting for
414 * various transfer types Multi/Single block select Block count enable Block
415 * count Function 0 Don't care Don't care Single transfer 1 0 Don't care Infinite
416 * transfer 1 1 Positive number Multiple transfer 1 1 Zero No data transfer The
417 * following table shows the relationship between XFERTYP[CICEN] and XFERTYP[CCCEN],
418 * in regards to XFERTYP[RSPTYP] as well as the name of the response type.
419 * Relationship between parameters and the name of the response type Response type
420 * (RSPTYP) Index check enable (CICEN) CRC check enable (CCCEN) Name of response
421 * type 00 0 0 No Response 01 0 1 IR2 10 0 0 R3,R4 10 1 1 R1,R5,R6 11 1 1 R1b,R5b In
422 * the SDIO specification, response type notation for R5b is not defined. R5
423 * includes R5b in the SDIO specification. But R5b is defined in this specification
424 * to specify that the SDHC will check the busy status after receiving a
425 * response. For example, usually CMD52 is used with R5, but the I/O abort command shall
426 * be used with R5b. The CRC field for R3 and R4 is expected to be all 1 bits.
427 * The CRC check shall be disabled for these response types.
428 */
429 typedef union _hw_sdhc_xfertyp
430 {
431 uint32_t U;
432 struct _hw_sdhc_xfertyp_bitfields
433 {
434 uint32_t DMAEN : 1; /*!< [0] DMA Enable */
435 uint32_t BCEN : 1; /*!< [1] Block Count Enable */
436 uint32_t AC12EN : 1; /*!< [2] Auto CMD12 Enable */
437 uint32_t RESERVED0 : 1; /*!< [3] */
438 uint32_t DTDSEL : 1; /*!< [4] Data Transfer Direction Select */
439 uint32_t MSBSEL : 1; /*!< [5] Multi/Single Block Select */
440 uint32_t RESERVED1 : 10; /*!< [15:6] */
441 uint32_t RSPTYP : 2; /*!< [17:16] Response Type Select */
442 uint32_t RESERVED2 : 1; /*!< [18] */
443 uint32_t CCCEN : 1; /*!< [19] Command CRC Check Enable */
444 uint32_t CICEN : 1; /*!< [20] Command Index Check Enable */
445 uint32_t DPSEL : 1; /*!< [21] Data Present Select */
446 uint32_t CMDTYP : 2; /*!< [23:22] Command Type */
447 uint32_t CMDINX : 6; /*!< [29:24] Command Index */
448 uint32_t RESERVED3 : 2; /*!< [31:30] */
449 } B;
450 } hw_sdhc_xfertyp_t;
451
452 /*!
453 * @name Constants and macros for entire SDHC_XFERTYP register
454 */
455 /*@{*/
456 #define HW_SDHC_XFERTYP_ADDR(x) ((x) + 0xCU)
457
458 #define HW_SDHC_XFERTYP(x) (*(__IO hw_sdhc_xfertyp_t *) HW_SDHC_XFERTYP_ADDR(x))
459 #define HW_SDHC_XFERTYP_RD(x) (HW_SDHC_XFERTYP(x).U)
460 #define HW_SDHC_XFERTYP_WR(x, v) (HW_SDHC_XFERTYP(x).U = (v))
461 #define HW_SDHC_XFERTYP_SET(x, v) (HW_SDHC_XFERTYP_WR(x, HW_SDHC_XFERTYP_RD(x) | (v)))
462 #define HW_SDHC_XFERTYP_CLR(x, v) (HW_SDHC_XFERTYP_WR(x, HW_SDHC_XFERTYP_RD(x) & ~(v)))
463 #define HW_SDHC_XFERTYP_TOG(x, v) (HW_SDHC_XFERTYP_WR(x, HW_SDHC_XFERTYP_RD(x) ^ (v)))
464 /*@}*/
465
466 /*
467 * Constants & macros for individual SDHC_XFERTYP bitfields
468 */
469
470 /*!
471 * @name Register SDHC_XFERTYP, field DMAEN[0] (RW)
472 *
473 * Enables DMA functionality. If this bit is set to 1, a DMA operation shall
474 * begin when the host driver sets the DPSEL bit of this register. Whether the
475 * simple DMA, or the advanced DMA, is active depends on PROCTL[DMAS].
476 *
477 * Values:
478 * - 0 - Disable
479 * - 1 - Enable
480 */
481 /*@{*/
482 #define BP_SDHC_XFERTYP_DMAEN (0U) /*!< Bit position for SDHC_XFERTYP_DMAEN. */
483 #define BM_SDHC_XFERTYP_DMAEN (0x00000001U) /*!< Bit mask for SDHC_XFERTYP_DMAEN. */
484 #define BS_SDHC_XFERTYP_DMAEN (1U) /*!< Bit field size in bits for SDHC_XFERTYP_DMAEN. */
485
486 /*! @brief Read current value of the SDHC_XFERTYP_DMAEN field. */
487 #define BR_SDHC_XFERTYP_DMAEN(x) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_DMAEN))
488
489 /*! @brief Format value for bitfield SDHC_XFERTYP_DMAEN. */
490 #define BF_SDHC_XFERTYP_DMAEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_XFERTYP_DMAEN) & BM_SDHC_XFERTYP_DMAEN)
491
492 /*! @brief Set the DMAEN field to a new value. */
493 #define BW_SDHC_XFERTYP_DMAEN(x, v) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_DMAEN) = (v))
494 /*@}*/
495
496 /*!
497 * @name Register SDHC_XFERTYP, field BCEN[1] (RW)
498 *
499 * Used to enable the Block Count register, which is only relevant for multiple
500 * block transfers. When this bit is 0, the internal counter for block is
501 * disabled, which is useful in executing an infinite transfer.
502 *
503 * Values:
504 * - 0 - Disable
505 * - 1 - Enable
506 */
507 /*@{*/
508 #define BP_SDHC_XFERTYP_BCEN (1U) /*!< Bit position for SDHC_XFERTYP_BCEN. */
509 #define BM_SDHC_XFERTYP_BCEN (0x00000002U) /*!< Bit mask for SDHC_XFERTYP_BCEN. */
510 #define BS_SDHC_XFERTYP_BCEN (1U) /*!< Bit field size in bits for SDHC_XFERTYP_BCEN. */
511
512 /*! @brief Read current value of the SDHC_XFERTYP_BCEN field. */
513 #define BR_SDHC_XFERTYP_BCEN(x) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_BCEN))
514
515 /*! @brief Format value for bitfield SDHC_XFERTYP_BCEN. */
516 #define BF_SDHC_XFERTYP_BCEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_XFERTYP_BCEN) & BM_SDHC_XFERTYP_BCEN)
517
518 /*! @brief Set the BCEN field to a new value. */
519 #define BW_SDHC_XFERTYP_BCEN(x, v) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_BCEN) = (v))
520 /*@}*/
521
522 /*!
523 * @name Register SDHC_XFERTYP, field AC12EN[2] (RW)
524 *
525 * Multiple block transfers for memory require a CMD12 to stop the transaction.
526 * When this bit is set to 1, the SDHC will issue a CMD12 automatically when the
527 * last block transfer has completed. The host driver shall not set this bit to
528 * issue commands that do not require CMD12 to stop a multiple block data
529 * transfer. In particular, secure commands defined in File Security Specification (see
530 * reference list) do not require CMD12. In single block transfer, the SDHC will
531 * ignore this bit whether it is set or not.
532 *
533 * Values:
534 * - 0 - Disable
535 * - 1 - Enable
536 */
537 /*@{*/
538 #define BP_SDHC_XFERTYP_AC12EN (2U) /*!< Bit position for SDHC_XFERTYP_AC12EN. */
539 #define BM_SDHC_XFERTYP_AC12EN (0x00000004U) /*!< Bit mask for SDHC_XFERTYP_AC12EN. */
540 #define BS_SDHC_XFERTYP_AC12EN (1U) /*!< Bit field size in bits for SDHC_XFERTYP_AC12EN. */
541
542 /*! @brief Read current value of the SDHC_XFERTYP_AC12EN field. */
543 #define BR_SDHC_XFERTYP_AC12EN(x) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_AC12EN))
544
545 /*! @brief Format value for bitfield SDHC_XFERTYP_AC12EN. */
546 #define BF_SDHC_XFERTYP_AC12EN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_XFERTYP_AC12EN) & BM_SDHC_XFERTYP_AC12EN)
547
548 /*! @brief Set the AC12EN field to a new value. */
549 #define BW_SDHC_XFERTYP_AC12EN(x, v) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_AC12EN) = (v))
550 /*@}*/
551
552 /*!
553 * @name Register SDHC_XFERTYP, field DTDSEL[4] (RW)
554 *
555 * Defines the direction of DAT line data transfers. The bit is set to 1 by the
556 * host driver to transfer data from the SD card to the SDHC and is set to 0 for
557 * all other commands.
558 *
559 * Values:
560 * - 0 - Write host to card.
561 * - 1 - Read card to host.
562 */
563 /*@{*/
564 #define BP_SDHC_XFERTYP_DTDSEL (4U) /*!< Bit position for SDHC_XFERTYP_DTDSEL. */
565 #define BM_SDHC_XFERTYP_DTDSEL (0x00000010U) /*!< Bit mask for SDHC_XFERTYP_DTDSEL. */
566 #define BS_SDHC_XFERTYP_DTDSEL (1U) /*!< Bit field size in bits for SDHC_XFERTYP_DTDSEL. */
567
568 /*! @brief Read current value of the SDHC_XFERTYP_DTDSEL field. */
569 #define BR_SDHC_XFERTYP_DTDSEL(x) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_DTDSEL))
570
571 /*! @brief Format value for bitfield SDHC_XFERTYP_DTDSEL. */
572 #define BF_SDHC_XFERTYP_DTDSEL(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_XFERTYP_DTDSEL) & BM_SDHC_XFERTYP_DTDSEL)
573
574 /*! @brief Set the DTDSEL field to a new value. */
575 #define BW_SDHC_XFERTYP_DTDSEL(x, v) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_DTDSEL) = (v))
576 /*@}*/
577
578 /*!
579 * @name Register SDHC_XFERTYP, field MSBSEL[5] (RW)
580 *
581 * Enables multiple block DAT line data transfers. For any other commands, this
582 * bit shall be set to 0. If this bit is 0, it is not necessary to set the block
583 * count register.
584 *
585 * Values:
586 * - 0 - Single block.
587 * - 1 - Multiple blocks.
588 */
589 /*@{*/
590 #define BP_SDHC_XFERTYP_MSBSEL (5U) /*!< Bit position for SDHC_XFERTYP_MSBSEL. */
591 #define BM_SDHC_XFERTYP_MSBSEL (0x00000020U) /*!< Bit mask for SDHC_XFERTYP_MSBSEL. */
592 #define BS_SDHC_XFERTYP_MSBSEL (1U) /*!< Bit field size in bits for SDHC_XFERTYP_MSBSEL. */
593
594 /*! @brief Read current value of the SDHC_XFERTYP_MSBSEL field. */
595 #define BR_SDHC_XFERTYP_MSBSEL(x) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_MSBSEL))
596
597 /*! @brief Format value for bitfield SDHC_XFERTYP_MSBSEL. */
598 #define BF_SDHC_XFERTYP_MSBSEL(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_XFERTYP_MSBSEL) & BM_SDHC_XFERTYP_MSBSEL)
599
600 /*! @brief Set the MSBSEL field to a new value. */
601 #define BW_SDHC_XFERTYP_MSBSEL(x, v) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_MSBSEL) = (v))
602 /*@}*/
603
604 /*!
605 * @name Register SDHC_XFERTYP, field RSPTYP[17:16] (RW)
606 *
607 * Values:
608 * - 00 - No response.
609 * - 01 - Response length 136.
610 * - 10 - Response length 48.
611 * - 11 - Response length 48, check busy after response.
612 */
613 /*@{*/
614 #define BP_SDHC_XFERTYP_RSPTYP (16U) /*!< Bit position for SDHC_XFERTYP_RSPTYP. */
615 #define BM_SDHC_XFERTYP_RSPTYP (0x00030000U) /*!< Bit mask for SDHC_XFERTYP_RSPTYP. */
616 #define BS_SDHC_XFERTYP_RSPTYP (2U) /*!< Bit field size in bits for SDHC_XFERTYP_RSPTYP. */
617
618 /*! @brief Read current value of the SDHC_XFERTYP_RSPTYP field. */
619 #define BR_SDHC_XFERTYP_RSPTYP(x) (HW_SDHC_XFERTYP(x).B.RSPTYP)
620
621 /*! @brief Format value for bitfield SDHC_XFERTYP_RSPTYP. */
622 #define BF_SDHC_XFERTYP_RSPTYP(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_XFERTYP_RSPTYP) & BM_SDHC_XFERTYP_RSPTYP)
623
624 /*! @brief Set the RSPTYP field to a new value. */
625 #define BW_SDHC_XFERTYP_RSPTYP(x, v) (HW_SDHC_XFERTYP_WR(x, (HW_SDHC_XFERTYP_RD(x) & ~BM_SDHC_XFERTYP_RSPTYP) | BF_SDHC_XFERTYP_RSPTYP(v)))
626 /*@}*/
627
628 /*!
629 * @name Register SDHC_XFERTYP, field CCCEN[19] (RW)
630 *
631 * If this bit is set to 1, the SDHC shall check the CRC field in the response.
632 * If an error is detected, it is reported as a Command CRC Error. If this bit is
633 * set to 0, the CRC field is not checked. The number of bits checked by the CRC
634 * field value changes according to the length of the response.
635 *
636 * Values:
637 * - 0 - Disable
638 * - 1 - Enable
639 */
640 /*@{*/
641 #define BP_SDHC_XFERTYP_CCCEN (19U) /*!< Bit position for SDHC_XFERTYP_CCCEN. */
642 #define BM_SDHC_XFERTYP_CCCEN (0x00080000U) /*!< Bit mask for SDHC_XFERTYP_CCCEN. */
643 #define BS_SDHC_XFERTYP_CCCEN (1U) /*!< Bit field size in bits for SDHC_XFERTYP_CCCEN. */
644
645 /*! @brief Read current value of the SDHC_XFERTYP_CCCEN field. */
646 #define BR_SDHC_XFERTYP_CCCEN(x) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_CCCEN))
647
648 /*! @brief Format value for bitfield SDHC_XFERTYP_CCCEN. */
649 #define BF_SDHC_XFERTYP_CCCEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_XFERTYP_CCCEN) & BM_SDHC_XFERTYP_CCCEN)
650
651 /*! @brief Set the CCCEN field to a new value. */
652 #define BW_SDHC_XFERTYP_CCCEN(x, v) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_CCCEN) = (v))
653 /*@}*/
654
655 /*!
656 * @name Register SDHC_XFERTYP, field CICEN[20] (RW)
657 *
658 * If this bit is set to 1, the SDHC will check the index field in the response
659 * to see if it has the same value as the command index. If it is not, it is
660 * reported as a command index error. If this bit is set to 0, the index field is not
661 * checked.
662 *
663 * Values:
664 * - 0 - Disable
665 * - 1 - Enable
666 */
667 /*@{*/
668 #define BP_SDHC_XFERTYP_CICEN (20U) /*!< Bit position for SDHC_XFERTYP_CICEN. */
669 #define BM_SDHC_XFERTYP_CICEN (0x00100000U) /*!< Bit mask for SDHC_XFERTYP_CICEN. */
670 #define BS_SDHC_XFERTYP_CICEN (1U) /*!< Bit field size in bits for SDHC_XFERTYP_CICEN. */
671
672 /*! @brief Read current value of the SDHC_XFERTYP_CICEN field. */
673 #define BR_SDHC_XFERTYP_CICEN(x) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_CICEN))
674
675 /*! @brief Format value for bitfield SDHC_XFERTYP_CICEN. */
676 #define BF_SDHC_XFERTYP_CICEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_XFERTYP_CICEN) & BM_SDHC_XFERTYP_CICEN)
677
678 /*! @brief Set the CICEN field to a new value. */
679 #define BW_SDHC_XFERTYP_CICEN(x, v) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_CICEN) = (v))
680 /*@}*/
681
682 /*!
683 * @name Register SDHC_XFERTYP, field DPSEL[21] (RW)
684 *
685 * This bit is set to 1 to indicate that data is present and shall be
686 * transferred using the DAT line. It is set to 0 for the following: Commands using only
687 * the CMD line, for example: CMD52. Commands with no data transfer, but using the
688 * busy signal on DAT[0] line, R1b or R5b, for example: CMD38. In resume command,
689 * this bit shall be set, and other bits in this register shall be set the same
690 * as when the transfer was initially launched. When the Write Protect switch is
691 * on, that is, the WPSPL bit is active as 0, any command with a write operation
692 * will be ignored. That is to say, when this bit is set, while the DTDSEL bit is
693 * 0, writes to the register Transfer Type are ignored.
694 *
695 * Values:
696 * - 0 - No data present.
697 * - 1 - Data present.
698 */
699 /*@{*/
700 #define BP_SDHC_XFERTYP_DPSEL (21U) /*!< Bit position for SDHC_XFERTYP_DPSEL. */
701 #define BM_SDHC_XFERTYP_DPSEL (0x00200000U) /*!< Bit mask for SDHC_XFERTYP_DPSEL. */
702 #define BS_SDHC_XFERTYP_DPSEL (1U) /*!< Bit field size in bits for SDHC_XFERTYP_DPSEL. */
703
704 /*! @brief Read current value of the SDHC_XFERTYP_DPSEL field. */
705 #define BR_SDHC_XFERTYP_DPSEL(x) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_DPSEL))
706
707 /*! @brief Format value for bitfield SDHC_XFERTYP_DPSEL. */
708 #define BF_SDHC_XFERTYP_DPSEL(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_XFERTYP_DPSEL) & BM_SDHC_XFERTYP_DPSEL)
709
710 /*! @brief Set the DPSEL field to a new value. */
711 #define BW_SDHC_XFERTYP_DPSEL(x, v) (BITBAND_ACCESS32(HW_SDHC_XFERTYP_ADDR(x), BP_SDHC_XFERTYP_DPSEL) = (v))
712 /*@}*/
713
714 /*!
715 * @name Register SDHC_XFERTYP, field CMDTYP[23:22] (RW)
716 *
717 * There are three types of special commands: suspend, resume, and abort. These
718 * bits shall be set to 00b for all other commands. Suspend command: If the
719 * suspend command succeeds, the SDHC shall assume that the card bus has been released
720 * and that it is possible to issue the next command which uses the DAT line.
721 * Because the SDHC does not monitor the content of command response, it does not
722 * know if the suspend command succeeded or not. It is the host driver's
723 * responsibility to check the status of the suspend command and send another command
724 * marked as suspend to inform the SDHC that a suspend command was successfully
725 * issued. After the end bit of command is sent, the SDHC deasserts read wait for read
726 * transactions and stops checking busy for write transactions. In 4-bit mode,
727 * the interrupt cycle starts. If the suspend command fails, the SDHC will
728 * maintain its current state, and the host driver shall restart the transfer by setting
729 * PROCTL[CREQ]. Resume command: The host driver restarts the data transfer by
730 * restoring the registers saved before sending the suspend command and then sends
731 * the resume command. The SDHC will check for a pending busy state before
732 * starting write transfers. Abort command: If this command is set when executing a
733 * read transfer, the SDHC will stop reads to the buffer. If this command is set
734 * when executing a write transfer, the SDHC will stop driving the DAT line. After
735 * issuing the abort command, the host driver must issue a software reset (abort
736 * transaction).
737 *
738 * Values:
739 * - 00 - Normal other commands.
740 * - 01 - Suspend CMD52 for writing bus suspend in CCCR.
741 * - 10 - Resume CMD52 for writing function select in CCCR.
742 * - 11 - Abort CMD12, CMD52 for writing I/O abort in CCCR.
743 */
744 /*@{*/
745 #define BP_SDHC_XFERTYP_CMDTYP (22U) /*!< Bit position for SDHC_XFERTYP_CMDTYP. */
746 #define BM_SDHC_XFERTYP_CMDTYP (0x00C00000U) /*!< Bit mask for SDHC_XFERTYP_CMDTYP. */
747 #define BS_SDHC_XFERTYP_CMDTYP (2U) /*!< Bit field size in bits for SDHC_XFERTYP_CMDTYP. */
748
749 /*! @brief Read current value of the SDHC_XFERTYP_CMDTYP field. */
750 #define BR_SDHC_XFERTYP_CMDTYP(x) (HW_SDHC_XFERTYP(x).B.CMDTYP)
751
752 /*! @brief Format value for bitfield SDHC_XFERTYP_CMDTYP. */
753 #define BF_SDHC_XFERTYP_CMDTYP(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_XFERTYP_CMDTYP) & BM_SDHC_XFERTYP_CMDTYP)
754
755 /*! @brief Set the CMDTYP field to a new value. */
756 #define BW_SDHC_XFERTYP_CMDTYP(x, v) (HW_SDHC_XFERTYP_WR(x, (HW_SDHC_XFERTYP_RD(x) & ~BM_SDHC_XFERTYP_CMDTYP) | BF_SDHC_XFERTYP_CMDTYP(v)))
757 /*@}*/
758
759 /*!
760 * @name Register SDHC_XFERTYP, field CMDINX[29:24] (RW)
761 *
762 * These bits shall be set to the command number that is specified in bits 45-40
763 * of the command-format in the SD Memory Card Physical Layer Specification and
764 * SDIO Card Specification.
765 */
766 /*@{*/
767 #define BP_SDHC_XFERTYP_CMDINX (24U) /*!< Bit position for SDHC_XFERTYP_CMDINX. */
768 #define BM_SDHC_XFERTYP_CMDINX (0x3F000000U) /*!< Bit mask for SDHC_XFERTYP_CMDINX. */
769 #define BS_SDHC_XFERTYP_CMDINX (6U) /*!< Bit field size in bits for SDHC_XFERTYP_CMDINX. */
770
771 /*! @brief Read current value of the SDHC_XFERTYP_CMDINX field. */
772 #define BR_SDHC_XFERTYP_CMDINX(x) (HW_SDHC_XFERTYP(x).B.CMDINX)
773
774 /*! @brief Format value for bitfield SDHC_XFERTYP_CMDINX. */
775 #define BF_SDHC_XFERTYP_CMDINX(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_XFERTYP_CMDINX) & BM_SDHC_XFERTYP_CMDINX)
776
777 /*! @brief Set the CMDINX field to a new value. */
778 #define BW_SDHC_XFERTYP_CMDINX(x, v) (HW_SDHC_XFERTYP_WR(x, (HW_SDHC_XFERTYP_RD(x) & ~BM_SDHC_XFERTYP_CMDINX) | BF_SDHC_XFERTYP_CMDINX(v)))
779 /*@}*/
780
781 /*******************************************************************************
782 * HW_SDHC_CMDRSP0 - Command Response 0
783 ******************************************************************************/
784
785 /*!
786 * @brief HW_SDHC_CMDRSP0 - Command Response 0 (RO)
787 *
788 * Reset value: 0x00000000U
789 *
790 * This register is used to store part 0 of the response bits from the card.
791 */
792 typedef union _hw_sdhc_cmdrsp0
793 {
794 uint32_t U;
795 struct _hw_sdhc_cmdrsp0_bitfields
796 {
797 uint32_t CMDRSP0 : 32; /*!< [31:0] Command Response 0 */
798 } B;
799 } hw_sdhc_cmdrsp0_t;
800
801 /*!
802 * @name Constants and macros for entire SDHC_CMDRSP0 register
803 */
804 /*@{*/
805 #define HW_SDHC_CMDRSP0_ADDR(x) ((x) + 0x10U)
806
807 #define HW_SDHC_CMDRSP0(x) (*(__I hw_sdhc_cmdrsp0_t *) HW_SDHC_CMDRSP0_ADDR(x))
808 #define HW_SDHC_CMDRSP0_RD(x) (HW_SDHC_CMDRSP0(x).U)
809 /*@}*/
810
811 /*
812 * Constants & macros for individual SDHC_CMDRSP0 bitfields
813 */
814
815 /*!
816 * @name Register SDHC_CMDRSP0, field CMDRSP0[31:0] (RO)
817 */
818 /*@{*/
819 #define BP_SDHC_CMDRSP0_CMDRSP0 (0U) /*!< Bit position for SDHC_CMDRSP0_CMDRSP0. */
820 #define BM_SDHC_CMDRSP0_CMDRSP0 (0xFFFFFFFFU) /*!< Bit mask for SDHC_CMDRSP0_CMDRSP0. */
821 #define BS_SDHC_CMDRSP0_CMDRSP0 (32U) /*!< Bit field size in bits for SDHC_CMDRSP0_CMDRSP0. */
822
823 /*! @brief Read current value of the SDHC_CMDRSP0_CMDRSP0 field. */
824 #define BR_SDHC_CMDRSP0_CMDRSP0(x) (HW_SDHC_CMDRSP0(x).U)
825 /*@}*/
826
827 /*******************************************************************************
828 * HW_SDHC_CMDRSP1 - Command Response 1
829 ******************************************************************************/
830
831 /*!
832 * @brief HW_SDHC_CMDRSP1 - Command Response 1 (RO)
833 *
834 * Reset value: 0x00000000U
835 *
836 * This register is used to store part 1 of the response bits from the card.
837 */
838 typedef union _hw_sdhc_cmdrsp1
839 {
840 uint32_t U;
841 struct _hw_sdhc_cmdrsp1_bitfields
842 {
843 uint32_t CMDRSP1 : 32; /*!< [31:0] Command Response 1 */
844 } B;
845 } hw_sdhc_cmdrsp1_t;
846
847 /*!
848 * @name Constants and macros for entire SDHC_CMDRSP1 register
849 */
850 /*@{*/
851 #define HW_SDHC_CMDRSP1_ADDR(x) ((x) + 0x14U)
852
853 #define HW_SDHC_CMDRSP1(x) (*(__I hw_sdhc_cmdrsp1_t *) HW_SDHC_CMDRSP1_ADDR(x))
854 #define HW_SDHC_CMDRSP1_RD(x) (HW_SDHC_CMDRSP1(x).U)
855 /*@}*/
856
857 /*
858 * Constants & macros for individual SDHC_CMDRSP1 bitfields
859 */
860
861 /*!
862 * @name Register SDHC_CMDRSP1, field CMDRSP1[31:0] (RO)
863 */
864 /*@{*/
865 #define BP_SDHC_CMDRSP1_CMDRSP1 (0U) /*!< Bit position for SDHC_CMDRSP1_CMDRSP1. */
866 #define BM_SDHC_CMDRSP1_CMDRSP1 (0xFFFFFFFFU) /*!< Bit mask for SDHC_CMDRSP1_CMDRSP1. */
867 #define BS_SDHC_CMDRSP1_CMDRSP1 (32U) /*!< Bit field size in bits for SDHC_CMDRSP1_CMDRSP1. */
868
869 /*! @brief Read current value of the SDHC_CMDRSP1_CMDRSP1 field. */
870 #define BR_SDHC_CMDRSP1_CMDRSP1(x) (HW_SDHC_CMDRSP1(x).U)
871 /*@}*/
872
873 /*******************************************************************************
874 * HW_SDHC_CMDRSP2 - Command Response 2
875 ******************************************************************************/
876
877 /*!
878 * @brief HW_SDHC_CMDRSP2 - Command Response 2 (RO)
879 *
880 * Reset value: 0x00000000U
881 *
882 * This register is used to store part 2 of the response bits from the card.
883 */
884 typedef union _hw_sdhc_cmdrsp2
885 {
886 uint32_t U;
887 struct _hw_sdhc_cmdrsp2_bitfields
888 {
889 uint32_t CMDRSP2 : 32; /*!< [31:0] Command Response 2 */
890 } B;
891 } hw_sdhc_cmdrsp2_t;
892
893 /*!
894 * @name Constants and macros for entire SDHC_CMDRSP2 register
895 */
896 /*@{*/
897 #define HW_SDHC_CMDRSP2_ADDR(x) ((x) + 0x18U)
898
899 #define HW_SDHC_CMDRSP2(x) (*(__I hw_sdhc_cmdrsp2_t *) HW_SDHC_CMDRSP2_ADDR(x))
900 #define HW_SDHC_CMDRSP2_RD(x) (HW_SDHC_CMDRSP2(x).U)
901 /*@}*/
902
903 /*
904 * Constants & macros for individual SDHC_CMDRSP2 bitfields
905 */
906
907 /*!
908 * @name Register SDHC_CMDRSP2, field CMDRSP2[31:0] (RO)
909 */
910 /*@{*/
911 #define BP_SDHC_CMDRSP2_CMDRSP2 (0U) /*!< Bit position for SDHC_CMDRSP2_CMDRSP2. */
912 #define BM_SDHC_CMDRSP2_CMDRSP2 (0xFFFFFFFFU) /*!< Bit mask for SDHC_CMDRSP2_CMDRSP2. */
913 #define BS_SDHC_CMDRSP2_CMDRSP2 (32U) /*!< Bit field size in bits for SDHC_CMDRSP2_CMDRSP2. */
914
915 /*! @brief Read current value of the SDHC_CMDRSP2_CMDRSP2 field. */
916 #define BR_SDHC_CMDRSP2_CMDRSP2(x) (HW_SDHC_CMDRSP2(x).U)
917 /*@}*/
918
919 /*******************************************************************************
920 * HW_SDHC_CMDRSP3 - Command Response 3
921 ******************************************************************************/
922
923 /*!
924 * @brief HW_SDHC_CMDRSP3 - Command Response 3 (RO)
925 *
926 * Reset value: 0x00000000U
927 *
928 * This register is used to store part 3 of the response bits from the card. The
929 * following table describes the mapping of command responses from the SD bus to
930 * command response registers for each response type. In the table, R[ ] refers
931 * to a bit range within the response data as transmitted on the SD bus. Response
932 * bit definition for each response type Response type Meaning of response
933 * Response field Response register R1,R1b (normal response) Card status R[39:8]
934 * CMDRSP0 R1b (Auto CMD12 response) Card status for auto CMD12 R[39:8] CMDRSP3 R2
935 * (CID, CSD register) CID/CSD register [127:8] R[127:8] {CMDRSP3[23:0], CMDRSP2,
936 * CMDRSP1, CMDRSP0} R3 (OCR register) OCR register for memory R[39:8] CMDRSP0 R4
937 * (OCR register) OCR register for I/O etc. R[39:8] CMDRSP0 R5, R5b SDIO response
938 * R[39:8] CMDRSP0 R6 (Publish RCA) New published RCA[31:16] and card
939 * status[15:0] R[39:9] CMDRSP0 This table shows that most responses with a length of 48
940 * (R[47:0]) have 32-bit of the response data (R[39:8]) stored in the CMDRSP0
941 * register. Responses of type R1b (auto CMD12 responses) have response data bits
942 * (R[39:8]) stored in the CMDRSP3 register. Responses with length 136 (R[135:0]) have
943 * 120-bit of the response data (R[127:8]) stored in the CMDRSP0, 1, 2, and 3
944 * registers. To be able to read the response status efficiently, the SDHC stores
945 * only a part of the response data in the command response registers. This
946 * enables the host driver to efficiently read 32-bit of response data in one read
947 * cycle on a 32-bit bus system. Parts of the response, the index field and the CRC,
948 * are checked by the SDHC, as specified by XFERTYP[CICEN] and XFERTYP[CCCEN],
949 * and generate an error interrupt if any error is detected. The bit range for the
950 * CRC check depends on the response length. If the response length is 48, the
951 * SDHC will check R[47:1], and if the response length is 136 the SDHC will check
952 * R[119:1]. Because the SDHC may have a multiple block data transfer executing
953 * concurrently with a CMD_wo_DAT command, the SDHC stores the auto CMD12 response
954 * in the CMDRSP3 register. The CMD_wo_DAT response is stored in CMDRSP0. This
955 * allows the SDHC to avoid overwriting the Auto CMD12 response with the CMD_wo_DAT
956 * and vice versa. When the SDHC modifies part of the command response
957 * registers, as shown in the table above, it preserves the unmodified bits.
958 */
959 typedef union _hw_sdhc_cmdrsp3
960 {
961 uint32_t U;
962 struct _hw_sdhc_cmdrsp3_bitfields
963 {
964 uint32_t CMDRSP3 : 32; /*!< [31:0] Command Response 3 */
965 } B;
966 } hw_sdhc_cmdrsp3_t;
967
968 /*!
969 * @name Constants and macros for entire SDHC_CMDRSP3 register
970 */
971 /*@{*/
972 #define HW_SDHC_CMDRSP3_ADDR(x) ((x) + 0x1CU)
973
974 #define HW_SDHC_CMDRSP3(x) (*(__I hw_sdhc_cmdrsp3_t *) HW_SDHC_CMDRSP3_ADDR(x))
975 #define HW_SDHC_CMDRSP3_RD(x) (HW_SDHC_CMDRSP3(x).U)
976 /*@}*/
977
978 /*
979 * Constants & macros for individual SDHC_CMDRSP3 bitfields
980 */
981
982 /*!
983 * @name Register SDHC_CMDRSP3, field CMDRSP3[31:0] (RO)
984 */
985 /*@{*/
986 #define BP_SDHC_CMDRSP3_CMDRSP3 (0U) /*!< Bit position for SDHC_CMDRSP3_CMDRSP3. */
987 #define BM_SDHC_CMDRSP3_CMDRSP3 (0xFFFFFFFFU) /*!< Bit mask for SDHC_CMDRSP3_CMDRSP3. */
988 #define BS_SDHC_CMDRSP3_CMDRSP3 (32U) /*!< Bit field size in bits for SDHC_CMDRSP3_CMDRSP3. */
989
990 /*! @brief Read current value of the SDHC_CMDRSP3_CMDRSP3 field. */
991 #define BR_SDHC_CMDRSP3_CMDRSP3(x) (HW_SDHC_CMDRSP3(x).U)
992 /*@}*/
993
994 /*******************************************************************************
995 * HW_SDHC_DATPORT - Buffer Data Port register
996 ******************************************************************************/
997
998 /*!
999 * @brief HW_SDHC_DATPORT - Buffer Data Port register (RW)
1000 *
1001 * Reset value: 0x00000000U
1002 *
1003 * This is a 32-bit data port register used to access the internal buffer and it
1004 * cannot be updated in Idle mode.
1005 */
1006 typedef union _hw_sdhc_datport
1007 {
1008 uint32_t U;
1009 struct _hw_sdhc_datport_bitfields
1010 {
1011 uint32_t DATCONT : 32; /*!< [31:0] Data Content */
1012 } B;
1013 } hw_sdhc_datport_t;
1014
1015 /*!
1016 * @name Constants and macros for entire SDHC_DATPORT register
1017 */
1018 /*@{*/
1019 #define HW_SDHC_DATPORT_ADDR(x) ((x) + 0x20U)
1020
1021 #define HW_SDHC_DATPORT(x) (*(__IO hw_sdhc_datport_t *) HW_SDHC_DATPORT_ADDR(x))
1022 #define HW_SDHC_DATPORT_RD(x) (HW_SDHC_DATPORT(x).U)
1023 #define HW_SDHC_DATPORT_WR(x, v) (HW_SDHC_DATPORT(x).U = (v))
1024 #define HW_SDHC_DATPORT_SET(x, v) (HW_SDHC_DATPORT_WR(x, HW_SDHC_DATPORT_RD(x) | (v)))
1025 #define HW_SDHC_DATPORT_CLR(x, v) (HW_SDHC_DATPORT_WR(x, HW_SDHC_DATPORT_RD(x) & ~(v)))
1026 #define HW_SDHC_DATPORT_TOG(x, v) (HW_SDHC_DATPORT_WR(x, HW_SDHC_DATPORT_RD(x) ^ (v)))
1027 /*@}*/
1028
1029 /*
1030 * Constants & macros for individual SDHC_DATPORT bitfields
1031 */
1032
1033 /*!
1034 * @name Register SDHC_DATPORT, field DATCONT[31:0] (RW)
1035 *
1036 * The Buffer Data Port register is for 32-bit data access by the CPU or the
1037 * external DMA. When the internal DMA is enabled, any write to this register is
1038 * ignored, and any read from this register will always yield 0s.
1039 */
1040 /*@{*/
1041 #define BP_SDHC_DATPORT_DATCONT (0U) /*!< Bit position for SDHC_DATPORT_DATCONT. */
1042 #define BM_SDHC_DATPORT_DATCONT (0xFFFFFFFFU) /*!< Bit mask for SDHC_DATPORT_DATCONT. */
1043 #define BS_SDHC_DATPORT_DATCONT (32U) /*!< Bit field size in bits for SDHC_DATPORT_DATCONT. */
1044
1045 /*! @brief Read current value of the SDHC_DATPORT_DATCONT field. */
1046 #define BR_SDHC_DATPORT_DATCONT(x) (HW_SDHC_DATPORT(x).U)
1047
1048 /*! @brief Format value for bitfield SDHC_DATPORT_DATCONT. */
1049 #define BF_SDHC_DATPORT_DATCONT(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_DATPORT_DATCONT) & BM_SDHC_DATPORT_DATCONT)
1050
1051 /*! @brief Set the DATCONT field to a new value. */
1052 #define BW_SDHC_DATPORT_DATCONT(x, v) (HW_SDHC_DATPORT_WR(x, v))
1053 /*@}*/
1054
1055 /*******************************************************************************
1056 * HW_SDHC_PRSSTAT - Present State register
1057 ******************************************************************************/
1058
1059 /*!
1060 * @brief HW_SDHC_PRSSTAT - Present State register (RO)
1061 *
1062 * Reset value: 0x00000000U
1063 *
1064 * The host driver can get status of the SDHC from this 32-bit read-only
1065 * register. The host driver can issue CMD0, CMD12, CMD13 (for memory) and CMD52 (for
1066 * SDIO) when the DAT lines are busy during a data transfer. These commands can be
1067 * issued when Command Inhibit (CIHB) is set to zero. Other commands shall be
1068 * issued when Command Inhibit (CDIHB) is set to zero. Possible changes to the SD
1069 * Physical Specification may add other commands to this list in the future.
1070 */
1071 typedef union _hw_sdhc_prsstat
1072 {
1073 uint32_t U;
1074 struct _hw_sdhc_prsstat_bitfields
1075 {
1076 uint32_t CIHB : 1; /*!< [0] Command Inhibit (CMD) */
1077 uint32_t CDIHB : 1; /*!< [1] Command Inhibit (DAT) */
1078 uint32_t DLA : 1; /*!< [2] Data Line Active */
1079 uint32_t SDSTB : 1; /*!< [3] SD Clock Stable */
1080 uint32_t IPGOFF : 1; /*!< [4] Bus Clock Gated Off Internally */
1081 uint32_t HCKOFF : 1; /*!< [5] System Clock Gated Off Internally */
1082 uint32_t PEROFF : 1; /*!< [6] SDHC clock Gated Off Internally */
1083 uint32_t SDOFF : 1; /*!< [7] SD Clock Gated Off Internally */
1084 uint32_t WTA : 1; /*!< [8] Write Transfer Active */
1085 uint32_t RTA : 1; /*!< [9] Read Transfer Active */
1086 uint32_t BWEN : 1; /*!< [10] Buffer Write Enable */
1087 uint32_t BREN : 1; /*!< [11] Buffer Read Enable */
1088 uint32_t RESERVED0 : 4; /*!< [15:12] */
1089 uint32_t CINS : 1; /*!< [16] Card Inserted */
1090 uint32_t RESERVED1 : 6; /*!< [22:17] */
1091 uint32_t CLSL : 1; /*!< [23] CMD Line Signal Level */
1092 uint32_t DLSL : 8; /*!< [31:24] DAT Line Signal Level */
1093 } B;
1094 } hw_sdhc_prsstat_t;
1095
1096 /*!
1097 * @name Constants and macros for entire SDHC_PRSSTAT register
1098 */
1099 /*@{*/
1100 #define HW_SDHC_PRSSTAT_ADDR(x) ((x) + 0x24U)
1101
1102 #define HW_SDHC_PRSSTAT(x) (*(__I hw_sdhc_prsstat_t *) HW_SDHC_PRSSTAT_ADDR(x))
1103 #define HW_SDHC_PRSSTAT_RD(x) (HW_SDHC_PRSSTAT(x).U)
1104 /*@}*/
1105
1106 /*
1107 * Constants & macros for individual SDHC_PRSSTAT bitfields
1108 */
1109
1110 /*!
1111 * @name Register SDHC_PRSSTAT, field CIHB[0] (RO)
1112 *
1113 * If this status bit is 0, it indicates that the CMD line is not in use and the
1114 * SDHC can issue a SD/MMC Command using the CMD line. This bit is set also
1115 * immediately after the Transfer Type register is written. This bit is cleared when
1116 * the command response is received. Even if the CDIHB bit is set to 1, Commands
1117 * using only the CMD line can be issued if this bit is 0. Changing from 1 to 0
1118 * generates a command complete interrupt in the interrupt status register. If the
1119 * SDHC cannot issue the command because of a command conflict error (see
1120 * command CRC error) or because of a command not issued by auto CMD12 error, this bit
1121 * will remain 1 and the command complete is not set. The status of issuing an
1122 * auto CMD12 does not show on this bit.
1123 *
1124 * Values:
1125 * - 0 - Can issue command using only CMD line.
1126 * - 1 - Cannot issue command.
1127 */
1128 /*@{*/
1129 #define BP_SDHC_PRSSTAT_CIHB (0U) /*!< Bit position for SDHC_PRSSTAT_CIHB. */
1130 #define BM_SDHC_PRSSTAT_CIHB (0x00000001U) /*!< Bit mask for SDHC_PRSSTAT_CIHB. */
1131 #define BS_SDHC_PRSSTAT_CIHB (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_CIHB. */
1132
1133 /*! @brief Read current value of the SDHC_PRSSTAT_CIHB field. */
1134 #define BR_SDHC_PRSSTAT_CIHB(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_CIHB))
1135 /*@}*/
1136
1137 /*!
1138 * @name Register SDHC_PRSSTAT, field CDIHB[1] (RO)
1139 *
1140 * This status bit is generated if either the DLA or the RTA is set to 1. If
1141 * this bit is 0, it indicates that the SDHC can issue the next SD/MMC Command.
1142 * Commands with a busy signal belong to CDIHB, for example, R1b, R5b type. Except in
1143 * the case when the command busy is finished, changing from 1 to 0 generates a
1144 * transfer complete interrupt in the Interrupt Status register. The SD host
1145 * driver can save registers for a suspend transaction after this bit has changed
1146 * from 1 to 0.
1147 *
1148 * Values:
1149 * - 0 - Can issue command which uses the DAT line.
1150 * - 1 - Cannot issue command which uses the DAT line.
1151 */
1152 /*@{*/
1153 #define BP_SDHC_PRSSTAT_CDIHB (1U) /*!< Bit position for SDHC_PRSSTAT_CDIHB. */
1154 #define BM_SDHC_PRSSTAT_CDIHB (0x00000002U) /*!< Bit mask for SDHC_PRSSTAT_CDIHB. */
1155 #define BS_SDHC_PRSSTAT_CDIHB (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_CDIHB. */
1156
1157 /*! @brief Read current value of the SDHC_PRSSTAT_CDIHB field. */
1158 #define BR_SDHC_PRSSTAT_CDIHB(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_CDIHB))
1159 /*@}*/
1160
1161 /*!
1162 * @name Register SDHC_PRSSTAT, field DLA[2] (RO)
1163 *
1164 * Indicates whether one of the DAT lines on the SD bus is in use. In the case
1165 * of read transactions: This status indicates whether a read transfer is
1166 * executing on the SD bus. Changes in this value from 1 to 0, between data blocks,
1167 * generates a block gap event interrupt in the Interrupt Status register. This bit
1168 * will be set in either of the following cases: After the end bit of the read
1169 * command. When writing a 1 to PROCTL[CREQ] to restart a read transfer. This bit
1170 * will be cleared in either of the following cases: When the end bit of the last
1171 * data block is sent from the SD bus to the SDHC. When the read wait state is
1172 * stopped by a suspend command and the DAT2 line is released. The SDHC will wait at
1173 * the next block gap by driving read wait at the start of the interrupt cycle.
1174 * If the read wait signal is already driven (data buffer cannot receive data),
1175 * the SDHC can wait for a current block gap by continuing to drive the read wait
1176 * signal. It is necessary to support read wait to use the suspend / resume
1177 * function. This bit will remain 1 during read wait. In the case of write
1178 * transactions: This status indicates that a write transfer is executing on the SD bus.
1179 * Changes in this value from 1 to 0 generate a transfer complete interrupt in the
1180 * interrupt status register. This bit will be set in either of the following
1181 * cases: After the end bit of the write command. When writing to 1 to PROCTL[CREQ] to
1182 * continue a write transfer. This bit will be cleared in either of the
1183 * following cases: When the SD card releases write busy of the last data block, the SDHC
1184 * will also detect if the output is not busy. If the SD card does not drive the
1185 * busy signal after the CRC status is received, the SDHC shall assume the card
1186 * drive "Not busy". When the SD card releases write busy, prior to waiting for
1187 * write transfer, and as a result of a stop at block gap request. In the case of
1188 * command with busy pending: This status indicates that a busy state follows the
1189 * command and the data line is in use. This bit will be cleared when the DAT0
1190 * line is released.
1191 *
1192 * Values:
1193 * - 0 - DAT line inactive.
1194 * - 1 - DAT line active.
1195 */
1196 /*@{*/
1197 #define BP_SDHC_PRSSTAT_DLA (2U) /*!< Bit position for SDHC_PRSSTAT_DLA. */
1198 #define BM_SDHC_PRSSTAT_DLA (0x00000004U) /*!< Bit mask for SDHC_PRSSTAT_DLA. */
1199 #define BS_SDHC_PRSSTAT_DLA (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_DLA. */
1200
1201 /*! @brief Read current value of the SDHC_PRSSTAT_DLA field. */
1202 #define BR_SDHC_PRSSTAT_DLA(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_DLA))
1203 /*@}*/
1204
1205 /*!
1206 * @name Register SDHC_PRSSTAT, field SDSTB[3] (RO)
1207 *
1208 * Indicates that the internal card clock is stable. This bit is for the host
1209 * driver to poll clock status when changing the clock frequency. It is recommended
1210 * to clear SYSCTL[SDCLKEN] to remove glitch on the card clock when the
1211 * frequency is changing.
1212 *
1213 * Values:
1214 * - 0 - Clock is changing frequency and not stable.
1215 * - 1 - Clock is stable.
1216 */
1217 /*@{*/
1218 #define BP_SDHC_PRSSTAT_SDSTB (3U) /*!< Bit position for SDHC_PRSSTAT_SDSTB. */
1219 #define BM_SDHC_PRSSTAT_SDSTB (0x00000008U) /*!< Bit mask for SDHC_PRSSTAT_SDSTB. */
1220 #define BS_SDHC_PRSSTAT_SDSTB (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_SDSTB. */
1221
1222 /*! @brief Read current value of the SDHC_PRSSTAT_SDSTB field. */
1223 #define BR_SDHC_PRSSTAT_SDSTB(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_SDSTB))
1224 /*@}*/
1225
1226 /*!
1227 * @name Register SDHC_PRSSTAT, field IPGOFF[4] (RO)
1228 *
1229 * Indicates that the bus clock is internally gated off. This bit is for the
1230 * host driver to debug.
1231 *
1232 * Values:
1233 * - 0 - Bus clock is active.
1234 * - 1 - Bus clock is gated off.
1235 */
1236 /*@{*/
1237 #define BP_SDHC_PRSSTAT_IPGOFF (4U) /*!< Bit position for SDHC_PRSSTAT_IPGOFF. */
1238 #define BM_SDHC_PRSSTAT_IPGOFF (0x00000010U) /*!< Bit mask for SDHC_PRSSTAT_IPGOFF. */
1239 #define BS_SDHC_PRSSTAT_IPGOFF (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_IPGOFF. */
1240
1241 /*! @brief Read current value of the SDHC_PRSSTAT_IPGOFF field. */
1242 #define BR_SDHC_PRSSTAT_IPGOFF(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_IPGOFF))
1243 /*@}*/
1244
1245 /*!
1246 * @name Register SDHC_PRSSTAT, field HCKOFF[5] (RO)
1247 *
1248 * Indicates that the system clock is internally gated off. This bit is for the
1249 * host driver to debug during a data transfer.
1250 *
1251 * Values:
1252 * - 0 - System clock is active.
1253 * - 1 - System clock is gated off.
1254 */
1255 /*@{*/
1256 #define BP_SDHC_PRSSTAT_HCKOFF (5U) /*!< Bit position for SDHC_PRSSTAT_HCKOFF. */
1257 #define BM_SDHC_PRSSTAT_HCKOFF (0x00000020U) /*!< Bit mask for SDHC_PRSSTAT_HCKOFF. */
1258 #define BS_SDHC_PRSSTAT_HCKOFF (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_HCKOFF. */
1259
1260 /*! @brief Read current value of the SDHC_PRSSTAT_HCKOFF field. */
1261 #define BR_SDHC_PRSSTAT_HCKOFF(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_HCKOFF))
1262 /*@}*/
1263
1264 /*!
1265 * @name Register SDHC_PRSSTAT, field PEROFF[6] (RO)
1266 *
1267 * Indicates that the is internally gated off. This bit is for the host driver
1268 * to debug transaction on the SD bus. When INITA bit is set, SDHC sending 80
1269 * clock cycles to the card, SDCLKEN must be 1 to enable the output card clock,
1270 * otherwise the will never be gate off, so and will be always active. SDHC clock SDHC
1271 * clock SDHC clock bus clock
1272 *
1273 * Values:
1274 * - 0 - SDHC clock is active.
1275 * - 1 - SDHC clock is gated off.
1276 */
1277 /*@{*/
1278 #define BP_SDHC_PRSSTAT_PEROFF (6U) /*!< Bit position for SDHC_PRSSTAT_PEROFF. */
1279 #define BM_SDHC_PRSSTAT_PEROFF (0x00000040U) /*!< Bit mask for SDHC_PRSSTAT_PEROFF. */
1280 #define BS_SDHC_PRSSTAT_PEROFF (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_PEROFF. */
1281
1282 /*! @brief Read current value of the SDHC_PRSSTAT_PEROFF field. */
1283 #define BR_SDHC_PRSSTAT_PEROFF(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_PEROFF))
1284 /*@}*/
1285
1286 /*!
1287 * @name Register SDHC_PRSSTAT, field SDOFF[7] (RO)
1288 *
1289 * Indicates that the SD clock is internally gated off, because of buffer
1290 * over/under-run or read pause without read wait assertion, or the driver has cleared
1291 * SYSCTL[SDCLKEN] to stop the SD clock. This bit is for the host driver to debug
1292 * data transaction on the SD bus.
1293 *
1294 * Values:
1295 * - 0 - SD clock is active.
1296 * - 1 - SD clock is gated off.
1297 */
1298 /*@{*/
1299 #define BP_SDHC_PRSSTAT_SDOFF (7U) /*!< Bit position for SDHC_PRSSTAT_SDOFF. */
1300 #define BM_SDHC_PRSSTAT_SDOFF (0x00000080U) /*!< Bit mask for SDHC_PRSSTAT_SDOFF. */
1301 #define BS_SDHC_PRSSTAT_SDOFF (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_SDOFF. */
1302
1303 /*! @brief Read current value of the SDHC_PRSSTAT_SDOFF field. */
1304 #define BR_SDHC_PRSSTAT_SDOFF(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_SDOFF))
1305 /*@}*/
1306
1307 /*!
1308 * @name Register SDHC_PRSSTAT, field WTA[8] (RO)
1309 *
1310 * Indicates that a write transfer is active. If this bit is 0, it means no
1311 * valid write data exists in the SDHC. This bit is set in either of the following
1312 * cases: After the end bit of the write command. When writing 1 to PROCTL[CREQ] to
1313 * restart a write transfer. This bit is cleared in either of the following
1314 * cases: After getting the CRC status of the last data block as specified by the
1315 * transfer count (single and multiple). After getting the CRC status of any block
1316 * where data transmission is about to be stopped by a stop at block gap request.
1317 * During a write transaction, a block gap event interrupt is generated when this
1318 * bit is changed to 0, as result of the stop at block gap request being set.
1319 * This status is useful for the host driver in determining when to issue commands
1320 * during write busy state.
1321 *
1322 * Values:
1323 * - 0 - No valid data.
1324 * - 1 - Transferring data.
1325 */
1326 /*@{*/
1327 #define BP_SDHC_PRSSTAT_WTA (8U) /*!< Bit position for SDHC_PRSSTAT_WTA. */
1328 #define BM_SDHC_PRSSTAT_WTA (0x00000100U) /*!< Bit mask for SDHC_PRSSTAT_WTA. */
1329 #define BS_SDHC_PRSSTAT_WTA (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_WTA. */
1330
1331 /*! @brief Read current value of the SDHC_PRSSTAT_WTA field. */
1332 #define BR_SDHC_PRSSTAT_WTA(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_WTA))
1333 /*@}*/
1334
1335 /*!
1336 * @name Register SDHC_PRSSTAT, field RTA[9] (RO)
1337 *
1338 * Used for detecting completion of a read transfer. This bit is set for either
1339 * of the following conditions: After the end bit of the read command. When
1340 * writing a 1 to PROCTL[CREQ] to restart a read transfer. A transfer complete
1341 * interrupt is generated when this bit changes to 0. This bit is cleared for either of
1342 * the following conditions: When the last data block as specified by block
1343 * length is transferred to the system, that is, all data are read away from SDHC
1344 * internal buffer. When all valid data blocks have been transferred from SDHC
1345 * internal buffer to the system and no current block transfers are being sent as a
1346 * result of the stop at block gap request being set to 1.
1347 *
1348 * Values:
1349 * - 0 - No valid data.
1350 * - 1 - Transferring data.
1351 */
1352 /*@{*/
1353 #define BP_SDHC_PRSSTAT_RTA (9U) /*!< Bit position for SDHC_PRSSTAT_RTA. */
1354 #define BM_SDHC_PRSSTAT_RTA (0x00000200U) /*!< Bit mask for SDHC_PRSSTAT_RTA. */
1355 #define BS_SDHC_PRSSTAT_RTA (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_RTA. */
1356
1357 /*! @brief Read current value of the SDHC_PRSSTAT_RTA field. */
1358 #define BR_SDHC_PRSSTAT_RTA(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_RTA))
1359 /*@}*/
1360
1361 /*!
1362 * @name Register SDHC_PRSSTAT, field BWEN[10] (RO)
1363 *
1364 * Used for non-DMA write transfers. The SDHC can implement multiple buffers to
1365 * transfer data efficiently. This read-only flag indicates whether space is
1366 * available for write data. If this bit is 1, valid data greater than the watermark
1367 * level can be written to the buffer. This read-only flag indicates whether
1368 * space is available for write data.
1369 *
1370 * Values:
1371 * - 0 - Write disable, the buffer can hold valid data less than the write
1372 * watermark level.
1373 * - 1 - Write enable, the buffer can hold valid data greater than the write
1374 * watermark level.
1375 */
1376 /*@{*/
1377 #define BP_SDHC_PRSSTAT_BWEN (10U) /*!< Bit position for SDHC_PRSSTAT_BWEN. */
1378 #define BM_SDHC_PRSSTAT_BWEN (0x00000400U) /*!< Bit mask for SDHC_PRSSTAT_BWEN. */
1379 #define BS_SDHC_PRSSTAT_BWEN (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_BWEN. */
1380
1381 /*! @brief Read current value of the SDHC_PRSSTAT_BWEN field. */
1382 #define BR_SDHC_PRSSTAT_BWEN(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_BWEN))
1383 /*@}*/
1384
1385 /*!
1386 * @name Register SDHC_PRSSTAT, field BREN[11] (RO)
1387 *
1388 * Used for non-DMA read transfers. The SDHC may implement multiple buffers to
1389 * transfer data efficiently. This read-only flag indicates that valid data exists
1390 * in the host side buffer. If this bit is high, valid data greater than the
1391 * watermark level exist in the buffer. This read-only flag indicates that valid
1392 * data exists in the host side buffer.
1393 *
1394 * Values:
1395 * - 0 - Read disable, valid data less than the watermark level exist in the
1396 * buffer.
1397 * - 1 - Read enable, valid data greater than the watermark level exist in the
1398 * buffer.
1399 */
1400 /*@{*/
1401 #define BP_SDHC_PRSSTAT_BREN (11U) /*!< Bit position for SDHC_PRSSTAT_BREN. */
1402 #define BM_SDHC_PRSSTAT_BREN (0x00000800U) /*!< Bit mask for SDHC_PRSSTAT_BREN. */
1403 #define BS_SDHC_PRSSTAT_BREN (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_BREN. */
1404
1405 /*! @brief Read current value of the SDHC_PRSSTAT_BREN field. */
1406 #define BR_SDHC_PRSSTAT_BREN(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_BREN))
1407 /*@}*/
1408
1409 /*!
1410 * @name Register SDHC_PRSSTAT, field CINS[16] (RO)
1411 *
1412 * Indicates whether a card has been inserted. The SDHC debounces this signal so
1413 * that the host driver will not need to wait for it to stabilize. Changing from
1414 * a 0 to 1 generates a card insertion interrupt in the Interrupt Status
1415 * register. Changing from a 1 to 0 generates a card removal interrupt in the Interrupt
1416 * Status register. A write to the force event register does not effect this bit.
1417 * SYSCTL[RSTA] does not effect this bit. A software reset does not effect this
1418 * bit.
1419 *
1420 * Values:
1421 * - 0 - Power on reset or no card.
1422 * - 1 - Card inserted.
1423 */
1424 /*@{*/
1425 #define BP_SDHC_PRSSTAT_CINS (16U) /*!< Bit position for SDHC_PRSSTAT_CINS. */
1426 #define BM_SDHC_PRSSTAT_CINS (0x00010000U) /*!< Bit mask for SDHC_PRSSTAT_CINS. */
1427 #define BS_SDHC_PRSSTAT_CINS (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_CINS. */
1428
1429 /*! @brief Read current value of the SDHC_PRSSTAT_CINS field. */
1430 #define BR_SDHC_PRSSTAT_CINS(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_CINS))
1431 /*@}*/
1432
1433 /*!
1434 * @name Register SDHC_PRSSTAT, field CLSL[23] (RO)
1435 *
1436 * Used to check the CMD line level to recover from errors, and for debugging.
1437 * The reset value is effected by the external pullup/pulldown resistor, by
1438 * default, the read value of this bit after reset is 1b, when the command line is
1439 * pulled up.
1440 */
1441 /*@{*/
1442 #define BP_SDHC_PRSSTAT_CLSL (23U) /*!< Bit position for SDHC_PRSSTAT_CLSL. */
1443 #define BM_SDHC_PRSSTAT_CLSL (0x00800000U) /*!< Bit mask for SDHC_PRSSTAT_CLSL. */
1444 #define BS_SDHC_PRSSTAT_CLSL (1U) /*!< Bit field size in bits for SDHC_PRSSTAT_CLSL. */
1445
1446 /*! @brief Read current value of the SDHC_PRSSTAT_CLSL field. */
1447 #define BR_SDHC_PRSSTAT_CLSL(x) (BITBAND_ACCESS32(HW_SDHC_PRSSTAT_ADDR(x), BP_SDHC_PRSSTAT_CLSL))
1448 /*@}*/
1449
1450 /*!
1451 * @name Register SDHC_PRSSTAT, field DLSL[31:24] (RO)
1452 *
1453 * Used to check the DAT line level to recover from errors, and for debugging.
1454 * This is especially useful in detecting the busy signal level from DAT[0]. The
1455 * reset value is effected by the external pullup/pulldown resistors. By default,
1456 * the read value of this field after reset is 8'b11110111, when DAT[3] is pulled
1457 * down and the other lines are pulled up.
1458 */
1459 /*@{*/
1460 #define BP_SDHC_PRSSTAT_DLSL (24U) /*!< Bit position for SDHC_PRSSTAT_DLSL. */
1461 #define BM_SDHC_PRSSTAT_DLSL (0xFF000000U) /*!< Bit mask for SDHC_PRSSTAT_DLSL. */
1462 #define BS_SDHC_PRSSTAT_DLSL (8U) /*!< Bit field size in bits for SDHC_PRSSTAT_DLSL. */
1463
1464 /*! @brief Read current value of the SDHC_PRSSTAT_DLSL field. */
1465 #define BR_SDHC_PRSSTAT_DLSL(x) (HW_SDHC_PRSSTAT(x).B.DLSL)
1466 /*@}*/
1467
1468 /*******************************************************************************
1469 * HW_SDHC_PROCTL - Protocol Control register
1470 ******************************************************************************/
1471
1472 /*!
1473 * @brief HW_SDHC_PROCTL - Protocol Control register (RW)
1474 *
1475 * Reset value: 0x00000020U
1476 *
1477 * There are three cases to restart the transfer after stop at the block gap.
1478 * Which case is appropriate depends on whether the SDHC issues a suspend command
1479 * or the SD card accepts the suspend command: If the host driver does not issue a
1480 * suspend command, the continue request shall be used to restart the transfer.
1481 * If the host driver issues a suspend command and the SD card accepts it, a
1482 * resume command shall be used to restart the transfer. If the host driver issues a
1483 * suspend command and the SD card does not accept it, the continue request shall
1484 * be used to restart the transfer. Any time stop at block gap request stops the
1485 * data transfer, the host driver shall wait for a transfer complete (in the
1486 * interrupt status register), before attempting to restart the transfer. When
1487 * restarting the data transfer by continue request, the host driver shall clear the
1488 * stop at block gap request before or simultaneously.
1489 */
1490 typedef union _hw_sdhc_proctl
1491 {
1492 uint32_t U;
1493 struct _hw_sdhc_proctl_bitfields
1494 {
1495 uint32_t LCTL : 1; /*!< [0] LED Control */
1496 uint32_t DTW : 2; /*!< [2:1] Data Transfer Width */
1497 uint32_t D3CD : 1; /*!< [3] DAT3 As Card Detection Pin */
1498 uint32_t EMODE : 2; /*!< [5:4] Endian Mode */
1499 uint32_t CDTL : 1; /*!< [6] Card Detect Test Level */
1500 uint32_t CDSS : 1; /*!< [7] Card Detect Signal Selection */
1501 uint32_t DMAS : 2; /*!< [9:8] DMA Select */
1502 uint32_t RESERVED0 : 6; /*!< [15:10] */
1503 uint32_t SABGREQ : 1; /*!< [16] Stop At Block Gap Request */
1504 uint32_t CREQ : 1; /*!< [17] Continue Request */
1505 uint32_t RWCTL : 1; /*!< [18] Read Wait Control */
1506 uint32_t IABG : 1; /*!< [19] Interrupt At Block Gap */
1507 uint32_t RESERVED1 : 4; /*!< [23:20] */
1508 uint32_t WECINT : 1; /*!< [24] Wakeup Event Enable On Card Interrupt
1509 * */
1510 uint32_t WECINS : 1; /*!< [25] Wakeup Event Enable On SD Card
1511 * Insertion */
1512 uint32_t WECRM : 1; /*!< [26] Wakeup Event Enable On SD Card Removal
1513 * */
1514 uint32_t RESERVED2 : 5; /*!< [31:27] */
1515 } B;
1516 } hw_sdhc_proctl_t;
1517
1518 /*!
1519 * @name Constants and macros for entire SDHC_PROCTL register
1520 */
1521 /*@{*/
1522 #define HW_SDHC_PROCTL_ADDR(x) ((x) + 0x28U)
1523
1524 #define HW_SDHC_PROCTL(x) (*(__IO hw_sdhc_proctl_t *) HW_SDHC_PROCTL_ADDR(x))
1525 #define HW_SDHC_PROCTL_RD(x) (HW_SDHC_PROCTL(x).U)
1526 #define HW_SDHC_PROCTL_WR(x, v) (HW_SDHC_PROCTL(x).U = (v))
1527 #define HW_SDHC_PROCTL_SET(x, v) (HW_SDHC_PROCTL_WR(x, HW_SDHC_PROCTL_RD(x) | (v)))
1528 #define HW_SDHC_PROCTL_CLR(x, v) (HW_SDHC_PROCTL_WR(x, HW_SDHC_PROCTL_RD(x) & ~(v)))
1529 #define HW_SDHC_PROCTL_TOG(x, v) (HW_SDHC_PROCTL_WR(x, HW_SDHC_PROCTL_RD(x) ^ (v)))
1530 /*@}*/
1531
1532 /*
1533 * Constants & macros for individual SDHC_PROCTL bitfields
1534 */
1535
1536 /*!
1537 * @name Register SDHC_PROCTL, field LCTL[0] (RW)
1538 *
1539 * This bit, fully controlled by the host driver, is used to caution the user
1540 * not to remove the card while the card is being accessed. If the software is
1541 * going to issue multiple SD commands, this bit can be set during all these
1542 * transactions. It is not necessary to change for each transaction. When the software
1543 * issues multiple SD commands, setting the bit once before the first command is
1544 * sufficient: it is not necessary to reset the bit between commands.
1545 *
1546 * Values:
1547 * - 0 - LED off.
1548 * - 1 - LED on.
1549 */
1550 /*@{*/
1551 #define BP_SDHC_PROCTL_LCTL (0U) /*!< Bit position for SDHC_PROCTL_LCTL. */
1552 #define BM_SDHC_PROCTL_LCTL (0x00000001U) /*!< Bit mask for SDHC_PROCTL_LCTL. */
1553 #define BS_SDHC_PROCTL_LCTL (1U) /*!< Bit field size in bits for SDHC_PROCTL_LCTL. */
1554
1555 /*! @brief Read current value of the SDHC_PROCTL_LCTL field. */
1556 #define BR_SDHC_PROCTL_LCTL(x) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_LCTL))
1557
1558 /*! @brief Format value for bitfield SDHC_PROCTL_LCTL. */
1559 #define BF_SDHC_PROCTL_LCTL(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_LCTL) & BM_SDHC_PROCTL_LCTL)
1560
1561 /*! @brief Set the LCTL field to a new value. */
1562 #define BW_SDHC_PROCTL_LCTL(x, v) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_LCTL) = (v))
1563 /*@}*/
1564
1565 /*!
1566 * @name Register SDHC_PROCTL, field DTW[2:1] (RW)
1567 *
1568 * Selects the data width of the SD bus for a data transfer. The host driver
1569 * shall set it to match the data width of the card. Possible data transfer width is
1570 * 1-bit, 4-bits or 8-bits.
1571 *
1572 * Values:
1573 * - 00 - 1-bit mode
1574 * - 01 - 4-bit mode
1575 * - 10 - 8-bit mode
1576 * - 11 - Reserved
1577 */
1578 /*@{*/
1579 #define BP_SDHC_PROCTL_DTW (1U) /*!< Bit position for SDHC_PROCTL_DTW. */
1580 #define BM_SDHC_PROCTL_DTW (0x00000006U) /*!< Bit mask for SDHC_PROCTL_DTW. */
1581 #define BS_SDHC_PROCTL_DTW (2U) /*!< Bit field size in bits for SDHC_PROCTL_DTW. */
1582
1583 /*! @brief Read current value of the SDHC_PROCTL_DTW field. */
1584 #define BR_SDHC_PROCTL_DTW(x) (HW_SDHC_PROCTL(x).B.DTW)
1585
1586 /*! @brief Format value for bitfield SDHC_PROCTL_DTW. */
1587 #define BF_SDHC_PROCTL_DTW(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_DTW) & BM_SDHC_PROCTL_DTW)
1588
1589 /*! @brief Set the DTW field to a new value. */
1590 #define BW_SDHC_PROCTL_DTW(x, v) (HW_SDHC_PROCTL_WR(x, (HW_SDHC_PROCTL_RD(x) & ~BM_SDHC_PROCTL_DTW) | BF_SDHC_PROCTL_DTW(v)))
1591 /*@}*/
1592
1593 /*!
1594 * @name Register SDHC_PROCTL, field D3CD[3] (RW)
1595 *
1596 * If this bit is set, DAT3 should be pulled down to act as a card detection
1597 * pin. Be cautious when using this feature, because DAT3 is also a chip-select for
1598 * the SPI mode. A pulldown on this pin and CMD0 may set the card into the SPI
1599 * mode, which the SDHC does not support. Note: Keep this bit set if SDIO interrupt
1600 * is used.
1601 *
1602 * Values:
1603 * - 0 - DAT3 does not monitor card Insertion.
1604 * - 1 - DAT3 as card detection pin.
1605 */
1606 /*@{*/
1607 #define BP_SDHC_PROCTL_D3CD (3U) /*!< Bit position for SDHC_PROCTL_D3CD. */
1608 #define BM_SDHC_PROCTL_D3CD (0x00000008U) /*!< Bit mask for SDHC_PROCTL_D3CD. */
1609 #define BS_SDHC_PROCTL_D3CD (1U) /*!< Bit field size in bits for SDHC_PROCTL_D3CD. */
1610
1611 /*! @brief Read current value of the SDHC_PROCTL_D3CD field. */
1612 #define BR_SDHC_PROCTL_D3CD(x) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_D3CD))
1613
1614 /*! @brief Format value for bitfield SDHC_PROCTL_D3CD. */
1615 #define BF_SDHC_PROCTL_D3CD(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_D3CD) & BM_SDHC_PROCTL_D3CD)
1616
1617 /*! @brief Set the D3CD field to a new value. */
1618 #define BW_SDHC_PROCTL_D3CD(x, v) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_D3CD) = (v))
1619 /*@}*/
1620
1621 /*!
1622 * @name Register SDHC_PROCTL, field EMODE[5:4] (RW)
1623 *
1624 * The SDHC supports all four endian modes in data transfer.
1625 *
1626 * Values:
1627 * - 00 - Big endian mode
1628 * - 01 - Half word big endian mode
1629 * - 10 - Little endian mode
1630 * - 11 - Reserved
1631 */
1632 /*@{*/
1633 #define BP_SDHC_PROCTL_EMODE (4U) /*!< Bit position for SDHC_PROCTL_EMODE. */
1634 #define BM_SDHC_PROCTL_EMODE (0x00000030U) /*!< Bit mask for SDHC_PROCTL_EMODE. */
1635 #define BS_SDHC_PROCTL_EMODE (2U) /*!< Bit field size in bits for SDHC_PROCTL_EMODE. */
1636
1637 /*! @brief Read current value of the SDHC_PROCTL_EMODE field. */
1638 #define BR_SDHC_PROCTL_EMODE(x) (HW_SDHC_PROCTL(x).B.EMODE)
1639
1640 /*! @brief Format value for bitfield SDHC_PROCTL_EMODE. */
1641 #define BF_SDHC_PROCTL_EMODE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_EMODE) & BM_SDHC_PROCTL_EMODE)
1642
1643 /*! @brief Set the EMODE field to a new value. */
1644 #define BW_SDHC_PROCTL_EMODE(x, v) (HW_SDHC_PROCTL_WR(x, (HW_SDHC_PROCTL_RD(x) & ~BM_SDHC_PROCTL_EMODE) | BF_SDHC_PROCTL_EMODE(v)))
1645 /*@}*/
1646
1647 /*!
1648 * @name Register SDHC_PROCTL, field CDTL[6] (RW)
1649 *
1650 * Enabled while the CDSS is set to 1 and it indicates card insertion.
1651 *
1652 * Values:
1653 * - 0 - Card detect test level is 0, no card inserted.
1654 * - 1 - Card detect test level is 1, card inserted.
1655 */
1656 /*@{*/
1657 #define BP_SDHC_PROCTL_CDTL (6U) /*!< Bit position for SDHC_PROCTL_CDTL. */
1658 #define BM_SDHC_PROCTL_CDTL (0x00000040U) /*!< Bit mask for SDHC_PROCTL_CDTL. */
1659 #define BS_SDHC_PROCTL_CDTL (1U) /*!< Bit field size in bits for SDHC_PROCTL_CDTL. */
1660
1661 /*! @brief Read current value of the SDHC_PROCTL_CDTL field. */
1662 #define BR_SDHC_PROCTL_CDTL(x) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_CDTL))
1663
1664 /*! @brief Format value for bitfield SDHC_PROCTL_CDTL. */
1665 #define BF_SDHC_PROCTL_CDTL(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_CDTL) & BM_SDHC_PROCTL_CDTL)
1666
1667 /*! @brief Set the CDTL field to a new value. */
1668 #define BW_SDHC_PROCTL_CDTL(x, v) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_CDTL) = (v))
1669 /*@}*/
1670
1671 /*!
1672 * @name Register SDHC_PROCTL, field CDSS[7] (RW)
1673 *
1674 * Selects the source for the card detection.
1675 *
1676 * Values:
1677 * - 0 - Card detection level is selected for normal purpose.
1678 * - 1 - Card detection test level is selected for test purpose.
1679 */
1680 /*@{*/
1681 #define BP_SDHC_PROCTL_CDSS (7U) /*!< Bit position for SDHC_PROCTL_CDSS. */
1682 #define BM_SDHC_PROCTL_CDSS (0x00000080U) /*!< Bit mask for SDHC_PROCTL_CDSS. */
1683 #define BS_SDHC_PROCTL_CDSS (1U) /*!< Bit field size in bits for SDHC_PROCTL_CDSS. */
1684
1685 /*! @brief Read current value of the SDHC_PROCTL_CDSS field. */
1686 #define BR_SDHC_PROCTL_CDSS(x) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_CDSS))
1687
1688 /*! @brief Format value for bitfield SDHC_PROCTL_CDSS. */
1689 #define BF_SDHC_PROCTL_CDSS(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_CDSS) & BM_SDHC_PROCTL_CDSS)
1690
1691 /*! @brief Set the CDSS field to a new value. */
1692 #define BW_SDHC_PROCTL_CDSS(x, v) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_CDSS) = (v))
1693 /*@}*/
1694
1695 /*!
1696 * @name Register SDHC_PROCTL, field DMAS[9:8] (RW)
1697 *
1698 * This field is valid while DMA (SDMA or ADMA) is enabled and selects the DMA
1699 * operation.
1700 *
1701 * Values:
1702 * - 00 - No DMA or simple DMA is selected.
1703 * - 01 - ADMA1 is selected.
1704 * - 10 - ADMA2 is selected.
1705 * - 11 - Reserved
1706 */
1707 /*@{*/
1708 #define BP_SDHC_PROCTL_DMAS (8U) /*!< Bit position for SDHC_PROCTL_DMAS. */
1709 #define BM_SDHC_PROCTL_DMAS (0x00000300U) /*!< Bit mask for SDHC_PROCTL_DMAS. */
1710 #define BS_SDHC_PROCTL_DMAS (2U) /*!< Bit field size in bits for SDHC_PROCTL_DMAS. */
1711
1712 /*! @brief Read current value of the SDHC_PROCTL_DMAS field. */
1713 #define BR_SDHC_PROCTL_DMAS(x) (HW_SDHC_PROCTL(x).B.DMAS)
1714
1715 /*! @brief Format value for bitfield SDHC_PROCTL_DMAS. */
1716 #define BF_SDHC_PROCTL_DMAS(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_DMAS) & BM_SDHC_PROCTL_DMAS)
1717
1718 /*! @brief Set the DMAS field to a new value. */
1719 #define BW_SDHC_PROCTL_DMAS(x, v) (HW_SDHC_PROCTL_WR(x, (HW_SDHC_PROCTL_RD(x) & ~BM_SDHC_PROCTL_DMAS) | BF_SDHC_PROCTL_DMAS(v)))
1720 /*@}*/
1721
1722 /*!
1723 * @name Register SDHC_PROCTL, field SABGREQ[16] (RW)
1724 *
1725 * Used to stop executing a transaction at the next block gap for both DMA and
1726 * non-DMA transfers. Until the IRQSTATEN[TCSEN] is set to 1, indicating a
1727 * transfer completion, the host driver shall leave this bit set to 1. Clearing both
1728 * PROCTL[SABGREQ] and PROCTL[CREQ] does not cause the transaction to restart. Read
1729 * Wait is used to stop the read transaction at the block gap. The SDHC will
1730 * honor the PROCTL[SABGREQ] for write transfers, but for read transfers it requires
1731 * that SDIO card support read wait. Therefore, the host driver shall not set
1732 * this bit during read transfers unless the SDIO card supports read wait and has
1733 * set PROCTL[RWCTL] to 1, otherwise the SDHC will stop the SD bus clock to pause
1734 * the read operation during block gap. In the case of write transfers in which
1735 * the host driver writes data to the data port register, the host driver shall set
1736 * this bit after all block data is written. If this bit is set to 1, the host
1737 * driver shall not write data to the Data Port register after a block is sent.
1738 * Once this bit is set, the host driver shall not clear this bit before
1739 * IRQSTATEN[TCSEN] is set, otherwise the SDHC's behavior is undefined. This bit effects
1740 * PRSSTAT[RTA], PRSSTAT[WTA], and PRSSTAT[CDIHB].
1741 *
1742 * Values:
1743 * - 0 - Transfer
1744 * - 1 - Stop
1745 */
1746 /*@{*/
1747 #define BP_SDHC_PROCTL_SABGREQ (16U) /*!< Bit position for SDHC_PROCTL_SABGREQ. */
1748 #define BM_SDHC_PROCTL_SABGREQ (0x00010000U) /*!< Bit mask for SDHC_PROCTL_SABGREQ. */
1749 #define BS_SDHC_PROCTL_SABGREQ (1U) /*!< Bit field size in bits for SDHC_PROCTL_SABGREQ. */
1750
1751 /*! @brief Read current value of the SDHC_PROCTL_SABGREQ field. */
1752 #define BR_SDHC_PROCTL_SABGREQ(x) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_SABGREQ))
1753
1754 /*! @brief Format value for bitfield SDHC_PROCTL_SABGREQ. */
1755 #define BF_SDHC_PROCTL_SABGREQ(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_SABGREQ) & BM_SDHC_PROCTL_SABGREQ)
1756
1757 /*! @brief Set the SABGREQ field to a new value. */
1758 #define BW_SDHC_PROCTL_SABGREQ(x, v) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_SABGREQ) = (v))
1759 /*@}*/
1760
1761 /*!
1762 * @name Register SDHC_PROCTL, field CREQ[17] (RW)
1763 *
1764 * Used to restart a transaction which was stopped using the PROCTL[SABGREQ].
1765 * When a suspend operation is not accepted by the card, it is also by setting this
1766 * bit to restart the paused transfer. To cancel stop at the block gap, set
1767 * PROCTL[SABGREQ] to 0 and set this bit to 1 to restart the transfer. The SDHC
1768 * automatically clears this bit, therefore it is not necessary for the host driver to
1769 * set this bit to 0. If both PROCTL[SABGREQ] and this bit are 1, the continue
1770 * request is ignored.
1771 *
1772 * Values:
1773 * - 0 - No effect.
1774 * - 1 - Restart
1775 */
1776 /*@{*/
1777 #define BP_SDHC_PROCTL_CREQ (17U) /*!< Bit position for SDHC_PROCTL_CREQ. */
1778 #define BM_SDHC_PROCTL_CREQ (0x00020000U) /*!< Bit mask for SDHC_PROCTL_CREQ. */
1779 #define BS_SDHC_PROCTL_CREQ (1U) /*!< Bit field size in bits for SDHC_PROCTL_CREQ. */
1780
1781 /*! @brief Read current value of the SDHC_PROCTL_CREQ field. */
1782 #define BR_SDHC_PROCTL_CREQ(x) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_CREQ))
1783
1784 /*! @brief Format value for bitfield SDHC_PROCTL_CREQ. */
1785 #define BF_SDHC_PROCTL_CREQ(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_CREQ) & BM_SDHC_PROCTL_CREQ)
1786
1787 /*! @brief Set the CREQ field to a new value. */
1788 #define BW_SDHC_PROCTL_CREQ(x, v) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_CREQ) = (v))
1789 /*@}*/
1790
1791 /*!
1792 * @name Register SDHC_PROCTL, field RWCTL[18] (RW)
1793 *
1794 * The read wait function is optional for SDIO cards. If the card supports read
1795 * wait, set this bit to enable use of the read wait protocol to stop read data
1796 * using the DAT[2] line. Otherwise, the SDHC has to stop the SD Clock to hold
1797 * read data, which restricts commands generation. When the host driver detects an
1798 * SDIO card insertion, it shall set this bit according to the CCCR of the card.
1799 * If the card does not support read wait, this bit shall never be set to 1,
1800 * otherwise DAT line conflicts may occur. If this bit is set to 0, stop at block gap
1801 * during read operation is also supported, but the SDHC will stop the SD Clock
1802 * to pause reading operation.
1803 *
1804 * Values:
1805 * - 0 - Disable read wait control, and stop SD clock at block gap when SABGREQ
1806 * is set.
1807 * - 1 - Enable read wait control, and assert read wait without stopping SD
1808 * clock at block gap when SABGREQ bit is set.
1809 */
1810 /*@{*/
1811 #define BP_SDHC_PROCTL_RWCTL (18U) /*!< Bit position for SDHC_PROCTL_RWCTL. */
1812 #define BM_SDHC_PROCTL_RWCTL (0x00040000U) /*!< Bit mask for SDHC_PROCTL_RWCTL. */
1813 #define BS_SDHC_PROCTL_RWCTL (1U) /*!< Bit field size in bits for SDHC_PROCTL_RWCTL. */
1814
1815 /*! @brief Read current value of the SDHC_PROCTL_RWCTL field. */
1816 #define BR_SDHC_PROCTL_RWCTL(x) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_RWCTL))
1817
1818 /*! @brief Format value for bitfield SDHC_PROCTL_RWCTL. */
1819 #define BF_SDHC_PROCTL_RWCTL(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_RWCTL) & BM_SDHC_PROCTL_RWCTL)
1820
1821 /*! @brief Set the RWCTL field to a new value. */
1822 #define BW_SDHC_PROCTL_RWCTL(x, v) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_RWCTL) = (v))
1823 /*@}*/
1824
1825 /*!
1826 * @name Register SDHC_PROCTL, field IABG[19] (RW)
1827 *
1828 * Valid only in 4-bit mode, of the SDIO card, and selects a sample point in the
1829 * interrupt cycle. Setting to 1 enables interrupt detection at the block gap
1830 * for a multiple block transfer. Setting to 0 disables interrupt detection during
1831 * a multiple block transfer. If the SDIO card can't signal an interrupt during a
1832 * multiple block transfer, this bit must be set to 0 to avoid an inadvertent
1833 * interrupt. When the host driver detects an SDIO card insertion, it shall set
1834 * this bit according to the CCCR of the card.
1835 *
1836 * Values:
1837 * - 0 - Disabled
1838 * - 1 - Enabled
1839 */
1840 /*@{*/
1841 #define BP_SDHC_PROCTL_IABG (19U) /*!< Bit position for SDHC_PROCTL_IABG. */
1842 #define BM_SDHC_PROCTL_IABG (0x00080000U) /*!< Bit mask for SDHC_PROCTL_IABG. */
1843 #define BS_SDHC_PROCTL_IABG (1U) /*!< Bit field size in bits for SDHC_PROCTL_IABG. */
1844
1845 /*! @brief Read current value of the SDHC_PROCTL_IABG field. */
1846 #define BR_SDHC_PROCTL_IABG(x) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_IABG))
1847
1848 /*! @brief Format value for bitfield SDHC_PROCTL_IABG. */
1849 #define BF_SDHC_PROCTL_IABG(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_IABG) & BM_SDHC_PROCTL_IABG)
1850
1851 /*! @brief Set the IABG field to a new value. */
1852 #define BW_SDHC_PROCTL_IABG(x, v) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_IABG) = (v))
1853 /*@}*/
1854
1855 /*!
1856 * @name Register SDHC_PROCTL, field WECINT[24] (RW)
1857 *
1858 * Enables a wakeup event, via IRQSTAT[CINT]. This bit can be set to 1 if FN_WUS
1859 * (Wake Up Support) in CIS is set to 1. When this bit is set, the card
1860 * interrupt status and the SDHC interrupt can be asserted without SD_CLK toggling. When
1861 * the wakeup feature is not enabled, the SD_CLK must be active to assert the
1862 * card interrupt status and the SDHC interrupt.
1863 *
1864 * Values:
1865 * - 0 - Disabled
1866 * - 1 - Enabled
1867 */
1868 /*@{*/
1869 #define BP_SDHC_PROCTL_WECINT (24U) /*!< Bit position for SDHC_PROCTL_WECINT. */
1870 #define BM_SDHC_PROCTL_WECINT (0x01000000U) /*!< Bit mask for SDHC_PROCTL_WECINT. */
1871 #define BS_SDHC_PROCTL_WECINT (1U) /*!< Bit field size in bits for SDHC_PROCTL_WECINT. */
1872
1873 /*! @brief Read current value of the SDHC_PROCTL_WECINT field. */
1874 #define BR_SDHC_PROCTL_WECINT(x) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_WECINT))
1875
1876 /*! @brief Format value for bitfield SDHC_PROCTL_WECINT. */
1877 #define BF_SDHC_PROCTL_WECINT(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_WECINT) & BM_SDHC_PROCTL_WECINT)
1878
1879 /*! @brief Set the WECINT field to a new value. */
1880 #define BW_SDHC_PROCTL_WECINT(x, v) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_WECINT) = (v))
1881 /*@}*/
1882
1883 /*!
1884 * @name Register SDHC_PROCTL, field WECINS[25] (RW)
1885 *
1886 * Enables a wakeup event, via IRQSTAT[CINS]. FN_WUS (Wake Up Support) in CIS
1887 * does not effect this bit. When this bit is set, IRQSTATEN[CINSEN] and the SDHC
1888 * interrupt can be asserted without SD_CLK toggling. When the wakeup feature is
1889 * not enabled, the SD_CLK must be active to assert IRQSTATEN[CINSEN] and the SDHC
1890 * interrupt.
1891 *
1892 * Values:
1893 * - 0 - Disabled
1894 * - 1 - Enabled
1895 */
1896 /*@{*/
1897 #define BP_SDHC_PROCTL_WECINS (25U) /*!< Bit position for SDHC_PROCTL_WECINS. */
1898 #define BM_SDHC_PROCTL_WECINS (0x02000000U) /*!< Bit mask for SDHC_PROCTL_WECINS. */
1899 #define BS_SDHC_PROCTL_WECINS (1U) /*!< Bit field size in bits for SDHC_PROCTL_WECINS. */
1900
1901 /*! @brief Read current value of the SDHC_PROCTL_WECINS field. */
1902 #define BR_SDHC_PROCTL_WECINS(x) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_WECINS))
1903
1904 /*! @brief Format value for bitfield SDHC_PROCTL_WECINS. */
1905 #define BF_SDHC_PROCTL_WECINS(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_WECINS) & BM_SDHC_PROCTL_WECINS)
1906
1907 /*! @brief Set the WECINS field to a new value. */
1908 #define BW_SDHC_PROCTL_WECINS(x, v) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_WECINS) = (v))
1909 /*@}*/
1910
1911 /*!
1912 * @name Register SDHC_PROCTL, field WECRM[26] (RW)
1913 *
1914 * Enables a wakeup event, via IRQSTAT[CRM]. FN_WUS (Wake Up Support) in CIS
1915 * does not effect this bit. When this bit is set, IRQSTAT[CRM] and the SDHC
1916 * interrupt can be asserted without SD_CLK toggling. When the wakeup feature is not
1917 * enabled, the SD_CLK must be active to assert IRQSTAT[CRM] and the SDHC interrupt.
1918 *
1919 * Values:
1920 * - 0 - Disabled
1921 * - 1 - Enabled
1922 */
1923 /*@{*/
1924 #define BP_SDHC_PROCTL_WECRM (26U) /*!< Bit position for SDHC_PROCTL_WECRM. */
1925 #define BM_SDHC_PROCTL_WECRM (0x04000000U) /*!< Bit mask for SDHC_PROCTL_WECRM. */
1926 #define BS_SDHC_PROCTL_WECRM (1U) /*!< Bit field size in bits for SDHC_PROCTL_WECRM. */
1927
1928 /*! @brief Read current value of the SDHC_PROCTL_WECRM field. */
1929 #define BR_SDHC_PROCTL_WECRM(x) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_WECRM))
1930
1931 /*! @brief Format value for bitfield SDHC_PROCTL_WECRM. */
1932 #define BF_SDHC_PROCTL_WECRM(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_PROCTL_WECRM) & BM_SDHC_PROCTL_WECRM)
1933
1934 /*! @brief Set the WECRM field to a new value. */
1935 #define BW_SDHC_PROCTL_WECRM(x, v) (BITBAND_ACCESS32(HW_SDHC_PROCTL_ADDR(x), BP_SDHC_PROCTL_WECRM) = (v))
1936 /*@}*/
1937
1938 /*******************************************************************************
1939 * HW_SDHC_SYSCTL - System Control register
1940 ******************************************************************************/
1941
1942 /*!
1943 * @brief HW_SDHC_SYSCTL - System Control register (RW)
1944 *
1945 * Reset value: 0x00008008U
1946 */
1947 typedef union _hw_sdhc_sysctl
1948 {
1949 uint32_t U;
1950 struct _hw_sdhc_sysctl_bitfields
1951 {
1952 uint32_t IPGEN : 1; /*!< [0] IPG Clock Enable */
1953 uint32_t HCKEN : 1; /*!< [1] System Clock Enable */
1954 uint32_t PEREN : 1; /*!< [2] Peripheral Clock Enable */
1955 uint32_t SDCLKEN : 1; /*!< [3] SD Clock Enable */
1956 uint32_t DVS : 4; /*!< [7:4] Divisor */
1957 uint32_t SDCLKFS : 8; /*!< [15:8] SDCLK Frequency Select */
1958 uint32_t DTOCV : 4; /*!< [19:16] Data Timeout Counter Value */
1959 uint32_t RESERVED0 : 4; /*!< [23:20] */
1960 uint32_t RSTA : 1; /*!< [24] Software Reset For ALL */
1961 uint32_t RSTC : 1; /*!< [25] Software Reset For CMD Line */
1962 uint32_t RSTD : 1; /*!< [26] Software Reset For DAT Line */
1963 uint32_t INITA : 1; /*!< [27] Initialization Active */
1964 uint32_t RESERVED1 : 4; /*!< [31:28] */
1965 } B;
1966 } hw_sdhc_sysctl_t;
1967
1968 /*!
1969 * @name Constants and macros for entire SDHC_SYSCTL register
1970 */
1971 /*@{*/
1972 #define HW_SDHC_SYSCTL_ADDR(x) ((x) + 0x2CU)
1973
1974 #define HW_SDHC_SYSCTL(x) (*(__IO hw_sdhc_sysctl_t *) HW_SDHC_SYSCTL_ADDR(x))
1975 #define HW_SDHC_SYSCTL_RD(x) (HW_SDHC_SYSCTL(x).U)
1976 #define HW_SDHC_SYSCTL_WR(x, v) (HW_SDHC_SYSCTL(x).U = (v))
1977 #define HW_SDHC_SYSCTL_SET(x, v) (HW_SDHC_SYSCTL_WR(x, HW_SDHC_SYSCTL_RD(x) | (v)))
1978 #define HW_SDHC_SYSCTL_CLR(x, v) (HW_SDHC_SYSCTL_WR(x, HW_SDHC_SYSCTL_RD(x) & ~(v)))
1979 #define HW_SDHC_SYSCTL_TOG(x, v) (HW_SDHC_SYSCTL_WR(x, HW_SDHC_SYSCTL_RD(x) ^ (v)))
1980 /*@}*/
1981
1982 /*
1983 * Constants & macros for individual SDHC_SYSCTL bitfields
1984 */
1985
1986 /*!
1987 * @name Register SDHC_SYSCTL, field IPGEN[0] (RW)
1988 *
1989 * If this bit is set, bus clock will always be active and no automatic gating
1990 * is applied. The bus clock will be internally gated off, if none of the
1991 * following factors are met: The cmd part is reset, or Data part is reset, or Soft
1992 * reset, or The cmd is about to send, or Clock divisor is just updated, or Continue
1993 * request is just set, or This bit is set, or Card insertion is detected, or Card
1994 * removal is detected, or Card external interrupt is detected, or The SDHC
1995 * clock is not gated off The bus clock will not be auto gated off if the SDHC clock
1996 * is not gated off. So clearing only this bit has no effect unless the PEREN bit
1997 * is also cleared.
1998 *
1999 * Values:
2000 * - 0 - Bus clock will be internally gated off.
2001 * - 1 - Bus clock will not be automatically gated off.
2002 */
2003 /*@{*/
2004 #define BP_SDHC_SYSCTL_IPGEN (0U) /*!< Bit position for SDHC_SYSCTL_IPGEN. */
2005 #define BM_SDHC_SYSCTL_IPGEN (0x00000001U) /*!< Bit mask for SDHC_SYSCTL_IPGEN. */
2006 #define BS_SDHC_SYSCTL_IPGEN (1U) /*!< Bit field size in bits for SDHC_SYSCTL_IPGEN. */
2007
2008 /*! @brief Read current value of the SDHC_SYSCTL_IPGEN field. */
2009 #define BR_SDHC_SYSCTL_IPGEN(x) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_IPGEN))
2010
2011 /*! @brief Format value for bitfield SDHC_SYSCTL_IPGEN. */
2012 #define BF_SDHC_SYSCTL_IPGEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_SYSCTL_IPGEN) & BM_SDHC_SYSCTL_IPGEN)
2013
2014 /*! @brief Set the IPGEN field to a new value. */
2015 #define BW_SDHC_SYSCTL_IPGEN(x, v) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_IPGEN) = (v))
2016 /*@}*/
2017
2018 /*!
2019 * @name Register SDHC_SYSCTL, field HCKEN[1] (RW)
2020 *
2021 * If this bit is set, system clock will always be active and no automatic
2022 * gating is applied. When this bit is cleared, system clock will be automatically off
2023 * when no data transfer is on the SD bus.
2024 *
2025 * Values:
2026 * - 0 - System clock will be internally gated off.
2027 * - 1 - System clock will not be automatically gated off.
2028 */
2029 /*@{*/
2030 #define BP_SDHC_SYSCTL_HCKEN (1U) /*!< Bit position for SDHC_SYSCTL_HCKEN. */
2031 #define BM_SDHC_SYSCTL_HCKEN (0x00000002U) /*!< Bit mask for SDHC_SYSCTL_HCKEN. */
2032 #define BS_SDHC_SYSCTL_HCKEN (1U) /*!< Bit field size in bits for SDHC_SYSCTL_HCKEN. */
2033
2034 /*! @brief Read current value of the SDHC_SYSCTL_HCKEN field. */
2035 #define BR_SDHC_SYSCTL_HCKEN(x) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_HCKEN))
2036
2037 /*! @brief Format value for bitfield SDHC_SYSCTL_HCKEN. */
2038 #define BF_SDHC_SYSCTL_HCKEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_SYSCTL_HCKEN) & BM_SDHC_SYSCTL_HCKEN)
2039
2040 /*! @brief Set the HCKEN field to a new value. */
2041 #define BW_SDHC_SYSCTL_HCKEN(x, v) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_HCKEN) = (v))
2042 /*@}*/
2043
2044 /*!
2045 * @name Register SDHC_SYSCTL, field PEREN[2] (RW)
2046 *
2047 * If this bit is set, SDHC clock will always be active and no automatic gating
2048 * is applied. Thus the SDCLK is active except for when auto gating-off during
2049 * buffer danger (buffer about to over-run or under-run). When this bit is cleared,
2050 * the SDHC clock will be automatically off whenever there is no transaction on
2051 * the SD bus. Because this bit is only a feature enabling bit, clearing this bit
2052 * does not stop SDCLK immediately. The SDHC clock will be internally gated off,
2053 * if none of the following factors are met: The cmd part is reset, or Data part
2054 * is reset, or A soft reset, or The cmd is about to send, or Clock divisor is
2055 * just updated, or Continue request is just set, or This bit is set, or Card
2056 * insertion is detected, or Card removal is detected, or Card external interrupt is
2057 * detected, or 80 clocks for initialization phase is ongoing
2058 *
2059 * Values:
2060 * - 0 - SDHC clock will be internally gated off.
2061 * - 1 - SDHC clock will not be automatically gated off.
2062 */
2063 /*@{*/
2064 #define BP_SDHC_SYSCTL_PEREN (2U) /*!< Bit position for SDHC_SYSCTL_PEREN. */
2065 #define BM_SDHC_SYSCTL_PEREN (0x00000004U) /*!< Bit mask for SDHC_SYSCTL_PEREN. */
2066 #define BS_SDHC_SYSCTL_PEREN (1U) /*!< Bit field size in bits for SDHC_SYSCTL_PEREN. */
2067
2068 /*! @brief Read current value of the SDHC_SYSCTL_PEREN field. */
2069 #define BR_SDHC_SYSCTL_PEREN(x) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_PEREN))
2070
2071 /*! @brief Format value for bitfield SDHC_SYSCTL_PEREN. */
2072 #define BF_SDHC_SYSCTL_PEREN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_SYSCTL_PEREN) & BM_SDHC_SYSCTL_PEREN)
2073
2074 /*! @brief Set the PEREN field to a new value. */
2075 #define BW_SDHC_SYSCTL_PEREN(x, v) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_PEREN) = (v))
2076 /*@}*/
2077
2078 /*!
2079 * @name Register SDHC_SYSCTL, field SDCLKEN[3] (RW)
2080 *
2081 * The host controller shall stop SDCLK when writing this bit to 0. SDCLK
2082 * frequency can be changed when this bit is 0. Then, the host controller shall
2083 * maintain the same clock frequency until SDCLK is stopped (stop at SDCLK = 0). If the
2084 * IRQSTAT[CINS] is cleared, this bit must be cleared by the host driver to save
2085 * power.
2086 */
2087 /*@{*/
2088 #define BP_SDHC_SYSCTL_SDCLKEN (3U) /*!< Bit position for SDHC_SYSCTL_SDCLKEN. */
2089 #define BM_SDHC_SYSCTL_SDCLKEN (0x00000008U) /*!< Bit mask for SDHC_SYSCTL_SDCLKEN. */
2090 #define BS_SDHC_SYSCTL_SDCLKEN (1U) /*!< Bit field size in bits for SDHC_SYSCTL_SDCLKEN. */
2091
2092 /*! @brief Read current value of the SDHC_SYSCTL_SDCLKEN field. */
2093 #define BR_SDHC_SYSCTL_SDCLKEN(x) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_SDCLKEN))
2094
2095 /*! @brief Format value for bitfield SDHC_SYSCTL_SDCLKEN. */
2096 #define BF_SDHC_SYSCTL_SDCLKEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_SYSCTL_SDCLKEN) & BM_SDHC_SYSCTL_SDCLKEN)
2097
2098 /*! @brief Set the SDCLKEN field to a new value. */
2099 #define BW_SDHC_SYSCTL_SDCLKEN(x, v) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_SDCLKEN) = (v))
2100 /*@}*/
2101
2102 /*!
2103 * @name Register SDHC_SYSCTL, field DVS[7:4] (RW)
2104 *
2105 * Used to provide a more exact divisor to generate the desired SD clock
2106 * frequency. Note the divider can even support odd divisor without deterioration of
2107 * duty cycle. The setting are as following:
2108 *
2109 * Values:
2110 * - 0 - Divisor by 1.
2111 * - 1 - Divisor by 2.
2112 * - 1110 - Divisor by 15.
2113 * - 1111 - Divisor by 16.
2114 */
2115 /*@{*/
2116 #define BP_SDHC_SYSCTL_DVS (4U) /*!< Bit position for SDHC_SYSCTL_DVS. */
2117 #define BM_SDHC_SYSCTL_DVS (0x000000F0U) /*!< Bit mask for SDHC_SYSCTL_DVS. */
2118 #define BS_SDHC_SYSCTL_DVS (4U) /*!< Bit field size in bits for SDHC_SYSCTL_DVS. */
2119
2120 /*! @brief Read current value of the SDHC_SYSCTL_DVS field. */
2121 #define BR_SDHC_SYSCTL_DVS(x) (HW_SDHC_SYSCTL(x).B.DVS)
2122
2123 /*! @brief Format value for bitfield SDHC_SYSCTL_DVS. */
2124 #define BF_SDHC_SYSCTL_DVS(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_SYSCTL_DVS) & BM_SDHC_SYSCTL_DVS)
2125
2126 /*! @brief Set the DVS field to a new value. */
2127 #define BW_SDHC_SYSCTL_DVS(x, v) (HW_SDHC_SYSCTL_WR(x, (HW_SDHC_SYSCTL_RD(x) & ~BM_SDHC_SYSCTL_DVS) | BF_SDHC_SYSCTL_DVS(v)))
2128 /*@}*/
2129
2130 /*!
2131 * @name Register SDHC_SYSCTL, field SDCLKFS[15:8] (RW)
2132 *
2133 * Used to select the frequency of the SDCLK pin. The frequency is not
2134 * programmed directly. Rather this register holds the prescaler (this register) and
2135 * divisor (next register) of the base clock frequency register. Setting 00h bypasses
2136 * the frequency prescaler of the SD Clock. Multiple bits must not be set, or the
2137 * behavior of this prescaler is undefined. The two default divider values can
2138 * be calculated by the frequency of SDHC clock and the following divisor bits.
2139 * The frequency of SDCLK is set by the following formula: Clock frequency = (Base
2140 * clock) / (prescaler x divisor) For example, if the base clock frequency is 96
2141 * MHz, and the target frequency is 25 MHz, then choosing the prescaler value of
2142 * 01h and divisor value of 1h will yield 24 MHz, which is the nearest frequency
2143 * less than or equal to the target. Similarly, to approach a clock value of 400
2144 * kHz, the prescaler value of 08h and divisor value of eh yields the exact clock
2145 * value of 400 kHz. The reset value of this field is 80h, so if the input base
2146 * clock ( SDHC clock ) is about 96 MHz, the default SD clock after reset is 375
2147 * kHz. According to the SD Physical Specification Version 1.1 and the SDIO Card
2148 * Specification Version 1.2, the maximum SD clock frequency is 50 MHz and shall
2149 * never exceed this limit. Only the following settings are allowed:
2150 *
2151 * Values:
2152 * - 1 - Base clock divided by 2.
2153 * - 10 - Base clock divided by 4.
2154 * - 100 - Base clock divided by 8.
2155 * - 1000 - Base clock divided by 16.
2156 * - 10000 - Base clock divided by 32.
2157 * - 100000 - Base clock divided by 64.
2158 * - 1000000 - Base clock divided by 128.
2159 * - 10000000 - Base clock divided by 256.
2160 */
2161 /*@{*/
2162 #define BP_SDHC_SYSCTL_SDCLKFS (8U) /*!< Bit position for SDHC_SYSCTL_SDCLKFS. */
2163 #define BM_SDHC_SYSCTL_SDCLKFS (0x0000FF00U) /*!< Bit mask for SDHC_SYSCTL_SDCLKFS. */
2164 #define BS_SDHC_SYSCTL_SDCLKFS (8U) /*!< Bit field size in bits for SDHC_SYSCTL_SDCLKFS. */
2165
2166 /*! @brief Read current value of the SDHC_SYSCTL_SDCLKFS field. */
2167 #define BR_SDHC_SYSCTL_SDCLKFS(x) (HW_SDHC_SYSCTL(x).B.SDCLKFS)
2168
2169 /*! @brief Format value for bitfield SDHC_SYSCTL_SDCLKFS. */
2170 #define BF_SDHC_SYSCTL_SDCLKFS(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_SYSCTL_SDCLKFS) & BM_SDHC_SYSCTL_SDCLKFS)
2171
2172 /*! @brief Set the SDCLKFS field to a new value. */
2173 #define BW_SDHC_SYSCTL_SDCLKFS(x, v) (HW_SDHC_SYSCTL_WR(x, (HW_SDHC_SYSCTL_RD(x) & ~BM_SDHC_SYSCTL_SDCLKFS) | BF_SDHC_SYSCTL_SDCLKFS(v)))
2174 /*@}*/
2175
2176 /*!
2177 * @name Register SDHC_SYSCTL, field DTOCV[19:16] (RW)
2178 *
2179 * Determines the interval by which DAT line timeouts are detected. See
2180 * IRQSTAT[DTOE] for information on factors that dictate time-out generation. Time-out
2181 * clock frequency will be generated by dividing the base clock SDCLK value by this
2182 * value. The host driver can clear IRQSTATEN[DTOESEN] to prevent inadvertent
2183 * time-out events.
2184 *
2185 * Values:
2186 * - 0000 - SDCLK x 2 13
2187 * - 0001 - SDCLK x 2 14
2188 * - 1110 - SDCLK x 2 27
2189 * - 1111 - Reserved
2190 */
2191 /*@{*/
2192 #define BP_SDHC_SYSCTL_DTOCV (16U) /*!< Bit position for SDHC_SYSCTL_DTOCV. */
2193 #define BM_SDHC_SYSCTL_DTOCV (0x000F0000U) /*!< Bit mask for SDHC_SYSCTL_DTOCV. */
2194 #define BS_SDHC_SYSCTL_DTOCV (4U) /*!< Bit field size in bits for SDHC_SYSCTL_DTOCV. */
2195
2196 /*! @brief Read current value of the SDHC_SYSCTL_DTOCV field. */
2197 #define BR_SDHC_SYSCTL_DTOCV(x) (HW_SDHC_SYSCTL(x).B.DTOCV)
2198
2199 /*! @brief Format value for bitfield SDHC_SYSCTL_DTOCV. */
2200 #define BF_SDHC_SYSCTL_DTOCV(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_SYSCTL_DTOCV) & BM_SDHC_SYSCTL_DTOCV)
2201
2202 /*! @brief Set the DTOCV field to a new value. */
2203 #define BW_SDHC_SYSCTL_DTOCV(x, v) (HW_SDHC_SYSCTL_WR(x, (HW_SDHC_SYSCTL_RD(x) & ~BM_SDHC_SYSCTL_DTOCV) | BF_SDHC_SYSCTL_DTOCV(v)))
2204 /*@}*/
2205
2206 /*!
2207 * @name Register SDHC_SYSCTL, field RSTA[24] (WORZ)
2208 *
2209 * Effects the entire host controller except for the card detection circuit.
2210 * Register bits of type ROC, RW, RW1C, RWAC are cleared. During its initialization,
2211 * the host driver shall set this bit to 1 to reset the SDHC. The SDHC shall
2212 * reset this bit to 0 when the capabilities registers are valid and the host driver
2213 * can read them. Additional use of software reset for all does not affect the
2214 * value of the capabilities registers. After this bit is set, it is recommended
2215 * that the host driver reset the external card and reinitialize it.
2216 *
2217 * Values:
2218 * - 0 - No reset.
2219 * - 1 - Reset.
2220 */
2221 /*@{*/
2222 #define BP_SDHC_SYSCTL_RSTA (24U) /*!< Bit position for SDHC_SYSCTL_RSTA. */
2223 #define BM_SDHC_SYSCTL_RSTA (0x01000000U) /*!< Bit mask for SDHC_SYSCTL_RSTA. */
2224 #define BS_SDHC_SYSCTL_RSTA (1U) /*!< Bit field size in bits for SDHC_SYSCTL_RSTA. */
2225
2226 /*! @brief Format value for bitfield SDHC_SYSCTL_RSTA. */
2227 #define BF_SDHC_SYSCTL_RSTA(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_SYSCTL_RSTA) & BM_SDHC_SYSCTL_RSTA)
2228
2229 /*! @brief Set the RSTA field to a new value. */
2230 #define BW_SDHC_SYSCTL_RSTA(x, v) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_RSTA) = (v))
2231 /*@}*/
2232
2233 /*!
2234 * @name Register SDHC_SYSCTL, field RSTC[25] (WORZ)
2235 *
2236 * Only part of the command circuit is reset. The following registers and bits
2237 * are cleared by this bit: PRSSTAT[CIHB] IRQSTAT[CC]
2238 *
2239 * Values:
2240 * - 0 - No reset.
2241 * - 1 - Reset.
2242 */
2243 /*@{*/
2244 #define BP_SDHC_SYSCTL_RSTC (25U) /*!< Bit position for SDHC_SYSCTL_RSTC. */
2245 #define BM_SDHC_SYSCTL_RSTC (0x02000000U) /*!< Bit mask for SDHC_SYSCTL_RSTC. */
2246 #define BS_SDHC_SYSCTL_RSTC (1U) /*!< Bit field size in bits for SDHC_SYSCTL_RSTC. */
2247
2248 /*! @brief Format value for bitfield SDHC_SYSCTL_RSTC. */
2249 #define BF_SDHC_SYSCTL_RSTC(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_SYSCTL_RSTC) & BM_SDHC_SYSCTL_RSTC)
2250
2251 /*! @brief Set the RSTC field to a new value. */
2252 #define BW_SDHC_SYSCTL_RSTC(x, v) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_RSTC) = (v))
2253 /*@}*/
2254
2255 /*!
2256 * @name Register SDHC_SYSCTL, field RSTD[26] (WORZ)
2257 *
2258 * Only part of the data circuit is reset. DMA circuit is also reset. The
2259 * following registers and bits are cleared by this bit: Data Port register Buffer Is
2260 * Cleared And Initialized.Present State register Buffer Read Enable Buffer Write
2261 * Enable Read Transfer Active Write Transfer Active DAT Line Active Command
2262 * Inhibit (DAT) Protocol Control register Continue Request Stop At Block Gap Request
2263 * Interrupt Status register Buffer Read Ready Buffer Write Ready DMA Interrupt
2264 * Block Gap Event Transfer Complete
2265 *
2266 * Values:
2267 * - 0 - No reset.
2268 * - 1 - Reset.
2269 */
2270 /*@{*/
2271 #define BP_SDHC_SYSCTL_RSTD (26U) /*!< Bit position for SDHC_SYSCTL_RSTD. */
2272 #define BM_SDHC_SYSCTL_RSTD (0x04000000U) /*!< Bit mask for SDHC_SYSCTL_RSTD. */
2273 #define BS_SDHC_SYSCTL_RSTD (1U) /*!< Bit field size in bits for SDHC_SYSCTL_RSTD. */
2274
2275 /*! @brief Format value for bitfield SDHC_SYSCTL_RSTD. */
2276 #define BF_SDHC_SYSCTL_RSTD(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_SYSCTL_RSTD) & BM_SDHC_SYSCTL_RSTD)
2277
2278 /*! @brief Set the RSTD field to a new value. */
2279 #define BW_SDHC_SYSCTL_RSTD(x, v) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_RSTD) = (v))
2280 /*@}*/
2281
2282 /*!
2283 * @name Register SDHC_SYSCTL, field INITA[27] (RW)
2284 *
2285 * When this bit is set, 80 SD-clocks are sent to the card. After the 80 clocks
2286 * are sent, this bit is self-cleared. This bit is very useful during the card
2287 * power-up period when 74 SD-clocks are needed and the clock auto gating feature
2288 * is enabled. Writing 1 to this bit when this bit is already 1 has no effect.
2289 * Writing 0 to this bit at any time has no effect. When either of the PRSSTAT[CIHB]
2290 * and PRSSTAT[CDIHB] bits are set, writing 1 to this bit is ignored, that is,
2291 * when command line or data lines are active, write to this bit is not allowed.
2292 * On the otherhand, when this bit is set, that is, during intialization active
2293 * period, it is allowed to issue command, and the command bit stream will appear
2294 * on the CMD pad after all 80 clock cycles are done. So when this command ends,
2295 * the driver can make sure the 80 clock cycles are sent out. This is very useful
2296 * when the driver needs send 80 cycles to the card and does not want to wait
2297 * till this bit is self-cleared.
2298 */
2299 /*@{*/
2300 #define BP_SDHC_SYSCTL_INITA (27U) /*!< Bit position for SDHC_SYSCTL_INITA. */
2301 #define BM_SDHC_SYSCTL_INITA (0x08000000U) /*!< Bit mask for SDHC_SYSCTL_INITA. */
2302 #define BS_SDHC_SYSCTL_INITA (1U) /*!< Bit field size in bits for SDHC_SYSCTL_INITA. */
2303
2304 /*! @brief Read current value of the SDHC_SYSCTL_INITA field. */
2305 #define BR_SDHC_SYSCTL_INITA(x) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_INITA))
2306
2307 /*! @brief Format value for bitfield SDHC_SYSCTL_INITA. */
2308 #define BF_SDHC_SYSCTL_INITA(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_SYSCTL_INITA) & BM_SDHC_SYSCTL_INITA)
2309
2310 /*! @brief Set the INITA field to a new value. */
2311 #define BW_SDHC_SYSCTL_INITA(x, v) (BITBAND_ACCESS32(HW_SDHC_SYSCTL_ADDR(x), BP_SDHC_SYSCTL_INITA) = (v))
2312 /*@}*/
2313
2314 /*******************************************************************************
2315 * HW_SDHC_IRQSTAT - Interrupt Status register
2316 ******************************************************************************/
2317
2318 /*!
2319 * @brief HW_SDHC_IRQSTAT - Interrupt Status register (RW)
2320 *
2321 * Reset value: 0x00000000U
2322 *
2323 * An interrupt is generated when the Normal Interrupt Signal Enable is enabled
2324 * and at least one of the status bits is set to 1. For all bits, writing 1 to a
2325 * bit clears it; writing to 0 keeps the bit unchanged. More than one status can
2326 * be cleared with a single register write. For Card Interrupt, before writing 1
2327 * to clear, it is required that the card stops asserting the interrupt, meaning
2328 * that when the Card Driver services the interrupt condition, otherwise the CINT
2329 * bit will be asserted again. The table below shows the relationship between
2330 * the CTOE and the CC bits. SDHC status for CTOE/CC bit combinations Command
2331 * complete Command timeout error Meaning of the status 0 0 X X 1 Response not
2332 * received within 64 SDCLK cycles 1 0 Response received The table below shows the
2333 * relationship between the Transfer Complete and the Data Timeout Error. SDHC status
2334 * for data timeout error/transfer complete bit combinations Transfer complete
2335 * Data timeout error Meaning of the status 0 0 X 0 1 Timeout occurred during
2336 * transfer 1 X Data transfer complete The table below shows the relationship between
2337 * the command CRC Error (CCE) and Command Timeout Error (CTOE). SDHC status for
2338 * CCE/CTOE Bit Combinations Command complete Command timeout error Meaning of
2339 * the status 0 0 No error 0 1 Response timeout error 1 0 Response CRC error 1 1
2340 * CMD line conflict
2341 */
2342 typedef union _hw_sdhc_irqstat
2343 {
2344 uint32_t U;
2345 struct _hw_sdhc_irqstat_bitfields
2346 {
2347 uint32_t CC : 1; /*!< [0] Command Complete */
2348 uint32_t TC : 1; /*!< [1] Transfer Complete */
2349 uint32_t BGE : 1; /*!< [2] Block Gap Event */
2350 uint32_t DINT : 1; /*!< [3] DMA Interrupt */
2351 uint32_t BWR : 1; /*!< [4] Buffer Write Ready */
2352 uint32_t BRR : 1; /*!< [5] Buffer Read Ready */
2353 uint32_t CINS : 1; /*!< [6] Card Insertion */
2354 uint32_t CRM : 1; /*!< [7] Card Removal */
2355 uint32_t CINT : 1; /*!< [8] Card Interrupt */
2356 uint32_t RESERVED0 : 7; /*!< [15:9] */
2357 uint32_t CTOE : 1; /*!< [16] Command Timeout Error */
2358 uint32_t CCE : 1; /*!< [17] Command CRC Error */
2359 uint32_t CEBE : 1; /*!< [18] Command End Bit Error */
2360 uint32_t CIE : 1; /*!< [19] Command Index Error */
2361 uint32_t DTOE : 1; /*!< [20] Data Timeout Error */
2362 uint32_t DCE : 1; /*!< [21] Data CRC Error */
2363 uint32_t DEBE : 1; /*!< [22] Data End Bit Error */
2364 uint32_t RESERVED1 : 1; /*!< [23] */
2365 uint32_t AC12E : 1; /*!< [24] Auto CMD12 Error */
2366 uint32_t RESERVED2 : 3; /*!< [27:25] */
2367 uint32_t DMAE : 1; /*!< [28] DMA Error */
2368 uint32_t RESERVED3 : 3; /*!< [31:29] */
2369 } B;
2370 } hw_sdhc_irqstat_t;
2371
2372 /*!
2373 * @name Constants and macros for entire SDHC_IRQSTAT register
2374 */
2375 /*@{*/
2376 #define HW_SDHC_IRQSTAT_ADDR(x) ((x) + 0x30U)
2377
2378 #define HW_SDHC_IRQSTAT(x) (*(__IO hw_sdhc_irqstat_t *) HW_SDHC_IRQSTAT_ADDR(x))
2379 #define HW_SDHC_IRQSTAT_RD(x) (HW_SDHC_IRQSTAT(x).U)
2380 #define HW_SDHC_IRQSTAT_WR(x, v) (HW_SDHC_IRQSTAT(x).U = (v))
2381 #define HW_SDHC_IRQSTAT_SET(x, v) (HW_SDHC_IRQSTAT_WR(x, HW_SDHC_IRQSTAT_RD(x) | (v)))
2382 #define HW_SDHC_IRQSTAT_CLR(x, v) (HW_SDHC_IRQSTAT_WR(x, HW_SDHC_IRQSTAT_RD(x) & ~(v)))
2383 #define HW_SDHC_IRQSTAT_TOG(x, v) (HW_SDHC_IRQSTAT_WR(x, HW_SDHC_IRQSTAT_RD(x) ^ (v)))
2384 /*@}*/
2385
2386 /*
2387 * Constants & macros for individual SDHC_IRQSTAT bitfields
2388 */
2389
2390 /*!
2391 * @name Register SDHC_IRQSTAT, field CC[0] (W1C)
2392 *
2393 * This bit is set when you receive the end bit of the command response, except
2394 * Auto CMD12. See PRSSTAT[CIHB].
2395 *
2396 * Values:
2397 * - 0 - Command not complete.
2398 * - 1 - Command complete.
2399 */
2400 /*@{*/
2401 #define BP_SDHC_IRQSTAT_CC (0U) /*!< Bit position for SDHC_IRQSTAT_CC. */
2402 #define BM_SDHC_IRQSTAT_CC (0x00000001U) /*!< Bit mask for SDHC_IRQSTAT_CC. */
2403 #define BS_SDHC_IRQSTAT_CC (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_CC. */
2404
2405 /*! @brief Read current value of the SDHC_IRQSTAT_CC field. */
2406 #define BR_SDHC_IRQSTAT_CC(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CC))
2407
2408 /*! @brief Format value for bitfield SDHC_IRQSTAT_CC. */
2409 #define BF_SDHC_IRQSTAT_CC(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_CC) & BM_SDHC_IRQSTAT_CC)
2410
2411 /*! @brief Set the CC field to a new value. */
2412 #define BW_SDHC_IRQSTAT_CC(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CC) = (v))
2413 /*@}*/
2414
2415 /*!
2416 * @name Register SDHC_IRQSTAT, field TC[1] (W1C)
2417 *
2418 * This bit is set when a read or write transfer is completed. In the case of a
2419 * read transaction: This bit is set at the falling edge of the read transfer
2420 * active status. There are two cases in which this interrupt is generated. The
2421 * first is when a data transfer is completed as specified by the data length, after
2422 * the last data has been read to the host system. The second is when data has
2423 * stopped at the block gap and completed the data transfer by setting
2424 * PROCTL[SABGREQ], after valid data has been read to the host system. In the case of a write
2425 * transaction: This bit is set at the falling edge of the DAT line active
2426 * status. There are two cases in which this interrupt is generated. The first is when
2427 * the last data is written to the SD card as specified by the data length and
2428 * the busy signal is released. The second is when data transfers are stopped at
2429 * the block gap, by setting PROCTL[SABGREQ], and the data transfers are
2430 * completed,after valid data is written to the SD card and the busy signal released.
2431 *
2432 * Values:
2433 * - 0 - Transfer not complete.
2434 * - 1 - Transfer complete.
2435 */
2436 /*@{*/
2437 #define BP_SDHC_IRQSTAT_TC (1U) /*!< Bit position for SDHC_IRQSTAT_TC. */
2438 #define BM_SDHC_IRQSTAT_TC (0x00000002U) /*!< Bit mask for SDHC_IRQSTAT_TC. */
2439 #define BS_SDHC_IRQSTAT_TC (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_TC. */
2440
2441 /*! @brief Read current value of the SDHC_IRQSTAT_TC field. */
2442 #define BR_SDHC_IRQSTAT_TC(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_TC))
2443
2444 /*! @brief Format value for bitfield SDHC_IRQSTAT_TC. */
2445 #define BF_SDHC_IRQSTAT_TC(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_TC) & BM_SDHC_IRQSTAT_TC)
2446
2447 /*! @brief Set the TC field to a new value. */
2448 #define BW_SDHC_IRQSTAT_TC(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_TC) = (v))
2449 /*@}*/
2450
2451 /*!
2452 * @name Register SDHC_IRQSTAT, field BGE[2] (W1C)
2453 *
2454 * If PROCTL[SABGREQ] is set, this bit is set when a read or write transaction
2455 * is stopped at a block gap. If PROCTL[SABGREQ] is not set to 1, this bit is not
2456 * set to 1. In the case of a read transaction: This bit is set at the falling
2457 * edge of the DAT line active status, when the transaction is stopped at SD Bus
2458 * timing. The read wait must be supported in order to use this function. In the
2459 * case of write transaction: This bit is set at the falling edge of write transfer
2460 * active status, after getting CRC status at SD bus timing.
2461 *
2462 * Values:
2463 * - 0 - No block gap event.
2464 * - 1 - Transaction stopped at block gap.
2465 */
2466 /*@{*/
2467 #define BP_SDHC_IRQSTAT_BGE (2U) /*!< Bit position for SDHC_IRQSTAT_BGE. */
2468 #define BM_SDHC_IRQSTAT_BGE (0x00000004U) /*!< Bit mask for SDHC_IRQSTAT_BGE. */
2469 #define BS_SDHC_IRQSTAT_BGE (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_BGE. */
2470
2471 /*! @brief Read current value of the SDHC_IRQSTAT_BGE field. */
2472 #define BR_SDHC_IRQSTAT_BGE(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_BGE))
2473
2474 /*! @brief Format value for bitfield SDHC_IRQSTAT_BGE. */
2475 #define BF_SDHC_IRQSTAT_BGE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_BGE) & BM_SDHC_IRQSTAT_BGE)
2476
2477 /*! @brief Set the BGE field to a new value. */
2478 #define BW_SDHC_IRQSTAT_BGE(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_BGE) = (v))
2479 /*@}*/
2480
2481 /*!
2482 * @name Register SDHC_IRQSTAT, field DINT[3] (W1C)
2483 *
2484 * Occurs only when the internal DMA finishes the data transfer successfully.
2485 * Whenever errors occur during data transfer, this bit will not be set. Instead,
2486 * the DMAE bit will be set. Either Simple DMA or ADMA finishes data transferring,
2487 * this bit will be set.
2488 *
2489 * Values:
2490 * - 0 - No DMA Interrupt.
2491 * - 1 - DMA Interrupt is generated.
2492 */
2493 /*@{*/
2494 #define BP_SDHC_IRQSTAT_DINT (3U) /*!< Bit position for SDHC_IRQSTAT_DINT. */
2495 #define BM_SDHC_IRQSTAT_DINT (0x00000008U) /*!< Bit mask for SDHC_IRQSTAT_DINT. */
2496 #define BS_SDHC_IRQSTAT_DINT (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_DINT. */
2497
2498 /*! @brief Read current value of the SDHC_IRQSTAT_DINT field. */
2499 #define BR_SDHC_IRQSTAT_DINT(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_DINT))
2500
2501 /*! @brief Format value for bitfield SDHC_IRQSTAT_DINT. */
2502 #define BF_SDHC_IRQSTAT_DINT(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_DINT) & BM_SDHC_IRQSTAT_DINT)
2503
2504 /*! @brief Set the DINT field to a new value. */
2505 #define BW_SDHC_IRQSTAT_DINT(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_DINT) = (v))
2506 /*@}*/
2507
2508 /*!
2509 * @name Register SDHC_IRQSTAT, field BWR[4] (W1C)
2510 *
2511 * This status bit is set if the Buffer Write Enable bit, in the Present State
2512 * register, changes from 0 to 1. See the Buffer Write Enable bit in the Present
2513 * State register for additional information.
2514 *
2515 * Values:
2516 * - 0 - Not ready to write buffer.
2517 * - 1 - Ready to write buffer.
2518 */
2519 /*@{*/
2520 #define BP_SDHC_IRQSTAT_BWR (4U) /*!< Bit position for SDHC_IRQSTAT_BWR. */
2521 #define BM_SDHC_IRQSTAT_BWR (0x00000010U) /*!< Bit mask for SDHC_IRQSTAT_BWR. */
2522 #define BS_SDHC_IRQSTAT_BWR (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_BWR. */
2523
2524 /*! @brief Read current value of the SDHC_IRQSTAT_BWR field. */
2525 #define BR_SDHC_IRQSTAT_BWR(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_BWR))
2526
2527 /*! @brief Format value for bitfield SDHC_IRQSTAT_BWR. */
2528 #define BF_SDHC_IRQSTAT_BWR(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_BWR) & BM_SDHC_IRQSTAT_BWR)
2529
2530 /*! @brief Set the BWR field to a new value. */
2531 #define BW_SDHC_IRQSTAT_BWR(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_BWR) = (v))
2532 /*@}*/
2533
2534 /*!
2535 * @name Register SDHC_IRQSTAT, field BRR[5] (W1C)
2536 *
2537 * This status bit is set if the Buffer Read Enable bit, in the Present State
2538 * register, changes from 0 to 1. See the Buffer Read Enable bit in the Present
2539 * State register for additional information.
2540 *
2541 * Values:
2542 * - 0 - Not ready to read buffer.
2543 * - 1 - Ready to read buffer.
2544 */
2545 /*@{*/
2546 #define BP_SDHC_IRQSTAT_BRR (5U) /*!< Bit position for SDHC_IRQSTAT_BRR. */
2547 #define BM_SDHC_IRQSTAT_BRR (0x00000020U) /*!< Bit mask for SDHC_IRQSTAT_BRR. */
2548 #define BS_SDHC_IRQSTAT_BRR (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_BRR. */
2549
2550 /*! @brief Read current value of the SDHC_IRQSTAT_BRR field. */
2551 #define BR_SDHC_IRQSTAT_BRR(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_BRR))
2552
2553 /*! @brief Format value for bitfield SDHC_IRQSTAT_BRR. */
2554 #define BF_SDHC_IRQSTAT_BRR(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_BRR) & BM_SDHC_IRQSTAT_BRR)
2555
2556 /*! @brief Set the BRR field to a new value. */
2557 #define BW_SDHC_IRQSTAT_BRR(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_BRR) = (v))
2558 /*@}*/
2559
2560 /*!
2561 * @name Register SDHC_IRQSTAT, field CINS[6] (W1C)
2562 *
2563 * This status bit is set if the Card Inserted bit in the Present State register
2564 * changes from 0 to 1. When the host driver writes this bit to 1 to clear this
2565 * status, the status of the Card Inserted in the Present State register must be
2566 * confirmed. Because the card state may possibly be changed when the host driver
2567 * clears this bit and the interrupt event may not be generated. When this bit
2568 * is cleared, it will be set again if a card is inserted. To leave it cleared,
2569 * clear the Card Inserted Status Enable bit in Interrupt Status Enable register.
2570 *
2571 * Values:
2572 * - 0 - Card state unstable or removed.
2573 * - 1 - Card inserted.
2574 */
2575 /*@{*/
2576 #define BP_SDHC_IRQSTAT_CINS (6U) /*!< Bit position for SDHC_IRQSTAT_CINS. */
2577 #define BM_SDHC_IRQSTAT_CINS (0x00000040U) /*!< Bit mask for SDHC_IRQSTAT_CINS. */
2578 #define BS_SDHC_IRQSTAT_CINS (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_CINS. */
2579
2580 /*! @brief Read current value of the SDHC_IRQSTAT_CINS field. */
2581 #define BR_SDHC_IRQSTAT_CINS(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CINS))
2582
2583 /*! @brief Format value for bitfield SDHC_IRQSTAT_CINS. */
2584 #define BF_SDHC_IRQSTAT_CINS(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_CINS) & BM_SDHC_IRQSTAT_CINS)
2585
2586 /*! @brief Set the CINS field to a new value. */
2587 #define BW_SDHC_IRQSTAT_CINS(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CINS) = (v))
2588 /*@}*/
2589
2590 /*!
2591 * @name Register SDHC_IRQSTAT, field CRM[7] (W1C)
2592 *
2593 * This status bit is set if the Card Inserted bit in the Present State register
2594 * changes from 1 to 0. When the host driver writes this bit to 1 to clear this
2595 * status, the status of the Card Inserted in the Present State register must be
2596 * confirmed. Because the card state may possibly be changed when the host driver
2597 * clears this bit and the interrupt event may not be generated. When this bit
2598 * is cleared, it will be set again if no card is inserted. To leave it cleared,
2599 * clear the Card Removal Status Enable bit in Interrupt Status Enable register.
2600 *
2601 * Values:
2602 * - 0 - Card state unstable or inserted.
2603 * - 1 - Card removed.
2604 */
2605 /*@{*/
2606 #define BP_SDHC_IRQSTAT_CRM (7U) /*!< Bit position for SDHC_IRQSTAT_CRM. */
2607 #define BM_SDHC_IRQSTAT_CRM (0x00000080U) /*!< Bit mask for SDHC_IRQSTAT_CRM. */
2608 #define BS_SDHC_IRQSTAT_CRM (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_CRM. */
2609
2610 /*! @brief Read current value of the SDHC_IRQSTAT_CRM field. */
2611 #define BR_SDHC_IRQSTAT_CRM(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CRM))
2612
2613 /*! @brief Format value for bitfield SDHC_IRQSTAT_CRM. */
2614 #define BF_SDHC_IRQSTAT_CRM(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_CRM) & BM_SDHC_IRQSTAT_CRM)
2615
2616 /*! @brief Set the CRM field to a new value. */
2617 #define BW_SDHC_IRQSTAT_CRM(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CRM) = (v))
2618 /*@}*/
2619
2620 /*!
2621 * @name Register SDHC_IRQSTAT, field CINT[8] (W1C)
2622 *
2623 * This status bit is set when an interrupt signal is detected from the external
2624 * card. In 1-bit mode, the SDHC will detect the Card Interrupt without the SD
2625 * Clock to support wakeup. In 4-bit mode, the card interrupt signal is sampled
2626 * during the interrupt cycle, so the interrupt from card can only be sampled
2627 * during interrupt cycle, introducing some delay between the interrupt signal from
2628 * the SDIO card and the interrupt to the host system. Writing this bit to 1 can
2629 * clear this bit, but as the interrupt factor from the SDIO card does not clear,
2630 * this bit is set again. To clear this bit, it is required to reset the interrupt
2631 * factor from the external card followed by a writing 1 to this bit. When this
2632 * status has been set, and the host driver needs to service this interrupt, the
2633 * Card Interrupt Signal Enable in the Interrupt Signal Enable register should be
2634 * 0 to stop driving the interrupt signal to the host system. After completion
2635 * of the card interrupt service (it must reset the interrupt factors in the SDIO
2636 * card and the interrupt signal may not be asserted), write 1 to clear this bit,
2637 * set the Card Interrupt Signal Enable to 1, and start sampling the interrupt
2638 * signal again.
2639 *
2640 * Values:
2641 * - 0 - No Card Interrupt.
2642 * - 1 - Generate Card Interrupt.
2643 */
2644 /*@{*/
2645 #define BP_SDHC_IRQSTAT_CINT (8U) /*!< Bit position for SDHC_IRQSTAT_CINT. */
2646 #define BM_SDHC_IRQSTAT_CINT (0x00000100U) /*!< Bit mask for SDHC_IRQSTAT_CINT. */
2647 #define BS_SDHC_IRQSTAT_CINT (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_CINT. */
2648
2649 /*! @brief Read current value of the SDHC_IRQSTAT_CINT field. */
2650 #define BR_SDHC_IRQSTAT_CINT(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CINT))
2651
2652 /*! @brief Format value for bitfield SDHC_IRQSTAT_CINT. */
2653 #define BF_SDHC_IRQSTAT_CINT(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_CINT) & BM_SDHC_IRQSTAT_CINT)
2654
2655 /*! @brief Set the CINT field to a new value. */
2656 #define BW_SDHC_IRQSTAT_CINT(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CINT) = (v))
2657 /*@}*/
2658
2659 /*!
2660 * @name Register SDHC_IRQSTAT, field CTOE[16] (W1C)
2661 *
2662 * Occurs only if no response is returned within 64 SDCLK cycles from the end
2663 * bit of the command. If the SDHC detects a CMD line conflict, in which case a
2664 * Command CRC Error shall also be set, this bit shall be set without waiting for 64
2665 * SDCLK cycles. This is because the command will be aborted by the SDHC.
2666 *
2667 * Values:
2668 * - 0 - No error.
2669 * - 1 - Time out.
2670 */
2671 /*@{*/
2672 #define BP_SDHC_IRQSTAT_CTOE (16U) /*!< Bit position for SDHC_IRQSTAT_CTOE. */
2673 #define BM_SDHC_IRQSTAT_CTOE (0x00010000U) /*!< Bit mask for SDHC_IRQSTAT_CTOE. */
2674 #define BS_SDHC_IRQSTAT_CTOE (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_CTOE. */
2675
2676 /*! @brief Read current value of the SDHC_IRQSTAT_CTOE field. */
2677 #define BR_SDHC_IRQSTAT_CTOE(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CTOE))
2678
2679 /*! @brief Format value for bitfield SDHC_IRQSTAT_CTOE. */
2680 #define BF_SDHC_IRQSTAT_CTOE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_CTOE) & BM_SDHC_IRQSTAT_CTOE)
2681
2682 /*! @brief Set the CTOE field to a new value. */
2683 #define BW_SDHC_IRQSTAT_CTOE(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CTOE) = (v))
2684 /*@}*/
2685
2686 /*!
2687 * @name Register SDHC_IRQSTAT, field CCE[17] (W1C)
2688 *
2689 * Command CRC Error is generated in two cases. If a response is returned and
2690 * the Command Timeout Error is set to 0, indicating no time-out, this bit is set
2691 * when detecting a CRC error in the command response. The SDHC detects a CMD line
2692 * conflict by monitoring the CMD line when a command is issued. If the SDHC
2693 * drives the CMD line to 1, but detects 0 on the CMD line at the next SDCLK edge,
2694 * then the SDHC shall abort the command (Stop driving CMD line) and set this bit
2695 * to 1. The Command Timeout Error shall also be set to 1 to distinguish CMD line
2696 * conflict.
2697 *
2698 * Values:
2699 * - 0 - No error.
2700 * - 1 - CRC Error generated.
2701 */
2702 /*@{*/
2703 #define BP_SDHC_IRQSTAT_CCE (17U) /*!< Bit position for SDHC_IRQSTAT_CCE. */
2704 #define BM_SDHC_IRQSTAT_CCE (0x00020000U) /*!< Bit mask for SDHC_IRQSTAT_CCE. */
2705 #define BS_SDHC_IRQSTAT_CCE (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_CCE. */
2706
2707 /*! @brief Read current value of the SDHC_IRQSTAT_CCE field. */
2708 #define BR_SDHC_IRQSTAT_CCE(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CCE))
2709
2710 /*! @brief Format value for bitfield SDHC_IRQSTAT_CCE. */
2711 #define BF_SDHC_IRQSTAT_CCE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_CCE) & BM_SDHC_IRQSTAT_CCE)
2712
2713 /*! @brief Set the CCE field to a new value. */
2714 #define BW_SDHC_IRQSTAT_CCE(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CCE) = (v))
2715 /*@}*/
2716
2717 /*!
2718 * @name Register SDHC_IRQSTAT, field CEBE[18] (W1C)
2719 *
2720 * Occurs when detecting that the end bit of a command response is 0.
2721 *
2722 * Values:
2723 * - 0 - No error.
2724 * - 1 - End Bit Error generated.
2725 */
2726 /*@{*/
2727 #define BP_SDHC_IRQSTAT_CEBE (18U) /*!< Bit position for SDHC_IRQSTAT_CEBE. */
2728 #define BM_SDHC_IRQSTAT_CEBE (0x00040000U) /*!< Bit mask for SDHC_IRQSTAT_CEBE. */
2729 #define BS_SDHC_IRQSTAT_CEBE (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_CEBE. */
2730
2731 /*! @brief Read current value of the SDHC_IRQSTAT_CEBE field. */
2732 #define BR_SDHC_IRQSTAT_CEBE(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CEBE))
2733
2734 /*! @brief Format value for bitfield SDHC_IRQSTAT_CEBE. */
2735 #define BF_SDHC_IRQSTAT_CEBE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_CEBE) & BM_SDHC_IRQSTAT_CEBE)
2736
2737 /*! @brief Set the CEBE field to a new value. */
2738 #define BW_SDHC_IRQSTAT_CEBE(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CEBE) = (v))
2739 /*@}*/
2740
2741 /*!
2742 * @name Register SDHC_IRQSTAT, field CIE[19] (W1C)
2743 *
2744 * Occurs if a Command Index error occurs in the command response.
2745 *
2746 * Values:
2747 * - 0 - No error.
2748 * - 1 - Error.
2749 */
2750 /*@{*/
2751 #define BP_SDHC_IRQSTAT_CIE (19U) /*!< Bit position for SDHC_IRQSTAT_CIE. */
2752 #define BM_SDHC_IRQSTAT_CIE (0x00080000U) /*!< Bit mask for SDHC_IRQSTAT_CIE. */
2753 #define BS_SDHC_IRQSTAT_CIE (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_CIE. */
2754
2755 /*! @brief Read current value of the SDHC_IRQSTAT_CIE field. */
2756 #define BR_SDHC_IRQSTAT_CIE(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CIE))
2757
2758 /*! @brief Format value for bitfield SDHC_IRQSTAT_CIE. */
2759 #define BF_SDHC_IRQSTAT_CIE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_CIE) & BM_SDHC_IRQSTAT_CIE)
2760
2761 /*! @brief Set the CIE field to a new value. */
2762 #define BW_SDHC_IRQSTAT_CIE(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_CIE) = (v))
2763 /*@}*/
2764
2765 /*!
2766 * @name Register SDHC_IRQSTAT, field DTOE[20] (W1C)
2767 *
2768 * Occurs when detecting one of following time-out conditions. Busy time-out for
2769 * R1b,R5b type Busy time-out after Write CRC status Read Data time-out
2770 *
2771 * Values:
2772 * - 0 - No error.
2773 * - 1 - Time out.
2774 */
2775 /*@{*/
2776 #define BP_SDHC_IRQSTAT_DTOE (20U) /*!< Bit position for SDHC_IRQSTAT_DTOE. */
2777 #define BM_SDHC_IRQSTAT_DTOE (0x00100000U) /*!< Bit mask for SDHC_IRQSTAT_DTOE. */
2778 #define BS_SDHC_IRQSTAT_DTOE (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_DTOE. */
2779
2780 /*! @brief Read current value of the SDHC_IRQSTAT_DTOE field. */
2781 #define BR_SDHC_IRQSTAT_DTOE(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_DTOE))
2782
2783 /*! @brief Format value for bitfield SDHC_IRQSTAT_DTOE. */
2784 #define BF_SDHC_IRQSTAT_DTOE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_DTOE) & BM_SDHC_IRQSTAT_DTOE)
2785
2786 /*! @brief Set the DTOE field to a new value. */
2787 #define BW_SDHC_IRQSTAT_DTOE(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_DTOE) = (v))
2788 /*@}*/
2789
2790 /*!
2791 * @name Register SDHC_IRQSTAT, field DCE[21] (W1C)
2792 *
2793 * Occurs when detecting a CRC error when transferring read data, which uses the
2794 * DAT line, or when detecting the Write CRC status having a value other than
2795 * 010.
2796 *
2797 * Values:
2798 * - 0 - No error.
2799 * - 1 - Error.
2800 */
2801 /*@{*/
2802 #define BP_SDHC_IRQSTAT_DCE (21U) /*!< Bit position for SDHC_IRQSTAT_DCE. */
2803 #define BM_SDHC_IRQSTAT_DCE (0x00200000U) /*!< Bit mask for SDHC_IRQSTAT_DCE. */
2804 #define BS_SDHC_IRQSTAT_DCE (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_DCE. */
2805
2806 /*! @brief Read current value of the SDHC_IRQSTAT_DCE field. */
2807 #define BR_SDHC_IRQSTAT_DCE(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_DCE))
2808
2809 /*! @brief Format value for bitfield SDHC_IRQSTAT_DCE. */
2810 #define BF_SDHC_IRQSTAT_DCE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_DCE) & BM_SDHC_IRQSTAT_DCE)
2811
2812 /*! @brief Set the DCE field to a new value. */
2813 #define BW_SDHC_IRQSTAT_DCE(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_DCE) = (v))
2814 /*@}*/
2815
2816 /*!
2817 * @name Register SDHC_IRQSTAT, field DEBE[22] (W1C)
2818 *
2819 * Occurs either when detecting 0 at the end bit position of read data, which
2820 * uses the DAT line, or at the end bit position of the CRC.
2821 *
2822 * Values:
2823 * - 0 - No error.
2824 * - 1 - Error.
2825 */
2826 /*@{*/
2827 #define BP_SDHC_IRQSTAT_DEBE (22U) /*!< Bit position for SDHC_IRQSTAT_DEBE. */
2828 #define BM_SDHC_IRQSTAT_DEBE (0x00400000U) /*!< Bit mask for SDHC_IRQSTAT_DEBE. */
2829 #define BS_SDHC_IRQSTAT_DEBE (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_DEBE. */
2830
2831 /*! @brief Read current value of the SDHC_IRQSTAT_DEBE field. */
2832 #define BR_SDHC_IRQSTAT_DEBE(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_DEBE))
2833
2834 /*! @brief Format value for bitfield SDHC_IRQSTAT_DEBE. */
2835 #define BF_SDHC_IRQSTAT_DEBE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_DEBE) & BM_SDHC_IRQSTAT_DEBE)
2836
2837 /*! @brief Set the DEBE field to a new value. */
2838 #define BW_SDHC_IRQSTAT_DEBE(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_DEBE) = (v))
2839 /*@}*/
2840
2841 /*!
2842 * @name Register SDHC_IRQSTAT, field AC12E[24] (W1C)
2843 *
2844 * Occurs when detecting that one of the bits in the Auto CMD12 Error Status
2845 * register has changed from 0 to 1. This bit is set to 1, not only when the errors
2846 * in Auto CMD12 occur, but also when the Auto CMD12 is not executed due to the
2847 * previous command error.
2848 *
2849 * Values:
2850 * - 0 - No error.
2851 * - 1 - Error.
2852 */
2853 /*@{*/
2854 #define BP_SDHC_IRQSTAT_AC12E (24U) /*!< Bit position for SDHC_IRQSTAT_AC12E. */
2855 #define BM_SDHC_IRQSTAT_AC12E (0x01000000U) /*!< Bit mask for SDHC_IRQSTAT_AC12E. */
2856 #define BS_SDHC_IRQSTAT_AC12E (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_AC12E. */
2857
2858 /*! @brief Read current value of the SDHC_IRQSTAT_AC12E field. */
2859 #define BR_SDHC_IRQSTAT_AC12E(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_AC12E))
2860
2861 /*! @brief Format value for bitfield SDHC_IRQSTAT_AC12E. */
2862 #define BF_SDHC_IRQSTAT_AC12E(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_AC12E) & BM_SDHC_IRQSTAT_AC12E)
2863
2864 /*! @brief Set the AC12E field to a new value. */
2865 #define BW_SDHC_IRQSTAT_AC12E(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_AC12E) = (v))
2866 /*@}*/
2867
2868 /*!
2869 * @name Register SDHC_IRQSTAT, field DMAE[28] (W1C)
2870 *
2871 * Occurs when an Internal DMA transfer has failed. This bit is set to 1, when
2872 * some error occurs in the data transfer. This error can be caused by either
2873 * Simple DMA or ADMA, depending on which DMA is in use. The value in DMA System
2874 * Address register is the next fetch address where the error occurs. Because any
2875 * error corrupts the whole data block, the host driver shall restart the transfer
2876 * from the corrupted block boundary. The address of the block boundary can be
2877 * calculated either from the current DSADDR value or from the remaining number of
2878 * blocks and the block size.
2879 *
2880 * Values:
2881 * - 0 - No error.
2882 * - 1 - Error.
2883 */
2884 /*@{*/
2885 #define BP_SDHC_IRQSTAT_DMAE (28U) /*!< Bit position for SDHC_IRQSTAT_DMAE. */
2886 #define BM_SDHC_IRQSTAT_DMAE (0x10000000U) /*!< Bit mask for SDHC_IRQSTAT_DMAE. */
2887 #define BS_SDHC_IRQSTAT_DMAE (1U) /*!< Bit field size in bits for SDHC_IRQSTAT_DMAE. */
2888
2889 /*! @brief Read current value of the SDHC_IRQSTAT_DMAE field. */
2890 #define BR_SDHC_IRQSTAT_DMAE(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_DMAE))
2891
2892 /*! @brief Format value for bitfield SDHC_IRQSTAT_DMAE. */
2893 #define BF_SDHC_IRQSTAT_DMAE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTAT_DMAE) & BM_SDHC_IRQSTAT_DMAE)
2894
2895 /*! @brief Set the DMAE field to a new value. */
2896 #define BW_SDHC_IRQSTAT_DMAE(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTAT_ADDR(x), BP_SDHC_IRQSTAT_DMAE) = (v))
2897 /*@}*/
2898
2899 /*******************************************************************************
2900 * HW_SDHC_IRQSTATEN - Interrupt Status Enable register
2901 ******************************************************************************/
2902
2903 /*!
2904 * @brief HW_SDHC_IRQSTATEN - Interrupt Status Enable register (RW)
2905 *
2906 * Reset value: 0x117F013FU
2907 *
2908 * Setting the bits in this register to 1 enables the corresponding interrupt
2909 * status to be set by the specified event. If any bit is cleared, the
2910 * corresponding interrupt status bit is also cleared, that is, when the bit in this register
2911 * is cleared, the corresponding bit in interrupt status register is always 0.
2912 * Depending on PROCTL[IABG] bit setting, SDHC may be programmed to sample the
2913 * card interrupt signal during the interrupt period and hold its value in the
2914 * flip-flop. There will be some delays on the card interrupt, asserted from the card,
2915 * to the time the host system is informed. To detect a CMD line conflict, the
2916 * host driver must set both IRQSTATEN[CTOESEN] and IRQSTATEN[CCESEN] to 1.
2917 */
2918 typedef union _hw_sdhc_irqstaten
2919 {
2920 uint32_t U;
2921 struct _hw_sdhc_irqstaten_bitfields
2922 {
2923 uint32_t CCSEN : 1; /*!< [0] Command Complete Status Enable */
2924 uint32_t TCSEN : 1; /*!< [1] Transfer Complete Status Enable */
2925 uint32_t BGESEN : 1; /*!< [2] Block Gap Event Status Enable */
2926 uint32_t DINTSEN : 1; /*!< [3] DMA Interrupt Status Enable */
2927 uint32_t BWRSEN : 1; /*!< [4] Buffer Write Ready Status Enable */
2928 uint32_t BRRSEN : 1; /*!< [5] Buffer Read Ready Status Enable */
2929 uint32_t CINSEN : 1; /*!< [6] Card Insertion Status Enable */
2930 uint32_t CRMSEN : 1; /*!< [7] Card Removal Status Enable */
2931 uint32_t CINTSEN : 1; /*!< [8] Card Interrupt Status Enable */
2932 uint32_t RESERVED0 : 7; /*!< [15:9] */
2933 uint32_t CTOESEN : 1; /*!< [16] Command Timeout Error Status Enable */
2934 uint32_t CCESEN : 1; /*!< [17] Command CRC Error Status Enable */
2935 uint32_t CEBESEN : 1; /*!< [18] Command End Bit Error Status Enable */
2936 uint32_t CIESEN : 1; /*!< [19] Command Index Error Status Enable */
2937 uint32_t DTOESEN : 1; /*!< [20] Data Timeout Error Status Enable */
2938 uint32_t DCESEN : 1; /*!< [21] Data CRC Error Status Enable */
2939 uint32_t DEBESEN : 1; /*!< [22] Data End Bit Error Status Enable */
2940 uint32_t RESERVED1 : 1; /*!< [23] */
2941 uint32_t AC12ESEN : 1; /*!< [24] Auto CMD12 Error Status Enable */
2942 uint32_t RESERVED2 : 3; /*!< [27:25] */
2943 uint32_t DMAESEN : 1; /*!< [28] DMA Error Status Enable */
2944 uint32_t RESERVED3 : 3; /*!< [31:29] */
2945 } B;
2946 } hw_sdhc_irqstaten_t;
2947
2948 /*!
2949 * @name Constants and macros for entire SDHC_IRQSTATEN register
2950 */
2951 /*@{*/
2952 #define HW_SDHC_IRQSTATEN_ADDR(x) ((x) + 0x34U)
2953
2954 #define HW_SDHC_IRQSTATEN(x) (*(__IO hw_sdhc_irqstaten_t *) HW_SDHC_IRQSTATEN_ADDR(x))
2955 #define HW_SDHC_IRQSTATEN_RD(x) (HW_SDHC_IRQSTATEN(x).U)
2956 #define HW_SDHC_IRQSTATEN_WR(x, v) (HW_SDHC_IRQSTATEN(x).U = (v))
2957 #define HW_SDHC_IRQSTATEN_SET(x, v) (HW_SDHC_IRQSTATEN_WR(x, HW_SDHC_IRQSTATEN_RD(x) | (v)))
2958 #define HW_SDHC_IRQSTATEN_CLR(x, v) (HW_SDHC_IRQSTATEN_WR(x, HW_SDHC_IRQSTATEN_RD(x) & ~(v)))
2959 #define HW_SDHC_IRQSTATEN_TOG(x, v) (HW_SDHC_IRQSTATEN_WR(x, HW_SDHC_IRQSTATEN_RD(x) ^ (v)))
2960 /*@}*/
2961
2962 /*
2963 * Constants & macros for individual SDHC_IRQSTATEN bitfields
2964 */
2965
2966 /*!
2967 * @name Register SDHC_IRQSTATEN, field CCSEN[0] (RW)
2968 *
2969 * Values:
2970 * - 0 - Masked
2971 * - 1 - Enabled
2972 */
2973 /*@{*/
2974 #define BP_SDHC_IRQSTATEN_CCSEN (0U) /*!< Bit position for SDHC_IRQSTATEN_CCSEN. */
2975 #define BM_SDHC_IRQSTATEN_CCSEN (0x00000001U) /*!< Bit mask for SDHC_IRQSTATEN_CCSEN. */
2976 #define BS_SDHC_IRQSTATEN_CCSEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_CCSEN. */
2977
2978 /*! @brief Read current value of the SDHC_IRQSTATEN_CCSEN field. */
2979 #define BR_SDHC_IRQSTATEN_CCSEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CCSEN))
2980
2981 /*! @brief Format value for bitfield SDHC_IRQSTATEN_CCSEN. */
2982 #define BF_SDHC_IRQSTATEN_CCSEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_CCSEN) & BM_SDHC_IRQSTATEN_CCSEN)
2983
2984 /*! @brief Set the CCSEN field to a new value. */
2985 #define BW_SDHC_IRQSTATEN_CCSEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CCSEN) = (v))
2986 /*@}*/
2987
2988 /*!
2989 * @name Register SDHC_IRQSTATEN, field TCSEN[1] (RW)
2990 *
2991 * Values:
2992 * - 0 - Masked
2993 * - 1 - Enabled
2994 */
2995 /*@{*/
2996 #define BP_SDHC_IRQSTATEN_TCSEN (1U) /*!< Bit position for SDHC_IRQSTATEN_TCSEN. */
2997 #define BM_SDHC_IRQSTATEN_TCSEN (0x00000002U) /*!< Bit mask for SDHC_IRQSTATEN_TCSEN. */
2998 #define BS_SDHC_IRQSTATEN_TCSEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_TCSEN. */
2999
3000 /*! @brief Read current value of the SDHC_IRQSTATEN_TCSEN field. */
3001 #define BR_SDHC_IRQSTATEN_TCSEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_TCSEN))
3002
3003 /*! @brief Format value for bitfield SDHC_IRQSTATEN_TCSEN. */
3004 #define BF_SDHC_IRQSTATEN_TCSEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_TCSEN) & BM_SDHC_IRQSTATEN_TCSEN)
3005
3006 /*! @brief Set the TCSEN field to a new value. */
3007 #define BW_SDHC_IRQSTATEN_TCSEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_TCSEN) = (v))
3008 /*@}*/
3009
3010 /*!
3011 * @name Register SDHC_IRQSTATEN, field BGESEN[2] (RW)
3012 *
3013 * Values:
3014 * - 0 - Masked
3015 * - 1 - Enabled
3016 */
3017 /*@{*/
3018 #define BP_SDHC_IRQSTATEN_BGESEN (2U) /*!< Bit position for SDHC_IRQSTATEN_BGESEN. */
3019 #define BM_SDHC_IRQSTATEN_BGESEN (0x00000004U) /*!< Bit mask for SDHC_IRQSTATEN_BGESEN. */
3020 #define BS_SDHC_IRQSTATEN_BGESEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_BGESEN. */
3021
3022 /*! @brief Read current value of the SDHC_IRQSTATEN_BGESEN field. */
3023 #define BR_SDHC_IRQSTATEN_BGESEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_BGESEN))
3024
3025 /*! @brief Format value for bitfield SDHC_IRQSTATEN_BGESEN. */
3026 #define BF_SDHC_IRQSTATEN_BGESEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_BGESEN) & BM_SDHC_IRQSTATEN_BGESEN)
3027
3028 /*! @brief Set the BGESEN field to a new value. */
3029 #define BW_SDHC_IRQSTATEN_BGESEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_BGESEN) = (v))
3030 /*@}*/
3031
3032 /*!
3033 * @name Register SDHC_IRQSTATEN, field DINTSEN[3] (RW)
3034 *
3035 * Values:
3036 * - 0 - Masked
3037 * - 1 - Enabled
3038 */
3039 /*@{*/
3040 #define BP_SDHC_IRQSTATEN_DINTSEN (3U) /*!< Bit position for SDHC_IRQSTATEN_DINTSEN. */
3041 #define BM_SDHC_IRQSTATEN_DINTSEN (0x00000008U) /*!< Bit mask for SDHC_IRQSTATEN_DINTSEN. */
3042 #define BS_SDHC_IRQSTATEN_DINTSEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_DINTSEN. */
3043
3044 /*! @brief Read current value of the SDHC_IRQSTATEN_DINTSEN field. */
3045 #define BR_SDHC_IRQSTATEN_DINTSEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_DINTSEN))
3046
3047 /*! @brief Format value for bitfield SDHC_IRQSTATEN_DINTSEN. */
3048 #define BF_SDHC_IRQSTATEN_DINTSEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_DINTSEN) & BM_SDHC_IRQSTATEN_DINTSEN)
3049
3050 /*! @brief Set the DINTSEN field to a new value. */
3051 #define BW_SDHC_IRQSTATEN_DINTSEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_DINTSEN) = (v))
3052 /*@}*/
3053
3054 /*!
3055 * @name Register SDHC_IRQSTATEN, field BWRSEN[4] (RW)
3056 *
3057 * Values:
3058 * - 0 - Masked
3059 * - 1 - Enabled
3060 */
3061 /*@{*/
3062 #define BP_SDHC_IRQSTATEN_BWRSEN (4U) /*!< Bit position for SDHC_IRQSTATEN_BWRSEN. */
3063 #define BM_SDHC_IRQSTATEN_BWRSEN (0x00000010U) /*!< Bit mask for SDHC_IRQSTATEN_BWRSEN. */
3064 #define BS_SDHC_IRQSTATEN_BWRSEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_BWRSEN. */
3065
3066 /*! @brief Read current value of the SDHC_IRQSTATEN_BWRSEN field. */
3067 #define BR_SDHC_IRQSTATEN_BWRSEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_BWRSEN))
3068
3069 /*! @brief Format value for bitfield SDHC_IRQSTATEN_BWRSEN. */
3070 #define BF_SDHC_IRQSTATEN_BWRSEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_BWRSEN) & BM_SDHC_IRQSTATEN_BWRSEN)
3071
3072 /*! @brief Set the BWRSEN field to a new value. */
3073 #define BW_SDHC_IRQSTATEN_BWRSEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_BWRSEN) = (v))
3074 /*@}*/
3075
3076 /*!
3077 * @name Register SDHC_IRQSTATEN, field BRRSEN[5] (RW)
3078 *
3079 * Values:
3080 * - 0 - Masked
3081 * - 1 - Enabled
3082 */
3083 /*@{*/
3084 #define BP_SDHC_IRQSTATEN_BRRSEN (5U) /*!< Bit position for SDHC_IRQSTATEN_BRRSEN. */
3085 #define BM_SDHC_IRQSTATEN_BRRSEN (0x00000020U) /*!< Bit mask for SDHC_IRQSTATEN_BRRSEN. */
3086 #define BS_SDHC_IRQSTATEN_BRRSEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_BRRSEN. */
3087
3088 /*! @brief Read current value of the SDHC_IRQSTATEN_BRRSEN field. */
3089 #define BR_SDHC_IRQSTATEN_BRRSEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_BRRSEN))
3090
3091 /*! @brief Format value for bitfield SDHC_IRQSTATEN_BRRSEN. */
3092 #define BF_SDHC_IRQSTATEN_BRRSEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_BRRSEN) & BM_SDHC_IRQSTATEN_BRRSEN)
3093
3094 /*! @brief Set the BRRSEN field to a new value. */
3095 #define BW_SDHC_IRQSTATEN_BRRSEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_BRRSEN) = (v))
3096 /*@}*/
3097
3098 /*!
3099 * @name Register SDHC_IRQSTATEN, field CINSEN[6] (RW)
3100 *
3101 * Values:
3102 * - 0 - Masked
3103 * - 1 - Enabled
3104 */
3105 /*@{*/
3106 #define BP_SDHC_IRQSTATEN_CINSEN (6U) /*!< Bit position for SDHC_IRQSTATEN_CINSEN. */
3107 #define BM_SDHC_IRQSTATEN_CINSEN (0x00000040U) /*!< Bit mask for SDHC_IRQSTATEN_CINSEN. */
3108 #define BS_SDHC_IRQSTATEN_CINSEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_CINSEN. */
3109
3110 /*! @brief Read current value of the SDHC_IRQSTATEN_CINSEN field. */
3111 #define BR_SDHC_IRQSTATEN_CINSEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CINSEN))
3112
3113 /*! @brief Format value for bitfield SDHC_IRQSTATEN_CINSEN. */
3114 #define BF_SDHC_IRQSTATEN_CINSEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_CINSEN) & BM_SDHC_IRQSTATEN_CINSEN)
3115
3116 /*! @brief Set the CINSEN field to a new value. */
3117 #define BW_SDHC_IRQSTATEN_CINSEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CINSEN) = (v))
3118 /*@}*/
3119
3120 /*!
3121 * @name Register SDHC_IRQSTATEN, field CRMSEN[7] (RW)
3122 *
3123 * Values:
3124 * - 0 - Masked
3125 * - 1 - Enabled
3126 */
3127 /*@{*/
3128 #define BP_SDHC_IRQSTATEN_CRMSEN (7U) /*!< Bit position for SDHC_IRQSTATEN_CRMSEN. */
3129 #define BM_SDHC_IRQSTATEN_CRMSEN (0x00000080U) /*!< Bit mask for SDHC_IRQSTATEN_CRMSEN. */
3130 #define BS_SDHC_IRQSTATEN_CRMSEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_CRMSEN. */
3131
3132 /*! @brief Read current value of the SDHC_IRQSTATEN_CRMSEN field. */
3133 #define BR_SDHC_IRQSTATEN_CRMSEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CRMSEN))
3134
3135 /*! @brief Format value for bitfield SDHC_IRQSTATEN_CRMSEN. */
3136 #define BF_SDHC_IRQSTATEN_CRMSEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_CRMSEN) & BM_SDHC_IRQSTATEN_CRMSEN)
3137
3138 /*! @brief Set the CRMSEN field to a new value. */
3139 #define BW_SDHC_IRQSTATEN_CRMSEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CRMSEN) = (v))
3140 /*@}*/
3141
3142 /*!
3143 * @name Register SDHC_IRQSTATEN, field CINTSEN[8] (RW)
3144 *
3145 * If this bit is set to 0, the SDHC will clear the interrupt request to the
3146 * system. The card interrupt detection is stopped when this bit is cleared and
3147 * restarted when this bit is set to 1. The host driver must clear the this bit
3148 * before servicing the card interrupt and must set this bit again after all interrupt
3149 * requests from the card are cleared to prevent inadvertent interrupts.
3150 *
3151 * Values:
3152 * - 0 - Masked
3153 * - 1 - Enabled
3154 */
3155 /*@{*/
3156 #define BP_SDHC_IRQSTATEN_CINTSEN (8U) /*!< Bit position for SDHC_IRQSTATEN_CINTSEN. */
3157 #define BM_SDHC_IRQSTATEN_CINTSEN (0x00000100U) /*!< Bit mask for SDHC_IRQSTATEN_CINTSEN. */
3158 #define BS_SDHC_IRQSTATEN_CINTSEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_CINTSEN. */
3159
3160 /*! @brief Read current value of the SDHC_IRQSTATEN_CINTSEN field. */
3161 #define BR_SDHC_IRQSTATEN_CINTSEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CINTSEN))
3162
3163 /*! @brief Format value for bitfield SDHC_IRQSTATEN_CINTSEN. */
3164 #define BF_SDHC_IRQSTATEN_CINTSEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_CINTSEN) & BM_SDHC_IRQSTATEN_CINTSEN)
3165
3166 /*! @brief Set the CINTSEN field to a new value. */
3167 #define BW_SDHC_IRQSTATEN_CINTSEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CINTSEN) = (v))
3168 /*@}*/
3169
3170 /*!
3171 * @name Register SDHC_IRQSTATEN, field CTOESEN[16] (RW)
3172 *
3173 * Values:
3174 * - 0 - Masked
3175 * - 1 - Enabled
3176 */
3177 /*@{*/
3178 #define BP_SDHC_IRQSTATEN_CTOESEN (16U) /*!< Bit position for SDHC_IRQSTATEN_CTOESEN. */
3179 #define BM_SDHC_IRQSTATEN_CTOESEN (0x00010000U) /*!< Bit mask for SDHC_IRQSTATEN_CTOESEN. */
3180 #define BS_SDHC_IRQSTATEN_CTOESEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_CTOESEN. */
3181
3182 /*! @brief Read current value of the SDHC_IRQSTATEN_CTOESEN field. */
3183 #define BR_SDHC_IRQSTATEN_CTOESEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CTOESEN))
3184
3185 /*! @brief Format value for bitfield SDHC_IRQSTATEN_CTOESEN. */
3186 #define BF_SDHC_IRQSTATEN_CTOESEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_CTOESEN) & BM_SDHC_IRQSTATEN_CTOESEN)
3187
3188 /*! @brief Set the CTOESEN field to a new value. */
3189 #define BW_SDHC_IRQSTATEN_CTOESEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CTOESEN) = (v))
3190 /*@}*/
3191
3192 /*!
3193 * @name Register SDHC_IRQSTATEN, field CCESEN[17] (RW)
3194 *
3195 * Values:
3196 * - 0 - Masked
3197 * - 1 - Enabled
3198 */
3199 /*@{*/
3200 #define BP_SDHC_IRQSTATEN_CCESEN (17U) /*!< Bit position for SDHC_IRQSTATEN_CCESEN. */
3201 #define BM_SDHC_IRQSTATEN_CCESEN (0x00020000U) /*!< Bit mask for SDHC_IRQSTATEN_CCESEN. */
3202 #define BS_SDHC_IRQSTATEN_CCESEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_CCESEN. */
3203
3204 /*! @brief Read current value of the SDHC_IRQSTATEN_CCESEN field. */
3205 #define BR_SDHC_IRQSTATEN_CCESEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CCESEN))
3206
3207 /*! @brief Format value for bitfield SDHC_IRQSTATEN_CCESEN. */
3208 #define BF_SDHC_IRQSTATEN_CCESEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_CCESEN) & BM_SDHC_IRQSTATEN_CCESEN)
3209
3210 /*! @brief Set the CCESEN field to a new value. */
3211 #define BW_SDHC_IRQSTATEN_CCESEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CCESEN) = (v))
3212 /*@}*/
3213
3214 /*!
3215 * @name Register SDHC_IRQSTATEN, field CEBESEN[18] (RW)
3216 *
3217 * Values:
3218 * - 0 - Masked
3219 * - 1 - Enabled
3220 */
3221 /*@{*/
3222 #define BP_SDHC_IRQSTATEN_CEBESEN (18U) /*!< Bit position for SDHC_IRQSTATEN_CEBESEN. */
3223 #define BM_SDHC_IRQSTATEN_CEBESEN (0x00040000U) /*!< Bit mask for SDHC_IRQSTATEN_CEBESEN. */
3224 #define BS_SDHC_IRQSTATEN_CEBESEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_CEBESEN. */
3225
3226 /*! @brief Read current value of the SDHC_IRQSTATEN_CEBESEN field. */
3227 #define BR_SDHC_IRQSTATEN_CEBESEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CEBESEN))
3228
3229 /*! @brief Format value for bitfield SDHC_IRQSTATEN_CEBESEN. */
3230 #define BF_SDHC_IRQSTATEN_CEBESEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_CEBESEN) & BM_SDHC_IRQSTATEN_CEBESEN)
3231
3232 /*! @brief Set the CEBESEN field to a new value. */
3233 #define BW_SDHC_IRQSTATEN_CEBESEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CEBESEN) = (v))
3234 /*@}*/
3235
3236 /*!
3237 * @name Register SDHC_IRQSTATEN, field CIESEN[19] (RW)
3238 *
3239 * Values:
3240 * - 0 - Masked
3241 * - 1 - Enabled
3242 */
3243 /*@{*/
3244 #define BP_SDHC_IRQSTATEN_CIESEN (19U) /*!< Bit position for SDHC_IRQSTATEN_CIESEN. */
3245 #define BM_SDHC_IRQSTATEN_CIESEN (0x00080000U) /*!< Bit mask for SDHC_IRQSTATEN_CIESEN. */
3246 #define BS_SDHC_IRQSTATEN_CIESEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_CIESEN. */
3247
3248 /*! @brief Read current value of the SDHC_IRQSTATEN_CIESEN field. */
3249 #define BR_SDHC_IRQSTATEN_CIESEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CIESEN))
3250
3251 /*! @brief Format value for bitfield SDHC_IRQSTATEN_CIESEN. */
3252 #define BF_SDHC_IRQSTATEN_CIESEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_CIESEN) & BM_SDHC_IRQSTATEN_CIESEN)
3253
3254 /*! @brief Set the CIESEN field to a new value. */
3255 #define BW_SDHC_IRQSTATEN_CIESEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_CIESEN) = (v))
3256 /*@}*/
3257
3258 /*!
3259 * @name Register SDHC_IRQSTATEN, field DTOESEN[20] (RW)
3260 *
3261 * Values:
3262 * - 0 - Masked
3263 * - 1 - Enabled
3264 */
3265 /*@{*/
3266 #define BP_SDHC_IRQSTATEN_DTOESEN (20U) /*!< Bit position for SDHC_IRQSTATEN_DTOESEN. */
3267 #define BM_SDHC_IRQSTATEN_DTOESEN (0x00100000U) /*!< Bit mask for SDHC_IRQSTATEN_DTOESEN. */
3268 #define BS_SDHC_IRQSTATEN_DTOESEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_DTOESEN. */
3269
3270 /*! @brief Read current value of the SDHC_IRQSTATEN_DTOESEN field. */
3271 #define BR_SDHC_IRQSTATEN_DTOESEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_DTOESEN))
3272
3273 /*! @brief Format value for bitfield SDHC_IRQSTATEN_DTOESEN. */
3274 #define BF_SDHC_IRQSTATEN_DTOESEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_DTOESEN) & BM_SDHC_IRQSTATEN_DTOESEN)
3275
3276 /*! @brief Set the DTOESEN field to a new value. */
3277 #define BW_SDHC_IRQSTATEN_DTOESEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_DTOESEN) = (v))
3278 /*@}*/
3279
3280 /*!
3281 * @name Register SDHC_IRQSTATEN, field DCESEN[21] (RW)
3282 *
3283 * Values:
3284 * - 0 - Masked
3285 * - 1 - Enabled
3286 */
3287 /*@{*/
3288 #define BP_SDHC_IRQSTATEN_DCESEN (21U) /*!< Bit position for SDHC_IRQSTATEN_DCESEN. */
3289 #define BM_SDHC_IRQSTATEN_DCESEN (0x00200000U) /*!< Bit mask for SDHC_IRQSTATEN_DCESEN. */
3290 #define BS_SDHC_IRQSTATEN_DCESEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_DCESEN. */
3291
3292 /*! @brief Read current value of the SDHC_IRQSTATEN_DCESEN field. */
3293 #define BR_SDHC_IRQSTATEN_DCESEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_DCESEN))
3294
3295 /*! @brief Format value for bitfield SDHC_IRQSTATEN_DCESEN. */
3296 #define BF_SDHC_IRQSTATEN_DCESEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_DCESEN) & BM_SDHC_IRQSTATEN_DCESEN)
3297
3298 /*! @brief Set the DCESEN field to a new value. */
3299 #define BW_SDHC_IRQSTATEN_DCESEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_DCESEN) = (v))
3300 /*@}*/
3301
3302 /*!
3303 * @name Register SDHC_IRQSTATEN, field DEBESEN[22] (RW)
3304 *
3305 * Values:
3306 * - 0 - Masked
3307 * - 1 - Enabled
3308 */
3309 /*@{*/
3310 #define BP_SDHC_IRQSTATEN_DEBESEN (22U) /*!< Bit position for SDHC_IRQSTATEN_DEBESEN. */
3311 #define BM_SDHC_IRQSTATEN_DEBESEN (0x00400000U) /*!< Bit mask for SDHC_IRQSTATEN_DEBESEN. */
3312 #define BS_SDHC_IRQSTATEN_DEBESEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_DEBESEN. */
3313
3314 /*! @brief Read current value of the SDHC_IRQSTATEN_DEBESEN field. */
3315 #define BR_SDHC_IRQSTATEN_DEBESEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_DEBESEN))
3316
3317 /*! @brief Format value for bitfield SDHC_IRQSTATEN_DEBESEN. */
3318 #define BF_SDHC_IRQSTATEN_DEBESEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_DEBESEN) & BM_SDHC_IRQSTATEN_DEBESEN)
3319
3320 /*! @brief Set the DEBESEN field to a new value. */
3321 #define BW_SDHC_IRQSTATEN_DEBESEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_DEBESEN) = (v))
3322 /*@}*/
3323
3324 /*!
3325 * @name Register SDHC_IRQSTATEN, field AC12ESEN[24] (RW)
3326 *
3327 * Values:
3328 * - 0 - Masked
3329 * - 1 - Enabled
3330 */
3331 /*@{*/
3332 #define BP_SDHC_IRQSTATEN_AC12ESEN (24U) /*!< Bit position for SDHC_IRQSTATEN_AC12ESEN. */
3333 #define BM_SDHC_IRQSTATEN_AC12ESEN (0x01000000U) /*!< Bit mask for SDHC_IRQSTATEN_AC12ESEN. */
3334 #define BS_SDHC_IRQSTATEN_AC12ESEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_AC12ESEN. */
3335
3336 /*! @brief Read current value of the SDHC_IRQSTATEN_AC12ESEN field. */
3337 #define BR_SDHC_IRQSTATEN_AC12ESEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_AC12ESEN))
3338
3339 /*! @brief Format value for bitfield SDHC_IRQSTATEN_AC12ESEN. */
3340 #define BF_SDHC_IRQSTATEN_AC12ESEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_AC12ESEN) & BM_SDHC_IRQSTATEN_AC12ESEN)
3341
3342 /*! @brief Set the AC12ESEN field to a new value. */
3343 #define BW_SDHC_IRQSTATEN_AC12ESEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_AC12ESEN) = (v))
3344 /*@}*/
3345
3346 /*!
3347 * @name Register SDHC_IRQSTATEN, field DMAESEN[28] (RW)
3348 *
3349 * Values:
3350 * - 0 - Masked
3351 * - 1 - Enabled
3352 */
3353 /*@{*/
3354 #define BP_SDHC_IRQSTATEN_DMAESEN (28U) /*!< Bit position for SDHC_IRQSTATEN_DMAESEN. */
3355 #define BM_SDHC_IRQSTATEN_DMAESEN (0x10000000U) /*!< Bit mask for SDHC_IRQSTATEN_DMAESEN. */
3356 #define BS_SDHC_IRQSTATEN_DMAESEN (1U) /*!< Bit field size in bits for SDHC_IRQSTATEN_DMAESEN. */
3357
3358 /*! @brief Read current value of the SDHC_IRQSTATEN_DMAESEN field. */
3359 #define BR_SDHC_IRQSTATEN_DMAESEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_DMAESEN))
3360
3361 /*! @brief Format value for bitfield SDHC_IRQSTATEN_DMAESEN. */
3362 #define BF_SDHC_IRQSTATEN_DMAESEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSTATEN_DMAESEN) & BM_SDHC_IRQSTATEN_DMAESEN)
3363
3364 /*! @brief Set the DMAESEN field to a new value. */
3365 #define BW_SDHC_IRQSTATEN_DMAESEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSTATEN_ADDR(x), BP_SDHC_IRQSTATEN_DMAESEN) = (v))
3366 /*@}*/
3367
3368 /*******************************************************************************
3369 * HW_SDHC_IRQSIGEN - Interrupt Signal Enable register
3370 ******************************************************************************/
3371
3372 /*!
3373 * @brief HW_SDHC_IRQSIGEN - Interrupt Signal Enable register (RW)
3374 *
3375 * Reset value: 0x00000000U
3376 *
3377 * This register is used to select which interrupt status is indicated to the
3378 * host system as the interrupt. All of these status bits share the same interrupt
3379 * line. Setting any of these bits to 1 enables interrupt generation. The
3380 * corresponding status register bit will generate an interrupt when the corresponding
3381 * interrupt signal enable bit is set.
3382 */
3383 typedef union _hw_sdhc_irqsigen
3384 {
3385 uint32_t U;
3386 struct _hw_sdhc_irqsigen_bitfields
3387 {
3388 uint32_t CCIEN : 1; /*!< [0] Command Complete Interrupt Enable */
3389 uint32_t TCIEN : 1; /*!< [1] Transfer Complete Interrupt Enable */
3390 uint32_t BGEIEN : 1; /*!< [2] Block Gap Event Interrupt Enable */
3391 uint32_t DINTIEN : 1; /*!< [3] DMA Interrupt Enable */
3392 uint32_t BWRIEN : 1; /*!< [4] Buffer Write Ready Interrupt Enable */
3393 uint32_t BRRIEN : 1; /*!< [5] Buffer Read Ready Interrupt Enable */
3394 uint32_t CINSIEN : 1; /*!< [6] Card Insertion Interrupt Enable */
3395 uint32_t CRMIEN : 1; /*!< [7] Card Removal Interrupt Enable */
3396 uint32_t CINTIEN : 1; /*!< [8] Card Interrupt Enable */
3397 uint32_t RESERVED0 : 7; /*!< [15:9] */
3398 uint32_t CTOEIEN : 1; /*!< [16] Command Timeout Error Interrupt
3399 * Enable */
3400 uint32_t CCEIEN : 1; /*!< [17] Command CRC Error Interrupt Enable */
3401 uint32_t CEBEIEN : 1; /*!< [18] Command End Bit Error Interrupt
3402 * Enable */
3403 uint32_t CIEIEN : 1; /*!< [19] Command Index Error Interrupt Enable */
3404 uint32_t DTOEIEN : 1; /*!< [20] Data Timeout Error Interrupt Enable */
3405 uint32_t DCEIEN : 1; /*!< [21] Data CRC Error Interrupt Enable */
3406 uint32_t DEBEIEN : 1; /*!< [22] Data End Bit Error Interrupt Enable */
3407 uint32_t RESERVED1 : 1; /*!< [23] */
3408 uint32_t AC12EIEN : 1; /*!< [24] Auto CMD12 Error Interrupt Enable */
3409 uint32_t RESERVED2 : 3; /*!< [27:25] */
3410 uint32_t DMAEIEN : 1; /*!< [28] DMA Error Interrupt Enable */
3411 uint32_t RESERVED3 : 3; /*!< [31:29] */
3412 } B;
3413 } hw_sdhc_irqsigen_t;
3414
3415 /*!
3416 * @name Constants and macros for entire SDHC_IRQSIGEN register
3417 */
3418 /*@{*/
3419 #define HW_SDHC_IRQSIGEN_ADDR(x) ((x) + 0x38U)
3420
3421 #define HW_SDHC_IRQSIGEN(x) (*(__IO hw_sdhc_irqsigen_t *) HW_SDHC_IRQSIGEN_ADDR(x))
3422 #define HW_SDHC_IRQSIGEN_RD(x) (HW_SDHC_IRQSIGEN(x).U)
3423 #define HW_SDHC_IRQSIGEN_WR(x, v) (HW_SDHC_IRQSIGEN(x).U = (v))
3424 #define HW_SDHC_IRQSIGEN_SET(x, v) (HW_SDHC_IRQSIGEN_WR(x, HW_SDHC_IRQSIGEN_RD(x) | (v)))
3425 #define HW_SDHC_IRQSIGEN_CLR(x, v) (HW_SDHC_IRQSIGEN_WR(x, HW_SDHC_IRQSIGEN_RD(x) & ~(v)))
3426 #define HW_SDHC_IRQSIGEN_TOG(x, v) (HW_SDHC_IRQSIGEN_WR(x, HW_SDHC_IRQSIGEN_RD(x) ^ (v)))
3427 /*@}*/
3428
3429 /*
3430 * Constants & macros for individual SDHC_IRQSIGEN bitfields
3431 */
3432
3433 /*!
3434 * @name Register SDHC_IRQSIGEN, field CCIEN[0] (RW)
3435 *
3436 * Values:
3437 * - 0 - Masked
3438 * - 1 - Enabled
3439 */
3440 /*@{*/
3441 #define BP_SDHC_IRQSIGEN_CCIEN (0U) /*!< Bit position for SDHC_IRQSIGEN_CCIEN. */
3442 #define BM_SDHC_IRQSIGEN_CCIEN (0x00000001U) /*!< Bit mask for SDHC_IRQSIGEN_CCIEN. */
3443 #define BS_SDHC_IRQSIGEN_CCIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_CCIEN. */
3444
3445 /*! @brief Read current value of the SDHC_IRQSIGEN_CCIEN field. */
3446 #define BR_SDHC_IRQSIGEN_CCIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CCIEN))
3447
3448 /*! @brief Format value for bitfield SDHC_IRQSIGEN_CCIEN. */
3449 #define BF_SDHC_IRQSIGEN_CCIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_CCIEN) & BM_SDHC_IRQSIGEN_CCIEN)
3450
3451 /*! @brief Set the CCIEN field to a new value. */
3452 #define BW_SDHC_IRQSIGEN_CCIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CCIEN) = (v))
3453 /*@}*/
3454
3455 /*!
3456 * @name Register SDHC_IRQSIGEN, field TCIEN[1] (RW)
3457 *
3458 * Values:
3459 * - 0 - Masked
3460 * - 1 - Enabled
3461 */
3462 /*@{*/
3463 #define BP_SDHC_IRQSIGEN_TCIEN (1U) /*!< Bit position for SDHC_IRQSIGEN_TCIEN. */
3464 #define BM_SDHC_IRQSIGEN_TCIEN (0x00000002U) /*!< Bit mask for SDHC_IRQSIGEN_TCIEN. */
3465 #define BS_SDHC_IRQSIGEN_TCIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_TCIEN. */
3466
3467 /*! @brief Read current value of the SDHC_IRQSIGEN_TCIEN field. */
3468 #define BR_SDHC_IRQSIGEN_TCIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_TCIEN))
3469
3470 /*! @brief Format value for bitfield SDHC_IRQSIGEN_TCIEN. */
3471 #define BF_SDHC_IRQSIGEN_TCIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_TCIEN) & BM_SDHC_IRQSIGEN_TCIEN)
3472
3473 /*! @brief Set the TCIEN field to a new value. */
3474 #define BW_SDHC_IRQSIGEN_TCIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_TCIEN) = (v))
3475 /*@}*/
3476
3477 /*!
3478 * @name Register SDHC_IRQSIGEN, field BGEIEN[2] (RW)
3479 *
3480 * Values:
3481 * - 0 - Masked
3482 * - 1 - Enabled
3483 */
3484 /*@{*/
3485 #define BP_SDHC_IRQSIGEN_BGEIEN (2U) /*!< Bit position for SDHC_IRQSIGEN_BGEIEN. */
3486 #define BM_SDHC_IRQSIGEN_BGEIEN (0x00000004U) /*!< Bit mask for SDHC_IRQSIGEN_BGEIEN. */
3487 #define BS_SDHC_IRQSIGEN_BGEIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_BGEIEN. */
3488
3489 /*! @brief Read current value of the SDHC_IRQSIGEN_BGEIEN field. */
3490 #define BR_SDHC_IRQSIGEN_BGEIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_BGEIEN))
3491
3492 /*! @brief Format value for bitfield SDHC_IRQSIGEN_BGEIEN. */
3493 #define BF_SDHC_IRQSIGEN_BGEIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_BGEIEN) & BM_SDHC_IRQSIGEN_BGEIEN)
3494
3495 /*! @brief Set the BGEIEN field to a new value. */
3496 #define BW_SDHC_IRQSIGEN_BGEIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_BGEIEN) = (v))
3497 /*@}*/
3498
3499 /*!
3500 * @name Register SDHC_IRQSIGEN, field DINTIEN[3] (RW)
3501 *
3502 * Values:
3503 * - 0 - Masked
3504 * - 1 - Enabled
3505 */
3506 /*@{*/
3507 #define BP_SDHC_IRQSIGEN_DINTIEN (3U) /*!< Bit position for SDHC_IRQSIGEN_DINTIEN. */
3508 #define BM_SDHC_IRQSIGEN_DINTIEN (0x00000008U) /*!< Bit mask for SDHC_IRQSIGEN_DINTIEN. */
3509 #define BS_SDHC_IRQSIGEN_DINTIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_DINTIEN. */
3510
3511 /*! @brief Read current value of the SDHC_IRQSIGEN_DINTIEN field. */
3512 #define BR_SDHC_IRQSIGEN_DINTIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_DINTIEN))
3513
3514 /*! @brief Format value for bitfield SDHC_IRQSIGEN_DINTIEN. */
3515 #define BF_SDHC_IRQSIGEN_DINTIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_DINTIEN) & BM_SDHC_IRQSIGEN_DINTIEN)
3516
3517 /*! @brief Set the DINTIEN field to a new value. */
3518 #define BW_SDHC_IRQSIGEN_DINTIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_DINTIEN) = (v))
3519 /*@}*/
3520
3521 /*!
3522 * @name Register SDHC_IRQSIGEN, field BWRIEN[4] (RW)
3523 *
3524 * Values:
3525 * - 0 - Masked
3526 * - 1 - Enabled
3527 */
3528 /*@{*/
3529 #define BP_SDHC_IRQSIGEN_BWRIEN (4U) /*!< Bit position for SDHC_IRQSIGEN_BWRIEN. */
3530 #define BM_SDHC_IRQSIGEN_BWRIEN (0x00000010U) /*!< Bit mask for SDHC_IRQSIGEN_BWRIEN. */
3531 #define BS_SDHC_IRQSIGEN_BWRIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_BWRIEN. */
3532
3533 /*! @brief Read current value of the SDHC_IRQSIGEN_BWRIEN field. */
3534 #define BR_SDHC_IRQSIGEN_BWRIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_BWRIEN))
3535
3536 /*! @brief Format value for bitfield SDHC_IRQSIGEN_BWRIEN. */
3537 #define BF_SDHC_IRQSIGEN_BWRIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_BWRIEN) & BM_SDHC_IRQSIGEN_BWRIEN)
3538
3539 /*! @brief Set the BWRIEN field to a new value. */
3540 #define BW_SDHC_IRQSIGEN_BWRIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_BWRIEN) = (v))
3541 /*@}*/
3542
3543 /*!
3544 * @name Register SDHC_IRQSIGEN, field BRRIEN[5] (RW)
3545 *
3546 * Values:
3547 * - 0 - Masked
3548 * - 1 - Enabled
3549 */
3550 /*@{*/
3551 #define BP_SDHC_IRQSIGEN_BRRIEN (5U) /*!< Bit position for SDHC_IRQSIGEN_BRRIEN. */
3552 #define BM_SDHC_IRQSIGEN_BRRIEN (0x00000020U) /*!< Bit mask for SDHC_IRQSIGEN_BRRIEN. */
3553 #define BS_SDHC_IRQSIGEN_BRRIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_BRRIEN. */
3554
3555 /*! @brief Read current value of the SDHC_IRQSIGEN_BRRIEN field. */
3556 #define BR_SDHC_IRQSIGEN_BRRIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_BRRIEN))
3557
3558 /*! @brief Format value for bitfield SDHC_IRQSIGEN_BRRIEN. */
3559 #define BF_SDHC_IRQSIGEN_BRRIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_BRRIEN) & BM_SDHC_IRQSIGEN_BRRIEN)
3560
3561 /*! @brief Set the BRRIEN field to a new value. */
3562 #define BW_SDHC_IRQSIGEN_BRRIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_BRRIEN) = (v))
3563 /*@}*/
3564
3565 /*!
3566 * @name Register SDHC_IRQSIGEN, field CINSIEN[6] (RW)
3567 *
3568 * Values:
3569 * - 0 - Masked
3570 * - 1 - Enabled
3571 */
3572 /*@{*/
3573 #define BP_SDHC_IRQSIGEN_CINSIEN (6U) /*!< Bit position for SDHC_IRQSIGEN_CINSIEN. */
3574 #define BM_SDHC_IRQSIGEN_CINSIEN (0x00000040U) /*!< Bit mask for SDHC_IRQSIGEN_CINSIEN. */
3575 #define BS_SDHC_IRQSIGEN_CINSIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_CINSIEN. */
3576
3577 /*! @brief Read current value of the SDHC_IRQSIGEN_CINSIEN field. */
3578 #define BR_SDHC_IRQSIGEN_CINSIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CINSIEN))
3579
3580 /*! @brief Format value for bitfield SDHC_IRQSIGEN_CINSIEN. */
3581 #define BF_SDHC_IRQSIGEN_CINSIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_CINSIEN) & BM_SDHC_IRQSIGEN_CINSIEN)
3582
3583 /*! @brief Set the CINSIEN field to a new value. */
3584 #define BW_SDHC_IRQSIGEN_CINSIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CINSIEN) = (v))
3585 /*@}*/
3586
3587 /*!
3588 * @name Register SDHC_IRQSIGEN, field CRMIEN[7] (RW)
3589 *
3590 * Values:
3591 * - 0 - Masked
3592 * - 1 - Enabled
3593 */
3594 /*@{*/
3595 #define BP_SDHC_IRQSIGEN_CRMIEN (7U) /*!< Bit position for SDHC_IRQSIGEN_CRMIEN. */
3596 #define BM_SDHC_IRQSIGEN_CRMIEN (0x00000080U) /*!< Bit mask for SDHC_IRQSIGEN_CRMIEN. */
3597 #define BS_SDHC_IRQSIGEN_CRMIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_CRMIEN. */
3598
3599 /*! @brief Read current value of the SDHC_IRQSIGEN_CRMIEN field. */
3600 #define BR_SDHC_IRQSIGEN_CRMIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CRMIEN))
3601
3602 /*! @brief Format value for bitfield SDHC_IRQSIGEN_CRMIEN. */
3603 #define BF_SDHC_IRQSIGEN_CRMIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_CRMIEN) & BM_SDHC_IRQSIGEN_CRMIEN)
3604
3605 /*! @brief Set the CRMIEN field to a new value. */
3606 #define BW_SDHC_IRQSIGEN_CRMIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CRMIEN) = (v))
3607 /*@}*/
3608
3609 /*!
3610 * @name Register SDHC_IRQSIGEN, field CINTIEN[8] (RW)
3611 *
3612 * Values:
3613 * - 0 - Masked
3614 * - 1 - Enabled
3615 */
3616 /*@{*/
3617 #define BP_SDHC_IRQSIGEN_CINTIEN (8U) /*!< Bit position for SDHC_IRQSIGEN_CINTIEN. */
3618 #define BM_SDHC_IRQSIGEN_CINTIEN (0x00000100U) /*!< Bit mask for SDHC_IRQSIGEN_CINTIEN. */
3619 #define BS_SDHC_IRQSIGEN_CINTIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_CINTIEN. */
3620
3621 /*! @brief Read current value of the SDHC_IRQSIGEN_CINTIEN field. */
3622 #define BR_SDHC_IRQSIGEN_CINTIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CINTIEN))
3623
3624 /*! @brief Format value for bitfield SDHC_IRQSIGEN_CINTIEN. */
3625 #define BF_SDHC_IRQSIGEN_CINTIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_CINTIEN) & BM_SDHC_IRQSIGEN_CINTIEN)
3626
3627 /*! @brief Set the CINTIEN field to a new value. */
3628 #define BW_SDHC_IRQSIGEN_CINTIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CINTIEN) = (v))
3629 /*@}*/
3630
3631 /*!
3632 * @name Register SDHC_IRQSIGEN, field CTOEIEN[16] (RW)
3633 *
3634 * Values:
3635 * - 0 - Masked
3636 * - 1 - Enabled
3637 */
3638 /*@{*/
3639 #define BP_SDHC_IRQSIGEN_CTOEIEN (16U) /*!< Bit position for SDHC_IRQSIGEN_CTOEIEN. */
3640 #define BM_SDHC_IRQSIGEN_CTOEIEN (0x00010000U) /*!< Bit mask for SDHC_IRQSIGEN_CTOEIEN. */
3641 #define BS_SDHC_IRQSIGEN_CTOEIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_CTOEIEN. */
3642
3643 /*! @brief Read current value of the SDHC_IRQSIGEN_CTOEIEN field. */
3644 #define BR_SDHC_IRQSIGEN_CTOEIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CTOEIEN))
3645
3646 /*! @brief Format value for bitfield SDHC_IRQSIGEN_CTOEIEN. */
3647 #define BF_SDHC_IRQSIGEN_CTOEIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_CTOEIEN) & BM_SDHC_IRQSIGEN_CTOEIEN)
3648
3649 /*! @brief Set the CTOEIEN field to a new value. */
3650 #define BW_SDHC_IRQSIGEN_CTOEIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CTOEIEN) = (v))
3651 /*@}*/
3652
3653 /*!
3654 * @name Register SDHC_IRQSIGEN, field CCEIEN[17] (RW)
3655 *
3656 * Values:
3657 * - 0 - Masked
3658 * - 1 - Enabled
3659 */
3660 /*@{*/
3661 #define BP_SDHC_IRQSIGEN_CCEIEN (17U) /*!< Bit position for SDHC_IRQSIGEN_CCEIEN. */
3662 #define BM_SDHC_IRQSIGEN_CCEIEN (0x00020000U) /*!< Bit mask for SDHC_IRQSIGEN_CCEIEN. */
3663 #define BS_SDHC_IRQSIGEN_CCEIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_CCEIEN. */
3664
3665 /*! @brief Read current value of the SDHC_IRQSIGEN_CCEIEN field. */
3666 #define BR_SDHC_IRQSIGEN_CCEIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CCEIEN))
3667
3668 /*! @brief Format value for bitfield SDHC_IRQSIGEN_CCEIEN. */
3669 #define BF_SDHC_IRQSIGEN_CCEIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_CCEIEN) & BM_SDHC_IRQSIGEN_CCEIEN)
3670
3671 /*! @brief Set the CCEIEN field to a new value. */
3672 #define BW_SDHC_IRQSIGEN_CCEIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CCEIEN) = (v))
3673 /*@}*/
3674
3675 /*!
3676 * @name Register SDHC_IRQSIGEN, field CEBEIEN[18] (RW)
3677 *
3678 * Values:
3679 * - 0 - Masked
3680 * - 1 - Enabled
3681 */
3682 /*@{*/
3683 #define BP_SDHC_IRQSIGEN_CEBEIEN (18U) /*!< Bit position for SDHC_IRQSIGEN_CEBEIEN. */
3684 #define BM_SDHC_IRQSIGEN_CEBEIEN (0x00040000U) /*!< Bit mask for SDHC_IRQSIGEN_CEBEIEN. */
3685 #define BS_SDHC_IRQSIGEN_CEBEIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_CEBEIEN. */
3686
3687 /*! @brief Read current value of the SDHC_IRQSIGEN_CEBEIEN field. */
3688 #define BR_SDHC_IRQSIGEN_CEBEIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CEBEIEN))
3689
3690 /*! @brief Format value for bitfield SDHC_IRQSIGEN_CEBEIEN. */
3691 #define BF_SDHC_IRQSIGEN_CEBEIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_CEBEIEN) & BM_SDHC_IRQSIGEN_CEBEIEN)
3692
3693 /*! @brief Set the CEBEIEN field to a new value. */
3694 #define BW_SDHC_IRQSIGEN_CEBEIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CEBEIEN) = (v))
3695 /*@}*/
3696
3697 /*!
3698 * @name Register SDHC_IRQSIGEN, field CIEIEN[19] (RW)
3699 *
3700 * Values:
3701 * - 0 - Masked
3702 * - 1 - Enabled
3703 */
3704 /*@{*/
3705 #define BP_SDHC_IRQSIGEN_CIEIEN (19U) /*!< Bit position for SDHC_IRQSIGEN_CIEIEN. */
3706 #define BM_SDHC_IRQSIGEN_CIEIEN (0x00080000U) /*!< Bit mask for SDHC_IRQSIGEN_CIEIEN. */
3707 #define BS_SDHC_IRQSIGEN_CIEIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_CIEIEN. */
3708
3709 /*! @brief Read current value of the SDHC_IRQSIGEN_CIEIEN field. */
3710 #define BR_SDHC_IRQSIGEN_CIEIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CIEIEN))
3711
3712 /*! @brief Format value for bitfield SDHC_IRQSIGEN_CIEIEN. */
3713 #define BF_SDHC_IRQSIGEN_CIEIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_CIEIEN) & BM_SDHC_IRQSIGEN_CIEIEN)
3714
3715 /*! @brief Set the CIEIEN field to a new value. */
3716 #define BW_SDHC_IRQSIGEN_CIEIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_CIEIEN) = (v))
3717 /*@}*/
3718
3719 /*!
3720 * @name Register SDHC_IRQSIGEN, field DTOEIEN[20] (RW)
3721 *
3722 * Values:
3723 * - 0 - Masked
3724 * - 1 - Enabled
3725 */
3726 /*@{*/
3727 #define BP_SDHC_IRQSIGEN_DTOEIEN (20U) /*!< Bit position for SDHC_IRQSIGEN_DTOEIEN. */
3728 #define BM_SDHC_IRQSIGEN_DTOEIEN (0x00100000U) /*!< Bit mask for SDHC_IRQSIGEN_DTOEIEN. */
3729 #define BS_SDHC_IRQSIGEN_DTOEIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_DTOEIEN. */
3730
3731 /*! @brief Read current value of the SDHC_IRQSIGEN_DTOEIEN field. */
3732 #define BR_SDHC_IRQSIGEN_DTOEIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_DTOEIEN))
3733
3734 /*! @brief Format value for bitfield SDHC_IRQSIGEN_DTOEIEN. */
3735 #define BF_SDHC_IRQSIGEN_DTOEIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_DTOEIEN) & BM_SDHC_IRQSIGEN_DTOEIEN)
3736
3737 /*! @brief Set the DTOEIEN field to a new value. */
3738 #define BW_SDHC_IRQSIGEN_DTOEIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_DTOEIEN) = (v))
3739 /*@}*/
3740
3741 /*!
3742 * @name Register SDHC_IRQSIGEN, field DCEIEN[21] (RW)
3743 *
3744 * Values:
3745 * - 0 - Masked
3746 * - 1 - Enabled
3747 */
3748 /*@{*/
3749 #define BP_SDHC_IRQSIGEN_DCEIEN (21U) /*!< Bit position for SDHC_IRQSIGEN_DCEIEN. */
3750 #define BM_SDHC_IRQSIGEN_DCEIEN (0x00200000U) /*!< Bit mask for SDHC_IRQSIGEN_DCEIEN. */
3751 #define BS_SDHC_IRQSIGEN_DCEIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_DCEIEN. */
3752
3753 /*! @brief Read current value of the SDHC_IRQSIGEN_DCEIEN field. */
3754 #define BR_SDHC_IRQSIGEN_DCEIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_DCEIEN))
3755
3756 /*! @brief Format value for bitfield SDHC_IRQSIGEN_DCEIEN. */
3757 #define BF_SDHC_IRQSIGEN_DCEIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_DCEIEN) & BM_SDHC_IRQSIGEN_DCEIEN)
3758
3759 /*! @brief Set the DCEIEN field to a new value. */
3760 #define BW_SDHC_IRQSIGEN_DCEIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_DCEIEN) = (v))
3761 /*@}*/
3762
3763 /*!
3764 * @name Register SDHC_IRQSIGEN, field DEBEIEN[22] (RW)
3765 *
3766 * Values:
3767 * - 0 - Masked
3768 * - 1 - Enabled
3769 */
3770 /*@{*/
3771 #define BP_SDHC_IRQSIGEN_DEBEIEN (22U) /*!< Bit position for SDHC_IRQSIGEN_DEBEIEN. */
3772 #define BM_SDHC_IRQSIGEN_DEBEIEN (0x00400000U) /*!< Bit mask for SDHC_IRQSIGEN_DEBEIEN. */
3773 #define BS_SDHC_IRQSIGEN_DEBEIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_DEBEIEN. */
3774
3775 /*! @brief Read current value of the SDHC_IRQSIGEN_DEBEIEN field. */
3776 #define BR_SDHC_IRQSIGEN_DEBEIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_DEBEIEN))
3777
3778 /*! @brief Format value for bitfield SDHC_IRQSIGEN_DEBEIEN. */
3779 #define BF_SDHC_IRQSIGEN_DEBEIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_DEBEIEN) & BM_SDHC_IRQSIGEN_DEBEIEN)
3780
3781 /*! @brief Set the DEBEIEN field to a new value. */
3782 #define BW_SDHC_IRQSIGEN_DEBEIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_DEBEIEN) = (v))
3783 /*@}*/
3784
3785 /*!
3786 * @name Register SDHC_IRQSIGEN, field AC12EIEN[24] (RW)
3787 *
3788 * Values:
3789 * - 0 - Masked
3790 * - 1 - Enabled
3791 */
3792 /*@{*/
3793 #define BP_SDHC_IRQSIGEN_AC12EIEN (24U) /*!< Bit position for SDHC_IRQSIGEN_AC12EIEN. */
3794 #define BM_SDHC_IRQSIGEN_AC12EIEN (0x01000000U) /*!< Bit mask for SDHC_IRQSIGEN_AC12EIEN. */
3795 #define BS_SDHC_IRQSIGEN_AC12EIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_AC12EIEN. */
3796
3797 /*! @brief Read current value of the SDHC_IRQSIGEN_AC12EIEN field. */
3798 #define BR_SDHC_IRQSIGEN_AC12EIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_AC12EIEN))
3799
3800 /*! @brief Format value for bitfield SDHC_IRQSIGEN_AC12EIEN. */
3801 #define BF_SDHC_IRQSIGEN_AC12EIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_AC12EIEN) & BM_SDHC_IRQSIGEN_AC12EIEN)
3802
3803 /*! @brief Set the AC12EIEN field to a new value. */
3804 #define BW_SDHC_IRQSIGEN_AC12EIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_AC12EIEN) = (v))
3805 /*@}*/
3806
3807 /*!
3808 * @name Register SDHC_IRQSIGEN, field DMAEIEN[28] (RW)
3809 *
3810 * Values:
3811 * - 0 - Masked
3812 * - 1 - Enabled
3813 */
3814 /*@{*/
3815 #define BP_SDHC_IRQSIGEN_DMAEIEN (28U) /*!< Bit position for SDHC_IRQSIGEN_DMAEIEN. */
3816 #define BM_SDHC_IRQSIGEN_DMAEIEN (0x10000000U) /*!< Bit mask for SDHC_IRQSIGEN_DMAEIEN. */
3817 #define BS_SDHC_IRQSIGEN_DMAEIEN (1U) /*!< Bit field size in bits for SDHC_IRQSIGEN_DMAEIEN. */
3818
3819 /*! @brief Read current value of the SDHC_IRQSIGEN_DMAEIEN field. */
3820 #define BR_SDHC_IRQSIGEN_DMAEIEN(x) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_DMAEIEN))
3821
3822 /*! @brief Format value for bitfield SDHC_IRQSIGEN_DMAEIEN. */
3823 #define BF_SDHC_IRQSIGEN_DMAEIEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_IRQSIGEN_DMAEIEN) & BM_SDHC_IRQSIGEN_DMAEIEN)
3824
3825 /*! @brief Set the DMAEIEN field to a new value. */
3826 #define BW_SDHC_IRQSIGEN_DMAEIEN(x, v) (BITBAND_ACCESS32(HW_SDHC_IRQSIGEN_ADDR(x), BP_SDHC_IRQSIGEN_DMAEIEN) = (v))
3827 /*@}*/
3828
3829 /*******************************************************************************
3830 * HW_SDHC_AC12ERR - Auto CMD12 Error Status Register
3831 ******************************************************************************/
3832
3833 /*!
3834 * @brief HW_SDHC_AC12ERR - Auto CMD12 Error Status Register (RO)
3835 *
3836 * Reset value: 0x00000000U
3837 *
3838 * When the AC12ESEN bit in the Status register is set, the host driver shall
3839 * check this register to identify what kind of error the Auto CMD12 indicated.
3840 * This register is valid only when the Auto CMD12 Error status bit is set. The
3841 * following table shows the relationship between the Auto CMGD12 CRC error and the
3842 * Auto CMD12 command timeout error. Relationship between Command CRC Error and
3843 * Command Timeout Error For Auto CMD12 Auto CMD12 CRC error Auto CMD12 timeout
3844 * error Type of error 0 0 No error 0 1 Response timeout error 1 0 Response CRC
3845 * error 1 1 CMD line conflict Changes in Auto CMD12 Error Status register can be
3846 * classified in three scenarios: When the SDHC is going to issue an Auto CMD12: Set
3847 * bit 0 to 1 if the Auto CMD12 can't be issued due to an error in the previous
3848 * command. Set bit 0 to 0 if the auto CMD12 is issued. At the end bit of an auto
3849 * CMD12 response: Check errors corresponding to bits 1-4. Set bits 1-4
3850 * corresponding to detected errors. Clear bits 1-4 corresponding to detected errors.
3851 * Before reading the Auto CMD12 error status bit 7: Set bit 7 to 1 if there is a
3852 * command that can't be issued. Clear bit 7 if there is no command to issue. The
3853 * timing for generating the auto CMD12 error and writing to the command register
3854 * are asynchronous. After that, bit 7 shall be sampled when the driver is not
3855 * writing to the command register. So it is suggested to read this register only
3856 * when IRQSTAT[AC12E] is set. An Auto CMD12 error interrupt is generated when one
3857 * of the error bits (0-4) is set to 1. The command not issued by auto CMD12
3858 * error does not generate an interrupt.
3859 */
3860 typedef union _hw_sdhc_ac12err
3861 {
3862 uint32_t U;
3863 struct _hw_sdhc_ac12err_bitfields
3864 {
3865 uint32_t AC12NE : 1; /*!< [0] Auto CMD12 Not Executed */
3866 uint32_t AC12TOE : 1; /*!< [1] Auto CMD12 Timeout Error */
3867 uint32_t AC12EBE : 1; /*!< [2] Auto CMD12 End Bit Error */
3868 uint32_t AC12CE : 1; /*!< [3] Auto CMD12 CRC Error */
3869 uint32_t AC12IE : 1; /*!< [4] Auto CMD12 Index Error */
3870 uint32_t RESERVED0 : 2; /*!< [6:5] */
3871 uint32_t CNIBAC12E : 1; /*!< [7] Command Not Issued By Auto CMD12
3872 * Error */
3873 uint32_t RESERVED1 : 24; /*!< [31:8] */
3874 } B;
3875 } hw_sdhc_ac12err_t;
3876
3877 /*!
3878 * @name Constants and macros for entire SDHC_AC12ERR register
3879 */
3880 /*@{*/
3881 #define HW_SDHC_AC12ERR_ADDR(x) ((x) + 0x3CU)
3882
3883 #define HW_SDHC_AC12ERR(x) (*(__I hw_sdhc_ac12err_t *) HW_SDHC_AC12ERR_ADDR(x))
3884 #define HW_SDHC_AC12ERR_RD(x) (HW_SDHC_AC12ERR(x).U)
3885 /*@}*/
3886
3887 /*
3888 * Constants & macros for individual SDHC_AC12ERR bitfields
3889 */
3890
3891 /*!
3892 * @name Register SDHC_AC12ERR, field AC12NE[0] (RO)
3893 *
3894 * If memory multiple block data transfer is not started, due to a command
3895 * error, this bit is not set because it is not necessary to issue an auto CMD12.
3896 * Setting this bit to 1 means the SDHC cannot issue the auto CMD12 to stop a memory
3897 * multiple block data transfer due to some error. If this bit is set to 1, other
3898 * error status bits (1-4) have no meaning.
3899 *
3900 * Values:
3901 * - 0 - Executed.
3902 * - 1 - Not executed.
3903 */
3904 /*@{*/
3905 #define BP_SDHC_AC12ERR_AC12NE (0U) /*!< Bit position for SDHC_AC12ERR_AC12NE. */
3906 #define BM_SDHC_AC12ERR_AC12NE (0x00000001U) /*!< Bit mask for SDHC_AC12ERR_AC12NE. */
3907 #define BS_SDHC_AC12ERR_AC12NE (1U) /*!< Bit field size in bits for SDHC_AC12ERR_AC12NE. */
3908
3909 /*! @brief Read current value of the SDHC_AC12ERR_AC12NE field. */
3910 #define BR_SDHC_AC12ERR_AC12NE(x) (BITBAND_ACCESS32(HW_SDHC_AC12ERR_ADDR(x), BP_SDHC_AC12ERR_AC12NE))
3911 /*@}*/
3912
3913 /*!
3914 * @name Register SDHC_AC12ERR, field AC12TOE[1] (RO)
3915 *
3916 * Occurs if no response is returned within 64 SDCLK cycles from the end bit of
3917 * the command. If this bit is set to 1, the other error status bits (2-4) have
3918 * no meaning.
3919 *
3920 * Values:
3921 * - 0 - No error.
3922 * - 1 - Time out.
3923 */
3924 /*@{*/
3925 #define BP_SDHC_AC12ERR_AC12TOE (1U) /*!< Bit position for SDHC_AC12ERR_AC12TOE. */
3926 #define BM_SDHC_AC12ERR_AC12TOE (0x00000002U) /*!< Bit mask for SDHC_AC12ERR_AC12TOE. */
3927 #define BS_SDHC_AC12ERR_AC12TOE (1U) /*!< Bit field size in bits for SDHC_AC12ERR_AC12TOE. */
3928
3929 /*! @brief Read current value of the SDHC_AC12ERR_AC12TOE field. */
3930 #define BR_SDHC_AC12ERR_AC12TOE(x) (BITBAND_ACCESS32(HW_SDHC_AC12ERR_ADDR(x), BP_SDHC_AC12ERR_AC12TOE))
3931 /*@}*/
3932
3933 /*!
3934 * @name Register SDHC_AC12ERR, field AC12EBE[2] (RO)
3935 *
3936 * Occurs when detecting that the end bit of command response is 0 which must be
3937 * 1.
3938 *
3939 * Values:
3940 * - 0 - No error.
3941 * - 1 - End bit error generated.
3942 */
3943 /*@{*/
3944 #define BP_SDHC_AC12ERR_AC12EBE (2U) /*!< Bit position for SDHC_AC12ERR_AC12EBE. */
3945 #define BM_SDHC_AC12ERR_AC12EBE (0x00000004U) /*!< Bit mask for SDHC_AC12ERR_AC12EBE. */
3946 #define BS_SDHC_AC12ERR_AC12EBE (1U) /*!< Bit field size in bits for SDHC_AC12ERR_AC12EBE. */
3947
3948 /*! @brief Read current value of the SDHC_AC12ERR_AC12EBE field. */
3949 #define BR_SDHC_AC12ERR_AC12EBE(x) (BITBAND_ACCESS32(HW_SDHC_AC12ERR_ADDR(x), BP_SDHC_AC12ERR_AC12EBE))
3950 /*@}*/
3951
3952 /*!
3953 * @name Register SDHC_AC12ERR, field AC12CE[3] (RO)
3954 *
3955 * Occurs when detecting a CRC error in the command response.
3956 *
3957 * Values:
3958 * - 0 - No CRC error.
3959 * - 1 - CRC error met in Auto CMD12 response.
3960 */
3961 /*@{*/
3962 #define BP_SDHC_AC12ERR_AC12CE (3U) /*!< Bit position for SDHC_AC12ERR_AC12CE. */
3963 #define BM_SDHC_AC12ERR_AC12CE (0x00000008U) /*!< Bit mask for SDHC_AC12ERR_AC12CE. */
3964 #define BS_SDHC_AC12ERR_AC12CE (1U) /*!< Bit field size in bits for SDHC_AC12ERR_AC12CE. */
3965
3966 /*! @brief Read current value of the SDHC_AC12ERR_AC12CE field. */
3967 #define BR_SDHC_AC12ERR_AC12CE(x) (BITBAND_ACCESS32(HW_SDHC_AC12ERR_ADDR(x), BP_SDHC_AC12ERR_AC12CE))
3968 /*@}*/
3969
3970 /*!
3971 * @name Register SDHC_AC12ERR, field AC12IE[4] (RO)
3972 *
3973 * Occurs if the command index error occurs in response to a command.
3974 *
3975 * Values:
3976 * - 0 - No error.
3977 * - 1 - Error, the CMD index in response is not CMD12.
3978 */
3979 /*@{*/
3980 #define BP_SDHC_AC12ERR_AC12IE (4U) /*!< Bit position for SDHC_AC12ERR_AC12IE. */
3981 #define BM_SDHC_AC12ERR_AC12IE (0x00000010U) /*!< Bit mask for SDHC_AC12ERR_AC12IE. */
3982 #define BS_SDHC_AC12ERR_AC12IE (1U) /*!< Bit field size in bits for SDHC_AC12ERR_AC12IE. */
3983
3984 /*! @brief Read current value of the SDHC_AC12ERR_AC12IE field. */
3985 #define BR_SDHC_AC12ERR_AC12IE(x) (BITBAND_ACCESS32(HW_SDHC_AC12ERR_ADDR(x), BP_SDHC_AC12ERR_AC12IE))
3986 /*@}*/
3987
3988 /*!
3989 * @name Register SDHC_AC12ERR, field CNIBAC12E[7] (RO)
3990 *
3991 * Setting this bit to 1 means CMD_wo_DAT is not executed due to an auto CMD12
3992 * error (D04-D01) in this register.
3993 *
3994 * Values:
3995 * - 0 - No error.
3996 * - 1 - Not issued.
3997 */
3998 /*@{*/
3999 #define BP_SDHC_AC12ERR_CNIBAC12E (7U) /*!< Bit position for SDHC_AC12ERR_CNIBAC12E. */
4000 #define BM_SDHC_AC12ERR_CNIBAC12E (0x00000080U) /*!< Bit mask for SDHC_AC12ERR_CNIBAC12E. */
4001 #define BS_SDHC_AC12ERR_CNIBAC12E (1U) /*!< Bit field size in bits for SDHC_AC12ERR_CNIBAC12E. */
4002
4003 /*! @brief Read current value of the SDHC_AC12ERR_CNIBAC12E field. */
4004 #define BR_SDHC_AC12ERR_CNIBAC12E(x) (BITBAND_ACCESS32(HW_SDHC_AC12ERR_ADDR(x), BP_SDHC_AC12ERR_CNIBAC12E))
4005 /*@}*/
4006
4007 /*******************************************************************************
4008 * HW_SDHC_HTCAPBLT - Host Controller Capabilities
4009 ******************************************************************************/
4010
4011 /*!
4012 * @brief HW_SDHC_HTCAPBLT - Host Controller Capabilities (RO)
4013 *
4014 * Reset value: 0x07F30000U
4015 *
4016 * This register provides the host driver with information specific to the SDHC
4017 * implementation. The value in this register is the power-on-reset value, and
4018 * does not change with a software reset. Any write to this register is ignored.
4019 */
4020 typedef union _hw_sdhc_htcapblt
4021 {
4022 uint32_t U;
4023 struct _hw_sdhc_htcapblt_bitfields
4024 {
4025 uint32_t RESERVED0 : 16; /*!< [15:0] */
4026 uint32_t MBL : 3; /*!< [18:16] Max Block Length */
4027 uint32_t RESERVED1 : 1; /*!< [19] */
4028 uint32_t ADMAS : 1; /*!< [20] ADMA Support */
4029 uint32_t HSS : 1; /*!< [21] High Speed Support */
4030 uint32_t DMAS : 1; /*!< [22] DMA Support */
4031 uint32_t SRS : 1; /*!< [23] Suspend/Resume Support */
4032 uint32_t VS33 : 1; /*!< [24] Voltage Support 3.3 V */
4033 uint32_t RESERVED2 : 7; /*!< [31:25] */
4034 } B;
4035 } hw_sdhc_htcapblt_t;
4036
4037 /*!
4038 * @name Constants and macros for entire SDHC_HTCAPBLT register
4039 */
4040 /*@{*/
4041 #define HW_SDHC_HTCAPBLT_ADDR(x) ((x) + 0x40U)
4042
4043 #define HW_SDHC_HTCAPBLT(x) (*(__I hw_sdhc_htcapblt_t *) HW_SDHC_HTCAPBLT_ADDR(x))
4044 #define HW_SDHC_HTCAPBLT_RD(x) (HW_SDHC_HTCAPBLT(x).U)
4045 /*@}*/
4046
4047 /*
4048 * Constants & macros for individual SDHC_HTCAPBLT bitfields
4049 */
4050
4051 /*!
4052 * @name Register SDHC_HTCAPBLT, field MBL[18:16] (RO)
4053 *
4054 * This value indicates the maximum block size that the host driver can read and
4055 * write to the buffer in the SDHC. The buffer shall transfer block size without
4056 * wait cycles.
4057 *
4058 * Values:
4059 * - 000 - 512 bytes
4060 * - 001 - 1024 bytes
4061 * - 010 - 2048 bytes
4062 * - 011 - 4096 bytes
4063 */
4064 /*@{*/
4065 #define BP_SDHC_HTCAPBLT_MBL (16U) /*!< Bit position for SDHC_HTCAPBLT_MBL. */
4066 #define BM_SDHC_HTCAPBLT_MBL (0x00070000U) /*!< Bit mask for SDHC_HTCAPBLT_MBL. */
4067 #define BS_SDHC_HTCAPBLT_MBL (3U) /*!< Bit field size in bits for SDHC_HTCAPBLT_MBL. */
4068
4069 /*! @brief Read current value of the SDHC_HTCAPBLT_MBL field. */
4070 #define BR_SDHC_HTCAPBLT_MBL(x) (HW_SDHC_HTCAPBLT(x).B.MBL)
4071 /*@}*/
4072
4073 /*!
4074 * @name Register SDHC_HTCAPBLT, field ADMAS[20] (RO)
4075 *
4076 * This bit indicates whether the SDHC supports the ADMA feature.
4077 *
4078 * Values:
4079 * - 0 - Advanced DMA not supported.
4080 * - 1 - Advanced DMA supported.
4081 */
4082 /*@{*/
4083 #define BP_SDHC_HTCAPBLT_ADMAS (20U) /*!< Bit position for SDHC_HTCAPBLT_ADMAS. */
4084 #define BM_SDHC_HTCAPBLT_ADMAS (0x00100000U) /*!< Bit mask for SDHC_HTCAPBLT_ADMAS. */
4085 #define BS_SDHC_HTCAPBLT_ADMAS (1U) /*!< Bit field size in bits for SDHC_HTCAPBLT_ADMAS. */
4086
4087 /*! @brief Read current value of the SDHC_HTCAPBLT_ADMAS field. */
4088 #define BR_SDHC_HTCAPBLT_ADMAS(x) (BITBAND_ACCESS32(HW_SDHC_HTCAPBLT_ADDR(x), BP_SDHC_HTCAPBLT_ADMAS))
4089 /*@}*/
4090
4091 /*!
4092 * @name Register SDHC_HTCAPBLT, field HSS[21] (RO)
4093 *
4094 * This bit indicates whether the SDHC supports high speed mode and the host
4095 * system can supply a SD Clock frequency from 25 MHz to 50 MHz.
4096 *
4097 * Values:
4098 * - 0 - High speed not supported.
4099 * - 1 - High speed supported.
4100 */
4101 /*@{*/
4102 #define BP_SDHC_HTCAPBLT_HSS (21U) /*!< Bit position for SDHC_HTCAPBLT_HSS. */
4103 #define BM_SDHC_HTCAPBLT_HSS (0x00200000U) /*!< Bit mask for SDHC_HTCAPBLT_HSS. */
4104 #define BS_SDHC_HTCAPBLT_HSS (1U) /*!< Bit field size in bits for SDHC_HTCAPBLT_HSS. */
4105
4106 /*! @brief Read current value of the SDHC_HTCAPBLT_HSS field. */
4107 #define BR_SDHC_HTCAPBLT_HSS(x) (BITBAND_ACCESS32(HW_SDHC_HTCAPBLT_ADDR(x), BP_SDHC_HTCAPBLT_HSS))
4108 /*@}*/
4109
4110 /*!
4111 * @name Register SDHC_HTCAPBLT, field DMAS[22] (RO)
4112 *
4113 * This bit indicates whether the SDHC is capable of using the internal DMA to
4114 * transfer data between system memory and the data buffer directly.
4115 *
4116 * Values:
4117 * - 0 - DMA not supported.
4118 * - 1 - DMA supported.
4119 */
4120 /*@{*/
4121 #define BP_SDHC_HTCAPBLT_DMAS (22U) /*!< Bit position for SDHC_HTCAPBLT_DMAS. */
4122 #define BM_SDHC_HTCAPBLT_DMAS (0x00400000U) /*!< Bit mask for SDHC_HTCAPBLT_DMAS. */
4123 #define BS_SDHC_HTCAPBLT_DMAS (1U) /*!< Bit field size in bits for SDHC_HTCAPBLT_DMAS. */
4124
4125 /*! @brief Read current value of the SDHC_HTCAPBLT_DMAS field. */
4126 #define BR_SDHC_HTCAPBLT_DMAS(x) (BITBAND_ACCESS32(HW_SDHC_HTCAPBLT_ADDR(x), BP_SDHC_HTCAPBLT_DMAS))
4127 /*@}*/
4128
4129 /*!
4130 * @name Register SDHC_HTCAPBLT, field SRS[23] (RO)
4131 *
4132 * This bit indicates whether the SDHC supports suspend / resume functionality.
4133 * If this bit is 0, the suspend and resume mechanism, as well as the read Wwait,
4134 * are not supported, and the host driver shall not issue either suspend or
4135 * resume commands.
4136 *
4137 * Values:
4138 * - 0 - Not supported.
4139 * - 1 - Supported.
4140 */
4141 /*@{*/
4142 #define BP_SDHC_HTCAPBLT_SRS (23U) /*!< Bit position for SDHC_HTCAPBLT_SRS. */
4143 #define BM_SDHC_HTCAPBLT_SRS (0x00800000U) /*!< Bit mask for SDHC_HTCAPBLT_SRS. */
4144 #define BS_SDHC_HTCAPBLT_SRS (1U) /*!< Bit field size in bits for SDHC_HTCAPBLT_SRS. */
4145
4146 /*! @brief Read current value of the SDHC_HTCAPBLT_SRS field. */
4147 #define BR_SDHC_HTCAPBLT_SRS(x) (BITBAND_ACCESS32(HW_SDHC_HTCAPBLT_ADDR(x), BP_SDHC_HTCAPBLT_SRS))
4148 /*@}*/
4149
4150 /*!
4151 * @name Register SDHC_HTCAPBLT, field VS33[24] (RO)
4152 *
4153 * This bit shall depend on the host system ability.
4154 *
4155 * Values:
4156 * - 0 - 3.3 V not supported.
4157 * - 1 - 3.3 V supported.
4158 */
4159 /*@{*/
4160 #define BP_SDHC_HTCAPBLT_VS33 (24U) /*!< Bit position for SDHC_HTCAPBLT_VS33. */
4161 #define BM_SDHC_HTCAPBLT_VS33 (0x01000000U) /*!< Bit mask for SDHC_HTCAPBLT_VS33. */
4162 #define BS_SDHC_HTCAPBLT_VS33 (1U) /*!< Bit field size in bits for SDHC_HTCAPBLT_VS33. */
4163
4164 /*! @brief Read current value of the SDHC_HTCAPBLT_VS33 field. */
4165 #define BR_SDHC_HTCAPBLT_VS33(x) (BITBAND_ACCESS32(HW_SDHC_HTCAPBLT_ADDR(x), BP_SDHC_HTCAPBLT_VS33))
4166 /*@}*/
4167
4168 /*******************************************************************************
4169 * HW_SDHC_WML - Watermark Level Register
4170 ******************************************************************************/
4171
4172 /*!
4173 * @brief HW_SDHC_WML - Watermark Level Register (RW)
4174 *
4175 * Reset value: 0x00100010U
4176 *
4177 * Both write and read watermark levels (FIFO threshold) are configurable. There
4178 * value can range from 1 to 128 words. Both write and read burst lengths are
4179 * also configurable. There value can range from 1 to 31 words.
4180 */
4181 typedef union _hw_sdhc_wml
4182 {
4183 uint32_t U;
4184 struct _hw_sdhc_wml_bitfields
4185 {
4186 uint32_t RDWML : 8; /*!< [7:0] Read Watermark Level */
4187 uint32_t RESERVED0 : 8; /*!< [15:8] */
4188 uint32_t WRWML : 8; /*!< [23:16] Write Watermark Level */
4189 uint32_t RESERVED1 : 8; /*!< [31:24] */
4190 } B;
4191 } hw_sdhc_wml_t;
4192
4193 /*!
4194 * @name Constants and macros for entire SDHC_WML register
4195 */
4196 /*@{*/
4197 #define HW_SDHC_WML_ADDR(x) ((x) + 0x44U)
4198
4199 #define HW_SDHC_WML(x) (*(__IO hw_sdhc_wml_t *) HW_SDHC_WML_ADDR(x))
4200 #define HW_SDHC_WML_RD(x) (HW_SDHC_WML(x).U)
4201 #define HW_SDHC_WML_WR(x, v) (HW_SDHC_WML(x).U = (v))
4202 #define HW_SDHC_WML_SET(x, v) (HW_SDHC_WML_WR(x, HW_SDHC_WML_RD(x) | (v)))
4203 #define HW_SDHC_WML_CLR(x, v) (HW_SDHC_WML_WR(x, HW_SDHC_WML_RD(x) & ~(v)))
4204 #define HW_SDHC_WML_TOG(x, v) (HW_SDHC_WML_WR(x, HW_SDHC_WML_RD(x) ^ (v)))
4205 /*@}*/
4206
4207 /*
4208 * Constants & macros for individual SDHC_WML bitfields
4209 */
4210
4211 /*!
4212 * @name Register SDHC_WML, field RDWML[7:0] (RW)
4213 *
4214 * The number of words used as the watermark level (FIFO threshold) in a DMA
4215 * read operation. Also the number of words as a sequence of read bursts in
4216 * back-to-back mode. The maximum legal value for the read water mark level is 128.
4217 */
4218 /*@{*/
4219 #define BP_SDHC_WML_RDWML (0U) /*!< Bit position for SDHC_WML_RDWML. */
4220 #define BM_SDHC_WML_RDWML (0x000000FFU) /*!< Bit mask for SDHC_WML_RDWML. */
4221 #define BS_SDHC_WML_RDWML (8U) /*!< Bit field size in bits for SDHC_WML_RDWML. */
4222
4223 /*! @brief Read current value of the SDHC_WML_RDWML field. */
4224 #define BR_SDHC_WML_RDWML(x) (HW_SDHC_WML(x).B.RDWML)
4225
4226 /*! @brief Format value for bitfield SDHC_WML_RDWML. */
4227 #define BF_SDHC_WML_RDWML(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_WML_RDWML) & BM_SDHC_WML_RDWML)
4228
4229 /*! @brief Set the RDWML field to a new value. */
4230 #define BW_SDHC_WML_RDWML(x, v) (HW_SDHC_WML_WR(x, (HW_SDHC_WML_RD(x) & ~BM_SDHC_WML_RDWML) | BF_SDHC_WML_RDWML(v)))
4231 /*@}*/
4232
4233 /*!
4234 * @name Register SDHC_WML, field WRWML[23:16] (RW)
4235 *
4236 * The number of words used as the watermark level (FIFO threshold) in a DMA
4237 * write operation. Also the number of words as a sequence of write bursts in
4238 * back-to-back mode. The maximum legal value for the write watermark level is 128.
4239 */
4240 /*@{*/
4241 #define BP_SDHC_WML_WRWML (16U) /*!< Bit position for SDHC_WML_WRWML. */
4242 #define BM_SDHC_WML_WRWML (0x00FF0000U) /*!< Bit mask for SDHC_WML_WRWML. */
4243 #define BS_SDHC_WML_WRWML (8U) /*!< Bit field size in bits for SDHC_WML_WRWML. */
4244
4245 /*! @brief Read current value of the SDHC_WML_WRWML field. */
4246 #define BR_SDHC_WML_WRWML(x) (HW_SDHC_WML(x).B.WRWML)
4247
4248 /*! @brief Format value for bitfield SDHC_WML_WRWML. */
4249 #define BF_SDHC_WML_WRWML(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_WML_WRWML) & BM_SDHC_WML_WRWML)
4250
4251 /*! @brief Set the WRWML field to a new value. */
4252 #define BW_SDHC_WML_WRWML(x, v) (HW_SDHC_WML_WR(x, (HW_SDHC_WML_RD(x) & ~BM_SDHC_WML_WRWML) | BF_SDHC_WML_WRWML(v)))
4253 /*@}*/
4254
4255 /*******************************************************************************
4256 * HW_SDHC_FEVT - Force Event register
4257 ******************************************************************************/
4258
4259 /*!
4260 * @brief HW_SDHC_FEVT - Force Event register (WO)
4261 *
4262 * Reset value: 0x00000000U
4263 *
4264 * The Force Event (FEVT) register is not a physically implemented register.
4265 * Rather, it is an address at which the Interrupt Status register can be written if
4266 * the corresponding bit of the Interrupt Status Enable register is set. This
4267 * register is a write only register and writing 0 to it has no effect. Writing 1
4268 * to this register actually sets the corresponding bit of Interrupt Status
4269 * register. A read from this register always results in 0's. To change the
4270 * corresponding status bits in the interrupt status register, make sure to set
4271 * SYSCTL[IPGEN] so that bus clock is always active. Forcing a card interrupt will generate a
4272 * short pulse on the DAT[1] line, and the driver may treat this interrupt as a
4273 * normal interrupt. The interrupt service routine may skip polling the card
4274 * interrupt factor as the interrupt is selfcleared.
4275 */
4276 typedef union _hw_sdhc_fevt
4277 {
4278 uint32_t U;
4279 struct _hw_sdhc_fevt_bitfields
4280 {
4281 uint32_t AC12NE : 1; /*!< [0] Force Event Auto Command 12 Not
4282 * Executed */
4283 uint32_t AC12TOE : 1; /*!< [1] Force Event Auto Command 12 Time Out
4284 * Error */
4285 uint32_t AC12CE : 1; /*!< [2] Force Event Auto Command 12 CRC Error */
4286 uint32_t AC12EBE : 1; /*!< [3] Force Event Auto Command 12 End Bit
4287 * Error */
4288 uint32_t AC12IE : 1; /*!< [4] Force Event Auto Command 12 Index Error
4289 * */
4290 uint32_t RESERVED0 : 2; /*!< [6:5] */
4291 uint32_t CNIBAC12E : 1; /*!< [7] Force Event Command Not Executed By
4292 * Auto Command 12 Error */
4293 uint32_t RESERVED1 : 8; /*!< [15:8] */
4294 uint32_t CTOE : 1; /*!< [16] Force Event Command Time Out Error */
4295 uint32_t CCE : 1; /*!< [17] Force Event Command CRC Error */
4296 uint32_t CEBE : 1; /*!< [18] Force Event Command End Bit Error */
4297 uint32_t CIE : 1; /*!< [19] Force Event Command Index Error */
4298 uint32_t DTOE : 1; /*!< [20] Force Event Data Time Out Error */
4299 uint32_t DCE : 1; /*!< [21] Force Event Data CRC Error */
4300 uint32_t DEBE : 1; /*!< [22] Force Event Data End Bit Error */
4301 uint32_t RESERVED2 : 1; /*!< [23] */
4302 uint32_t AC12E : 1; /*!< [24] Force Event Auto Command 12 Error */
4303 uint32_t RESERVED3 : 3; /*!< [27:25] */
4304 uint32_t DMAE : 1; /*!< [28] Force Event DMA Error */
4305 uint32_t RESERVED4 : 2; /*!< [30:29] */
4306 uint32_t CINT : 1; /*!< [31] Force Event Card Interrupt */
4307 } B;
4308 } hw_sdhc_fevt_t;
4309
4310 /*!
4311 * @name Constants and macros for entire SDHC_FEVT register
4312 */
4313 /*@{*/
4314 #define HW_SDHC_FEVT_ADDR(x) ((x) + 0x50U)
4315
4316 #define HW_SDHC_FEVT(x) (*(__O hw_sdhc_fevt_t *) HW_SDHC_FEVT_ADDR(x))
4317 #define HW_SDHC_FEVT_RD(x) (HW_SDHC_FEVT(x).U)
4318 #define HW_SDHC_FEVT_WR(x, v) (HW_SDHC_FEVT(x).U = (v))
4319 /*@}*/
4320
4321 /*
4322 * Constants & macros for individual SDHC_FEVT bitfields
4323 */
4324
4325 /*!
4326 * @name Register SDHC_FEVT, field AC12NE[0] (WORZ)
4327 *
4328 * Forces AC12ERR[AC12NE] to be set.
4329 */
4330 /*@{*/
4331 #define BP_SDHC_FEVT_AC12NE (0U) /*!< Bit position for SDHC_FEVT_AC12NE. */
4332 #define BM_SDHC_FEVT_AC12NE (0x00000001U) /*!< Bit mask for SDHC_FEVT_AC12NE. */
4333 #define BS_SDHC_FEVT_AC12NE (1U) /*!< Bit field size in bits for SDHC_FEVT_AC12NE. */
4334
4335 /*! @brief Format value for bitfield SDHC_FEVT_AC12NE. */
4336 #define BF_SDHC_FEVT_AC12NE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_AC12NE) & BM_SDHC_FEVT_AC12NE)
4337
4338 /*! @brief Set the AC12NE field to a new value. */
4339 #define BW_SDHC_FEVT_AC12NE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_AC12NE) = (v))
4340 /*@}*/
4341
4342 /*!
4343 * @name Register SDHC_FEVT, field AC12TOE[1] (WORZ)
4344 *
4345 * Forces AC12ERR[AC12TOE] to be set.
4346 */
4347 /*@{*/
4348 #define BP_SDHC_FEVT_AC12TOE (1U) /*!< Bit position for SDHC_FEVT_AC12TOE. */
4349 #define BM_SDHC_FEVT_AC12TOE (0x00000002U) /*!< Bit mask for SDHC_FEVT_AC12TOE. */
4350 #define BS_SDHC_FEVT_AC12TOE (1U) /*!< Bit field size in bits for SDHC_FEVT_AC12TOE. */
4351
4352 /*! @brief Format value for bitfield SDHC_FEVT_AC12TOE. */
4353 #define BF_SDHC_FEVT_AC12TOE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_AC12TOE) & BM_SDHC_FEVT_AC12TOE)
4354
4355 /*! @brief Set the AC12TOE field to a new value. */
4356 #define BW_SDHC_FEVT_AC12TOE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_AC12TOE) = (v))
4357 /*@}*/
4358
4359 /*!
4360 * @name Register SDHC_FEVT, field AC12CE[2] (WORZ)
4361 *
4362 * Forces AC12ERR[AC12CE] to be set.
4363 */
4364 /*@{*/
4365 #define BP_SDHC_FEVT_AC12CE (2U) /*!< Bit position for SDHC_FEVT_AC12CE. */
4366 #define BM_SDHC_FEVT_AC12CE (0x00000004U) /*!< Bit mask for SDHC_FEVT_AC12CE. */
4367 #define BS_SDHC_FEVT_AC12CE (1U) /*!< Bit field size in bits for SDHC_FEVT_AC12CE. */
4368
4369 /*! @brief Format value for bitfield SDHC_FEVT_AC12CE. */
4370 #define BF_SDHC_FEVT_AC12CE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_AC12CE) & BM_SDHC_FEVT_AC12CE)
4371
4372 /*! @brief Set the AC12CE field to a new value. */
4373 #define BW_SDHC_FEVT_AC12CE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_AC12CE) = (v))
4374 /*@}*/
4375
4376 /*!
4377 * @name Register SDHC_FEVT, field AC12EBE[3] (WORZ)
4378 *
4379 * Forces AC12ERR[AC12EBE] to be set.
4380 */
4381 /*@{*/
4382 #define BP_SDHC_FEVT_AC12EBE (3U) /*!< Bit position for SDHC_FEVT_AC12EBE. */
4383 #define BM_SDHC_FEVT_AC12EBE (0x00000008U) /*!< Bit mask for SDHC_FEVT_AC12EBE. */
4384 #define BS_SDHC_FEVT_AC12EBE (1U) /*!< Bit field size in bits for SDHC_FEVT_AC12EBE. */
4385
4386 /*! @brief Format value for bitfield SDHC_FEVT_AC12EBE. */
4387 #define BF_SDHC_FEVT_AC12EBE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_AC12EBE) & BM_SDHC_FEVT_AC12EBE)
4388
4389 /*! @brief Set the AC12EBE field to a new value. */
4390 #define BW_SDHC_FEVT_AC12EBE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_AC12EBE) = (v))
4391 /*@}*/
4392
4393 /*!
4394 * @name Register SDHC_FEVT, field AC12IE[4] (WORZ)
4395 *
4396 * Forces AC12ERR[AC12IE] to be set.
4397 */
4398 /*@{*/
4399 #define BP_SDHC_FEVT_AC12IE (4U) /*!< Bit position for SDHC_FEVT_AC12IE. */
4400 #define BM_SDHC_FEVT_AC12IE (0x00000010U) /*!< Bit mask for SDHC_FEVT_AC12IE. */
4401 #define BS_SDHC_FEVT_AC12IE (1U) /*!< Bit field size in bits for SDHC_FEVT_AC12IE. */
4402
4403 /*! @brief Format value for bitfield SDHC_FEVT_AC12IE. */
4404 #define BF_SDHC_FEVT_AC12IE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_AC12IE) & BM_SDHC_FEVT_AC12IE)
4405
4406 /*! @brief Set the AC12IE field to a new value. */
4407 #define BW_SDHC_FEVT_AC12IE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_AC12IE) = (v))
4408 /*@}*/
4409
4410 /*!
4411 * @name Register SDHC_FEVT, field CNIBAC12E[7] (WORZ)
4412 *
4413 * Forces AC12ERR[CNIBAC12E] to be set.
4414 */
4415 /*@{*/
4416 #define BP_SDHC_FEVT_CNIBAC12E (7U) /*!< Bit position for SDHC_FEVT_CNIBAC12E. */
4417 #define BM_SDHC_FEVT_CNIBAC12E (0x00000080U) /*!< Bit mask for SDHC_FEVT_CNIBAC12E. */
4418 #define BS_SDHC_FEVT_CNIBAC12E (1U) /*!< Bit field size in bits for SDHC_FEVT_CNIBAC12E. */
4419
4420 /*! @brief Format value for bitfield SDHC_FEVT_CNIBAC12E. */
4421 #define BF_SDHC_FEVT_CNIBAC12E(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_CNIBAC12E) & BM_SDHC_FEVT_CNIBAC12E)
4422
4423 /*! @brief Set the CNIBAC12E field to a new value. */
4424 #define BW_SDHC_FEVT_CNIBAC12E(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_CNIBAC12E) = (v))
4425 /*@}*/
4426
4427 /*!
4428 * @name Register SDHC_FEVT, field CTOE[16] (WORZ)
4429 *
4430 * Forces IRQSTAT[CTOE] to be set.
4431 */
4432 /*@{*/
4433 #define BP_SDHC_FEVT_CTOE (16U) /*!< Bit position for SDHC_FEVT_CTOE. */
4434 #define BM_SDHC_FEVT_CTOE (0x00010000U) /*!< Bit mask for SDHC_FEVT_CTOE. */
4435 #define BS_SDHC_FEVT_CTOE (1U) /*!< Bit field size in bits for SDHC_FEVT_CTOE. */
4436
4437 /*! @brief Format value for bitfield SDHC_FEVT_CTOE. */
4438 #define BF_SDHC_FEVT_CTOE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_CTOE) & BM_SDHC_FEVT_CTOE)
4439
4440 /*! @brief Set the CTOE field to a new value. */
4441 #define BW_SDHC_FEVT_CTOE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_CTOE) = (v))
4442 /*@}*/
4443
4444 /*!
4445 * @name Register SDHC_FEVT, field CCE[17] (WORZ)
4446 *
4447 * Forces IRQSTAT[CCE] to be set.
4448 */
4449 /*@{*/
4450 #define BP_SDHC_FEVT_CCE (17U) /*!< Bit position for SDHC_FEVT_CCE. */
4451 #define BM_SDHC_FEVT_CCE (0x00020000U) /*!< Bit mask for SDHC_FEVT_CCE. */
4452 #define BS_SDHC_FEVT_CCE (1U) /*!< Bit field size in bits for SDHC_FEVT_CCE. */
4453
4454 /*! @brief Format value for bitfield SDHC_FEVT_CCE. */
4455 #define BF_SDHC_FEVT_CCE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_CCE) & BM_SDHC_FEVT_CCE)
4456
4457 /*! @brief Set the CCE field to a new value. */
4458 #define BW_SDHC_FEVT_CCE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_CCE) = (v))
4459 /*@}*/
4460
4461 /*!
4462 * @name Register SDHC_FEVT, field CEBE[18] (WORZ)
4463 *
4464 * Forces IRQSTAT[CEBE] to be set.
4465 */
4466 /*@{*/
4467 #define BP_SDHC_FEVT_CEBE (18U) /*!< Bit position for SDHC_FEVT_CEBE. */
4468 #define BM_SDHC_FEVT_CEBE (0x00040000U) /*!< Bit mask for SDHC_FEVT_CEBE. */
4469 #define BS_SDHC_FEVT_CEBE (1U) /*!< Bit field size in bits for SDHC_FEVT_CEBE. */
4470
4471 /*! @brief Format value for bitfield SDHC_FEVT_CEBE. */
4472 #define BF_SDHC_FEVT_CEBE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_CEBE) & BM_SDHC_FEVT_CEBE)
4473
4474 /*! @brief Set the CEBE field to a new value. */
4475 #define BW_SDHC_FEVT_CEBE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_CEBE) = (v))
4476 /*@}*/
4477
4478 /*!
4479 * @name Register SDHC_FEVT, field CIE[19] (WORZ)
4480 *
4481 * Forces IRQSTAT[CCE] to be set.
4482 */
4483 /*@{*/
4484 #define BP_SDHC_FEVT_CIE (19U) /*!< Bit position for SDHC_FEVT_CIE. */
4485 #define BM_SDHC_FEVT_CIE (0x00080000U) /*!< Bit mask for SDHC_FEVT_CIE. */
4486 #define BS_SDHC_FEVT_CIE (1U) /*!< Bit field size in bits for SDHC_FEVT_CIE. */
4487
4488 /*! @brief Format value for bitfield SDHC_FEVT_CIE. */
4489 #define BF_SDHC_FEVT_CIE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_CIE) & BM_SDHC_FEVT_CIE)
4490
4491 /*! @brief Set the CIE field to a new value. */
4492 #define BW_SDHC_FEVT_CIE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_CIE) = (v))
4493 /*@}*/
4494
4495 /*!
4496 * @name Register SDHC_FEVT, field DTOE[20] (WORZ)
4497 *
4498 * Forces IRQSTAT[DTOE] to be set.
4499 */
4500 /*@{*/
4501 #define BP_SDHC_FEVT_DTOE (20U) /*!< Bit position for SDHC_FEVT_DTOE. */
4502 #define BM_SDHC_FEVT_DTOE (0x00100000U) /*!< Bit mask for SDHC_FEVT_DTOE. */
4503 #define BS_SDHC_FEVT_DTOE (1U) /*!< Bit field size in bits for SDHC_FEVT_DTOE. */
4504
4505 /*! @brief Format value for bitfield SDHC_FEVT_DTOE. */
4506 #define BF_SDHC_FEVT_DTOE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_DTOE) & BM_SDHC_FEVT_DTOE)
4507
4508 /*! @brief Set the DTOE field to a new value. */
4509 #define BW_SDHC_FEVT_DTOE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_DTOE) = (v))
4510 /*@}*/
4511
4512 /*!
4513 * @name Register SDHC_FEVT, field DCE[21] (WORZ)
4514 *
4515 * Forces IRQSTAT[DCE] to be set.
4516 */
4517 /*@{*/
4518 #define BP_SDHC_FEVT_DCE (21U) /*!< Bit position for SDHC_FEVT_DCE. */
4519 #define BM_SDHC_FEVT_DCE (0x00200000U) /*!< Bit mask for SDHC_FEVT_DCE. */
4520 #define BS_SDHC_FEVT_DCE (1U) /*!< Bit field size in bits for SDHC_FEVT_DCE. */
4521
4522 /*! @brief Format value for bitfield SDHC_FEVT_DCE. */
4523 #define BF_SDHC_FEVT_DCE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_DCE) & BM_SDHC_FEVT_DCE)
4524
4525 /*! @brief Set the DCE field to a new value. */
4526 #define BW_SDHC_FEVT_DCE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_DCE) = (v))
4527 /*@}*/
4528
4529 /*!
4530 * @name Register SDHC_FEVT, field DEBE[22] (WORZ)
4531 *
4532 * Forces IRQSTAT[DEBE] to be set.
4533 */
4534 /*@{*/
4535 #define BP_SDHC_FEVT_DEBE (22U) /*!< Bit position for SDHC_FEVT_DEBE. */
4536 #define BM_SDHC_FEVT_DEBE (0x00400000U) /*!< Bit mask for SDHC_FEVT_DEBE. */
4537 #define BS_SDHC_FEVT_DEBE (1U) /*!< Bit field size in bits for SDHC_FEVT_DEBE. */
4538
4539 /*! @brief Format value for bitfield SDHC_FEVT_DEBE. */
4540 #define BF_SDHC_FEVT_DEBE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_DEBE) & BM_SDHC_FEVT_DEBE)
4541
4542 /*! @brief Set the DEBE field to a new value. */
4543 #define BW_SDHC_FEVT_DEBE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_DEBE) = (v))
4544 /*@}*/
4545
4546 /*!
4547 * @name Register SDHC_FEVT, field AC12E[24] (WORZ)
4548 *
4549 * Forces IRQSTAT[AC12E] to be set.
4550 */
4551 /*@{*/
4552 #define BP_SDHC_FEVT_AC12E (24U) /*!< Bit position for SDHC_FEVT_AC12E. */
4553 #define BM_SDHC_FEVT_AC12E (0x01000000U) /*!< Bit mask for SDHC_FEVT_AC12E. */
4554 #define BS_SDHC_FEVT_AC12E (1U) /*!< Bit field size in bits for SDHC_FEVT_AC12E. */
4555
4556 /*! @brief Format value for bitfield SDHC_FEVT_AC12E. */
4557 #define BF_SDHC_FEVT_AC12E(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_AC12E) & BM_SDHC_FEVT_AC12E)
4558
4559 /*! @brief Set the AC12E field to a new value. */
4560 #define BW_SDHC_FEVT_AC12E(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_AC12E) = (v))
4561 /*@}*/
4562
4563 /*!
4564 * @name Register SDHC_FEVT, field DMAE[28] (WORZ)
4565 *
4566 * Forces the DMAE bit of Interrupt Status Register to be set.
4567 */
4568 /*@{*/
4569 #define BP_SDHC_FEVT_DMAE (28U) /*!< Bit position for SDHC_FEVT_DMAE. */
4570 #define BM_SDHC_FEVT_DMAE (0x10000000U) /*!< Bit mask for SDHC_FEVT_DMAE. */
4571 #define BS_SDHC_FEVT_DMAE (1U) /*!< Bit field size in bits for SDHC_FEVT_DMAE. */
4572
4573 /*! @brief Format value for bitfield SDHC_FEVT_DMAE. */
4574 #define BF_SDHC_FEVT_DMAE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_DMAE) & BM_SDHC_FEVT_DMAE)
4575
4576 /*! @brief Set the DMAE field to a new value. */
4577 #define BW_SDHC_FEVT_DMAE(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_DMAE) = (v))
4578 /*@}*/
4579
4580 /*!
4581 * @name Register SDHC_FEVT, field CINT[31] (WORZ)
4582 *
4583 * Writing 1 to this bit generates a short low-level pulse on the internal
4584 * DAT[1] line, as if a self-clearing interrupt was received from the external card.
4585 * If enabled, the CINT bit will be set and the interrupt service routine may
4586 * treat this interrupt as a normal interrupt from the external card.
4587 */
4588 /*@{*/
4589 #define BP_SDHC_FEVT_CINT (31U) /*!< Bit position for SDHC_FEVT_CINT. */
4590 #define BM_SDHC_FEVT_CINT (0x80000000U) /*!< Bit mask for SDHC_FEVT_CINT. */
4591 #define BS_SDHC_FEVT_CINT (1U) /*!< Bit field size in bits for SDHC_FEVT_CINT. */
4592
4593 /*! @brief Format value for bitfield SDHC_FEVT_CINT. */
4594 #define BF_SDHC_FEVT_CINT(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_FEVT_CINT) & BM_SDHC_FEVT_CINT)
4595
4596 /*! @brief Set the CINT field to a new value. */
4597 #define BW_SDHC_FEVT_CINT(x, v) (BITBAND_ACCESS32(HW_SDHC_FEVT_ADDR(x), BP_SDHC_FEVT_CINT) = (v))
4598 /*@}*/
4599
4600 /*******************************************************************************
4601 * HW_SDHC_ADMAES - ADMA Error Status register
4602 ******************************************************************************/
4603
4604 /*!
4605 * @brief HW_SDHC_ADMAES - ADMA Error Status register (RO)
4606 *
4607 * Reset value: 0x00000000U
4608 *
4609 * When an ADMA error interrupt has occurred, the ADMA Error States field in
4610 * this register holds the ADMA state and the ADMA System Address register holds the
4611 * address around the error descriptor. For recovering from this error, the host
4612 * driver requires the ADMA state to identify the error descriptor address as
4613 * follows: ST_STOP: Previous location set in the ADMA System Address register is
4614 * the error descriptor address. ST_FDS: Current location set in the ADMA System
4615 * Address register is the error descriptor address. ST_CADR: This state is never
4616 * set because it only increments the descriptor pointer and doesn't generate an
4617 * ADMA error. ST_TFR: Previous location set in the ADMA System Address register
4618 * is the error descriptor address. In case of a write operation, the host driver
4619 * must use the ACMD22 to get the number of the written block, rather than using
4620 * this information, because unwritten data may exist in the host controller.
4621 * The host controller generates the ADMA error interrupt when it detects invalid
4622 * descriptor data (valid = 0) in the ST_FDS state. The host driver can
4623 * distinguish this error by reading the valid bit of the error descriptor. ADMA Error
4624 * State coding D01-D00 ADMA Error State when error has occurred Contents of ADMA
4625 * System Address register 00 ST_STOP (Stop DMA) Holds the address of the next
4626 * executable descriptor command 01 ST_FDS (fetch descriptor) Holds the valid
4627 * descriptor address 10 ST_CADR (change address) No ADMA error is generated 11 ST_TFR
4628 * (Transfer Data) Holds the address of the next executable descriptor command
4629 */
4630 typedef union _hw_sdhc_admaes
4631 {
4632 uint32_t U;
4633 struct _hw_sdhc_admaes_bitfields
4634 {
4635 uint32_t ADMAES : 2; /*!< [1:0] ADMA Error State (When ADMA Error Is
4636 * Occurred.) */
4637 uint32_t ADMALME : 1; /*!< [2] ADMA Length Mismatch Error */
4638 uint32_t ADMADCE : 1; /*!< [3] ADMA Descriptor Error */
4639 uint32_t RESERVED0 : 28; /*!< [31:4] */
4640 } B;
4641 } hw_sdhc_admaes_t;
4642
4643 /*!
4644 * @name Constants and macros for entire SDHC_ADMAES register
4645 */
4646 /*@{*/
4647 #define HW_SDHC_ADMAES_ADDR(x) ((x) + 0x54U)
4648
4649 #define HW_SDHC_ADMAES(x) (*(__I hw_sdhc_admaes_t *) HW_SDHC_ADMAES_ADDR(x))
4650 #define HW_SDHC_ADMAES_RD(x) (HW_SDHC_ADMAES(x).U)
4651 /*@}*/
4652
4653 /*
4654 * Constants & macros for individual SDHC_ADMAES bitfields
4655 */
4656
4657 /*!
4658 * @name Register SDHC_ADMAES, field ADMAES[1:0] (RO)
4659 *
4660 * Indicates the state of the ADMA when an error has occurred during an ADMA
4661 * data transfer.
4662 */
4663 /*@{*/
4664 #define BP_SDHC_ADMAES_ADMAES (0U) /*!< Bit position for SDHC_ADMAES_ADMAES. */
4665 #define BM_SDHC_ADMAES_ADMAES (0x00000003U) /*!< Bit mask for SDHC_ADMAES_ADMAES. */
4666 #define BS_SDHC_ADMAES_ADMAES (2U) /*!< Bit field size in bits for SDHC_ADMAES_ADMAES. */
4667
4668 /*! @brief Read current value of the SDHC_ADMAES_ADMAES field. */
4669 #define BR_SDHC_ADMAES_ADMAES(x) (HW_SDHC_ADMAES(x).B.ADMAES)
4670 /*@}*/
4671
4672 /*!
4673 * @name Register SDHC_ADMAES, field ADMALME[2] (RO)
4674 *
4675 * This error occurs in the following 2 cases: While the block count enable is
4676 * being set, the total data length specified by the descriptor table is different
4677 * from that specified by the block count and block length. Total data length
4678 * can not be divided by the block length.
4679 *
4680 * Values:
4681 * - 0 - No error.
4682 * - 1 - Error.
4683 */
4684 /*@{*/
4685 #define BP_SDHC_ADMAES_ADMALME (2U) /*!< Bit position for SDHC_ADMAES_ADMALME. */
4686 #define BM_SDHC_ADMAES_ADMALME (0x00000004U) /*!< Bit mask for SDHC_ADMAES_ADMALME. */
4687 #define BS_SDHC_ADMAES_ADMALME (1U) /*!< Bit field size in bits for SDHC_ADMAES_ADMALME. */
4688
4689 /*! @brief Read current value of the SDHC_ADMAES_ADMALME field. */
4690 #define BR_SDHC_ADMAES_ADMALME(x) (BITBAND_ACCESS32(HW_SDHC_ADMAES_ADDR(x), BP_SDHC_ADMAES_ADMALME))
4691 /*@}*/
4692
4693 /*!
4694 * @name Register SDHC_ADMAES, field ADMADCE[3] (RO)
4695 *
4696 * This error occurs when an invalid descriptor is fetched by ADMA.
4697 *
4698 * Values:
4699 * - 0 - No error.
4700 * - 1 - Error.
4701 */
4702 /*@{*/
4703 #define BP_SDHC_ADMAES_ADMADCE (3U) /*!< Bit position for SDHC_ADMAES_ADMADCE. */
4704 #define BM_SDHC_ADMAES_ADMADCE (0x00000008U) /*!< Bit mask for SDHC_ADMAES_ADMADCE. */
4705 #define BS_SDHC_ADMAES_ADMADCE (1U) /*!< Bit field size in bits for SDHC_ADMAES_ADMADCE. */
4706
4707 /*! @brief Read current value of the SDHC_ADMAES_ADMADCE field. */
4708 #define BR_SDHC_ADMAES_ADMADCE(x) (BITBAND_ACCESS32(HW_SDHC_ADMAES_ADDR(x), BP_SDHC_ADMAES_ADMADCE))
4709 /*@}*/
4710
4711 /*******************************************************************************
4712 * HW_SDHC_ADSADDR - ADMA System Addressregister
4713 ******************************************************************************/
4714
4715 /*!
4716 * @brief HW_SDHC_ADSADDR - ADMA System Addressregister (RW)
4717 *
4718 * Reset value: 0x00000000U
4719 *
4720 * This register contains the physical system memory address used for ADMA
4721 * transfers.
4722 */
4723 typedef union _hw_sdhc_adsaddr
4724 {
4725 uint32_t U;
4726 struct _hw_sdhc_adsaddr_bitfields
4727 {
4728 uint32_t RESERVED0 : 2; /*!< [1:0] */
4729 uint32_t ADSADDR : 30; /*!< [31:2] ADMA System Address */
4730 } B;
4731 } hw_sdhc_adsaddr_t;
4732
4733 /*!
4734 * @name Constants and macros for entire SDHC_ADSADDR register
4735 */
4736 /*@{*/
4737 #define HW_SDHC_ADSADDR_ADDR(x) ((x) + 0x58U)
4738
4739 #define HW_SDHC_ADSADDR(x) (*(__IO hw_sdhc_adsaddr_t *) HW_SDHC_ADSADDR_ADDR(x))
4740 #define HW_SDHC_ADSADDR_RD(x) (HW_SDHC_ADSADDR(x).U)
4741 #define HW_SDHC_ADSADDR_WR(x, v) (HW_SDHC_ADSADDR(x).U = (v))
4742 #define HW_SDHC_ADSADDR_SET(x, v) (HW_SDHC_ADSADDR_WR(x, HW_SDHC_ADSADDR_RD(x) | (v)))
4743 #define HW_SDHC_ADSADDR_CLR(x, v) (HW_SDHC_ADSADDR_WR(x, HW_SDHC_ADSADDR_RD(x) & ~(v)))
4744 #define HW_SDHC_ADSADDR_TOG(x, v) (HW_SDHC_ADSADDR_WR(x, HW_SDHC_ADSADDR_RD(x) ^ (v)))
4745 /*@}*/
4746
4747 /*
4748 * Constants & macros for individual SDHC_ADSADDR bitfields
4749 */
4750
4751 /*!
4752 * @name Register SDHC_ADSADDR, field ADSADDR[31:2] (RW)
4753 *
4754 * Holds the word address of the executing command in the descriptor table. At
4755 * the start of ADMA, the host driver shall set the start address of the
4756 * Descriptor table. The ADMA engine increments this register address whenever fetching a
4757 * descriptor command. When the ADMA is stopped at the block gap, this register
4758 * indicates the address of the next executable descriptor command. When the ADMA
4759 * error interrupt is generated, this register shall hold the valid descriptor
4760 * address depending on the ADMA state. The lower 2 bits of this register is tied
4761 * to '0' so the ADMA address is always word-aligned. Because this register
4762 * supports dynamic address reflecting, when TC bit is set, it automatically alters the
4763 * value of internal address counter, so SW cannot change this register when TC
4764 * bit is set.
4765 */
4766 /*@{*/
4767 #define BP_SDHC_ADSADDR_ADSADDR (2U) /*!< Bit position for SDHC_ADSADDR_ADSADDR. */
4768 #define BM_SDHC_ADSADDR_ADSADDR (0xFFFFFFFCU) /*!< Bit mask for SDHC_ADSADDR_ADSADDR. */
4769 #define BS_SDHC_ADSADDR_ADSADDR (30U) /*!< Bit field size in bits for SDHC_ADSADDR_ADSADDR. */
4770
4771 /*! @brief Read current value of the SDHC_ADSADDR_ADSADDR field. */
4772 #define BR_SDHC_ADSADDR_ADSADDR(x) (HW_SDHC_ADSADDR(x).B.ADSADDR)
4773
4774 /*! @brief Format value for bitfield SDHC_ADSADDR_ADSADDR. */
4775 #define BF_SDHC_ADSADDR_ADSADDR(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_ADSADDR_ADSADDR) & BM_SDHC_ADSADDR_ADSADDR)
4776
4777 /*! @brief Set the ADSADDR field to a new value. */
4778 #define BW_SDHC_ADSADDR_ADSADDR(x, v) (HW_SDHC_ADSADDR_WR(x, (HW_SDHC_ADSADDR_RD(x) & ~BM_SDHC_ADSADDR_ADSADDR) | BF_SDHC_ADSADDR_ADSADDR(v)))
4779 /*@}*/
4780
4781 /*******************************************************************************
4782 * HW_SDHC_VENDOR - Vendor Specific register
4783 ******************************************************************************/
4784
4785 /*!
4786 * @brief HW_SDHC_VENDOR - Vendor Specific register (RW)
4787 *
4788 * Reset value: 0x00000001U
4789 *
4790 * This register contains the vendor-specific control/status register.
4791 */
4792 typedef union _hw_sdhc_vendor
4793 {
4794 uint32_t U;
4795 struct _hw_sdhc_vendor_bitfields
4796 {
4797 uint32_t EXTDMAEN : 1; /*!< [0] External DMA Request Enable */
4798 uint32_t EXBLKNU : 1; /*!< [1] Exact Block Number Block Read Enable
4799 * For SDIO CMD53 */
4800 uint32_t RESERVED0 : 14; /*!< [15:2] */
4801 uint32_t INTSTVAL : 8; /*!< [23:16] Internal State Value */
4802 uint32_t RESERVED1 : 8; /*!< [31:24] */
4803 } B;
4804 } hw_sdhc_vendor_t;
4805
4806 /*!
4807 * @name Constants and macros for entire SDHC_VENDOR register
4808 */
4809 /*@{*/
4810 #define HW_SDHC_VENDOR_ADDR(x) ((x) + 0xC0U)
4811
4812 #define HW_SDHC_VENDOR(x) (*(__IO hw_sdhc_vendor_t *) HW_SDHC_VENDOR_ADDR(x))
4813 #define HW_SDHC_VENDOR_RD(x) (HW_SDHC_VENDOR(x).U)
4814 #define HW_SDHC_VENDOR_WR(x, v) (HW_SDHC_VENDOR(x).U = (v))
4815 #define HW_SDHC_VENDOR_SET(x, v) (HW_SDHC_VENDOR_WR(x, HW_SDHC_VENDOR_RD(x) | (v)))
4816 #define HW_SDHC_VENDOR_CLR(x, v) (HW_SDHC_VENDOR_WR(x, HW_SDHC_VENDOR_RD(x) & ~(v)))
4817 #define HW_SDHC_VENDOR_TOG(x, v) (HW_SDHC_VENDOR_WR(x, HW_SDHC_VENDOR_RD(x) ^ (v)))
4818 /*@}*/
4819
4820 /*
4821 * Constants & macros for individual SDHC_VENDOR bitfields
4822 */
4823
4824 /*!
4825 * @name Register SDHC_VENDOR, field EXTDMAEN[0] (RW)
4826 *
4827 * Enables the request to external DMA. When the internal DMA (either simple DMA
4828 * or advanced DMA) is not in use, and this bit is set, SDHC will send out DMA
4829 * request when the internal buffer is ready. This bit is particularly useful when
4830 * transferring data by CPU polling mode, and it is not allowed to send out the
4831 * external DMA request. By default, this bit is set.
4832 *
4833 * Values:
4834 * - 0 - In any scenario, SDHC does not send out the external DMA request.
4835 * - 1 - When internal DMA is not active, the external DMA request will be sent
4836 * out.
4837 */
4838 /*@{*/
4839 #define BP_SDHC_VENDOR_EXTDMAEN (0U) /*!< Bit position for SDHC_VENDOR_EXTDMAEN. */
4840 #define BM_SDHC_VENDOR_EXTDMAEN (0x00000001U) /*!< Bit mask for SDHC_VENDOR_EXTDMAEN. */
4841 #define BS_SDHC_VENDOR_EXTDMAEN (1U) /*!< Bit field size in bits for SDHC_VENDOR_EXTDMAEN. */
4842
4843 /*! @brief Read current value of the SDHC_VENDOR_EXTDMAEN field. */
4844 #define BR_SDHC_VENDOR_EXTDMAEN(x) (BITBAND_ACCESS32(HW_SDHC_VENDOR_ADDR(x), BP_SDHC_VENDOR_EXTDMAEN))
4845
4846 /*! @brief Format value for bitfield SDHC_VENDOR_EXTDMAEN. */
4847 #define BF_SDHC_VENDOR_EXTDMAEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_VENDOR_EXTDMAEN) & BM_SDHC_VENDOR_EXTDMAEN)
4848
4849 /*! @brief Set the EXTDMAEN field to a new value. */
4850 #define BW_SDHC_VENDOR_EXTDMAEN(x, v) (BITBAND_ACCESS32(HW_SDHC_VENDOR_ADDR(x), BP_SDHC_VENDOR_EXTDMAEN) = (v))
4851 /*@}*/
4852
4853 /*!
4854 * @name Register SDHC_VENDOR, field EXBLKNU[1] (RW)
4855 *
4856 * This bit must be set before S/W issues CMD53 multi-block read with exact
4857 * block number. This bit must not be set if the CMD53 multi-block read is not exact
4858 * block number.
4859 *
4860 * Values:
4861 * - 0 - None exact block read.
4862 * - 1 - Exact block read for SDIO CMD53.
4863 */
4864 /*@{*/
4865 #define BP_SDHC_VENDOR_EXBLKNU (1U) /*!< Bit position for SDHC_VENDOR_EXBLKNU. */
4866 #define BM_SDHC_VENDOR_EXBLKNU (0x00000002U) /*!< Bit mask for SDHC_VENDOR_EXBLKNU. */
4867 #define BS_SDHC_VENDOR_EXBLKNU (1U) /*!< Bit field size in bits for SDHC_VENDOR_EXBLKNU. */
4868
4869 /*! @brief Read current value of the SDHC_VENDOR_EXBLKNU field. */
4870 #define BR_SDHC_VENDOR_EXBLKNU(x) (BITBAND_ACCESS32(HW_SDHC_VENDOR_ADDR(x), BP_SDHC_VENDOR_EXBLKNU))
4871
4872 /*! @brief Format value for bitfield SDHC_VENDOR_EXBLKNU. */
4873 #define BF_SDHC_VENDOR_EXBLKNU(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_VENDOR_EXBLKNU) & BM_SDHC_VENDOR_EXBLKNU)
4874
4875 /*! @brief Set the EXBLKNU field to a new value. */
4876 #define BW_SDHC_VENDOR_EXBLKNU(x, v) (BITBAND_ACCESS32(HW_SDHC_VENDOR_ADDR(x), BP_SDHC_VENDOR_EXBLKNU) = (v))
4877 /*@}*/
4878
4879 /*!
4880 * @name Register SDHC_VENDOR, field INTSTVAL[23:16] (RO)
4881 *
4882 * Internal state value, reflecting the corresponding state value selected by
4883 * Debug Select field. This field is read-only and write to this field does not
4884 * have effect.
4885 */
4886 /*@{*/
4887 #define BP_SDHC_VENDOR_INTSTVAL (16U) /*!< Bit position for SDHC_VENDOR_INTSTVAL. */
4888 #define BM_SDHC_VENDOR_INTSTVAL (0x00FF0000U) /*!< Bit mask for SDHC_VENDOR_INTSTVAL. */
4889 #define BS_SDHC_VENDOR_INTSTVAL (8U) /*!< Bit field size in bits for SDHC_VENDOR_INTSTVAL. */
4890
4891 /*! @brief Read current value of the SDHC_VENDOR_INTSTVAL field. */
4892 #define BR_SDHC_VENDOR_INTSTVAL(x) (HW_SDHC_VENDOR(x).B.INTSTVAL)
4893 /*@}*/
4894
4895 /*******************************************************************************
4896 * HW_SDHC_MMCBOOT - MMC Boot register
4897 ******************************************************************************/
4898
4899 /*!
4900 * @brief HW_SDHC_MMCBOOT - MMC Boot register (RW)
4901 *
4902 * Reset value: 0x00000000U
4903 *
4904 * This register contains the MMC fast boot control register.
4905 */
4906 typedef union _hw_sdhc_mmcboot
4907 {
4908 uint32_t U;
4909 struct _hw_sdhc_mmcboot_bitfields
4910 {
4911 uint32_t DTOCVACK : 4; /*!< [3:0] Boot ACK Time Out Counter Value */
4912 uint32_t BOOTACK : 1; /*!< [4] Boot Ack Mode Select */
4913 uint32_t BOOTMODE : 1; /*!< [5] Boot Mode Select */
4914 uint32_t BOOTEN : 1; /*!< [6] Boot Mode Enable */
4915 uint32_t AUTOSABGEN : 1; /*!< [7] */
4916 uint32_t RESERVED0 : 8; /*!< [15:8] */
4917 uint32_t BOOTBLKCNT : 16; /*!< [31:16] */
4918 } B;
4919 } hw_sdhc_mmcboot_t;
4920
4921 /*!
4922 * @name Constants and macros for entire SDHC_MMCBOOT register
4923 */
4924 /*@{*/
4925 #define HW_SDHC_MMCBOOT_ADDR(x) ((x) + 0xC4U)
4926
4927 #define HW_SDHC_MMCBOOT(x) (*(__IO hw_sdhc_mmcboot_t *) HW_SDHC_MMCBOOT_ADDR(x))
4928 #define HW_SDHC_MMCBOOT_RD(x) (HW_SDHC_MMCBOOT(x).U)
4929 #define HW_SDHC_MMCBOOT_WR(x, v) (HW_SDHC_MMCBOOT(x).U = (v))
4930 #define HW_SDHC_MMCBOOT_SET(x, v) (HW_SDHC_MMCBOOT_WR(x, HW_SDHC_MMCBOOT_RD(x) | (v)))
4931 #define HW_SDHC_MMCBOOT_CLR(x, v) (HW_SDHC_MMCBOOT_WR(x, HW_SDHC_MMCBOOT_RD(x) & ~(v)))
4932 #define HW_SDHC_MMCBOOT_TOG(x, v) (HW_SDHC_MMCBOOT_WR(x, HW_SDHC_MMCBOOT_RD(x) ^ (v)))
4933 /*@}*/
4934
4935 /*
4936 * Constants & macros for individual SDHC_MMCBOOT bitfields
4937 */
4938
4939 /*!
4940 * @name Register SDHC_MMCBOOT, field DTOCVACK[3:0] (RW)
4941 *
4942 * Values:
4943 * - 0000 - SDCLK x 2^8
4944 * - 0001 - SDCLK x 2^9
4945 * - 0010 - SDCLK x 2^10
4946 * - 0011 - SDCLK x 2^11
4947 * - 0100 - SDCLK x 2^12
4948 * - 0101 - SDCLK x 2^13
4949 * - 0110 - SDCLK x 2^14
4950 * - 0111 - SDCLK x 2^15
4951 * - 1110 - SDCLK x 2^22
4952 * - 1111 - Reserved
4953 */
4954 /*@{*/
4955 #define BP_SDHC_MMCBOOT_DTOCVACK (0U) /*!< Bit position for SDHC_MMCBOOT_DTOCVACK. */
4956 #define BM_SDHC_MMCBOOT_DTOCVACK (0x0000000FU) /*!< Bit mask for SDHC_MMCBOOT_DTOCVACK. */
4957 #define BS_SDHC_MMCBOOT_DTOCVACK (4U) /*!< Bit field size in bits for SDHC_MMCBOOT_DTOCVACK. */
4958
4959 /*! @brief Read current value of the SDHC_MMCBOOT_DTOCVACK field. */
4960 #define BR_SDHC_MMCBOOT_DTOCVACK(x) (HW_SDHC_MMCBOOT(x).B.DTOCVACK)
4961
4962 /*! @brief Format value for bitfield SDHC_MMCBOOT_DTOCVACK. */
4963 #define BF_SDHC_MMCBOOT_DTOCVACK(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_MMCBOOT_DTOCVACK) & BM_SDHC_MMCBOOT_DTOCVACK)
4964
4965 /*! @brief Set the DTOCVACK field to a new value. */
4966 #define BW_SDHC_MMCBOOT_DTOCVACK(x, v) (HW_SDHC_MMCBOOT_WR(x, (HW_SDHC_MMCBOOT_RD(x) & ~BM_SDHC_MMCBOOT_DTOCVACK) | BF_SDHC_MMCBOOT_DTOCVACK(v)))
4967 /*@}*/
4968
4969 /*!
4970 * @name Register SDHC_MMCBOOT, field BOOTACK[4] (RW)
4971 *
4972 * Values:
4973 * - 0 - No ack.
4974 * - 1 - Ack.
4975 */
4976 /*@{*/
4977 #define BP_SDHC_MMCBOOT_BOOTACK (4U) /*!< Bit position for SDHC_MMCBOOT_BOOTACK. */
4978 #define BM_SDHC_MMCBOOT_BOOTACK (0x00000010U) /*!< Bit mask for SDHC_MMCBOOT_BOOTACK. */
4979 #define BS_SDHC_MMCBOOT_BOOTACK (1U) /*!< Bit field size in bits for SDHC_MMCBOOT_BOOTACK. */
4980
4981 /*! @brief Read current value of the SDHC_MMCBOOT_BOOTACK field. */
4982 #define BR_SDHC_MMCBOOT_BOOTACK(x) (BITBAND_ACCESS32(HW_SDHC_MMCBOOT_ADDR(x), BP_SDHC_MMCBOOT_BOOTACK))
4983
4984 /*! @brief Format value for bitfield SDHC_MMCBOOT_BOOTACK. */
4985 #define BF_SDHC_MMCBOOT_BOOTACK(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_MMCBOOT_BOOTACK) & BM_SDHC_MMCBOOT_BOOTACK)
4986
4987 /*! @brief Set the BOOTACK field to a new value. */
4988 #define BW_SDHC_MMCBOOT_BOOTACK(x, v) (BITBAND_ACCESS32(HW_SDHC_MMCBOOT_ADDR(x), BP_SDHC_MMCBOOT_BOOTACK) = (v))
4989 /*@}*/
4990
4991 /*!
4992 * @name Register SDHC_MMCBOOT, field BOOTMODE[5] (RW)
4993 *
4994 * Values:
4995 * - 0 - Normal boot.
4996 * - 1 - Alternative boot.
4997 */
4998 /*@{*/
4999 #define BP_SDHC_MMCBOOT_BOOTMODE (5U) /*!< Bit position for SDHC_MMCBOOT_BOOTMODE. */
5000 #define BM_SDHC_MMCBOOT_BOOTMODE (0x00000020U) /*!< Bit mask for SDHC_MMCBOOT_BOOTMODE. */
5001 #define BS_SDHC_MMCBOOT_BOOTMODE (1U) /*!< Bit field size in bits for SDHC_MMCBOOT_BOOTMODE. */
5002
5003 /*! @brief Read current value of the SDHC_MMCBOOT_BOOTMODE field. */
5004 #define BR_SDHC_MMCBOOT_BOOTMODE(x) (BITBAND_ACCESS32(HW_SDHC_MMCBOOT_ADDR(x), BP_SDHC_MMCBOOT_BOOTMODE))
5005
5006 /*! @brief Format value for bitfield SDHC_MMCBOOT_BOOTMODE. */
5007 #define BF_SDHC_MMCBOOT_BOOTMODE(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_MMCBOOT_BOOTMODE) & BM_SDHC_MMCBOOT_BOOTMODE)
5008
5009 /*! @brief Set the BOOTMODE field to a new value. */
5010 #define BW_SDHC_MMCBOOT_BOOTMODE(x, v) (BITBAND_ACCESS32(HW_SDHC_MMCBOOT_ADDR(x), BP_SDHC_MMCBOOT_BOOTMODE) = (v))
5011 /*@}*/
5012
5013 /*!
5014 * @name Register SDHC_MMCBOOT, field BOOTEN[6] (RW)
5015 *
5016 * Values:
5017 * - 0 - Fast boot disable.
5018 * - 1 - Fast boot enable.
5019 */
5020 /*@{*/
5021 #define BP_SDHC_MMCBOOT_BOOTEN (6U) /*!< Bit position for SDHC_MMCBOOT_BOOTEN. */
5022 #define BM_SDHC_MMCBOOT_BOOTEN (0x00000040U) /*!< Bit mask for SDHC_MMCBOOT_BOOTEN. */
5023 #define BS_SDHC_MMCBOOT_BOOTEN (1U) /*!< Bit field size in bits for SDHC_MMCBOOT_BOOTEN. */
5024
5025 /*! @brief Read current value of the SDHC_MMCBOOT_BOOTEN field. */
5026 #define BR_SDHC_MMCBOOT_BOOTEN(x) (BITBAND_ACCESS32(HW_SDHC_MMCBOOT_ADDR(x), BP_SDHC_MMCBOOT_BOOTEN))
5027
5028 /*! @brief Format value for bitfield SDHC_MMCBOOT_BOOTEN. */
5029 #define BF_SDHC_MMCBOOT_BOOTEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_MMCBOOT_BOOTEN) & BM_SDHC_MMCBOOT_BOOTEN)
5030
5031 /*! @brief Set the BOOTEN field to a new value. */
5032 #define BW_SDHC_MMCBOOT_BOOTEN(x, v) (BITBAND_ACCESS32(HW_SDHC_MMCBOOT_ADDR(x), BP_SDHC_MMCBOOT_BOOTEN) = (v))
5033 /*@}*/
5034
5035 /*!
5036 * @name Register SDHC_MMCBOOT, field AUTOSABGEN[7] (RW)
5037 *
5038 * When boot, enable auto stop at block gap function. This function will be
5039 * triggered, and host will stop at block gap when received card block cnt is equal
5040 * to BOOTBLKCNT.
5041 */
5042 /*@{*/
5043 #define BP_SDHC_MMCBOOT_AUTOSABGEN (7U) /*!< Bit position for SDHC_MMCBOOT_AUTOSABGEN. */
5044 #define BM_SDHC_MMCBOOT_AUTOSABGEN (0x00000080U) /*!< Bit mask for SDHC_MMCBOOT_AUTOSABGEN. */
5045 #define BS_SDHC_MMCBOOT_AUTOSABGEN (1U) /*!< Bit field size in bits for SDHC_MMCBOOT_AUTOSABGEN. */
5046
5047 /*! @brief Read current value of the SDHC_MMCBOOT_AUTOSABGEN field. */
5048 #define BR_SDHC_MMCBOOT_AUTOSABGEN(x) (BITBAND_ACCESS32(HW_SDHC_MMCBOOT_ADDR(x), BP_SDHC_MMCBOOT_AUTOSABGEN))
5049
5050 /*! @brief Format value for bitfield SDHC_MMCBOOT_AUTOSABGEN. */
5051 #define BF_SDHC_MMCBOOT_AUTOSABGEN(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_MMCBOOT_AUTOSABGEN) & BM_SDHC_MMCBOOT_AUTOSABGEN)
5052
5053 /*! @brief Set the AUTOSABGEN field to a new value. */
5054 #define BW_SDHC_MMCBOOT_AUTOSABGEN(x, v) (BITBAND_ACCESS32(HW_SDHC_MMCBOOT_ADDR(x), BP_SDHC_MMCBOOT_AUTOSABGEN) = (v))
5055 /*@}*/
5056
5057 /*!
5058 * @name Register SDHC_MMCBOOT, field BOOTBLKCNT[31:16] (RW)
5059 *
5060 * Defines the stop at block gap value of automatic mode. When received card
5061 * block cnt is equal to BOOTBLKCNT and AUTOSABGEN is 1, then stop at block gap.
5062 */
5063 /*@{*/
5064 #define BP_SDHC_MMCBOOT_BOOTBLKCNT (16U) /*!< Bit position for SDHC_MMCBOOT_BOOTBLKCNT. */
5065 #define BM_SDHC_MMCBOOT_BOOTBLKCNT (0xFFFF0000U) /*!< Bit mask for SDHC_MMCBOOT_BOOTBLKCNT. */
5066 #define BS_SDHC_MMCBOOT_BOOTBLKCNT (16U) /*!< Bit field size in bits for SDHC_MMCBOOT_BOOTBLKCNT. */
5067
5068 /*! @brief Read current value of the SDHC_MMCBOOT_BOOTBLKCNT field. */
5069 #define BR_SDHC_MMCBOOT_BOOTBLKCNT(x) (HW_SDHC_MMCBOOT(x).B.BOOTBLKCNT)
5070
5071 /*! @brief Format value for bitfield SDHC_MMCBOOT_BOOTBLKCNT. */
5072 #define BF_SDHC_MMCBOOT_BOOTBLKCNT(v) ((uint32_t)((uint32_t)(v) << BP_SDHC_MMCBOOT_BOOTBLKCNT) & BM_SDHC_MMCBOOT_BOOTBLKCNT)
5073
5074 /*! @brief Set the BOOTBLKCNT field to a new value. */
5075 #define BW_SDHC_MMCBOOT_BOOTBLKCNT(x, v) (HW_SDHC_MMCBOOT_WR(x, (HW_SDHC_MMCBOOT_RD(x) & ~BM_SDHC_MMCBOOT_BOOTBLKCNT) | BF_SDHC_MMCBOOT_BOOTBLKCNT(v)))
5076 /*@}*/
5077
5078 /*******************************************************************************
5079 * HW_SDHC_HOSTVER - Host Controller Version
5080 ******************************************************************************/
5081
5082 /*!
5083 * @brief HW_SDHC_HOSTVER - Host Controller Version (RO)
5084 *
5085 * Reset value: 0x00001201U
5086 *
5087 * This register contains the vendor host controller version information. All
5088 * bits are read only and will read the same as the power-reset value.
5089 */
5090 typedef union _hw_sdhc_hostver
5091 {
5092 uint32_t U;
5093 struct _hw_sdhc_hostver_bitfields
5094 {
5095 uint32_t SVN : 8; /*!< [7:0] Specification Version Number */
5096 uint32_t VVN : 8; /*!< [15:8] Vendor Version Number */
5097 uint32_t RESERVED0 : 16; /*!< [31:16] */
5098 } B;
5099 } hw_sdhc_hostver_t;
5100
5101 /*!
5102 * @name Constants and macros for entire SDHC_HOSTVER register
5103 */
5104 /*@{*/
5105 #define HW_SDHC_HOSTVER_ADDR(x) ((x) + 0xFCU)
5106
5107 #define HW_SDHC_HOSTVER(x) (*(__I hw_sdhc_hostver_t *) HW_SDHC_HOSTVER_ADDR(x))
5108 #define HW_SDHC_HOSTVER_RD(x) (HW_SDHC_HOSTVER(x).U)
5109 /*@}*/
5110
5111 /*
5112 * Constants & macros for individual SDHC_HOSTVER bitfields
5113 */
5114
5115 /*!
5116 * @name Register SDHC_HOSTVER, field SVN[7:0] (RO)
5117 *
5118 * These status bits indicate the host controller specification version.
5119 *
5120 * Values:
5121 * - 1 - SD host specification version 2.0, supports test event register and
5122 * ADMA.
5123 */
5124 /*@{*/
5125 #define BP_SDHC_HOSTVER_SVN (0U) /*!< Bit position for SDHC_HOSTVER_SVN. */
5126 #define BM_SDHC_HOSTVER_SVN (0x000000FFU) /*!< Bit mask for SDHC_HOSTVER_SVN. */
5127 #define BS_SDHC_HOSTVER_SVN (8U) /*!< Bit field size in bits for SDHC_HOSTVER_SVN. */
5128
5129 /*! @brief Read current value of the SDHC_HOSTVER_SVN field. */
5130 #define BR_SDHC_HOSTVER_SVN(x) (HW_SDHC_HOSTVER(x).B.SVN)
5131 /*@}*/
5132
5133 /*!
5134 * @name Register SDHC_HOSTVER, field VVN[15:8] (RO)
5135 *
5136 * These status bits are reserved for the vendor version number. The host driver
5137 * shall not use this status.
5138 *
5139 * Values:
5140 * - 0 - Freescale SDHC version 1.0
5141 * - 10000 - Freescale SDHC version 2.0
5142 * - 10001 - Freescale SDHC version 2.1
5143 * - 10010 - Freescale SDHC version 2.2
5144 */
5145 /*@{*/
5146 #define BP_SDHC_HOSTVER_VVN (8U) /*!< Bit position for SDHC_HOSTVER_VVN. */
5147 #define BM_SDHC_HOSTVER_VVN (0x0000FF00U) /*!< Bit mask for SDHC_HOSTVER_VVN. */
5148 #define BS_SDHC_HOSTVER_VVN (8U) /*!< Bit field size in bits for SDHC_HOSTVER_VVN. */
5149
5150 /*! @brief Read current value of the SDHC_HOSTVER_VVN field. */
5151 #define BR_SDHC_HOSTVER_VVN(x) (HW_SDHC_HOSTVER(x).B.VVN)
5152 /*@}*/
5153
5154 /*******************************************************************************
5155 * hw_sdhc_t - module struct
5156 ******************************************************************************/
5157 /*!
5158 * @brief All SDHC module registers.
5159 */
5160 #pragma pack(1)
5161 typedef struct _hw_sdhc
5162 {
5163 __IO hw_sdhc_dsaddr_t DSADDR; /*!< [0x0] DMA System Address register */
5164 __IO hw_sdhc_blkattr_t BLKATTR; /*!< [0x4] Block Attributes register */
5165 __IO hw_sdhc_cmdarg_t CMDARG; /*!< [0x8] Command Argument register */
5166 __IO hw_sdhc_xfertyp_t XFERTYP; /*!< [0xC] Transfer Type register */
5167 __I hw_sdhc_cmdrsp0_t CMDRSP0; /*!< [0x10] Command Response 0 */
5168 __I hw_sdhc_cmdrsp1_t CMDRSP1; /*!< [0x14] Command Response 1 */
5169 __I hw_sdhc_cmdrsp2_t CMDRSP2; /*!< [0x18] Command Response 2 */
5170 __I hw_sdhc_cmdrsp3_t CMDRSP3; /*!< [0x1C] Command Response 3 */
5171 __IO hw_sdhc_datport_t DATPORT; /*!< [0x20] Buffer Data Port register */
5172 __I hw_sdhc_prsstat_t PRSSTAT; /*!< [0x24] Present State register */
5173 __IO hw_sdhc_proctl_t PROCTL; /*!< [0x28] Protocol Control register */
5174 __IO hw_sdhc_sysctl_t SYSCTL; /*!< [0x2C] System Control register */
5175 __IO hw_sdhc_irqstat_t IRQSTAT; /*!< [0x30] Interrupt Status register */
5176 __IO hw_sdhc_irqstaten_t IRQSTATEN; /*!< [0x34] Interrupt Status Enable register */
5177 __IO hw_sdhc_irqsigen_t IRQSIGEN; /*!< [0x38] Interrupt Signal Enable register */
5178 __I hw_sdhc_ac12err_t AC12ERR; /*!< [0x3C] Auto CMD12 Error Status Register */
5179 __I hw_sdhc_htcapblt_t HTCAPBLT; /*!< [0x40] Host Controller Capabilities */
5180 __IO hw_sdhc_wml_t WML; /*!< [0x44] Watermark Level Register */
5181 uint8_t _reserved0[8];
5182 __O hw_sdhc_fevt_t FEVT; /*!< [0x50] Force Event register */
5183 __I hw_sdhc_admaes_t ADMAES; /*!< [0x54] ADMA Error Status register */
5184 __IO hw_sdhc_adsaddr_t ADSADDR; /*!< [0x58] ADMA System Addressregister */
5185 uint8_t _reserved1[100];
5186 __IO hw_sdhc_vendor_t VENDOR; /*!< [0xC0] Vendor Specific register */
5187 __IO hw_sdhc_mmcboot_t MMCBOOT; /*!< [0xC4] MMC Boot register */
5188 uint8_t _reserved2[52];
5189 __I hw_sdhc_hostver_t HOSTVER; /*!< [0xFC] Host Controller Version */
5190 } hw_sdhc_t;
5191 #pragma pack()
5192
5193 /*! @brief Macro to access all SDHC registers. */
5194 /*! @param x SDHC module instance base address. */
5195 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
5196 * use the '&' operator, like <code>&HW_SDHC(SDHC_BASE)</code>. */
5197 #define HW_SDHC(x) (*(hw_sdhc_t *)(x))
5198
5199 #endif /* __HW_SDHC_REGISTERS_H__ */
5200 /* EOF */
Imprint / Impressum