C# Class Emlid.WindowsIot.Hardware.Components.I2cExtensions

Mostra file Open project: emlid/Navio-SDK-Windows-IoT

Public Methods

Method Description
WriteJoinByte ( this device, byte data1, byte data2 ) : void

Joins two byte values then writes them.

WriteJoinBytes ( this device, byte data1, byte data2 ) : void

Joins two byte values then writes them.

WriteReadBit ( this device, byte writeData, byte mask ) : bool

Writes data, reads a byte result then tests on or more bits.

Commonly used to test register flags.

WriteReadByte ( this device, byte writeData ) : byte

Writes data then reads a single byte result.

WriteReadBytes ( this device, byte writeData, int size ) : byte[]

Writes data then reads a single byte result.

WriteReadBytes ( this device, byte writeData, int size, byte buffer, int offset ) : void

Writes data then reads one or more bytes into an existing buffer.

WriteReadWriteBit ( this device, byte writeData, byte mask, bool value ) : byte

Sets or clears one or more bits.

Commonly used to set register flags. Reads the current byte value, merges the positive or negative bit mask according to value, then writes the modified byte back.

Method Details

WriteJoinByte() public static method

Joins two byte values then writes them.
public static WriteJoinByte ( this device, byte data1, byte data2 ) : void
device this Device to use.
data1 byte First part of data to write.
data2 byte Second part of data to write.
return void

WriteJoinBytes() public static method

Joins two byte values then writes them.
public static WriteJoinBytes ( this device, byte data1, byte data2 ) : void
device this Device to use.
data1 byte First part of data to write.
data2 byte Second part of data to write.
return void

WriteReadBit() public static method

Writes data, reads a byte result then tests on or more bits.
Commonly used to test register flags.
public static WriteReadBit ( this device, byte writeData, byte mask ) : bool
device this Device to use.
writeData byte Data to write.
mask byte Index of the bit to read, zero based.
return bool

WriteReadByte() public static method

Writes data then reads a single byte result.
public static WriteReadByte ( this device, byte writeData ) : byte
device this Device to use.
writeData byte Data to write.
return byte

WriteReadBytes() public static method

Writes data then reads a single byte result.
public static WriteReadBytes ( this device, byte writeData, int size ) : byte[]
device this Device to use.
writeData byte Data to write.
size int Amount of data to read.
return byte[]

WriteReadBytes() public static method

Writes data then reads one or more bytes into an existing buffer.
public static WriteReadBytes ( this device, byte writeData, int size, byte buffer, int offset ) : void
device this Device to use.
writeData byte Data to write.
size int Amount of data to read.
buffer byte Target buffer.
offset int Target buffer offset.
return void

WriteReadWriteBit() public static method

Sets or clears one or more bits.
Commonly used to set register flags. Reads the current byte value, merges the positive or negative bit mask according to value, then writes the modified byte back.
public static WriteReadWriteBit ( this device, byte writeData, byte mask, bool value ) : byte
device this Device to use.
writeData byte Data to write.
mask byte /// Mask of the bit to set or clear according to value. /// Supports setting or clearing multiple bits. ///
value bool Value of the bits, i.e. set or clear.
return byte