public int SpiOpen(int chan, int baud, int flags) { short ret = PiGpioNativeMethods.spiOpen((ushort)chan, (ushort)baud, (ushort)flags); if (ret < 0) { throw new PiGPIOException(ret); } return(ret); }