Skip to content

Commit d991d4e

Browse files
committed
squash! Enable FT230X support, set hwspi pinout for it
Mention whole FT-X family. Also allow to change default pinout based on chip type
1 parent cf16f84 commit d991d4e

File tree

5 files changed

+26
-24
lines changed

5 files changed

+26
-24
lines changed

Makefile.mingw

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ LIBUSB ?= ./libusb
1010
CPPFLAGS += -DSPI_STATS
1111
# Enable LEDs
1212
CPPFLAGS += -DENABLE_LEDS
13-
# FT230X support is available since libftdi-1.1
14-
CPPFLAGS += -DENABLE_FT230X
13+
# Support for FT-X family chips is available since libftdi-1.1
14+
CPPFLAGS += -DENABLE_FT_X
1515

1616
# Fixes compilation on Debian/Ubuntu with mingw-w64 < 3.0.
1717
# See: http://sourceforge.net/p/mingw-w64/mailman/mingw-w64-public/thread/4F8CA26A.70103@users.sourceforge.net/

Makefile.wine

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ STDCXX_LIB ?= /usr/lib/gcc/i686-linux-gnu/$(WINEGCC_VER)
1010
CPPFLAGS += -DSPI_STATS
1111
# Enable LEDs
1212
CPPFLAGS += -DENABLE_LEDS
13-
# FT230X support is available since libftdi-1.1
14-
CPPFLAGS += -DENABLE_FT230X
13+
# Support for FT-X family chips is available since libftdi-1.1
14+
CPPFLAGS += -DENABLE_FT_X
1515
CPPFLAGS += $(shell libftdi1-config --cflags) $(shell env PKG_CONFIG_PATH=$(I386_LIB)/pkgconfig pkg-config --cflags libusb-1.0)
1616

1717
# Compile with debugging

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ KiCad schematic for a dedicated programmer can be found in
123123

124124
The following FTDI chips are reported working with programmer driver: FT232R
125125
(including counterfeits, even "bricked" ones), FT2232H, FT4232H. There is
126-
experimental support for the following chips: FT2232C, FT2232D, FT232H, FT230X.
127-
Please report the working status via
126+
experimental support for the following chips: FT2232C, FT2232D, FT232H, FT220X,
127+
FT221X, FT230X, FT231X, FT234XD, FT240X. Please report the working status via
128128
[GitHub issues](https://github.com/lorf/csr-spi-ftdi/issues).
129129

130-
FT230X has only four primary GPIO pins and does not support default pinout. The
131-
pinout for FT230X is set to `hwspi` on initialization, see `FTDI_PINOUT`
132-
[option](#options).
130+
Some FT-X family chips (FT220X, FT230X, FT234XD) have only four primary GPIO
131+
pins and don't support default pinout. To use such chip You'll need to set
132+
`hwspi` pinout using `FTDI_PINOUT` [option](#options).
133133

134134
### Counterfeit FT232RL chips
135135

@@ -250,13 +250,13 @@ variables or using the -TRANS option to most CSR commandline apps.
250250
* `default` - default pinout as described in [Using FT232RL breakout board as
251251
a programmer](#using-ft232rl-breakout-board-as-a-programmer).
252252
* `noleds` - this is the same as `default` but without LEDs.
253-
* `hwspi` - pinout for use with MPSSE chips (FT2232, FT4232, FT232H), uses
254-
the same pins as hardware SPI. Note that hardware SPI capability is not
255-
used, just the same pinout is used for convenience. This pinout can be used
256-
with adapters like [TIAO
257-
TUMPA](http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_User's_Manual).
258-
The pinout is as follows: `CS` - `CTS#` (`D3`), `CLK` - `TXD` (`D0`), `MOSI` -
259-
`RXD` (`D1`), `MISO` - `RTS#` (`D2`).
253+
* `hwspi` - pinout for use with MPSSE (FT2232, FT4232, FT232H) and FT-X
254+
chips, uses the same pins as hardware SPI. Note that hardware SPI
255+
capability is not used, just the same pinout is used for convenience. This
256+
pinout can be used with adapters like
257+
[TIAO TUMPA](http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_User's_Manual).
258+
The pinout is as follows: `CS` - `CTS#` (`D3`), `CLK` - `TXD` (`D0`),
259+
`MOSI` - `RXD` (`D1`), `MISO` - `RTS#` (`D2`).
260260
* `hwspi+leds` - this is the same as `hwspi` but adds read and write LEDs on
261261
`DTR#` (`D4`) and `DSR#` (`D5`) pins respectively.
262262
* `sparkfun` - pinout for use with adapters with TX, RX, DTR and CTS

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.3-a3
1+
0.5.3-a4

spi.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ static struct ftdi_device_ids ftdi_device_ids[] = {
6363
{ 0x0403, 0x6010, "FT2232" }, /* FT2232H/C/D */
6464
{ 0x0403, 0x6011, "FT4232" }, /* FT4232H */
6565
{ 0x0403, 0x6014, "FT232H" }, /* FT232H */
66-
#ifdef ENABLE_FT230X
67-
/* FT230X support is available since libftdi-1.1 */
68-
{ 0x0403, 0x6015, "FT230X" }, /* FT230X */
66+
#ifdef ENABLE_FT_X
67+
/* FT-X family support is available since libftdi-1.1. This includes
68+
* FT220X, FT221X, FT230X, FT231X, FT234XD and FT240X */
69+
{ 0x0403, 0x6015, "FT-X FAMILY" }, /* FT-X family */
6970
#endif
7071
};
7172

@@ -781,14 +782,15 @@ int spi_open(int nport)
781782
ftdi_type_str = "FT232H";
782783
ftdi_buf_size = 2048;
783784
break;
784-
#ifdef ENABLE_FT230X
785-
/* FT230X support is available since libftdi-1.1 */
785+
#ifdef ENABLE_FT_X
786786
case TYPE_230X:
787-
ftdi_type_str = "FT230X";
787+
ftdi_type_str = "FT-X FAMILY";
788788
ftdi_buf_size = 1024;
789-
/* If pinout was not set via spi_set_pinout() */
789+
/* Change default pinout if pinout was not set via spi_set_pinout() */
790+
/*
790791
if (!spi_pinout_set)
791792
spi_set_pinout(SPI_PINOUT_HWSPI);
793+
*/
792794
break;
793795
#endif
794796
default:

0 commit comments

Comments
 (0)