!
be discarded by the ESP8266 SDIO module. Therefore, when sending packets, addr is
related to the actual length of the effective data.
4. int sif_spi_read_bytes(u32 addr,u8* dst,u16 count,u8 func)
Function:
The SDIO byte mode reads the API; encapsulate the read function of the CMD53 byte
mode. It can process the register or the packets. According to the SDIO protocol, the
maximum data length is 512 Bytes.
Location:
port_spi.c. Called by SdioRW in egl_thread.c.
Parameters:
dst: starting address of the receiving buffer
count: length of the packet to be received (unit: Byte)
func: function number. It is 0 for communication of block_size in the block mode used to
read the SDIO CMD53, and 1 for all other communications.
addr: starting address of the data to be read. If you want to operate the register, input the
corresponding address. For example, 0x20, the SDIO status register. If you want to operate
the packets, input a value that equals 0x1f800 - tx_length, and 0x1f800 - tx_length
equals count. If count > tx_length, the SPI host will send packets of count length. But
data between tx_length + 1 and count will be discarded by the ESP8266 SDIO
module. Therefore, when sending packets, addr is related to the actual length of the
effective data.
5. int sif_spi_write_blocks(u32 addr, u8 * src, u16 count,u16
block_size)
Function:
Write the SDIO block mode into the API; encapsulate the write-in function of the CMD53
byte mode. It can only transport the packets, According to the SDIO protocol, the
maximum data length is 512 blocks.
Location:
port_spi.c. Called by dioRW in egl_thread.c and sif_io_sync used by the
program downloader in esp_main_sim.c.
Parameters:
src: starting address of the packet to be sent.
count: length of the packet to be sent (unit: block)
block_size: the number of bytes in 1 block. It should be equal to the 16 bit value whose
func=0, and whose addr=0x110-111. In general, when initialising the SDIO, block_size of
the ESP8266 SDIO should be configured. The starting value of DEMO is 512. During the
operation, it is configured to be 1024. block_size should be an integer multiple of 4.
Espressif
3. SPI Compatibility Mode User Guide
19 86
!
/!
2016.05
Need help?
Do you have a question about the ESP8266 and is the answer not in the manual?
Questions and answers