Skip to content

Commit

Permalink
v1.2.2
Browse files Browse the repository at this point in the history
- Added a GPIO toggle on the FTDI SPI module to reset the SX1301 board.
  • Loading branch information
Sylvain Miermont committed Mar 10, 2014
1 parent f835eac commit 0e2b2cf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libloragw/VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Software library version: */
#define VERSION_LIBRARY "1.2.1"
#define VERSION_LIBRARY "1.2.2"

/* API version */
#define VERSION_API "1"
Expand Down
5 changes: 5 additions & 0 deletions libloragw/doc/CHANGELOG.TXT
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Lora Gateway HAL changelog
==========================

v1.2.2
---------------------

* Added a GPIO toggle on the FTDI SPI module to reset the SX1301 board.

v1.2.1
---------------------

Expand Down
10 changes: 10 additions & 0 deletions libloragw/src/loragw_spi.ftdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Maintainer: Sylvain Miermont
/* SPI initialization and configuration */
int lgw_spi_open(void **spi_target_ptr) {
struct mpsse_context *mpsse = NULL;
int a, b;

/* check input variables */
CHECK_NULL(spi_target_ptr); /* cannot be null, must point on a void pointer (*spi_target_ptr can be null) */
Expand All @@ -75,6 +76,15 @@ int lgw_spi_open(void **spi_target_ptr) {
return LGW_SPI_ERROR;
}

/* toggle pin ADBUS5 of the FT2232H */
/* On the Semtech reference board, it resets the SX1301 */
a = PinHigh(mpsse, GPIOL1);
b = PinLow(mpsse, GPIOL1);
if ((a != MPSSE_OK) || (b != MPSSE_OK)) {
DEBUG_MSG("ERROR: IMPOSSIBLE TO TOGGLE GPIOL1/ADBUS5\n");
return LGW_SPI_ERROR;
}

DEBUG_PRINTF("SPI port opened and configured ok\ndesc: %s\nPID: 0x%04X\nVID: 0x%04X\nclock: %d\nLibmpsse version: 0x%02X\n", GetDescription(mpsse), GetPid(mpsse), GetVid(mpsse), GetClock(mpsse), Version());
*spi_target_ptr = (void *)mpsse;
return LGW_SPI_SUCCESS;
Expand Down

0 comments on commit 0e2b2cf

Please sign in to comment.