Class I2cStep
One transfer a script expects, and what the part answers.
public sealed class I2cStep
- Inheritance
-
I2cStep
- Inherited Members
Methods
Fault(byte, I2cFault)
The next transfer to the address fails, the way a missing or busy part does.
public static I2cStep Fault(byte address, I2cFault fault)
Parameters
addressbyteThe 7-bit address the failing transfer must go to.
faultI2cFaultThe failure the driver sees.
Returns
- I2cStep
The step.
Read(byte, ReadOnlySpan<byte>)
The driver reads from the address and receives reply.
public static I2cStep Read(byte address, ReadOnlySpan<byte> reply)
Parameters
addressbyteThe 7-bit address the read must come from.
replyReadOnlySpan<byte>The bytes the part answers with; the driver must ask for exactly this many.
Returns
- I2cStep
The step.
Write(byte, ReadOnlySpan<byte>)
The driver writes exactly bytes to the address.
public static I2cStep Write(byte address, ReadOnlySpan<byte> bytes)
Parameters
addressbyteThe 7-bit address the write must go to.
bytesReadOnlySpan<byte>The bytes the driver must send.
Returns
- I2cStep
The step.
WriteRead(byte, ReadOnlySpan<byte>, ReadOnlySpan<byte>)
The driver writes bytes and then reads reply in one
transaction, the shape of a register read.
public static I2cStep WriteRead(byte address, ReadOnlySpan<byte> bytes, ReadOnlySpan<byte> reply)
Parameters
addressbyteThe 7-bit address of the part.
bytesReadOnlySpan<byte>The bytes the driver must send first, usually a register address.
replyReadOnlySpan<byte>The bytes the part answers with.
Returns
- I2cStep
The step.