diff options
author | Jason Abele <jason@ettus.com> | 2011-04-13 19:03:18 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-04-14 14:14:17 -0700 |
commit | 98a05d85cd6537dee9bf2f48d0e068d322363fc4 (patch) | |
tree | 5057f69b0a39257b5493d25874500a04602671da /host/lib/usrp/dboard/db_xcvr2450.cpp | |
parent | d24d9d9bd9e6783aa1bb0692386e05f67c019329 (diff) | |
download | uhd-98a05d85cd6537dee9bf2f48d0e068d322363fc4.tar.gz uhd-98a05d85cd6537dee9bf2f48d0e068d322363fc4.tar.bz2 uhd-98a05d85cd6537dee9bf2f48d0e068d322363fc4.zip |
Updated documentation and improved XCVR RSSI calculation
Documented dboard sensors
Documented DBSRX2
Added description of direct conversion vs low IF for each dboard
Added E1xx docs for adding refclock and pps connectors
XCVR rssi calculation was in unscaled dB units
Used chart in datasheet (pg 16) to rescale to dBm
Diffstat (limited to 'host/lib/usrp/dboard/db_xcvr2450.cpp')
-rw-r--r-- | host/lib/usrp/dboard/db_xcvr2450.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 9d25b30a5..70b0bbabd 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -152,12 +152,21 @@ private: * \return the rssi in dB */ double get_rssi(void){ + //*FIXME* RSSI depends on LNA Gain Setting (datasheet pg 16 top middle chart) + double max_power; + switch(_max2829_regs.rx_lna_gain){ + case 0: + case 1: max_power = 0; break; + case 2: max_power = -15; break; + case 3: max_power = -30.5; break; + } + //constants for the rssi calculation static const double min_v = 0.5, max_v = 2.5; static const double rssi_dyn_range = 60; //calculate the rssi from the voltage double voltage = this->get_iface()->read_aux_adc(dboard_iface::UNIT_RX, dboard_iface::AUX_ADC_B); - return rssi_dyn_range*(voltage - min_v)/(max_v - min_v); + return max_power - rssi_dyn_range*(voltage - min_v)/(max_v - min_v); } }; @@ -621,7 +630,7 @@ void xcvr2450::rx_get(const wax::obj &key_, wax::obj &val){ if (key.name == "lo_locked") val = sensor_value_t("LO", this->get_locked(), "locked", "unlocked"); else if (key.name == "rssi") - val = sensor_value_t("RSSI", this->get_rssi(), "dB"); + val = sensor_value_t("RSSI", this->get_rssi(), "dBm"); else UHD_THROW_INVALID_CODE_PATH(); return; |