#ifndef _SD_MMC_INTF_ #define _SD_MMC_INTF_ // SD MMC Interface // Define FUNCTIONS and stuff here /** * @brief Selects device for use with the SD MMC driver. * * This function selects the device for use. This can mean a number of things, * but the only thing the implementer needs to worry about is hardware selection. * This means setting the CS pin low for SPI or * * @return 0 if successful, else return anything else. * @todo implement mci support and spi support */ #define SD_MMC_INTF_SELECT_DEVICE() /** * @brief Deselects device for use with the SD MMC driver. * * This function deselects the device for use. This can mean a number of things, * but the only thing the implementer needs to worry about is hardware deselection. * * This means setting the CS pin high for SPI or * @return 0 if successul, else return anything else. * @todo implement mci support and mci support */ #define SD_MMC_INTF_DESELECT_DEVICE() /** * @brief Reads bytes from device in the most primitive form. * * * This function reads bytes from the device. It is up to the implementer to simply read the bytes * and return the number of bytes read. Only supports synchronous transactions currently. * This assumes the implementer writes a dummy byte for initiating * an spi read. The slave selection is handled by the driver. There is no need to include * selecting the device in the read function. Doing so could actually interfere with the driver. * * @return The number of bytes read. Failed reads can be <= 0. * @todo -- */ #define SD_MMC_INTF_READ(bytes, len) /** * @brief Writes bytes from the device in the most primitive form. * * This function writes bytes to the device. Only supports synchronous transactions currently. * The slave selection is handled by the driver. There is no need to include * selecting the device in the read function. Doing so could actually interfere with the driver. * * @return The number of bytes written. Failed reads can be <= 0. * @todo -- */ #define SD_MMC_INTF_WRITE(bytes, len) /** * @brief Initializes hardware for the device. * * This function initializes the device. This initialization can be ignored if it is done by your HAL, * but some stub at the very least needs to be provided. * * @return 0 if successful, anything else signifies failure * @todo -- */ #define SD_MMC_INTF_INIT() #endif