private static void EnableLine(MpsseDevice mpsse) { FtdiPin PinState = FtdiPin.GPIOL0 | FtdiPin.GPIOL1; FtdiPin PinDirection = (FtdiPin)(FtdiPin.TCK | FtdiPin.TDI | FtdiPin.TMS | FtdiPin.GPIOL0 | FtdiPin.GPIOL1); mpsse.SetDataBitsLowByte(PinState, PinDirection); }
private static void DisableLine(FT2232H mpsse) { FtdiPin PinDirection = (FtdiPin)(FtdiPin.TCK | FtdiPin.TDI | FtdiPin.TMS | FtdiPin.GPIOL0 | FtdiPin.GPIOL1); FtdiPin PinState = (FtdiPin)(FtdiPin.CS | FtdiPin.GPIOL0 | FtdiPin.GPIOL1); mpsse.SetDataBitsLowByte(PinState, PinDirection); }
/// <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)); }
/// <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)); }
private static byte[] transfer(CommandCode cmd, FtdiPin value, FtdiPin direction) { return(new byte[] { (byte)cmd, (byte)value, (byte)direction }); }
public static byte[] SetIoToOnlyDriveOn0andTristateOn1(FtdiPin low, FtdiPin high) { return(transfer(CommandCode.SetIoToOnlyDriveOn0andTristateOn1, low, high)); }
public static byte[] SetDataBitsHighByte(FtdiPin value, FtdiPin direction) { return(transfer(CommandCode.SetDataBitsHighByte, value, direction)); }