Skip to content

Commit

Permalink
Add pinout for Sparkfun FTDI Basic
Browse files Browse the repository at this point in the history
For issue #27
  • Loading branch information
lorf committed Mar 27, 2018
1 parent 0ad297e commit cf16f84
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ variables or using the -TRANS option to most CSR commandline apps.
`RXD` (`D1`), `MISO` - `RTS#` (`D2`).
* `hwspi+leds` - this is the same as `hwspi` but adds read and write LEDs on
`DTR#` (`D4`) and `DSR#` (`D5`) pins respectively.
* `sparkfun` - pinout for use with adapters with TX, RX, DTR and CTS
signals brougth out, such as
[Sparkfun FTDI Basic breakout board](https://cdn.sparkfun.com/datasheets/BreakoutBoards/FTDI%20Basic-v22-3.3V.pdf):
`CS` - `CTS#` (`D3`), `CLK` - `TXD` (`D0`), `MOSI` - `RXD` (`D1`), `MISO` -
`DTR#` (`D4`).

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

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.3-a1
0.5.3-a3
2 changes: 2 additions & 0 deletions basics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ static int spifns_sequence_setvar(const char *szName, const char *szValue) {
pinout = SPI_PINOUT_HWSPI_LEDS;
} else if (!stricmp(szValue, "hwspi")) {
pinout = SPI_PINOUT_HWSPI;
} else if (!stricmp(szValue, "sparkfun")) {
pinout = SPI_PINOUT_SPARKFUN;
} else {
const char szError[]="Invalid pinout specified in FTDI_PINOUT";
memcpy(g_szErrorString,szError,sizeof(szError));
Expand Down
13 changes: 13 additions & 0 deletions spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,31 @@ struct spi_pins {
#define SPI_PIN_PRESET_HWSPI \
{ (1 << 3), (1 << 0), (1 << 1), (1 << 2), 0, 0 }

/*
* Pinout for Sparkfun FTDI-Basic breakout board.
* Ref: https://cdn.sparkfun.com/datasheets/BreakoutBoards/FTDI%20Basic-v22-3.3V.pdf
* CS - CTS# (D3)
* CLK - TXD (D0)
* MOSI - RXD (D1)
* MISO - DTR# (D4)
*/
#define SPI_PIN_PRESET_SPARKFUN \
{ (1 << 3), (1 << 0), (1 << 1), (1 << 4), 0, 0 }

#define SPI_PIN_PRESETS { \
SPI_PIN_PRESET_DEFAULT, \
SPI_PIN_PRESET_NOLEDS, \
SPI_PIN_PRESET_HWSPI_LEDS, \
SPI_PIN_PRESET_HWSPI, \
SPI_PIN_PRESET_SPARKFUN, \
}

enum spi_pinouts {
SPI_PINOUT_DEFAULT = 0,
SPI_PINOUT_NOLEDS,
SPI_PINOUT_HWSPI_LEDS,
SPI_PINOUT_HWSPI,
SPI_PINOUT_SPARKFUN,
};

#ifdef __cplusplus
Expand Down

2 comments on commit cf16f84

@kalpeke
Copy link

@kalpeke kalpeke commented on cf16f84 Aug 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @lorf it seems this commit is not on the latest release; look at the top of this page it says This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

and when running this command on Powershell with latest release .\BlueFlashCmd.exe -trans "FTDI_PINOUT=sparkfun" -identify

result is `****************************************************************************

ERROR: Invalid pinout specified in FTDI_PINOUT

Failed`

It seems the code there up to 0.5.3-a8 and the problem starts at 0.5.3-a9

I am struggling to create the DLL from source please assist by releasing new version with fix

@kalpeke
Copy link

@kalpeke kalpeke commented on cf16f84 Aug 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I managed to build DLL after merging sparkfun commit to latest release and now the -identify command says no error and PStool does not see the sparkfun device
image

Please sign in to comment.