Ashet OS

struct: ashet.io.i2c.Operation

Fields

address: u16

The 7- or 10 bit device that should be addressed.

Note:

Values above 1023 will always make the batch execution fail.

type: io.i2c.Operation.Type

The kind of operation that should be performed.

data: bytebuf

The data which should either be written or read.

Note:

If the operation is Type.read, the buffer will be overwritten by the OS. All other operations treat this buffer as immutable.

processed: usize = 0

The number of processed bytes inside data.

Note:

This field can be left uninitialized and will be overwritten by the OS with the result of the operation. If the batch item wasn't scheduled, the resulting value will be zero.

error: io.i2c.Operation.Error

The error that happened when processing this batch item. On success, this will be set to Error.none.

Note:

This field can be left uninitialized and will be overwritten by the OS with the result of the operation. If the batch item wasn't scheduled, the resulting value will be Error.aborted.

Types