R01UH0823EJ0100 Rev.1.00
Page 1448 of 1823
Jul 31, 2019
RX23W Group
40. SD Host Interface (SDHIa)
40.3.2
SD Buffer and the SDBUFR Register
The SDHI transfers data to an SD card via its internal SD buffer. The SD buffer is comprised of a double buffer, and each
buffer is 512 bytes.
shows the data configuration of a single buffer of the SD buffer’s double buffer.
Figure 40.4
Data Configuration of Single Buffer in the SD Buffer
Access to the SD buffer is done via the SDBUFR register. If data is written to the SDBUFR register while the
SDSWAP.BWSWP bit is 1, the SDHI swaps the endian for the byte, and stores the data in the SDBUFR register. If data
is read from the SDBUFR register while the SDSWAP.BRSWP bit is 1, the data of the endian for the byte that was
swapped can be read.
shows the data alignment when reading the SDBUFR register.
Figure 40.5
Data Alignment When Reading the SDBUFR Register
Word
MSB
LSB
0
30 29 28 27 26 25 24
23
16
Byte 2
15
8
Byte 1
Byte 0
7
6
5
4
3
2
1
0
Byte 3
31
1
30 29 28 27 26 25 24
23
16
Byte 6
15
8
Byte 5
Byte 4
7
6
5
4
3
2
1
0
Byte 7
31
127
30 29 28 27 26 25 24
23
16
Byte 510
15
8
Byte 509
Byte 508
7
6
5
4
3
2
1
0
Byte 511
31
When bytes are not swapped (SDSWAP.BRSWP bit is 0)
SDBUFR register
23
16
Byte (4
n
+ 2)
15
8
Byte (4
n
)
7
6
5
4
3
2
1
0
Byte (4
n
+ 3)
30 29 28 27 26 25 24
31
Byte (4
n
+ 1)
When bytes are swapped (SDSWAP.BRSWP bit is 1)
SDBUFR register
15
8
Byte (4
n
+ 1)
23
16
Byte (4
n
+ 3)
31 30 29 28 27 26 25 24
Byte (4
n
)
6
5
4
3
2
1
0
7
Byte (4
n
+ 2)
In this diagram,
n
= 0 to 127.