Skip to content

Commit cf16f84

Browse files
committed
Add pinout for Sparkfun FTDI Basic
For issue #27
1 parent 0ad297e commit cf16f84

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ variables or using the -TRANS option to most CSR commandline apps.
259259
`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.
262+
* `sparkfun` - pinout for use with adapters with TX, RX, DTR and CTS
263+
signals brougth out, such as
264+
[Sparkfun FTDI Basic breakout board](https://cdn.sparkfun.com/datasheets/BreakoutBoards/FTDI%20Basic-v22-3.3V.pdf):
265+
`CS` - `CTS#` (`D3`), `CLK` - `TXD` (`D0`), `MOSI` - `RXD` (`D1`), `MISO` -
266+
`DTR#` (`D4`).
262267

263268
For other options see [misc/transport-options.md](misc/transport-options.md).
264269

VERSION

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

basics.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ static int spifns_sequence_setvar(const char *szName, const char *szValue) {
402402
pinout = SPI_PINOUT_HWSPI_LEDS;
403403
} else if (!stricmp(szValue, "hwspi")) {
404404
pinout = SPI_PINOUT_HWSPI;
405+
} else if (!stricmp(szValue, "sparkfun")) {
406+
pinout = SPI_PINOUT_SPARKFUN;
405407
} else {
406408
const char szError[]="Invalid pinout specified in FTDI_PINOUT";
407409
memcpy(g_szErrorString,szError,sizeof(szError));

spi.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,31 @@ struct spi_pins {
6666
#define SPI_PIN_PRESET_HWSPI \
6767
{ (1 << 3), (1 << 0), (1 << 1), (1 << 2), 0, 0 }
6868

69+
/*
70+
* Pinout for Sparkfun FTDI-Basic breakout board.
71+
* Ref: https://cdn.sparkfun.com/datasheets/BreakoutBoards/FTDI%20Basic-v22-3.3V.pdf
72+
* CS - CTS# (D3)
73+
* CLK - TXD (D0)
74+
* MOSI - RXD (D1)
75+
* MISO - DTR# (D4)
76+
*/
77+
#define SPI_PIN_PRESET_SPARKFUN \
78+
{ (1 << 3), (1 << 0), (1 << 1), (1 << 4), 0, 0 }
79+
6980
#define SPI_PIN_PRESETS { \
7081
SPI_PIN_PRESET_DEFAULT, \
7182
SPI_PIN_PRESET_NOLEDS, \
7283
SPI_PIN_PRESET_HWSPI_LEDS, \
7384
SPI_PIN_PRESET_HWSPI, \
85+
SPI_PIN_PRESET_SPARKFUN, \
7486
}
7587

7688
enum spi_pinouts {
7789
SPI_PINOUT_DEFAULT = 0,
7890
SPI_PINOUT_NOLEDS,
7991
SPI_PINOUT_HWSPI_LEDS,
8092
SPI_PINOUT_HWSPI,
93+
SPI_PINOUT_SPARKFUN,
8194
};
8295

8396
#ifdef __cplusplus

0 commit comments

Comments
 (0)