Skip to main content

StorageControllerApiWrapper Class

NuGet: GHIElectronics.TinyCLR.Devices.Storage
Assembly: GHIElectronics.TinyCLR.Devices.Storage
Namespace: GHIElectronics.TinyCLR.Devices.Storage.Provider

Concrete IStorageControllerProvider backed by the native TinyCLR storage HAL.

public sealed class StorageControllerApiWrapper : IStorageControllerProvider, IApiImplementation

Constructors​

StorageControllerApiWrapper(NativeApi api)​

public StorageControllerApiWrapper(NativeApi api)

Wraps the given native API as a provider.

Properties​

Api​

public NativeApi Api { get; }

The underlying native API descriptor.

Descriptor​

public extern StorageDescriptor Descriptor { get; }

Media geometry and capabilities. (inherited)

Methods​

Dispose()​

public void Dispose()

Releases the native controller.

Open()​

public extern void Open()

Powers on and initializes the media. (inherited)

Close()​

public extern void Close()

Powers off the media. (inherited)

Read(long address, int count, byte[] buffer, int offset, TimeSpan timeout)​

public extern int Read(long address, int count, byte[] buffer, int offset, TimeSpan timeout)

Reads count bytes from address into buffer+offset. (inherited)

Returns int

Write(long address, int count, byte[] buffer, int offset, TimeSpan timeout)​

public extern int Write(long address, int count, byte[] buffer, int offset, TimeSpan timeout)

Writes count bytes from buffer+offset to address. (inherited)

Returns int

Erase(long sector, int count, TimeSpan timeout)​

public extern int Erase(long sector, int count, TimeSpan timeout)

Erases count sectors starting at address. (inherited)

Returns int

IsErased(long address, int count)​

public extern bool IsErased(long address, int count)

True when the addressed span is in its erased (all-0xFF) state. (inherited)

Returns bool

EraseAll(TimeSpan timeout)​

public extern void EraseAll(TimeSpan timeout)

Erases every sector on the media. (inherited)