public void SelectDiffrentialChannel(CHANNEL chPlus, CHANNEL chMinus) { m_cmdReg.SD = 0; if (chPlus == CHANNEL.CH0 && chMinus == CHANNEL.CH1) { m_cmdReg.C0 = 0; m_cmdReg.C1 = 0; m_cmdReg.C2 = 0; return; } if (chPlus == CHANNEL.CH2 && chMinus == CHANNEL.CH3) { m_cmdReg.C0 = 1; m_cmdReg.C1 = 0; m_cmdReg.C2 = 0; return; } if (chPlus == CHANNEL.CH4 && chMinus == CHANNEL.CH5) { m_cmdReg.C0 = 0; m_cmdReg.C1 = 1; m_cmdReg.C2 = 0; return; } // Complete here //http://www.ti.com/lit/ds/symlink/ads7828.pdf m_i2c.Write(m_slaveAddress, m_cmdReg.ToUInt8()); }
private void Write(Command command, IO_BITS dataPort) { //Populating the commands bits SetCommand(command); //Format: 0:Address, 1:Command, 2:Port Data byte[] data = { 0, 0 }; data[0] = m_cmdReg.ToUInt8(); data[1] &= Convert.ToByte(dataPort); m_i2c.Write(m_slaveAddress, data); }