Beispiel #1
0
            /// <summary>This uses the standard baud rates defined by the SERIAL_BAUD enumerated type</summary>
            public static RESULTS setI2C_MODE(ISS_MODES_I2C mode, SERIAL_BAUD_RATES baud)
            {
                ISSComm comm = ISSComm.getComm();

                comm.Write(new byte[] { 0x5A, 0x02, (byte)((byte)mode | (byte)ISS_MODES.SERIAL), (byte)(((uint)baud) >> 8), (byte)baud });
                comm.Read(2);
                //if (comm.readData[0] == 0xFF) // is Ack
                return((RESULTS)comm.readData[1]);
            }
Beispiel #2
0
            /// <summary>This uses the custom specified baud rate. Eg: baud = 57600</summary>
            public static RESULTS setI2C_MODE(ISS_MODES_I2C mode, uint baud)
            {
                baud = (48000000 / (16 + baud)) - 1; // convert to baud rate divisor
                ISSComm comm = ISSComm.getComm();

                comm.Write(new byte[] { 0x5A, 0x02, (byte)((byte)mode | (byte)ISS_MODES.SERIAL), (byte)(((uint)baud) >> 8), (byte)baud });
                comm.Read(2);
                //if (comm.readData[0] == 0xFF) // is Ack
                return((RESULTS)comm.readData[1]);
            }
Beispiel #3
0
 public static RESULTS setI2C_MODE(ISS_MODES_I2C mode, IO_TYPES pin1, IO_TYPES pin2)
 {
     return(setMode((ISS_MODES)mode, pin1, pin2, 0, 0));
 }