C# Класс Emlid.WindowsIot.Hardware.Components.I2cExtensions

Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Описание методов

WriteJoinByte() публичный статический Метод

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.
Результат void

WriteJoinBytes() публичный статический Метод

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.
Результат void

WriteReadBit() публичный статический Метод

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.
Результат bool

WriteReadByte() публичный статический Метод

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.
Результат byte

WriteReadBytes() публичный статический Метод

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.
Результат byte[]

WriteReadBytes() публичный статический Метод

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.
Результат void

WriteReadWriteBit() публичный статический Метод

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.
Результат byte