Skip to main content

StorageController Class

Namespace: GHIElectronics.TinyCLR.Devices.Storage · Assembly: GHIElectronics.TinyCLR.Devices.Storage

Represents a block-storage device — internal flash, external SPI/SD flash, SD/MMC, or USB mass-storage. Use Hdc to mount the controller with the file-system stack, or call the provider's Read/Write/Erase methods directly for raw block access.

public class StorageController : IDisposable

Properties

Provider

public IStorageControllerProvider Provider { get; }

The low-level provider backing this controller.

Hdc

public IntPtr Hdc { get; }

Native handle (HDC) of the underlying provider, for use with the file-system mount API.

Descriptor

public StorageDescriptor Descriptor { get; }

Reports the media's block layout and capabilities.

Methods

GetDefault()

public static StorageController GetDefault()

Returns the default storage controller for this device.

Returns StorageController

FromName(string name)

public static StorageController FromName(string name)

Returns a storage controller identified by its native API name.

ParameterTypeDescription
namestring

Returns StorageController

FromProvider(IStorageControllerProvider provider)

public static StorageController FromProvider(IStorageControllerProvider provider)

Creates a controller from a custom IStorageControllerProvider.

ParameterTypeDescription
providerIStorageControllerProvider

Returns StorageController

Dispose()

public void Dispose()

Releases the underlying provider.

Open()

public void Open()

Powers on and initializes the underlying media.

Close()

public void Close()

Powers off the underlying media.