using System; using System.Runtime.InteropServices; namespace Unosquare.WiringPi.Native { public partial class WiringPi { #region WiringPi - Shift Library /// /// This shifts an 8-bit data value in with the data appearing on the dPin and the clock being sent out on the cPin. /// Order is either LSBFIRST or MSBFIRST. The data is sampled after the cPin goes high. /// (So cPin high, sample data, cPin low, repeat for 8 bits) The 8-bit value is returned by the function. /// /// The d pin. /// The c pin. /// The order. /// The result. [DllImport(WiringPiLibrary, EntryPoint = "shiftIn", SetLastError = true)] public static extern Byte ShiftIn(Byte dPin, Byte cPin, Byte order); /// /// The shifts an 8-bit data value val out with the data being sent out on dPin and the clock being sent out on the cPin. /// order is as above. Data is clocked out on the rising or falling edge – ie. dPin is set, then cPin is taken high then low /// – repeated for the 8 bits. /// /// The d pin. /// The c pin. /// The order. /// The value. [DllImport(WiringPiLibrary, EntryPoint = "shiftOut", SetLastError = true)] public static extern void ShiftOut(Byte dPin, Byte cPin, Byte order, Byte val); #endregion } }