Пример #1
0
        /// <summary>
        /// 3.6.4 Read Data bits HighByte
        /// 0x83,
        /// This will read the current state of the high 8 pins and send back 1 byte.
        /// </summary>
        /// <returns></returns>
        public byte ReadDataBitsHighByte()
        {
            write(MpsseCommand.ReadDataBitsHighByte());
            while (inputLen == 0)
            {
                Thread.Sleep(10);
            }

            return(read(1)[0]);
        }
Пример #2
0
        /// <summary>
        /// 3.5.2 Clock Data to TMS pin with read
        /// 0x6F
        /// Length,
        /// Byte1
        /// This will send data bits 6 down to 0 to the TMS pin using the LSB or MSB and -ve
        /// or +ve clk , depending on which of the lower bits have been set.
        /// 0x6F : TMS with LSB first on -ve clk edge, read on -ve edge - use if clk is set to '0'
        /// Bit 7 of the Byte1 is passed on to TDI/DO before the first clk of TMS and is held
        /// static for the duration of TMS clocking. The TDO/DI pin is sampled for the
        /// duration of TMS and a byte containing the data is passed back at the end of TMS
        /// clocking.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="len"></param>
        /// <returns></returns>
        public byte TmsInOutOnMinusEdge(byte data, byte len)
        {
            write(MpsseCommand.TmsInOutOnMinusEdge(data, len));
            while (inputLen == 0)
            {
                Thread.Sleep(10);
            }

            return(read(1)[0]);
        }
Пример #3
0
        /// <summary>
        /// 3.4.8 Clock Data Bits In on -ve clock edge LSB first (no write)
        /// TDO/DI sampled just prior to falling edge
        /// 0x2E,
        /// Length,
        /// This will clock in bits on TDO/DI from 1 to 8 depending on the Length byte. A
        /// length of 0x00 will do 1 bit and a length of 0x07 will do 8 bits. The data will be
        /// shifted down so that the first bit in may not be in bit 0 but from 1 upwards
        /// depending on the number of bits to shift (i.e. a length of 1 bit will have the
        /// data bit sampled in bit 7 of the byte sent back to the PC). The data will be
        /// sampled on the falling edge of the CLK pin. No data is clocked out of the device
        /// on TDI/DO.
        /// </summary>
        /// <param name="len"></param>
        /// <returns></returns>
        public byte BitsInOnMinusEdgeWithLsbFirst(byte len)
        {
            write(MpsseCommand.BitsInOnMinusEdgeWithLsbFirst(len));
            while (inputLen == 0)
            {
                Thread.Sleep(10);
            }

            return(read(1)[0]);
        }
Пример #4
0
        /// <summary>
        /// 4.4 CPUMode Write Short Address
        /// 0x92,
        /// 0xAddrLow,
        /// 0xData
        /// This will write 1 byte from the target device.
        /// </summary>
        /// <param name="addrLow"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public byte WriteShortAddress(byte addrLow, byte data)
        {
            write(MpsseCommand.WriteShortAddress(addrLow, data));

            while (inputLen == 0)
            {
                Thread.Sleep(10);
            }

            return(read(1)[0]);
        }
Пример #5
0
        /// <summary>
        /// 3.4.9 Clock Data Bytes In and Out LSB first
        /// The following commands allow for data to be clocked in and out at the same time
        /// least significant bit first.
        /// 0x3C, out on +ve edge, in on -ve edge
        /// LengthL,
        /// LengthH,
        /// Byte1
        /// ..
        /// Byte65536 (max)
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public byte[] BytesInOnMinusOutOnPlusWithLsbFirst(byte[] data)
        {
            write(MpsseCommand.BytesInOnMinusOutOnPlusWithLsbFirst(data));

            while (inputLen == 0)
            {
                Thread.Sleep(10);
            }

            return(read((uint)data.Length));
        }
Пример #6
0
        /// <summary>
        /// 3.4.10 Clock Data Bits In and Out LSB first
        /// The following commands allow for data to be clocked in and out at the same time
        /// least significant bit first.
        /// 0x3E, out on +ve edge, in on -ve edge
        /// Length
        /// Byte
        /// </summary>
        /// <param name="data"></param>
        /// <param name="len"></param>
        /// <returns></returns>
        public byte BitsInOnMinusOutOnPlusWithLsbFirst(byte data, byte len)
        {
            write(MpsseCommand.BitsInOnMinusOutOnPlusWithLsbFirst(data, len));

            while (inputLen == 0)
            {
                Thread.Sleep(10);
            }

            return(read()[0]);
        }
Пример #7
0
        /// <summary>
        /// 4.5 CPUMode Write Extended Address
        /// 0x93,
        /// 0xAddrHigh,
        /// 0xAddrLow,
        /// 0xData
        /// This will write 1 byte from the target device.
        /// </summary>
        /// <param name="addr"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public byte WriteExtendedAddress(UInt16 addr, byte data)
        {
            write(MpsseCommand.WriteExtendedAddress(addr, data));

            while (inputLen == 0)
            {
                Thread.Sleep(10);
            }

            return(read(1)[0]);
        }
Пример #8
0
        /// <summary>
        /// 3.4.6 Clock Data Bytes In on -ve clock edge LSB first (no write)
        /// 0x2C,
        /// LengthL,
        /// LengthH
        /// This will clock in bytes on TDO/DI from 1 to 65536 depending on the Length bytes.
        /// A length of 0x0000 will do 1 byte and a length of 0xffff will do 65536 bytes. The
        /// first bit in will be the LSB of the first byte and so on. The data will be sampled
        /// on the falling edge of the CLK pin. No data is clocked out of the device on TDI/DO.
        /// </summary>
        /// <param name="len"></param>
        /// <returns></returns>
        public byte[] BytesInOnMinusEdgeWithLsbFirst(uint len)
        {
            write(MpsseCommand.BytesInOnMinusEdgeWithLsbFirst(len));

            while (inputLen == 0)
            {
                Thread.Sleep(10);
            }

            return(read(len));
        }
Пример #9
0
        /// <summary>
        /// 4.3 CPUMode Read Extended Address
        /// 0x91,
        /// 0xAddrHigh
        /// 0xAddrLow
        /// This will read 1 byte from the target device.
        /// </summary>
        /// <param name="addr"></param>
        /// <returns></returns>
        public byte ReadExtendedAddress(UInt16 addr)
        {
            write(MpsseCommand.ReadExtendedAddress(addr));

            while (inputLen == 0)
            {
                Thread.Sleep(10);
            }

            return(read(1)[0]);
        }
Пример #10
0
        /// <summary>
        /// 4.2 CPUMode Read Short Address
        /// 0x90,
        /// 0xAddrLow
        /// This will read 1 byte from the target device.
        /// </summary>
        /// <param name="addrLow"></param>
        /// <returns></returns>
        public byte ReadShortAddress(byte addrLow)
        {
            write(MpsseCommand.ReadShortAddress(addrLow));

            while (inputLen == 0)
            {
                Thread.Sleep(10);
            }

            return(read(1)[0]);
        }
Пример #11
0
        /// <summary>
        /// 3.5.2 Clock Data to TMS pin with read
        /// 0x6F
        /// Length,
        /// Byte1
        /// This will send data bits 6 down to 0 to the TMS pin using the LSB or MSB and -ve
        /// or +ve clk , depending on which of the lower bits have been set.
        /// 0x6F : TMS with LSB first on -ve clk edge, read on -ve edge - use if clk is set to '0'
        /// Bit 7 of the Byte1 is passed on to TDI/DO before the first clk of TMS and is held
        /// static for the duration of TMS clocking. The TDO/DI pin is sampled for the
        /// duration of TMS and a byte containing the data is passed back at the end of TMS
        /// clocking.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="len"></param>
        /// <returns></returns>
        public byte TmsInOutOnMinusEdge(byte data, byte len)
        {
            write(MpsseCommand.TmsInOutOnMinusEdge(data, len));

            return(read(1)[0]);
        }
Пример #12
0
 /// <summary>
 /// 3.4.4 Clock Data Bits Out on -ve clock edge LSB first (no read)
 /// Use if CLK starts at '0'
 /// 0x1B,
 /// Length,
 /// Byte1
 /// This will clock out bits on TDI/DO from 1 to 8 depending on the Length byte. A
 /// length of 0x00 will do 1 bit and a length of 0x07 will do 8 bits. The data is sent
 /// LSB first. Bit 0 of the data byte is placed on TDI/DO then the CLK pin is clocked.
 /// The data will change to the next bit on the falling edge of the CLK pin. No data
 /// is clocked into the device on TDO/DI.
 /// </summary>
 /// <param name="data"></param>
 /// <param name="len"></param>
 public void BitsOutOnMinusEdgeWithLsbFirst(byte data, byte len)
 {
     write(MpsseCommand.BitsOutOnMinusEdgeWithLsbFirst(data, len));
 }
Пример #13
0
        /// <summary>
        /// 3.4.10 Clock Data Bits In and Out LSB first
        /// The following commands allow for data to be clocked in and out at the same time
        /// least significant bit first.
        /// 0x3E, out on +ve edge, in on -ve edge
        /// Length
        /// Byte
        /// </summary>
        /// <param name="data"></param>
        /// <param name="len"></param>
        /// <returns></returns>
        public byte BitsInOnMinusOutOnPlusWithLsbFirst(byte data, byte len)
        {
            write(MpsseCommand.BitsInOnMinusOutOnPlusWithLsbFirst(data, len));

            return(flush()[0]);
        }
Пример #14
0
 /// <summary>
 /// 6.8 Clk continuously and Wait On I/O Low
 /// 0x95,
 /// This will cause the controller to create CLK pulses until GPIOL1 or I/O1 (CPU mode
 /// of FT2232H) is high. Once it is detected as low, it will move on to process the
 /// next instruction. The only way out of this will be to disable the controller if
 /// the I/O line never goes high.
 /// </summary>
 public void ClkContinuouslyAndWaitOnIoLow()
 {
     write(MpsseCommand.ClkContinuouslyAndWaitOnIoLow());
 }
Пример #15
0
 /// <summary>
 /// 6.5 Clock For n bits with no data transfer
 /// 0x8E
 /// Length,
 /// This will pulse the clock for 1 to 8 times given by length. A length of 0x00 will
 /// do 1 clock and a length of 0x07 will do 8 clocks.
 /// </summary>
 /// <param name="len"></param>
 public void ClockForNbitswithNoDataTransfer(byte len)
 {
     write(MpsseCommand.ClockForNbitswithNoDataTransfer(len));
 }
Пример #16
0
        /// <summary>
        /// 3.6.4 Read Data bits HighByte
        /// 0x83,
        /// This will read the current state of the high 8 pins and send back 1 byte.
        /// </summary>
        /// <returns></returns>
        public byte ReadDataBitsHighByte()
        {
            write(MpsseCommand.ReadDataBitsHighByte());

            return(read(1)[0]);
        }
Пример #17
0
        /// <summary>
        /// 4.2 CPUMode Read Short Address
        /// 0x90,
        /// 0xAddrLow
        /// This will read 1 byte from the target device.
        /// </summary>
        /// <param name="addrLow"></param>
        /// <returns></returns>
        public byte ReadShortAddress(byte addrLow)
        {
            write(MpsseCommand.ReadShortAddress(addrLow));

            return(read(1)[0]);
        }
Пример #18
0
        /// <summary>
        /// 4.5 CPUMode Write Extended Address
        /// 0x93,
        /// 0xAddrHigh,
        /// 0xAddrLow,
        /// 0xData
        /// This will write 1 byte from the target device.
        /// </summary>
        /// <param name="addr"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public byte WriteExtendedAddress(UInt16 addr, byte data)
        {
            write(MpsseCommand.WriteExtendedAddress(addr, data));

            return(read(1)[0]);
        }
Пример #19
0
        /// <summary>
        /// 4.4 CPUMode Write Short Address
        /// 0x92,
        /// 0xAddrLow,
        /// 0xData
        /// This will write 1 byte from the target device.
        /// </summary>
        /// <param name="addrLow"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public byte WriteShortAddress(byte addrLow, byte data)
        {
            write(MpsseCommand.WriteShortAddress(addrLow, data));

            return(read(1)[0]);
        }
Пример #20
0
        /// <summary>
        /// 4.3 CPUMode Read Extended Address
        /// 0x91,
        /// 0xAddrHigh
        /// 0xAddrLow
        /// This will read 1 byte from the target device.
        /// </summary>
        /// <param name="addr"></param>
        /// <returns></returns>
        public byte ReadExtendedAddress(UInt16 addr)
        {
            write(MpsseCommand.ReadExtendedAddress(addr));

            return(read(1)[0]);
        }
Пример #21
0
 /// <summary>
 /// 3.5.1 Clock Data to TMS pin (no read)
 /// 0x4B
 /// Length,
 /// Byte1
 /// This will send data bits 6 down to 0 to the TMS pin using the LSB or MSB and -ve
 /// or +ve clk , depending on which of the lower bits have been set.
 /// 0x4B : TMS with LSB first on -ve clk edge - use if clk is set to '0'
 /// Bit 7 of the Byte1 is passed on to TDI/DO before the first clk of TMS and is held
 /// static for the duration of TMS clocking. No read operation will take place.
 /// </summary>
 /// <param name="data"></param>
 /// <param name="len"></param>
 public void TmsOutOnMinusEdge(byte data, byte len)
 {
     write(MpsseCommand.TmsOutOnMinusEdge(data, len));
 }
Пример #22
0
 /// <summary>
 /// 5.1 Send Immediate
 /// 0x87,
 /// This will make the chip flush its buffer back to the PC.
 /// </summary>
 public void SendImmediate()
 {
     write(MpsseCommand.SendImmediate());
 }
Пример #23
0
 /// <summary>
 /// 3.6.2 Set Data bits High Byte
 /// 0x82,
 /// 0xValue,
 /// 0xDirection
 /// This will setup the direction of the high 8 lines and force a value on the bits
 /// that are set as output. A 1 in the Direction byte will make that bit an output.
 /// </summary>
 /// <param name="value"></param>
 /// <param name="direction"></param>
 public void SetDataBitsHighByte(FtdiPin value, FtdiPin direction)
 {
     write(MpsseCommand.SetDataBitsHighByte(value, direction));
 }
Пример #24
0
 /// <summary>
 /// 5.2 Wait On I/O High
 /// 0x88,
 /// This will cause the MPSSE controller to wait until GPIOL1 (JTAG) or I/O1 (CPU) is
 /// high. Once it is detected as high, it will move on to process the next
 /// instruction. The only way out of this will be to disable the controller if the I/O
 /// line never goes high.
 /// </summary>
 public void WaitOnIoHigh()
 {
     write(MpsseCommand.WaitOnIoHigh());
 }
 /// <summary>
 /// 7.1 Set I/O to only drive on a ‘0’ and tristate on a ‘1’
 /// 0x9E
 /// LowByteEnablesForOnlyDrive0
 /// HighByteEnablesForOnlyDrive0
 /// This will make the I/Os only drive when the data is ‘0’ and tristate on the data
 /// being ‘1’ when the appropriate bit is set. Use this op-code when configuring the
 /// MPSSE for I2C use.
 /// </summary>
 /// <param name="low"></param>
 /// <param name="high"></param>
 public void SetIoToOnlyDriveOn0andTristateOn1(FtdiPin low, FtdiPin high)
 {
     write(MpsseCommand.SetIoToOnlyDriveOn0andTristateOn1(low, high));
 }
Пример #26
0
 /// <summary>
 /// 5.3 Wait On I/O Low
 /// 0x89,
 /// This will cause the controller to wait until GPIOL1 (JTAG) or I/O1 (CPU) is low.
 /// Once it is detected as low, it will move on to process the next instruction. The
 /// only way out of this will be to disable the controller if the I/O line never goes
 /// low.
 /// </summary>
 public void WaitOnIoLow()
 {
     write(MpsseCommand.WaitOnIoLow());
 }
Пример #27
0
 /// <summary>
 /// 6.6 Clock For n x 8 bits with no data transfer
 /// 0x8F
 /// LengthL,
 /// LengthH,
 /// This will pulse the clock for 8 to (8 x $10000) times given by length. A length of
 /// 0x0000 will do 8 clocks and a length of 0xFFFF will do 524288 clocks
 /// </summary>
 /// <param name="len"></param>
 public void ClockForNx8bitswithNoDataTransfer(uint len)
 {
     write(MpsseCommand.ClockForNx8bitswithNoDataTransfer(len));
 }
Пример #28
0
 /// <summary>
 /// 3.4.2 Clock Data Bytes Out on -ve clock edge LSB first (no read)
 /// Use if CLK starts at '0'
 /// 0x19,
 /// LengthL,
 /// LengthH,
 /// Byte1
 /// ..
 /// Byte65536 (max)
 /// This will clock out bytes on TDI/DO from 1 to 65536 depending on the Length bytes.
 /// A length of 0x0000 will do 1 byte and a length of 0xffff will do 65536 bytes. The
 /// data is sent LSB first. Bit 0 of the first byte is placed on TDI/DO then the CLK
 /// pin is clocked. The data will change to the next bit on the falling edge of the
 /// CLK pin. No data is clocked into the device on TDO/DI.
 /// </summary>
 /// <param name="data"></param>
 public void BytesOutOnMinusEdgeWithLsbFirst(byte[] data)
 {
     write(MpsseCommand.BytesOutOnMinusEdgeWithLsbFirst(data));
 }
Пример #29
0
 /// <summary>
 /// 6.12 Clock For n x 8 bits with no data transfer or Until GPIOL1 is Low
 /// 0x9D
 /// LengthL,
 /// LengthH,
 /// This will pulse the clock for 8 to (8 x $10000) times given by length. A length of
 /// 0x0000 will do 8 clocks and a length of 0xFFFF will do 524288 clocks or until
 /// GPIOL1 is low.
 /// </summary>
 /// <param name="len"></param>
 public void ClockForNx8BitsWithNoDataTransferOrUntilGPIOL1isLow(uint len)
 {
     write(MpsseCommand.ClockForNx8BitsWithNoDataTransferOrUntilGPIOL1isLow(len));
 }
Пример #30
0
        /// <summary>
        /// 3.4.9 Clock Data Bytes In and Out LSB first
        /// The following commands allow for data to be clocked in and out at the same time
        /// least significant bit first.
        /// 0x3C, out on +ve edge, in on -ve edge
        /// LengthL,
        /// LengthH,
        /// Byte1
        /// ..
        /// Byte65536 (max)
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public byte[] BytesInOnMinusOutOnPlusWithLsbFirst(byte[] data)
        {
            write(MpsseCommand.BytesInOnMinusOutOnPlusWithLsbFirst(data));

            return(read((uint)data.Length));
        }