28 #if (HAL_USE_MMC_SPI == TRUE) || defined(__DOXYGEN__) 34 #define MMC_CMD0_RETRY 10U 35 #define MMC_CMD1_RETRY 100U 36 #define MMC_ACMD41_RETRY 100U 37 #define MMC_WAIT_DATA 10000U 55 #if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) 56 #define MMC_NICE_WAITING TRUE 64 #if (HAL_USE_SPI == FALSE) || (SPI_USE_WAIT == FALSE) 65 #error "MMC_SPI driver requires HAL_USE_SPI and SPI_USE_WAIT" 93 #define _mmc_driver_methods \ 94 _mmcsd_block_device_methods 123 bool block_addresses;
148 #define mmcIsCardInserted(mmcp) mmc_lld_is_card_inserted(mmcp) 160 #define mmcIsWriteProtected(mmcp) mmc_lld_is_write_protected(mmcp) 185 bool mmc_lld_is_card_inserted(
MMCDriver *mmcp);
186 bool mmc_lld_is_write_protected(
MMCDriver *mmcp);
Structure representing a MMC/SD over SPI driver.
#define _mmc_driver_methods
MMCDriver specific methods.
bool mmcStartSequentialRead(MMCDriver *mmcp, uint32_t startblk)
Starts a sequential read.
bool mmcStopSequentialWrite(MMCDriver *mmcp)
Stops a sequential write gracefully.
#define _mmcsd_block_device_data
MMCSDBlockDevice specific data.
bool mmcConnect(MMCDriver *mmcp)
Performs the initialization procedure on the inserted card.
void mmcStart(MMCDriver *mmcp, const MMCConfig *config)
Configures and activates the MMC peripheral.
MMC/SD over SPI driver configuration structure.
bool mmcStopSequentialRead(MMCDriver *mmcp)
Stops a sequential read gracefully.
void mmcStop(MMCDriver *mmcp)
Disables the MMC peripheral.
const SPIConfig * lscfg
SPI low speed configuration used during initialization.
bool mmcGetInfo(MMCDriver *mmcp, BlockDeviceInfo *bdip)
Returns the media info.
bool mmcErase(MMCDriver *mmcp, uint32_t startblk, uint32_t endblk)
Erases blocks.
bool mmcSync(MMCDriver *mmcp)
Waits for card idle condition.
_mmcsd_block_device_data const MMCConfig * config
Current configuration data.
const struct MMCDriverVMT * vmt
Virtual Methods Table.
bool mmcStartSequentialWrite(MMCDriver *mmcp, uint32_t startblk)
Starts a sequential write.
void mmcObjectInit(MMCDriver *mmcp)
Initializes an instance.
bool mmcSequentialWrite(MMCDriver *mmcp, const uint8_t *buffer)
Writes a block within a sequential write operation.
Driver configuration structure.
SPIDriver * spip
SPI driver associated to this MMC driver.
MMCDriver virtual methods table.
void mmcInit(void)
MMC over SPI driver initialization.
bool mmcDisconnect(MMCDriver *mmcp)
Brings the driver in a state safe for card removal.
const SPIConfig * hscfg
SPI high speed configuration used during transfers.
Structure representing an SPI driver.
bool mmcSequentialRead(MMCDriver *mmcp, uint8_t *buffer)
Reads a block within a sequential read operation.