public void SetDirection(int pRegister, byte pValue) { do { retval = CH341a.CH341WriteI2C(device, pexaddr, (pRegister == 0) ? Reg.IODIRA : Reg.IODIRB, pValue); }while (retval == false); }
public void SetPullup(int pRegister, bool state) { do { retval = CH341a.CH341WriteI2C(device, pexaddr, (pRegister == 0) ? Reg.GPIOA : Reg.GPIOA, (state == true) ? (byte)0xff : (byte)0x00); } while (retval == false); }
//Writes value to output latch public void GPIOWrite(int pRegister, byte pValue) { //Try again until the shitty library returns true. do { retval = CH341a.CH341WriteI2C(device, pexaddr, (pRegister == 0) ? Reg.OLATA : Reg.OLATB, pValue); }while (retval == false); }