/// <summary> /// Read int from register. /// </summary> /// <param name="register">The register.</param> /// <returns>An int.</returns> public short ReadInt16(SensorRegister register) { Span <byte> val = stackalloc byte[2]; this.Read(register, val); return(BinaryPrimitives.ReadInt16LittleEndian(val)); }
/// <summary> /// Read int from register. /// </summary> /// <param name="register">The register.</param> /// <returns>An int.</returns> public int ReadInt24(SensorRegister register) { Span <byte> val = stackalloc byte[3]; this.Read(register, val); return(ConvertToInt24LittleEndian(val)); }
/// <summary> /// Write a byte to the specified register. /// </summary> /// <param name="register">The register.</param> /// <param name="data">The data to write.</param> public void WriteByte(SensorRegister register, byte data) { this.WriteByte((byte)register, data); }
/// <summary> /// Read raw from register. /// </summary> /// <param name="register">The register.</param> /// <returns>A single byte.</returns> public byte Read(SensorRegister register) { return(this.Read((byte)register)); }
/// <summary> /// Read int from register. /// </summary> /// <param name="register">The register.</param> /// <param name="buffer">the buffer to read.</param> public void Read(SensorRegister register, Span <byte> buffer) { this.Read((byte)register, buffer); }