diff options
author | Sylvain Miermont <smiermont@semtech.com> | 2014-03-10 08:48:00 +0100 |
---|---|---|
committer | Sylvain Miermont <smiermont@semtech.com> | 2014-03-10 08:48:00 +0100 |
commit | 0e2b2cfa32767e516870a4e6a2ce0b6cce827910 (patch) | |
tree | 1bffb308849d69f4ab6e50cdc763d24c8c8e3252 | |
parent | f835eac31780cf7da5b69ae6bd4f57edefa45947 (diff) | |
download | lora_gateway-0e2b2cfa32767e516870a4e6a2ce0b6cce827910.tar.gz lora_gateway-0e2b2cfa32767e516870a4e6a2ce0b6cce827910.tar.bz2 lora_gateway-0e2b2cfa32767e516870a4e6a2ce0b6cce827910.zip |
v1.2.2v1.2.2
- Added a GPIO toggle on the FTDI SPI module to reset the SX1301 board.
-rw-r--r-- | libloragw/VERSION | 2 | ||||
-rw-r--r-- | libloragw/doc/CHANGELOG.TXT | 5 | ||||
-rw-r--r-- | libloragw/src/loragw_spi.ftdi.c | 10 |
3 files changed, 16 insertions, 1 deletions
diff --git a/libloragw/VERSION b/libloragw/VERSION index fff109c..e7ee96c 100644 --- a/libloragw/VERSION +++ b/libloragw/VERSION @@ -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" diff --git a/libloragw/doc/CHANGELOG.TXT b/libloragw/doc/CHANGELOG.TXT index 9402573..a03e7e0 100644 --- a/libloragw/doc/CHANGELOG.TXT +++ b/libloragw/doc/CHANGELOG.TXT @@ -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 --------------------- diff --git a/libloragw/src/loragw_spi.ftdi.c b/libloragw/src/loragw_spi.ftdi.c index 35bc951..23b2a19 100644 --- a/libloragw/src/loragw_spi.ftdi.c +++ b/libloragw/src/loragw_spi.ftdi.c @@ -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) */ @@ -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; |