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 StorageDevices deviceName, const enum FileSystems fileSystem, 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 StorageDevices deviceName, 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
StorageDevices
deviceName, const enum
FileSystems
fileSystem, const enum
MountFlags
mountFlags)
Attach a file system to a device.
-
deviceName
The device to attach to: DEV_SDCARD or DEV_USB. -
fileSystem
The file system type to attach: FS_FAT or FS_LITTLEFS. -
mountFlags
The 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.
deviceName
The 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.
-
deviceName
The device to register for: DEV_SDCARD or DEV_USB. -
callbackFunction
A 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.
deviceName
The 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
StorageDevices
deviceName, const enum
FileSystems
fileSystem)
Format a device (make file system).
-
deviceName
The device to format: DEV_SDCARD or DEV_USB. -
fileSystem
The 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.