summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Miermont <smiermont@semtech.com>2013-10-24 11:10:04 +0200
committerSylvain Miermont <smiermont@semtech.com>2013-10-24 11:10:50 +0200
commitb9710cd6fa8195e442f8bbce53364a125c9198ad (patch)
treed01d5345b7c85df6d003db1e17c82187c8b22d31
parent4977430ef31fb52994fed42b9cb180930ed943d0 (diff)
downloadlora_gateway-b9710cd6fa8195e442f8bbce53364a125c9198ad.tar.gz
lora_gateway-b9710cd6fa8195e442f8bbce53364a125c9198ad.tar.bz2
lora_gateway-b9710cd6fa8195e442f8bbce53364a125c9198ad.zip
v1.0.0v1.0.0
- switched FTDI as default SPI phy layer in library.cfg - fixed a bug in TX power control; still only two TW power available, 14 and 24 dBm - changed library directory name from loragw_hal to libloragw to follow usual conventions
-rw-r--r--libloragw/VERSION4
-rw-r--r--libloragw/doc/CHANGELOG.TXT7
-rw-r--r--libloragw/library.cfg8
-rw-r--r--libloragw/src/loragw_hal.c15
-rw-r--r--loragw_band_survey/Makefile5
-rw-r--r--loragw_band_survey/README.TXT4
-rw-r--r--loragw_pkt_logger/Makefile5
-rw-r--r--loragw_pkt_logger/README.TXT4
-rw-r--r--loragw_spi_stress/Makefile5
-rw-r--r--loragw_spi_stress/README.TXT4
-rw-r--r--loragw_tx_test/Makefile5
-rw-r--r--loragw_tx_test/README.TXT4
-rw-r--r--loragw_tx_test/src/loragw_tx_test.c2
13 files changed, 45 insertions, 27 deletions
diff --git a/libloragw/VERSION b/libloragw/VERSION
index eafdd0f..94fa4e6 100644
--- a/libloragw/VERSION
+++ b/libloragw/VERSION
@@ -1,8 +1,8 @@
/* Software library version: */
-#define VERSION_LIBRARY "beta8"
+#define VERSION_LIBRARY "1.0.0"
/* API version */
-#define VERSION_API "beta"
+#define VERSION_API "1.0"
/* Accepted value of CHIP_ID (SPI registers) must match reg default value in loragw_reg.c */
#define ACCEPT_CHIP_ID "1"
diff --git a/libloragw/doc/CHANGELOG.TXT b/libloragw/doc/CHANGELOG.TXT
index f1d4a64..ba5866e 100644
--- a/libloragw/doc/CHANGELOG.TXT
+++ b/libloragw/doc/CHANGELOG.TXT
@@ -1,6 +1,13 @@
Lora Gateway HAL changelog
==========================
+ v1.0.0 (from beta 8)
+---------------------
+
+ * switched FTDI as default SPI phy layer in library.cfg
+ * fixed a bug in TX power control; still only two TW power available, 14 and 24 dBm
+ * changed library directory name from loragw_hal to libloragw to follow usual conventions
+
Beta 8 (from beta 7)
---------------------
diff --git a/libloragw/library.cfg b/libloragw/library.cfg
index ac24416..8e3ba0e 100644
--- a/libloragw/library.cfg
+++ b/libloragw/library.cfg
@@ -19,8 +19,8 @@ FLAG_HAL= -D DEBUG_HAL=0
# The flags bellow define which physical link to the nano board will be used
# Pick one and comment the other(s)
-# Pcduino native SPI (Linux device in /dev)
-LGW_PHY= native
-
# FTDI SPI-over-USB bridge
-#LGW_PHY= ftdi
+LGW_PHY= ftdi
+
+# Pcduino native SPI (Linux device in /dev)
+#LGW_PHY= native
diff --git a/libloragw/src/loragw_hal.c b/libloragw/src/loragw_hal.c
index 930f13e..881abd4 100644
--- a/libloragw/src/loragw_hal.c
+++ b/libloragw/src/loragw_hal.c
@@ -886,6 +886,7 @@ int lgw_send(struct lgw_pkt_tx_s pkt_data) {
uint16_t fsk_dr_div; /* divider to configure for target datarate */
int transfer_size = 0; /* data to transfer from host to TX databuffer */
int payload_offset = 0; /* start of the payload content in the databuffer */
+ uint8_t power_nibble = 0; /* 4-bit value to set the firmware TX power */
/* check if the gateway is running */
if (lgw_is_started == false) {
@@ -948,6 +949,14 @@ int lgw_send(struct lgw_pkt_tx_s pkt_data) {
return LGW_HAL_ERROR;
}
+ /* interpretation of TX power */
+ if (pkt_data.rf_power < 24) {
+ power_nibble = 0x0; /* ~15.5 dBm, so 14 after cavity filter + cables */
+ } else {
+ power_nibble = 0xF; /* maximum power ~25.5 dBm, 24 after filter */
+ }
+ // TODO: implement LUT in the firmware and matched value in the HAL
+
/* reset TX command flags */
lgw_reg_w(LGW_TX_TRIG_IMMEDIATE, 0);
lgw_reg_w(LGW_TX_TRIG_DELAYED, 0);
@@ -973,8 +982,7 @@ int lgw_send(struct lgw_pkt_tx_s pkt_data) {
/* parameters depending on modulation */
if (pkt_data.modulation == MOD_LORA) {
/* metadata 7, modulation type, radio chain selection and TX power */
- buff[7] = (0x20 & (pkt_data.rf_chain << 5)) | (0x0F & pkt_data.rf_power); /* bit 4 is 0 -> Lora modulation */
- /* fine control over TX power not supported yet, any value other than 8 is 14 dBm */
+ buff[7] = (0x20 & (pkt_data.rf_chain << 5)) | (0x0F & power_nibble); /* bit 4 is 0 -> Lora modulation */
buff[8] = 0; /* metadata 8, not used */
@@ -1033,8 +1041,7 @@ int lgw_send(struct lgw_pkt_tx_s pkt_data) {
} else if (pkt_data.modulation == MOD_FSK) {
/* metadata 7, modulation type, radio chain selection and TX power */
- buff[7] = (0x20 & (pkt_data.rf_chain << 5)) | 0x10 | (0x0F & pkt_data.rf_power); /* bit 4 is 1 -> FSK modulation */
- /* fine control over TX power not supported yet, any value other than 8 is 14 dBm */
+ buff[7] = (0x20 & (pkt_data.rf_chain << 5)) | 0x10 | (0x0F & power_nibble); /* bit 4 is 1 -> FSK modulation */
buff[8] = 0; /* metadata 8, not used */
diff --git a/loragw_band_survey/Makefile b/loragw_band_survey/Makefile
index da10ef6..4ae2f2e 100644
--- a/loragw_band_survey/Makefile
+++ b/loragw_band_survey/Makefile
@@ -11,10 +11,11 @@ FLAG_AUX=
### constants for Lora Gateway HAL library
-LGW_PATH=../loragw_hal
+LGW_PATH=../libloragw
LGW_INC=-I$(LGW_PATH)/inc
-#LGW_LNK=-lloragw -lrt
+
LGW_LNK=-lloragw -lrt -lmpsse
+#LGW_LNK=-lloragw -lrt
# add libmpsse or not, depending on what option you compiled the libloragw with
### general build targets
diff --git a/loragw_band_survey/README.TXT b/loragw_band_survey/README.TXT
index da4e672..a34134d 100644
--- a/loragw_band_survey/README.TXT
+++ b/loragw_band_survey/README.TXT
@@ -25,7 +25,7 @@ This software call functions in the loragw_reg and loragw_reg sub-modules of
loragwlib. loragw_spi is used indirectly, and the loragw_hal sub-module is not
used at all, except for constants define at the top level.
-It has been qualified with the Lora Getway HAL library version beta8, and should
+It has been qualified with the Lora Getway HAL library version 1.0.0, and should
be compatible with any compatible later version that use the same API, or a
downward-compatible one.
@@ -53,5 +53,5 @@ yyyymmddThhmmssZ (eg. 20131009T172345Z for October 9th, 2013 at 5:23:45PM UTC)
4. Changelog
-------------
-2013-10-18, beta 1
+2013-10-24, v1
Initial version.
diff --git a/loragw_pkt_logger/Makefile b/loragw_pkt_logger/Makefile
index 6b90495..761ab03 100644
--- a/loragw_pkt_logger/Makefile
+++ b/loragw_pkt_logger/Makefile
@@ -11,10 +11,11 @@ FLAG_AUX=
### constants for Lora Gateway HAL library
-LGW_PATH=../loragw_hal
+LGW_PATH=../libloragw
LGW_INC=-I$(LGW_PATH)/inc
-#LGW_LNK=-lloragw -lrt
+
LGW_LNK=-lloragw -lrt -lmpsse
+#LGW_LNK=-lloragw -lrt
# add libmpsse or not, depending on what option you compiled the libloragw with
### general build targets
diff --git a/loragw_pkt_logger/README.TXT b/loragw_pkt_logger/README.TXT
index 278d026..9469904 100644
--- a/loragw_pkt_logger/README.TXT
+++ b/loragw_pkt_logger/README.TXT
@@ -34,7 +34,7 @@ Data structures of the received packets are accessed by name (ie. not at a
binary level) so new functionalities can be added to the API without affecting
that program at all.
-It was tested with beta8 of the libloragw library, and should be compatible
+It was tested with v1.0.0 of the libloragw library, and should be compatible
with any later version of the library assuming the API is downward-compatible.
3. Usage
@@ -84,5 +84,5 @@ without any consequence for the program execution.
4. Changelog
-------------
-2013-10-18, beta 1
+2013-10-24, v1
Initial version.
diff --git a/loragw_spi_stress/Makefile b/loragw_spi_stress/Makefile
index d2fe09d..b19eee9 100644
--- a/loragw_spi_stress/Makefile
+++ b/loragw_spi_stress/Makefile
@@ -11,10 +11,11 @@ FLAG_AUX=
### constants for Lora Gateway HAL library
-LGW_PATH=../loragw_hal
+LGW_PATH=../libloragw
LGW_INC=-I$(LGW_PATH)/inc
-#LGW_LNK=-lloragw -lrt
+
LGW_LNK=-lloragw -lrt -lmpsse
+#LGW_LNK=-lloragw -lrt
# add libmpsse or not, depending on what option you compiled the libloragw with
### general build targets
diff --git a/loragw_spi_stress/README.TXT b/loragw_spi_stress/README.TXT
index fa73da1..605fed6 100644
--- a/loragw_spi_stress/README.TXT
+++ b/loragw_spi_stress/README.TXT
@@ -22,7 +22,7 @@ happens.
This program only access the Lora gateway HAL library through its loragw_reg
"named registers" access sub-module.
-It was tested with beta8 of the libloragw library, and should be compatible
+It was tested with v1.0.0 of the libloragw library, and should be compatible
with any later version of the library and the hardware, assuming the registers
used for the tests are still present.
@@ -60,5 +60,5 @@ Test 4 > data buffer R/W (long SPI bursts access)
4. Changelog
-------------
-2013-10-18, beta 1
+2013-10-24, v1
Initial version.
diff --git a/loragw_tx_test/Makefile b/loragw_tx_test/Makefile
index 5d07c6d..8ece9b9 100644
--- a/loragw_tx_test/Makefile
+++ b/loragw_tx_test/Makefile
@@ -11,10 +11,11 @@ FLAG_AUX=
### constants for Lora Gateway HAL library
-LGW_PATH=../loragw_hal
+LGW_PATH=../libloragw
LGW_INC=-I$(LGW_PATH)/inc
-#LGW_LNK=-lloragw -lrt
+
LGW_LNK=-lloragw -lrt -lmpsse
+#LGW_LNK=-lloragw -lrt
# add libmpsse or not, depending on what option you compiled the libloragw with
### general build targets
diff --git a/loragw_tx_test/README.TXT b/loragw_tx_test/README.TXT
index 2f95735..ca02b16 100644
--- a/loragw_tx_test/README.TXT
+++ b/loragw_tx_test/README.TXT
@@ -28,7 +28,7 @@ Data structures of the sent packets are accessed by name (ie. not at a
binary level) so new functionalities can be added to the API without affecting
that program at all.
-It was tested with beta8 of the libloragw library, and should be compatible
+It was tested with v1.0.0 of the libloragw library, and should be compatible
with any later version of the library assuming the API is downward-compatible.
3. Usage
@@ -61,5 +61,5 @@ packet error rate.
4. Changelog
-------------
-2013-10-18, beta 1
+2013-10-24, v1
Initial version.
diff --git a/loragw_tx_test/src/loragw_tx_test.c b/loragw_tx_test/src/loragw_tx_test.c
index bb8fe2c..d1c5403 100644
--- a/loragw_tx_test/src/loragw_tx_test.c
+++ b/loragw_tx_test/src/loragw_tx_test.c
@@ -158,7 +158,7 @@ int main(int argc, char **argv)
case 'p': /* -p <int> RF power */
i = sscanf(optarg, "%i", &xi);
- if ((i != 1) || (xi < 0) || (xi > 20)) {
+ if ((i != 1) || (xi < 0) || (xi > 30)) {
MSG("ERROR: invalid RF power\n");
return EXIT_FAILURE;
} else {