- Imports:
- interface
wasi:i2c/i2c@0.2.0-draft
- interface
wasi:i2c/delay@0.2.0-draft
- interface
Inter-Integrated Circuit (I²C) API that is based upon hello-embedded and embedded-hal.
u16
An address value, in either 7-bit or 10-bit form, depending on the device.
No-acknowledge error source.
In cases where it is possible, a device should indicate if a no acknowledge response was received to an address versus a no acknowledge to a data byte. Where it is not possible to differentiate, Unknown should be indicated.
-
The device did not acknowledge its address. The device may be missing.
-
The device did not acknowledge the data. It may not be ready to process requests at the moment.
-
Either the device did not acknowledge its address or the data, but it is unknown which.
Operation errors.
-
Bus error occurred. e.g. A START or a STOP condition is detected and is not located after a multiple of 9 SCL clock pulses.
-
The arbitration was lost, e.g. electrical problems with the clock signal.
-
no-acknowledge
:no-acknowledge-source
A bus operation was not acknowledged, e.g. due to the addressed device not being available on the bus or the device not being ready to process requests at the moment.
-
The peripheral receive buffer was overrun.
-
A different error occurred.
An operation used by the transaction
method.
Execute the provided operation
s on the I²C bus.
- result<list<list<
u8
>>,error-code
>
Reads len
bytes from address address
.
- result<list<
u8
>,error-code
>
Writes bytes to target with address address
.
- result<_,
error-code
>
Writes bytes to address address
and then reads read-len
bytes
in a single transaction.
- result<list<
u8
>,error-code
>
Delays.
Pauses execution for at minimum ns
nanoseconds. Pause can be
longer if the implementation requires it due to precision/timing
issues.
self
: borrow<delay
>ns
:u32