#ifndef _SD_SPI_H #define _SD_SPI_H #include // Send CMD17 to an SD card (read a single block) // The buffer passed to the function MUST have a length of at least 512 // Return 1 on failure (0 on success) uint8_t SDSPIReadOneBlock(volatile uint32_t* spix_regs, uint32_t addr, uint8_t* buff, uint8_t slv); // Send CMD24 to an SD card // The buffer passed to the function MUST have a length of at least 512 // Return 1 on failure (0 on success) uint8_t SDSPIWriteOneBlock(volatile uint32_t* spix_regs, uint32_t addr, uint8_t* buff, uint8_t slv); // Run the full initialization sequence as shown in the example application // Sets PL1 frequency, resets QSPI peripheral, initializes QSPI peripheral, calls SDCard initialization // Will return the addresses of the 2 QSPI device registers (in parameters) // Return 1 on failure (0 on success) uint8_t SDSPIFullInitialization(volatile uint32_t** spi0_regs_ret, volatile uint32_t** spi1_regs_ret); #endif /* sd-spi.h */