Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Commit

Permalink
- changes required to build for MultiTech mLinux conduit
Browse files Browse the repository at this point in the history
  • Loading branch information
kersing committed Nov 15, 2015
1 parent 05f3612 commit 4f77b38
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
4 changes: 4 additions & 0 deletions libloragw/Makefile
Expand Up @@ -18,7 +18,11 @@ ifeq ($(CFG_SPI),native)
CFG_SPI_MSG := Linux native SPI driver
CFG_SPI_OPT := CFG_SPI_NATIVE
else ifeq ($(CFG_SPI),ftdi)
ifeq ($(PLATFORM),multitech)
CFLAGS := -O2 -Wall -Wextra -std=c99 -Iinc -I. -I/opt/mlinux/3.1.0/sysroots/arm926ejste-mlinux-linux-gnueabi/usr/include/libftdi1
else
CFLAGS := -O2 -Wall -Wextra -std=c99 -Iinc -I.
endif
CFG_SPI_MSG := FTDI SPI-over-USB bridge using libmpsse/libftdi/libusb
CFG_SPI_OPT := CFG_SPI_FTDI
else ifeq ($(CFG_SPI),mac)
Expand Down
22 changes: 22 additions & 0 deletions libloragw/inc/multitech.h
@@ -0,0 +1,22 @@
/*
* multitech.h
*
* Created on: Nov 12, 2015
* Author: Jac
*/

#ifndef _MULTITECH_H_
#define _MULTITECH_H_

/* Human readable platform definition */
#define DISPLAY_PLATFORM "MultiTech"

/* parameters for native spi */
//#define SPI_SPEED 8000000
//#define SPI_DEV_PATH "/dev/spidev32766.2"

/* parameters for a FT232H */
#define VID 0x0403
#define PID 0x6014

#endif /* _MULTITECH_H_ */
4 changes: 2 additions & 2 deletions libloragw/library.cfg
Expand Up @@ -10,15 +10,15 @@
# Note: building on the MAC (OSX) is for testing purposes only
# not for regular operations.

CFG_SPI= native
CFG_SPI= ftdi


### Specify which platform you are on.
# Accepted values:
# kerlink This is the default from Semtech and works for the Kerlink
# lorank This is for the Lorank, and probably for any gateway based on the IMST concentrator.

PLATFORM= kerlink
PLATFORM= multitech


### Debug options ###
Expand Down
7 changes: 7 additions & 0 deletions libloragw/src/loragw_spi.ftdi.c
Expand Up @@ -72,10 +72,17 @@ int lgw_spi_open(void **spi_target_ptr) {
return LGW_SPI_ERROR;
}

#ifdef _MULTITECH_H_
/* toggle pin ADBUS5 of the FT232H */
/* On the MTAC LORA, it resets the SX1301 */
a = PinLow(mpsse, GPIOL1);
b = PinHigh(mpsse, GPIOL1);
#else
/* toggle pin ADBUS5 of the FT2232H */
/* On the Semtech reference board, it resets the SX1301 */
a = PinHigh(mpsse, GPIOL1);
b = PinLow(mpsse, GPIOL1);
#endif
if ((a != MPSSE_OK) || (b != MPSSE_OK)) {
DEBUG_MSG("ERROR: IMPOSSIBLE TO TOGGLE GPIOL1/ADBUS5\n");
return LGW_SPI_ERROR;
Expand Down

0 comments on commit 4f77b38

Please sign in to comment.