storage: Add primitive BIS support

This commit is contained in:
CTCaer
2020-04-30 15:04:20 +03:00
parent a2bb576c03
commit b6933013be
5 changed files with 224 additions and 2 deletions

View File

@@ -11,6 +11,7 @@
#include "diskio.h" /* FatFs lower layer API */
#include "../../../../common/memory_map.h"
#include "../../storage/nx_emmc_bis.h"
#include "../../storage/nx_sd.h"
#include "../../storage/ramdisk.h"
#include "../../storage/sdmmc.h"
@@ -51,6 +52,10 @@ DRESULT disk_read (
return sdmmc_storage_read(&sd_storage, sector, count, (void *)buff) ? RES_OK : RES_ERROR;
case DRIVE_RAM:
return ram_disk_read(sector, count, (void *)buff);
case DRIVE_EMMC:
return sdmmc_storage_read(&emmc_storage, sector, count, (void *)buff) ? RES_OK : RES_ERROR;
case DRIVE_BIS:
return nx_emmc_bis_read(sector, count, (void *)buff);
}
return RES_ERROR;
@@ -72,6 +77,9 @@ DRESULT disk_write (
return sdmmc_storage_write(&sd_storage, sector, count, (void *)buff) ? RES_OK : RES_ERROR;
case DRIVE_RAM:
return ram_disk_write(sector, count, (void *)buff);
case DRIVE_EMMC:
case DRIVE_BIS:
return RES_WRPRT;
}
return RES_ERROR;

View File

@@ -26,6 +26,8 @@ typedef enum {
typedef enum {
DRIVE_SD = 0,
DRIVE_RAM = 1,
DRIVE_EMMC = 2,
DRIVE_BIS = 3
} DDRIVE;

View File

@@ -168,13 +168,13 @@
/ Drive/Volume Configurations
/---------------------------------------------------------------------------*/
#define FF_VOLUMES 2
#define FF_VOLUMES 4
/* Number of volumes (logical drives) to be used. (1-10) */
#define FF_STR_VOLUME_ID 1
// Order is important. Any change to order, must also be reflected to diskio drive enum.
#define FF_VOLUME_STRS "sd","ram"
#define FF_VOLUME_STRS "sd","ram","emmc","bis"
/* FF_STR_VOLUME_ID switches support for volume ID in arbitrary strings.
/ When FF_STR_VOLUME_ID is set to 1 or 2, arbitrary strings can be used as drive
/ number in the path name. FF_VOLUME_STRS defines the volume ID strings for each