From c05674a9613e5acd5e0bdee9d1298a780189a459 Mon Sep 17 00:00:00 2001 From: Harsh Sharma Date: Tue, 29 Oct 2019 14:40:59 -0500 Subject: Added support for attenuator for LGA modules and full cards --- libloragw/inc/loragw_hal.h | 1 + libloragw/inc/loragw_reg.h | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'libloragw/inc') diff --git a/libloragw/inc/loragw_hal.h b/libloragw/inc/loragw_hal.h index 15bf918..fda8908 100644 --- a/libloragw/inc/loragw_hal.h +++ b/libloragw/inc/loragw_hal.h @@ -177,6 +177,7 @@ enum lgw_radio_type_e { struct lgw_conf_board_s { bool lorawan_public; /*!> Enable ONLY for *public* networks using the LoRa MAC protocol */ uint8_t clksrc; /*!> Index of RF chain which provides clock to concentrator */ + uint8_t max_tx_power; /*!> Max power limit for transmitting packets */ }; /** diff --git a/libloragw/inc/loragw_reg.h b/libloragw/inc/loragw_reg.h index 1e98efa..4dd9edb 100644 --- a/libloragw/inc/loragw_reg.h +++ b/libloragw/inc/loragw_reg.h @@ -403,14 +403,17 @@ uint8_t read_fpga_version(); @param version number provided to check through the validated list @return status true/false */ -bool check_fpga_version(uint8_t version); +bool fpga_version_supported(); + +/** +@brief Check if the LoRa FPGA uses an attenuator for transmitting packets +@return status true/false +*/ +bool fpga_supports_attenuator(); /** @brief Connect LoRa concentrator by opening SPI link -@param spi_only indicates if we only want to create the SPI connexion to the concentrator, or if we also want to reset it and configure the FPGA (if present) -@param tx_notch_filter TX notch filter frequency to be set in the FPGA (only -used with SX1301AP2 reference design). @return status of register operation (LGW_REG_SUCCESS/LGW_REG_ERROR) */ int lgw_connect(bool spi_only, uint32_t tx_notch_freq); -- cgit v1.2.3 From 408ecd322635e37c710006c95a22dddc455e7f08 Mon Sep 17 00:00:00 2001 From: Harsh Sharma Date: Thu, 31 Oct 2019 11:17:13 -0500 Subject: Fixed lora attenuator mode --- libloragw/inc/config.h | 11 +++++++++++ libloragw/inc/loragw_fpga.h | 3 +-- libloragw/inc/loragw_hal.h | 9 +-------- 3 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 libloragw/inc/config.h (limited to 'libloragw/inc') diff --git a/libloragw/inc/config.h b/libloragw/inc/config.h new file mode 100644 index 0000000..9b96c5f --- /dev/null +++ b/libloragw/inc/config.h @@ -0,0 +1,11 @@ +#ifndef _LORAGW_CONFIGURATION_H +#define _LORAGW_CONFIGURATION_H + #define LIBLORAGW_VERSION "0.1-16-gc05674a" + #define DEBUG_AUX 0 + #define DEBUG_SPI 0 + #define DEBUG_REG 0 + #define DEBUG_HAL 0 + #define DEBUG_GPS 0 + #define DEBUG_GPIO + #define DEBUG_LBT 0 +#endif diff --git a/libloragw/inc/loragw_fpga.h b/libloragw/inc/loragw_fpga.h index 46246b6..d5b6f9d 100644 --- a/libloragw/inc/loragw_fpga.h +++ b/libloragw/inc/loragw_fpga.h @@ -135,7 +135,6 @@ int lgw_fpga_reg_wb(uint16_t register_id, uint8_t *data, uint16_t size); */ int lgw_fpga_reg_rb(uint16_t register_id, uint8_t *data, uint16_t size); -int lgw_set_attenuation(float attenuation); - +int lgw_set_attenuation(float *attn); #endif /* --- EOF ------------------------------------------------------------------ */ diff --git a/libloragw/inc/loragw_hal.h b/libloragw/inc/loragw_hal.h index fda8908..f5a6183 100644 --- a/libloragw/inc/loragw_hal.h +++ b/libloragw/inc/loragw_hal.h @@ -260,7 +260,7 @@ struct lgw_pkt_tx_s { uint8_t tx_mode; /*!> select on what event/time the TX is triggered */ uint32_t count_us; /*!> timestamp or delay in microseconds for TX trigger */ uint8_t rf_chain; /*!> through which RF chain will the packet be sent */ - int8_t rf_power; /*!> TX power, in dBm */ + float 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) */ @@ -415,13 +415,6 @@ const char* lgw_version_info(void); */ uint32_t lgw_time_on_air(struct lgw_pkt_tx_s *packet); -/** -@brief Set the attenuation for sending packets to get the exact power level -@param attenuation is in dB, it can be between 0-31.75 -@return LGW_HAL_ERROR if the operation failed, LGW_HAL_SUCCESS else -*/ -int lgw_set_attenuation(float attenuation); - #endif /* --- EOF ------------------------------------------------------------------ */ -- cgit v1.2.3 From f870877782ba8a279580f2df0ab7c244a4849ab0 Mon Sep 17 00:00:00 2001 From: Harsh Sharma Date: Fri, 15 Nov 2019 14:02:18 -0600 Subject: Changed attenuator power to be int instead of float --- libloragw/inc/loragw_fpga.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libloragw/inc') diff --git a/libloragw/inc/loragw_fpga.h b/libloragw/inc/loragw_fpga.h index d5b6f9d..722438c 100644 --- a/libloragw/inc/loragw_fpga.h +++ b/libloragw/inc/loragw_fpga.h @@ -135,6 +135,6 @@ int lgw_fpga_reg_wb(uint16_t register_id, uint8_t *data, uint16_t size); */ int lgw_fpga_reg_rb(uint16_t register_id, uint8_t *data, uint16_t size); -int lgw_set_attenuation(float *attn); +int lgw_set_attenuation(uint8_t *attn); #endif /* --- EOF ------------------------------------------------------------------ */ -- cgit v1.2.3 From 60296026590d64f61766896cf770e69e3bfb185c Mon Sep 17 00:00:00 2001 From: Harsh Sharma Date: Fri, 24 Jan 2020 16:11:32 -0600 Subject: Changed lgw version to use git describe --- libloragw/inc/config.h | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 libloragw/inc/config.h (limited to 'libloragw/inc') diff --git a/libloragw/inc/config.h b/libloragw/inc/config.h deleted file mode 100644 index 9b96c5f..0000000 --- a/libloragw/inc/config.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _LORAGW_CONFIGURATION_H -#define _LORAGW_CONFIGURATION_H - #define LIBLORAGW_VERSION "0.1-16-gc05674a" - #define DEBUG_AUX 0 - #define DEBUG_SPI 0 - #define DEBUG_REG 0 - #define DEBUG_HAL 0 - #define DEBUG_GPS 0 - #define DEBUG_GPIO - #define DEBUG_LBT 0 -#endif -- cgit v1.2.3