Skip to content

Commit

Permalink
Invert Data and direction position when setting up outputs for SPI mode
Browse files Browse the repository at this point in the history
The opcode specification says that data comes before direction. The current code prevents the clock pin from outputting the clock signal
  • Loading branch information
ProtectedVariable authored Nov 14, 2024
1 parent ddb69e5 commit c39bc80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/devices/Ft232H/Ftx232HDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c39bc80

Please sign in to comment.