namespace Unosquare.RaspberryIO.Abstractions
{
///
/// Interfaces a device on the I2C Bus.
///
public interface II2CDevice
{
///
/// Gets the device identifier.
///
///
/// The device identifier.
///
int DeviceId { get; }
///
/// Gets the standard POSIX file descriptor.
///
///
/// The file descriptor.
///
int FileDescriptor { get; }
///
/// Reads a byte from the specified file descriptor.
///
/// The byte from device.
byte Read();
///
/// Reads a buffer of the specified length, one byte at a time.
///
/// The length.
/// The byte array from device.
byte[] Read(int length);
///
/// Writes a byte of data the specified file descriptor.
///
/// The data.
void Write(byte data);
///
/// Writes a set of bytes to the specified file descriptor.
///
/// The data.
void Write(byte[] data);
///
/// These write an 8 or 16-bit data value into the device register indicated.
///
/// The register.
/// The data.
void WriteAddressByte(int address, byte data);
///
/// These write an 8 or 16-bit data value into the device register indicated.
///
/// The register.
/// The data.
void WriteAddressWord(int address, ushort data);
///
/// These read an 8 or 16-bit value from the device register indicated.
///
/// The register.
/// The address byte from device.
byte ReadAddressByte(int address);
///
/// These read an 8 or 16-bit value from the device register indicated.
///
/// The register.
/// The address word from device.
ushort ReadAddressWord(int address);
}
}