67 lines
1.2 KiB
C
67 lines
1.2 KiB
C
|
|
#include "fileio_driver.h"
|
|
#include "sd_spi.h"
|
|
#include "fileio_lfn.h"
|
|
|
|
|
|
void FILEIO_DRIVER_IOInitialize(int VolumeID)
|
|
{
|
|
//if(VolumeID == 1)
|
|
{
|
|
FILEIO_SD_IOInitialize(0);
|
|
}
|
|
}
|
|
|
|
bool FILEIO_DRIVER_MediaDetect(int VolumeID)
|
|
{
|
|
//if(VolumeID == 1)
|
|
{
|
|
return FILEIO_SD_MediaDetect(0);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
FILEIO_MEDIA_INFORMATION * FILEIO_DRIVER_MediaInitialize(int VolumeID)
|
|
{
|
|
//if(VolumeID == 1)
|
|
{
|
|
return FILEIO_SD_MediaInitialize(0);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
bool FILEIO_DRIVER_MediaDeinitialize(int VolumeID)
|
|
{
|
|
// if(VolumeID == 1)
|
|
{
|
|
return FILEIO_SD_MediaDeinitialize(0);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
bool FILEIO_DRIVER_SectorRead(int VolumeID, uint32_t sector_addr, uint8_t* buffer)
|
|
{
|
|
// if(VolumeID == 1)
|
|
{
|
|
return FILEIO_SD_SectorRead(0,sector_addr,buffer);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
uint8_t FILEIO_DRIVER_SectorWrite(int VolumeID, uint32_t sector_addr, uint8_t* buffer, bool allowWriteToZero)
|
|
{
|
|
// if(VolumeID == 1)
|
|
{
|
|
return FILEIO_SD_SectorWrite(0,sector_addr,buffer,allowWriteToZero);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
bool FILEIO_DRIVER_WriteProtectStateGet(int VolumeID)
|
|
{
|
|
// if(VolumeID == 1)
|
|
{
|
|
|
|
}
|
|
return FILEIO_SD_WriteProtectStateGet(0);
|
|
} |