From 9c6b628a08f9e8d5cda06e624fc5c7d9f1b5d7d8 Mon Sep 17 00:00:00 2001 From: Thomas Ibanez Date: Fri, 27 Dec 2024 19:35:27 +0100 Subject: [PATCH] FTx: Invert Data and direction position when setting up outputs for SPI mode (#2362) The opcode specification says that data comes before direction. The current code prevents the clock pin from outputting the clock signal --- src/devices/Ft232H/Ftx232HDevice.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/Ft232H/Ftx232HDevice.cs b/src/devices/Ft232H/Ftx232HDevice.cs index 3835e67106..ab8ec80de8 100644 --- a/src/devices/Ft232H/Ftx232HDevice.cs +++ b/src/devices/Ft232H/Ftx232HDevice.cs @@ -784,8 +784,8 @@ internal void SpiInitialize() GpioLowDir = (byte)((GpioLowDir & MaskGpio) | 0x03); // clock, MOSI and MISO to 0 GpioLowData = (byte)(GpioLowData & MaskGpio); - toSend[idx++] = GpioLowDir; toSend[idx++] = GpioLowData; + toSend[idx++] = GpioLowDir; // The SK clock frequency can be worked out by below algorithm with divide by 5 set as off // TCK period = 60MHz / (( 1 + [ (0xValueH * 256) OR 0xValueL] ) * 2) // Command to set clock divisor