summaryrefslogtreecommitdiff
path: root/libloragw/inc
diff options
context:
space:
mode:
authorHarsh Sharma <harsh.sharma@multitech.com>2018-08-09 15:10:43 -0500
committerHarsh Sharma <harsh.sharma@multitech.com>2018-08-09 15:10:43 -0500
commit1e66084295f37f0d7f5f0a3518e43ae0cc613898 (patch)
tree3b6fcae715309aeec4f39c2b59f5945a18542c18 /libloragw/inc
parent4a262a7c7e76e118cefb0cc7569a9597f230c888 (diff)
downloadlora_gateway_mtac_full-1e66084295f37f0d7f5f0a3518e43ae0cc613898.tar.gz
lora_gateway_mtac_full-1e66084295f37f0d7f5f0a3518e43ae0cc613898.tar.bz2
lora_gateway_mtac_full-1e66084295f37f0d7f5f0a3518e43ae0cc613898.zip
Changed attenuation setup to be the difference between the LUT power and the tx packet power and make it automatically set
Diffstat (limited to 'libloragw/inc')
-rw-r--r--libloragw/inc/loragw_fpga.h4
-rw-r--r--libloragw/inc/loragw_hal.h8
-rw-r--r--libloragw/inc/loragw_reg.h2
3 files changed, 11 insertions, 3 deletions
diff --git a/libloragw/inc/loragw_fpga.h b/libloragw/inc/loragw_fpga.h
index 07418e4..46246b6 100644
--- a/libloragw/inc/loragw_fpga.h
+++ b/libloragw/inc/loragw_fpga.h
@@ -99,7 +99,7 @@ float lgw_fpga_get_tx_notch_delay(void);
@param tx_notch_freq TX notch filter frequency, in Hertz
@return status of register operation (LGW_REG_SUCCESS/LGW_REG_ERROR)
*/
-int lgw_fpga_configure(uint32_t tx_notch_freq, bool fpga_attn_used);
+int lgw_fpga_configure(uint32_t tx_notch_freq);
/**
@brief LoRa concentrator FPGA register write
@@ -135,5 +135,7 @@ 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);
+
#endif
/* --- EOF ------------------------------------------------------------------ */
diff --git a/libloragw/inc/loragw_hal.h b/libloragw/inc/loragw_hal.h
index 632b72b..15bf918 100644
--- a/libloragw/inc/loragw_hal.h
+++ b/libloragw/inc/loragw_hal.h
@@ -282,7 +282,6 @@ struct lgw_tx_gain_s {
uint8_t pa_gain; /*!> 2 bits, control of the external PA (SX1301 I/O) */
uint8_t dac_gain; /*!> 2 bits, control of the radio DAC */
uint8_t mix_gain; /*!> 4 bits, control of the radio mixer */
- float attenuation; /*!> 7 bits, control of the attenuator , in dBm */
int8_t rf_power; /*!> measured TX power at the board connector, in dBm */
};
@@ -415,6 +414,13 @@ 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 ------------------------------------------------------------------ */
diff --git a/libloragw/inc/loragw_reg.h b/libloragw/inc/loragw_reg.h
index 085dfb6..1e98efa 100644
--- a/libloragw/inc/loragw_reg.h
+++ b/libloragw/inc/loragw_reg.h
@@ -413,7 +413,7 @@ concentrator, or if we also want to reset it and configure the FPGA (if present)
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, bool fpga_attn_used);
+int lgw_connect(bool spi_only, uint32_t tx_notch_freq);
/**
@brief Disconnect LoRa concentrator by closing SPI link