| Members | Descriptions |
|---|---|
enum StorageDevices |
Enum to select the storage device to use. |
enum FileSystems |
Enum to select the file system to use. |
enum MountFlags |
Enum to select the mount mode to use. The default mode is Read/Write. |
public int mount(const enum StorageDevicesdeviceName, const enum FileSystemsfileSystem, const enum MountFlags mountFlags) |
Attach a file system to a device. |
public int umount(const enum StorageDevices deviceName) |
Remove the attached file system from a device. |
public int register_hotplug_callback(const enum StorageDevices deviceName, void(*)() callbackFunction) |
Register a hotplug callback function. Currently only supported for DEV_USB on Portenta C33. |
public int deregister_hotplug_callback(const enum StorageDevices deviceName) |
Deregister a previously registered hotplug callback function. Not currently supported on any platform. |
public int mkfs(const enum StorageDevicesdeviceName, const enum FileSystems fileSystem) |
Format a device (make file system). |
enum StorageDevices
Enum to select the storage device to use.
| Values | Descriptions |
|---|---|
| DEV_SDCARD | SD Card. |
| DEV_USB | USB Thumb Drive. |
enum FileSystems
Enum to select the file system to use.
| Values | Descriptions |
|---|---|
| FS_FAT | FAT file system. |
| FS_LITTLEFS | LittleFS file system. |
enum MountFlags
Enum to select the mount mode to use. The default mode is Read/Write.
| Values | Descriptions |
|---|---|
| MNT_DEFAULT | Default mount mode (Read/Write) |
| MNT_RDONLY | Read only mode. |
public int mount(const enum StorageDevicesdeviceName, const enum FileSystemsfileSystem, const enum MountFlags mountFlags)
Attach a file system to a device.
-
deviceNameThe device to attach to: DEV_SDCARD or DEV_USB. -
fileSystemThe file system type to attach: FS_FAT or FS_LITTLEFS. -
mountFlagsThe only valid flag at this time: MNT_DEFAULT.
On success: 0. On failure: -1 with an error code in the errno variable.
public int umount(const enum StorageDevices deviceName)
Remove the attached file system from a device.
deviceNameThe device to remove from: DEV_SDCARD or DEV_USB.
On success: 0. On failure: -1 with an error code in the errno variable.
public int register_hotplug_callback(const enum StorageDevices deviceName, void(*)() callbackFunction)
Register a hotplug callback function. Currently only supported for DEV_USB on Portenta C33.
-
deviceNameThe device to register for: DEV_SDCARD or DEV_USB. -
callbackFunctionA function pointer to the callback.
On success: 0. On failure: -1 with an error code in the errno variable.
public int deregister_hotplug_callback(const enum StorageDevices deviceName)
Deregister a previously registered hotplug callback function. Not currently supported on any platform.
deviceNameThe device to deregister for: DEV_SDCARD or DEV_USB.
On success: 0. On failure: -1 with an error code in the errno variable.
public int mkfs(const enum StorageDevicesdeviceName, const enum FileSystems fileSystem)
Format a device (make file system).
-
deviceNameThe device to format: DEV_SDCARD or DEV_USB. -
fileSystemThe file system type to format: FS_FAT or FS_LITTLEFS. FS_FAT is probably the better choice for both SD Cards and USB thumb drives in most cases.
On success: 0. On failure: -1 with an error code in the errno variable.