Beispiel #1
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));
 }
Beispiel #2
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]);
        }
Beispiel #3
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));
 }
Beispiel #4
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]);
        }
Beispiel #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));

            return(read((uint)data.Length));
        }
Beispiel #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));

            return(flush()[0]);
        }
Beispiel #7
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));

            return(read(1)[0]);
        }
Beispiel #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));

            return(read(len));
        }
Beispiel #9
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));
 }
Beispiel #10
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));
 }
Beispiel #11
0
 /// <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));
 }