using System; namespace Unosquare.RaspberryIO.Abstractions { /// /// Interfaces a device on the I2C Bus. /// public interface II2CDevice { /// /// Gets the device identifier. /// /// /// The device identifier. /// Int32 DeviceId { get; } /// /// Gets the standard POSIX file descriptor. /// /// /// The file descriptor. /// Int32 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(Int32 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(Int32 address, Byte data); /// /// These write an 8 or 16-bit data value into the device register indicated. /// /// The register. /// The data. void WriteAddressWord(Int32 address, UInt16 data); /// /// These read an 8 or 16-bit value from the device register indicated. /// /// The register. /// The address byte from device. Byte ReadAddressByte(Int32 address); /// /// These read an 8 or 16-bit value from the device register indicated. /// /// The register. /// The address word from device. UInt16 ReadAddressWord(Int32 address); } }