aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.hpp')
-rw-r--r--host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.hpp127
1 files changed, 41 insertions, 86 deletions
diff --git a/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.hpp b/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.hpp
index ac7fd70e9..88d1eed73 100644
--- a/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.hpp
+++ b/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.hpp
@@ -11,13 +11,12 @@
#include <uhd/types/serial.hpp>
#include <uhd/usrp/dboard_manager.hpp>
#include <uhd/usrp/gpio_defs.hpp>
-#include <uhdlib/usrp/cores/gpio_atr_3000.hpp>
-#include <uhdlib/rfnoc/rpc_block_ctrl.hpp>
#include <uhdlib/rfnoc/radio_ctrl_impl.hpp>
+#include <uhdlib/rfnoc/rpc_block_ctrl.hpp>
+#include <uhdlib/usrp/cores/gpio_atr_3000.hpp>
#include <mutex>
-namespace uhd {
- namespace rfnoc {
+namespace uhd { namespace rfnoc {
/*! \brief Provide access to an Magnesium radio.
*/
@@ -27,16 +26,7 @@ public:
typedef boost::shared_ptr<neon_radio_ctrl_impl> sptr;
//! Frequency bands for RX. Bands are a function of the analog filter banks
- enum class rx_band {
- INVALID_BAND,
- LB_B2,
- LB_B3,
- LB_B4,
- LB_B5,
- LB_B6,
- LB_B7,
- HB
- };
+ enum class rx_band { INVALID_BAND, LB_B2, LB_B3, LB_B4, LB_B5, LB_B6, LB_B7, HB };
//! Frequency bands for TX. Bands are a function of the analog filter banks
enum class tx_band {
@@ -56,37 +46,28 @@ public:
* ATR/ Switches Types
*************************************************************************/
//! ATR state
- enum atr_state_t {
- IDLE,
- RX_ONLY,
- TX_ONLY,
- FULL_DUPLEX
- };
+ enum atr_state_t { IDLE, RX_ONLY, TX_ONLY, FULL_DUPLEX };
//! Channel select:
- enum chan_sel_t {
- CHAN1,
- CHAN2,
- BOTH
- };
+ enum chan_sel_t { CHAN1, CHAN2, BOTH };
enum tx_sw1_t {
- TX_SW1_LB_80 = 3,
- TX_SW1_LB_160 = 7,
- TX_SW1_LB_225 = 1,
- TX_SW1_LB_400 = 5,
- TX_SW1_LB_575 = 2,
+ TX_SW1_LB_80 = 3,
+ TX_SW1_LB_160 = 7,
+ TX_SW1_LB_225 = 1,
+ TX_SW1_LB_400 = 5,
+ TX_SW1_LB_575 = 2,
TX_SW1_LB_1000 = 6,
TX_SW1_LB_1700 = 0,
TX_SW1_LB_2750 = 4
};
enum tx_sw2_t {
- TX_SW2_LB_80 = 7,
- TX_SW2_LB_160 = 3,
- TX_SW2_LB_225 = 5,
- TX_SW2_LB_400 = 1,
- TX_SW2_LB_575 = 6,
+ TX_SW2_LB_80 = 7,
+ TX_SW2_LB_160 = 3,
+ TX_SW2_LB_225 = 5,
+ TX_SW2_LB_400 = 1,
+ TX_SW2_LB_575 = 6,
TX_SW2_LB_1000 = 2,
TX_SW2_LB_1700 = 4,
TX_SW2_LB_2750 = 0
@@ -95,10 +76,10 @@ public:
enum trx_sw_t {
TRX1_SW_TX_HB = 2,
TRX1_SW_TX_LB = 1,
- TRX1_SW_RX = 4,
+ TRX1_SW_RX = 4,
TRX2_SW_TX_HB = 2,
TRX2_SW_TX_LB = 4,
- TRX2_SW_RX = 1
+ TRX2_SW_RX = 1
};
enum rx_sw1_t {
@@ -108,7 +89,7 @@ public:
RX_SW1_LB_B5 = 3,
RX_SW1_LB_B6 = 0,
RX_SW1_LB_B7 = 1,
- RX_SW1_OFF = 7
+ RX_SW1_OFF = 7
};
@@ -119,20 +100,16 @@ public:
RX_SW2_LB_B5 = 2,
RX_SW2_LB_B6 = 1,
RX_SW2_LB_B7 = 0,
- RX_SW2_OFF = 7
+ RX_SW2_OFF = 7
};
enum rx_sw3_t {
RX_SW3_HBRX_LBTRX = 1,
RX_SW3_HBTRX_LBRX = 2,
- RX_SW3_OFF = 0 //or 3
+ RX_SW3_OFF = 0 // or 3
};
- enum tx_amp_t {
- TX_AMP_HF_ON = 2,
- TX_AMP_LF_ON = 1,
- TX_AMP_OFF = 3
- };
+ enum tx_amp_t { TX_AMP_HF_ON = 2, TX_AMP_LF_ON = 1, TX_AMP_OFF = 3 };
/************************************************************************
* Structors
@@ -149,10 +126,11 @@ public:
virtual bool check_radio_config();
//! Set which channel mode is used
- void set_channel_mode(const std::string &channel_mode);
+ void set_channel_mode(const std::string& channel_mode);
//! Set streaming mode - active chains, channel_mode, timing_mode
- void set_streaming_mode(const bool tx1, const bool tx2, const bool rx1, const bool rx2);
+ void set_streaming_mode(
+ const bool tx1, const bool tx2, const bool rx1, const bool rx2);
/*! Run a loopback self test.
*
@@ -163,19 +141,18 @@ public:
*
* \param iface An interface to the associated radio control core
* \param iface The radio control core's address to write the loopback value
- * \param iface The radio control core's readback address to read back the returned value
+ * \param iface The radio control core's readback address to read back the returned
+ * value
*
* \throws a uhd::runtime_error if the loopback value didn't match.
*/
- void loopback_self_test(
- std::function<void(uint32_t)> poker_functor,
- std::function<uint64_t()> peeker_functor
- );
+ void loopback_self_test(std::function<void(uint32_t)> poker_functor,
+ std::function<uint64_t()> peeker_functor);
double set_rate(const double rate);
- void set_tx_antenna(const std::string &ant, const size_t chan);
- void set_rx_antenna(const std::string &ant, const size_t chan);
+ void set_tx_antenna(const std::string& ant, const size_t chan);
+ void set_rx_antenna(const std::string& ant, const size_t chan);
double set_tx_frequency(const double freq, const size_t chan);
double set_rx_frequency(const double freq, const size_t chan);
@@ -186,13 +163,10 @@ public:
double set_tx_gain(const double gain, const size_t chan);
double set_rx_gain(const double gain, const size_t chan);
- size_t get_chan_from_dboard_fe(const std::string &fe, const direction_t dir);
+ size_t get_chan_from_dboard_fe(const std::string& fe, const direction_t dir);
std::string get_dboard_fe_from_chan(const size_t chan, const direction_t dir);
- void set_rpc_client(
- uhd::rpc_client::sptr rpcc,
- const uhd::device_addr_t &block_args
- );
+ void set_rpc_client(uhd::rpc_client::sptr rpcc, const uhd::device_addr_t& block_args);
private:
/**************************************************************************
@@ -205,10 +179,7 @@ private:
void _init_defaults();
//! Init a subtree for the RF frontends
- void _init_frontend_subtree(
- uhd::property_tree::sptr subtree,
- const size_t chan_idx
- );
+ void _init_frontend_subtree(uhd::property_tree::sptr subtree, const size_t chan_idx);
//! Initialize Catalina defaults
void _init_codec();
@@ -216,10 +187,7 @@ private:
//! Initialize property tree
void _init_prop_tree();
- void _init_mpm_sensors(
- const direction_t dir,
- const size_t chan_idx
- );
+ void _init_mpm_sensors(const direction_t dir, const size_t chan_idx);
//! Map a frequency in Hz to an rx_band value. Will return
// rx_band::INVALID_BAND if the frequency is out of range.
@@ -233,33 +201,21 @@ private:
*************************************************************************/
//! Return LO lock status. Factors in current band (low/high) and
// direction (TX/RX)
- bool get_lo_lock_status(
- const direction_t dir
- );
+ bool get_lo_lock_status(const direction_t dir);
/**************************************************************************
* Misc Controls
*************************************************************************/
//! Blink the front-panel LEDs for \p identify_duration,
// and resume normal operation.
- void _identify_with_leds(
- const int identify_duration
- );
+ void _identify_with_leds(const int identify_duration);
uint32_t _get_rx_switches(
- const size_t chan,
- const double freq,
- const std::string &ant
- );
+ const size_t chan, const double freq, const std::string& ant);
- uint32_t _get_tx_switches(
- const size_t chan,
- const double freq
- );
+ uint32_t _get_tx_switches(const size_t chan, const double freq);
- void _set_atr_bits(
- const size_t chan
- );
+ void _set_atr_bits(const size_t chan);
/**************************************************************************
* Private attributes
@@ -283,7 +239,7 @@ private:
uhd::spi_iface::sptr _spi;
//! Reference to the AD9361 controls
- //neon_ad9361_iface::uptr _ad9361;
+ // neon_ad9361_iface::uptr _ad9361;
ad9361_ctrl::sptr _ad9361;
//! ATR controls. These control the AD9361 gain
@@ -305,4 +261,3 @@ private:
}} /* namespace uhd::rfnoc */
#endif /* INCLUDED_LIBUHD_RFNOC_NEON_RADIO_CTRL_IMPL_HPP */
-