summaryrefslogtreecommitdiff
path: root/libloragw/inc
diff options
context:
space:
mode:
Diffstat (limited to 'libloragw/inc')
-rw-r--r--libloragw/inc/loragw_aux.h9
-rw-r--r--libloragw/inc/loragw_gps.h12
-rw-r--r--libloragw/inc/loragw_hal.h168
-rw-r--r--libloragw/inc/loragw_reg.h26
-rw-r--r--libloragw/inc/loragw_spi.h22
5 files changed, 156 insertions, 81 deletions
diff --git a/libloragw/inc/loragw_aux.h b/libloragw/inc/loragw_aux.h
index 8f485b4..feb0594 100644
--- a/libloragw/inc/loragw_aux.h
+++ b/libloragw/inc/loragw_aux.h
@@ -4,10 +4,10 @@
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
- ©2013 Semtech-Cycleo
+ (C)2013 Semtech-Cycleo
Description:
- Lora gateway library common auxiliary functions
+ LoRa concentrator HAL common auxiliary functions
License: Revised BSD License, see LICENSE.TXT file include in the project
Maintainer: Sylvain Miermont
@@ -18,6 +18,11 @@ Maintainer: Sylvain Miermont
#define _LORAGW_AUX_H
/* -------------------------------------------------------------------------- */
+/* --- DEPENDANCIES --------------------------------------------------------- */
+
+#include "config.h" /* library configuration options (dynamically generated) */
+
+/* -------------------------------------------------------------------------- */
/* --- PUBLIC FUNCTIONS PROTOTYPES ------------------------------------------ */
/**
diff --git a/libloragw/inc/loragw_gps.h b/libloragw/inc/loragw_gps.h
index 3884fd5..3f771e4 100644
--- a/libloragw/inc/loragw_gps.h
+++ b/libloragw/inc/loragw_gps.h
@@ -4,7 +4,7 @@
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
- ©2013 Semtech-Cycleo
+ (C)2013 Semtech-Cycleo
Description:
Library of functions to manage a GNSS module (typically GPS) for accurate
@@ -33,6 +33,8 @@ Maintainer: Sylvain Miermont
#include <time.h> /* time library */
#include <termios.h> /* speed_t */
+#include "config.h" /* library configuration options (dynamically generated) */
+
/* -------------------------------------------------------------------------- */
/* --- PUBLIC TYPES --------------------------------------------------------- */
@@ -44,7 +46,7 @@ struct tref {
time_t systime; /*!> system time when solution was calculated */
uint32_t count_us; /*!> reference concentrator internal timestamp */
struct timespec utc; /*!> reference UTC time (from GPS) */
- double xtal_err; /*!> clock error estimation (eg. <1 'slow' XTAL) */
+ double xtal_err; /*!> raw clock error (eg. <1 'slow' XTAL) */
};
/**
@@ -119,7 +121,7 @@ lock must be acquired before calling either function.
enum gps_msg lgw_parse_nmea(char* serial_buff, int buff_size);
/**
-@brief Get the GPS solution (space & time) for the gateway
+@brief Get the GPS solution (space & time) for the concentrator
@param utc pointer to store UTC time, with ns precision (NULL to ignore)
@param loc pointer to store coordinates (NULL to ignore)
@@ -150,7 +152,7 @@ int lgw_gps_sync(struct tref* ref, uint32_t count_us, struct timespec utc);
@brief Convert concentrator timestamp counter value to UTC time
@param ref time reference structure required for time conversion
-@param count_us internal timestamp counter of a Lora gateway
+@param count_us internal timestamp counter of the LoRa concentrator
@param utc pointer to store UTC time, with ns precision (leap seconds ignored)
@return success if the function was able to convert timestamp to UTC
@@ -165,7 +167,7 @@ int lgw_cnt2utc(struct tref ref, uint32_t count_us, struct timespec* utc);
@param ref time reference structure required for time conversion
@param utc UTC time, with ns precision (leap seconds are ignored)
-@param count_us pointer to store internal timestamp counter of a Lora gateway
+@param count_us pointer to store internal timestamp counter of LoRa concentrator
@return success if the function was able to convert UTC to timestamp
This function is typically used when a packet must be sent at an accurate time
diff --git a/libloragw/inc/loragw_hal.h b/libloragw/inc/loragw_hal.h
index 022313f..27ca1a2 100644
--- a/libloragw/inc/loragw_hal.h
+++ b/libloragw/inc/loragw_hal.h
@@ -4,10 +4,10 @@
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
- ©2013 Semtech-Cycleo
+ (C)2013 Semtech-Cycleo
Description:
- Lora gateway Hardware Abstraction Layer
+ LoRa concentrator Hardware Abstraction Layer
License: Revised BSD License, see LICENSE.TXT file include in the project
Maintainer: Sylvain Miermont
@@ -23,12 +23,14 @@ Maintainer: Sylvain Miermont
#include <stdint.h> /* C99 types */
#include <stdbool.h> /* bool type */
+#include "config.h" /* library configuration options (dynamically generated) */
+
/* -------------------------------------------------------------------------- */
/* --- PUBLIC MACROS -------------------------------------------------------- */
#define IS_LORA_BW(bw) ((bw == BW_125KHZ) || (bw == BW_250KHZ) || (bw == BW_500KHZ))
#define IS_LORA_STD_DR(dr) ((dr == DR_LORA_SF7) || (dr == DR_LORA_SF8) || (dr == DR_LORA_SF9) || (dr == DR_LORA_SF10) || (dr == DR_LORA_SF11) || (dr == DR_LORA_SF12))
-#define IS_LORA_MULTI_DR(dr) ((dr & ~DR_LORA_MULTI) == 0) /* ones outside of DR_LORA_MULTI bitmask -> not a combination of Lora datarates */
+#define IS_LORA_MULTI_DR(dr) ((dr & ~DR_LORA_MULTI) == 0) /* ones outside of DR_LORA_MULTI bitmask -> not a combination of LoRa datarates */
#define IS_LORA_CR(cr) ((cr == CR_LORA_4_5) || (cr == CR_LORA_4_6) || (cr == CR_LORA_4_7) || (cr == CR_LORA_4_8))
#define IS_FSK_BW(bw) ((bw >= 1) && (bw <= 7))
@@ -43,42 +45,104 @@ Maintainer: Sylvain Miermont
#define LGW_HAL_SUCCESS 0
#define LGW_HAL_ERROR -1
-/* hardware characteristics */
-#define LGW_RF_CHAIN_NB 2 /* number of RF chains */
-#define LGW_IF_CHAIN_NB 10 /* number of IF+modem RX chains */
-#define LGW_MULTI_NB 4 /* number of Lora 'multi SF' chains */
-
-#define LGW_PKT_FIFO_SIZE 8 /* depth of the RX packet FIFO */
-#define LGW_DATABUFF_SIZE 1024 /* size in bytes of the RX data buffer (contains payload & metadata) */
-#define LGW_REF_BW 125000 /* typical bandwidth of data channel */
-#define LGW_XTAL_FREQU 32000000 /* frequency of the RF reference oscillator */
+/* radio-specific parameters */
+#if ((CFG_RADIO_1257 == 1) || (CFG_RADIO_1255 == 1))
+ #define LGW_XTAL_FREQU 32000000 /* frequency of the RF reference oscillator */
+ #define LGW_RF_CHAIN_NB 2 /* number of RF chains */
+ #define LGW_RF_RX_BANDWIDTH { 1000000, 1000000} /* bandwidth of the radios */
+#endif
-/* to use those parameters, declare a local constant, and use 'rf_chain' as index */
-#define LGW_RF_RX_LOWFREQ {863000000, 863000000} /* lower limit of the usable band in RX for each radio */
-#define LGW_RF_RX_UPFREQ {870000000, 870000000} /* upper limit of the usable band in RX for each radio */
-#define LGW_RF_RX_BANDWIDTH {800000, 800000} /* bandwidth of the radios */
-#define LGW_RF_TX_LOWFREQ {863000000, 863000000} /* lower limit of the usable band in TX for each radio */
-#define LGW_RF_TX_UPFREQ {870000000, 870000000} /* upper limit of the usable band in TX for each radio */
+/* band-specific parameters */
+/* to use array parameters, declare a local const and use 'rf_chain' as index */
+#if (CFG_BAND_FULL == 1)
+ #if (CFG_RADIO_1257 == 1)
+ #define LGW_RF_RX_LOWFREQ { 862000000, 862000000} /* lower limit of the usable band in RX for each radio */
+ #define LGW_RF_RX_UPFREQ {1020000000,1020000000} /* upper limit of the usable band in RX for each radio */
+ #define LGW_RF_TX_LOWFREQ { 862000000, 862000000} /* lower limit of the usable band in TX for each radio */
+ #define LGW_RF_TX_UPFREQ {1020000000,1020000000} /* upper limit of the usable band in TX for each radio */
+ #elif (CFG_RADIO_1255 == 1)
+ #define LGW_RF_RX_LOWFREQ { 400000000, 400000000}
+ #define LGW_RF_RX_UPFREQ { 510000000, 510000000}
+ #define LGW_RF_TX_LOWFREQ { 400000000, 400000000}
+ #define LGW_RF_TX_UPFREQ { 510000000, 510000000}
+ #endif
+#elif (CFG_BAND_868 == 1)
+ #define LGW_RF_RX_LOWFREQ { 863000000, 863000000}
+ #define LGW_RF_RX_UPFREQ { 870000000, 870000000}
+ #define LGW_RF_TX_LOWFREQ { 863000000, 863000000}
+ #define LGW_RF_TX_UPFREQ { 870000000, 870000000}
+#elif (CFG_BAND_915 == 1)
+ #define LGW_RF_RX_LOWFREQ { 902000000, 902000000}
+ #define LGW_RF_RX_UPFREQ { 928000000, 928000000}
+ #define LGW_RF_TX_LOWFREQ { 902000000, 902000000}
+ #define LGW_RF_TX_UPFREQ { 928000000, 928000000}
+#elif (CFG_BAND_470 == 1)
+ #define LGW_RF_RX_LOWFREQ { 470000000, 470000000}
+ #define LGW_RF_RX_UPFREQ { 510000000, 510000000}
+ #define LGW_RF_TX_LOWFREQ { 470000000, 470000000}
+ #define LGW_RF_TX_UPFREQ { 510000000, 510000000}
+#elif (CFG_BAND_433 == 1)
+ #define LGW_RF_RX_LOWFREQ { 433050000, 433050000}
+ #define LGW_RF_RX_UPFREQ { 434790000, 434790000}
+ #define LGW_RF_TX_LOWFREQ { 433050000, 433050000}
+ #define LGW_RF_TX_UPFREQ { 434790000, 434790000}
+#endif
/* type of if_chain + modem */
#define IF_UNDEFINED 0
-#define IF_LORA_STD 0x10 /* if + standard single-SF Lora modem */
-#define IF_LORA_MULTI 0x11 /* if + Lora receiver with multi-SF capability */
+#define IF_LORA_STD 0x10 /* if + standard single-SF LoRa modem */
+#define IF_LORA_MULTI 0x11 /* if + LoRa receiver with multi-SF capability */
#define IF_FSK_STD 0x20 /* if + standard FSK modem */
-/* configuration of available IF chains and modems on the hardware */
-/* to use, declare a local constant, and use 'if_chain' as index */
-#define LGW_IFMODEM_CONFIG {\
- IF_LORA_MULTI, \
- IF_LORA_MULTI, \
- IF_LORA_MULTI, \
- IF_LORA_MULTI, \
- IF_UNDEFINED, \
- IF_UNDEFINED, \
- IF_UNDEFINED, \
- IF_UNDEFINED, \
- IF_LORA_STD, \
- IF_FSK_STD }
+/* concentrator chipset-specific parameters */
+/* to use array parameters, declare a local const and use 'if_chain' as index */
+#if ((CFG_CHIP_1301 == 1) || (CFG_CHIP_FPGA == 1))
+ #define LGW_IF_CHAIN_NB 10 /* number of IF+modem RX chains */
+ #define LGW_PKT_FIFO_SIZE 8 /* depth of the RX packet FIFO */
+ #define LGW_DATABUFF_SIZE 1024 /* size in bytes of the RX data buffer (contains payload & metadata) */
+ #define LGW_REF_BW 125000 /* typical bandwidth of data channel */
+#endif
+
+#if (CFG_CHIP_1301 == 1)
+ #define LGW_MULTI_NB 8 /* number of LoRa 'multi SF' chains */
+ #define LGW_IFMODEM_CONFIG {\
+ IF_LORA_MULTI, \
+ IF_LORA_MULTI, \
+ IF_LORA_MULTI, \
+ IF_LORA_MULTI, \
+ IF_LORA_MULTI, \
+ IF_LORA_MULTI, \
+ IF_LORA_MULTI, \
+ IF_LORA_MULTI, \
+ IF_LORA_STD, \
+ IF_FSK_STD } /* configuration of available IF chains and modems on the hardware */
+#elif (CFG_CHIP_FPGA == 1)
+ #define LGW_MULTI_NB 4 /* number of LoRa 'multi SF' chains */
+ #define LGW_IFMODEM_CONFIG {\
+ IF_LORA_MULTI, \
+ IF_LORA_MULTI, \
+ IF_LORA_MULTI, \
+ IF_LORA_MULTI, \
+ IF_UNDEFINED, \
+ IF_UNDEFINED, \
+ IF_UNDEFINED, \
+ IF_UNDEFINED, \
+ IF_LORA_STD, \
+ IF_FSK_STD } /* configuration of available IF chains and modems on the hardware */
+#endif
+
+/* board-specific parameters */
+/* to use array parameters, declare a local const and use 'rf_chain' as index */
+#if (CFG_BRD_NANO868 == 1)
+ #define LGW_RF_TX_ENABLE { true, true} /* both radio A and B are usable in TX */
+ #define LGW_RF_CLKOUT { true, true} /* both radios have clkout enabled */
+#elif (CFG_BRD_REF1301 == 1)
+ #define LGW_RF_TX_ENABLE { true,false} /* radio B TX output is disconnected */
+ #define LGW_RF_CLKOUT {false, true} /* radio A clkout disabled for spur optimization */
+#elif (CFG_BRD_NONE == 1)
+ #define LGW_RF_TX_ENABLE { true, true} /* both radio A and B are usable in TX */
+ #define LGW_RF_CLKOUT { true, true} /* both radios have clkout enabled */
+#endif
/* values available for the 'modulation' parameters */
/* NOTE: arbitrary values */
@@ -86,7 +150,7 @@ Maintainer: Sylvain Miermont
#define MOD_LORA 0x10
#define MOD_FSK 0x20
-/* values available for the 'bandwidth' parameters (Lora & FSK) */
+/* values available for the 'bandwidth' parameters (LoRa & FSK) */
/* NOTE: directly encode FSK RX bandwidth, do not change */
#define BW_UNDEFINED 0
#define BW_500KHZ 0x01
@@ -98,7 +162,7 @@ Maintainer: Sylvain Miermont
#define BW_7K8HZ 0x07
/* values available for the 'datarate' parameters */
-/* NOTE: Lora values used directly to code SF bitmask in 'multi' modem, do not change */
+/* NOTE: LoRa values used directly to code SF bitmask in 'multi' modem, do not change */
#define DR_UNDEFINED 0
#define DR_LORA_SF7 0x02
#define DR_LORA_SF8 0x04
@@ -111,7 +175,7 @@ Maintainer: Sylvain Miermont
#define DR_FSK_MIN 500
#define DR_FSK_MAX 250000
-/* values available for the 'coderate' parameters (Lora only) */
+/* values available for the 'coderate' parameters (LoRa only) */
/* NOTE: arbitrary values */
#define CR_UNDEFINED 0
#define CR_LORA_4_5 0x01
@@ -185,16 +249,16 @@ struct lgw_pkt_rx_s {
uint32_t freq_hz; /*!> central frequency of the IF chain */
uint8_t if_chain; /*!> by which IF chain was packet received */
uint8_t status; /*!> status of the received packet */
- uint32_t count_us; /*!> internal gateway counter for timestamping, 1 microsecond resolution */
+ uint32_t count_us; /*!> internal concentrator counter for timestamping, 1 microsecond resolution */
uint8_t rf_chain; /*!> through which RF chain the packet was received */
uint8_t modulation; /*!> modulation used by the packet */
- uint8_t bandwidth; /*!> modulation bandwidth (Lora only) */
- uint32_t datarate; /*!> RX datarate of the packet (SF for Lora) */
- uint8_t coderate; /*!> error-correcting code of the packet (Lora only) */
+ uint8_t bandwidth; /*!> modulation bandwidth (LoRa only) */
+ uint32_t datarate; /*!> RX datarate of the packet (SF for LoRa) */
+ uint8_t coderate; /*!> error-correcting code of the packet (LoRa only) */
float rssi; /*!> average packet RSSI in dB */
- float snr; /*!> average packet SNR, in dB (Lora only) */
- float snr_min; /*!> minimum packet SNR, in dB (Lora only) */
- float snr_max; /*!> maximum packet SNR, in dB (Lora only) */
+ float snr; /*!> average packet SNR, in dB (LoRa only) */
+ float snr_min; /*!> minimum packet SNR, in dB (LoRa only) */
+ float snr_max; /*!> maximum packet SNR, in dB (LoRa only) */
uint16_t crc; /*!> CRC that was received in the payload */
uint16_t size; /*!> payload size in bytes */
uint8_t payload[256]; /*!> buffer containing the payload */
@@ -211,14 +275,14 @@ struct lgw_pkt_tx_s {
uint8_t rf_chain; /*!> through which RF chain will the packet be sent */
int8_t rf_power; /*!> TX power, in dBm */
uint8_t modulation; /*!> modulation to use for the packet */
- uint8_t bandwidth; /*!> modulation bandwidth (Lora only) */
- uint32_t datarate; /*!> TX datarate (baudrate for FSK, SF for Lora) */
- uint8_t coderate; /*!> error-correcting code of the packet (Lora only) */
- bool invert_pol; /*!> invert signal polarity, for orthogonal downlinks (Lora only) */
+ uint8_t bandwidth; /*!> modulation bandwidth (LoRa only) */
+ uint32_t datarate; /*!> TX datarate (baudrate for FSK, SF for LoRa) */
+ uint8_t coderate; /*!> error-correcting code of the packet (LoRa only) */
+ bool invert_pol; /*!> invert signal polarity, for orthogonal downlinks (LoRa only) */
uint8_t f_dev; /*!> frequency deviation, in kHz (FSK only) */
uint16_t preamble; /*!> set the preamble length, 0 for default */
bool no_crc; /*!> if true, do not send a CRC in the packet */
- bool no_header; /*!> if true, enable implicit header mode (Lora), fixed length (FSK) */
+ bool no_header; /*!> if true, enable implicit header mode (LoRa), fixed length (FSK) */
uint16_t size; /*!> payload size in bytes */
uint8_t payload[256]; /*!> buffer containing the payload */
};
@@ -243,19 +307,19 @@ int lgw_rxrf_setconf(uint8_t rf_chain, struct lgw_conf_rxrf_s conf);
int lgw_rxif_setconf(uint8_t if_chain, struct lgw_conf_rxif_s conf);
/**
-@brief Connect to the Lora gateway, reset it and configure it according to previously set parameters
+@brief Connect to the LoRa concentrator, reset it and configure it according to previously set parameters
@return LGW_HAL_ERROR id the operation failed, LGW_HAL_SUCCESS else
*/
int lgw_start(void);
/**
-@brief Stop the Lora gateway and disconnect it
+@brief Stop the LoRa concentrator and disconnect it
@return LGW_HAL_ERROR id the operation failed, LGW_HAL_SUCCESS else
*/
int lgw_stop(void);
/**
-@brief A non-blocking function that will fetch up to 'max_pkt' packets from the Lora gateway FIFO and data buffer
+@brief A non-blocking function that will fetch up to 'max_pkt' packets from the LoRa concentrator FIFO and data buffer
@param max_pkt maximum number of packet that must be retrieved (equal to the size of the array of struct)
@param pkt_data pointer to an array of struct that will receive the packet metadata and payload pointers
@return LGW_HAL_ERROR id the operation failed, else the number of packets retrieved
@@ -270,7 +334,7 @@ int lgw_receive(uint8_t max_pkt, struct lgw_pkt_rx_s *pkt_data);
int lgw_send(struct lgw_pkt_tx_s pkt_data);
/**
-@brief Give the the status of different part of the Lora gateway
+@brief Give the the status of different part of the LoRa concentrator
@param select is used to select what status we want to know
@param code is used to return the status code
@return LGW_HAL_ERROR id the operation failed, LGW_HAL_SUCCESS else
diff --git a/libloragw/inc/loragw_reg.h b/libloragw/inc/loragw_reg.h
index 3b74bc3..1c6e9e7 100644
--- a/libloragw/inc/loragw_reg.h
+++ b/libloragw/inc/loragw_reg.h
@@ -4,10 +4,10 @@
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
- ©2013 Semtech-Cycleo
+ (C)2013 Semtech-Cycleo
Description:
- Functions used to handle a single Lora gateway.
+ Functions used to handle a single LoRa concentrator.
Registers are addressed by name.
Multi-bytes registers are handled automatically.
Read-modify-write is handled automatically.
@@ -26,6 +26,8 @@ Maintainer: Sylvain Miermont
#include <stdint.h> /* C99 types */
#include <stdbool.h> /* bool type */
+#include "config.h" /* library configuration options (dynamically generated) */
+
/* -------------------------------------------------------------------------- */
/* --- PUBLIC CONSTANTS ----------------------------------------------------- */
@@ -34,7 +36,7 @@ Maintainer: Sylvain Miermont
/*
auto generated register mapping for C code : 11-Jul-2013 13:20:40
-this file contains autogenerated C struct used to access the LORA register from the Primer firmware
+this file contains autogenerated C struct used to access the LORA registers
this file is autogenerated from registers description
293 registers are defined
*/
@@ -371,19 +373,19 @@ this file is autogenerated from registers description
/* --- PUBLIC FUNCTIONS PROTOTYPES ------------------------------------------ */
/**
-@brief Connect Lora gateway by opening SPI link
+@brief Connect LoRa concentrator by opening SPI link
@return status of register operation (LGW_REG_SUCCESS/LGW_REG_ERROR)
*/
int lgw_connect(void);
/**
-@brief Disconnect Lora gateway by closing SPI link
+@brief Disconnect LoRa concentrator by closing SPI link
@return status of register operation (LGW_REG_SUCCESS/LGW_REG_ERROR)
*/
int lgw_disconnect(void);
/**
-@brief Use the soft-reset register to put the gateway in initial state
+@brief Use the soft-reset register to put the concentrator in initial state
@return status of register operation (LGW_REG_SUCCESS/LGW_REG_ERROR)
*/
int lgw_soft_reset(void);
@@ -396,7 +398,7 @@ int lgw_soft_reset(void);
int lgw_reg_check(FILE *f);
/**
-@brief Lora gateway register write
+@brief LoRa concentrator register write
@param register_id register number in the data structure describing registers
@param reg_value signed value to write to the register (for u32, use cast)
@return status of register operation (LGW_REG_SUCCESS/LGW_REG_ERROR)
@@ -404,7 +406,7 @@ int lgw_reg_check(FILE *f);
int lgw_reg_w(uint16_t register_id, int32_t reg_value);
/**
-@brief Lora gateway register read
+@brief LoRa concentrator register read
@param register_id register number in the data structure describing registers
@param reg_value pointer to a variable where to write register read value
@return status of register operation (LGW_REG_SUCCESS/LGW_REG_ERROR)
@@ -412,18 +414,18 @@ int lgw_reg_w(uint16_t register_id, int32_t reg_value);
int lgw_reg_r(uint16_t register_id, int32_t *reg_value);
/**
-@brief Lora gateway register burst write
+@brief LoRa concentrator register burst write
@param register_id register number in the data structure describing registers
-@param data pointer to byte array that will be sent to the Lora gateway
+@param data pointer to byte array that will be sent to the LoRa concentrator
@param size size of the transfer, in byte(s)
@return status of register operation (LGW_REG_SUCCESS/LGW_REG_ERROR)
*/
int lgw_reg_wb(uint16_t register_id, uint8_t *data, uint16_t size);
/**
-@brief Lora gateway register burst read
+@brief LoRa concentrator register burst read
@param register_id register number in the data structure describing registers
-@param data pointer to byte array that will be written from the Lora gateway
+@param data pointer to byte array that will be written from the LoRa concentrator
@param size size of the transfer, in byte(s)
@return status of register operation (LGW_REG_SUCCESS/LGW_REG_ERROR)
*/
diff --git a/libloragw/inc/loragw_spi.h b/libloragw/inc/loragw_spi.h
index c03df41..ae9ba68 100644
--- a/libloragw/inc/loragw_spi.h
+++ b/libloragw/inc/loragw_spi.h
@@ -4,10 +4,10 @@
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
- ©2013 Semtech-Cycleo
+ (C)2013 Semtech-Cycleo
Description:
- Host specific functions to address the LoRa™ gateway registers through a
+ Host specific functions to address the LoRa concentrator registers through a
SPI interface.
Single-byte read/write and burst read/write.
Does not handle pagination.
@@ -26,6 +26,8 @@ Maintainer: Sylvain Miermont
#include <stdint.h> /* C99 types*/
+#include "config.h" /* library configuration options (dynamically generated) */
+
/* -------------------------------------------------------------------------- */
/* --- PUBLIC CONSTANTS ----------------------------------------------------- */
@@ -37,7 +39,7 @@ Maintainer: Sylvain Miermont
/* --- PUBLIC FUNCTIONS PROTOTYPES ------------------------------------------ */
/**
-@brief Lora gateway SPI setup (configure I/O and peripherals)
+@brief LoRa concentrator SPI setup (configure I/O and peripherals)
@param spi_target_ptr pointer on a generic pointer to SPI target (implementation dependant)
@return status of register operation (LGW_SPI_SUCCESS/LGW_SPI_ERROR)
*/
@@ -45,7 +47,7 @@ Maintainer: Sylvain Miermont
int lgw_spi_open(void **spi_target_ptr);
/**
-@brief Lora gateway SPI close
+@brief LoRa concentrator SPI close
@param spi_target generic pointer to SPI target (implementation dependant)
@return status of register operation (LGW_SPI_SUCCESS/LGW_SPI_ERROR)
*/
@@ -53,7 +55,7 @@ int lgw_spi_open(void **spi_target_ptr);
int lgw_spi_close(void *spi_target);
/**
-@brief Lora gateway SPI single-byte write
+@brief LoRa concentrator SPI single-byte write
@param spi_target generic pointer to SPI target (implementation dependant)
@param address 7-bit register address
@param data data byte to write
@@ -62,7 +64,7 @@ int lgw_spi_close(void *spi_target);
int lgw_spi_w(void *spi_target, uint8_t address, uint8_t data);
/**
-@brief Lora gateway SPI single-byte read
+@brief LoRa concentrator SPI single-byte read
@param spi_target generic pointer to SPI target (implementation dependant)
@param address 7-bit register address
@param data data byte to write
@@ -71,20 +73,20 @@ int lgw_spi_w(void *spi_target, uint8_t address, uint8_t data);
int lgw_spi_r(void *spi_target, uint8_t address, uint8_t *data);
/**
-@brief Lora gateway SPI burst (multiple-byte) write
+@brief LoRa concentrator SPI burst (multiple-byte) write
@param spi_target generic pointer to SPI target (implementation dependant)
@param address 7-bit register address
-@param data pointer to byte array that will be sent to the Lora gateway
+@param data pointer to byte array that will be sent to the LoRa concentrator
@param size size of the transfer, in byte(s)
@return status of register operation (LGW_SPI_SUCCESS/LGW_SPI_ERROR)
*/
int lgw_spi_wb(void *spi_target, uint8_t address, uint8_t *data, uint16_t size);
/**
-@brief Lora gateway SPI burst (multiple-byte) read
+@brief LoRa concentrator SPI burst (multiple-byte) read
@param spi_target generic pointer to SPI target (implementation dependant)
@param address 7-bit register address
-@param data pointer to byte array that will be written from the Lora gateway
+@param data pointer to byte array that will be written from the LoRa concentrator
@param size size of the transfer, in byte(s)
@return status of register operation (LGW_SPI_SUCCESS/LGW_SPI_ERROR)
*/