Documentation
¶
Overview ¶
Package mmc provides support for accessing the SD/eMMC storage provided by the USB Armory. Note that these are very low-level primitives, and care must be taken when using them not to overwrite existing data (e.g. the unikernel itself!)
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // MaxTransferBytes is the largest transfer we'll attempt. // If we're asked to read or write more data than can fit into available DMA memeory // we'll had a bad time, so we'll chunk into requests of at most MaxTransferBytes bytes. MaxTransferBytes = 32 * 1024 )
Functions ¶
This section is empty.
Types ¶
type Device ¶
Device allows writing to one of the USB Armory storage peripherals, hiding some of the sharp edges around DMA etc.
func (*Device) BlockSize ¶
BlockSize returns the size in bytes of the each block in the underlying storage.
func (*Device) ReadBlocks ¶
ReadBlocks reads data from the storage device at the given address into b. b must be a multiple of the underlying device's block size.
func (*Device) WriteBlocks ¶
WriteBlocks writes the data in b to the device blocks starting at the given block address. If the final block to be written is partial, it will be padded with zeroes to ensure that full blocks are written. Returns the number of blocks written, or an error.