49 const std::string &role,
unsigned int in_stream,
52 ~MAX2771EVKITSignalSourceFPGA();
54 std::vector<uint32_t> setup_regs(uint64_t freq);
56 inline size_t item_size()
override
61 void connect(gr::top_block_sptr top_block)
override;
62 void disconnect(gr::top_block_sptr top_block)
override;
63 gr::basic_block_sptr get_left_block()
override;
64 gr::basic_block_sptr get_right_block()
override;
67 const std::string DEFAULT_BUFF_MON_FILENAME = std::string(
"FPGA_buffer_monitor_dump.dat");
68 const std::string FREQ_BAND_0_SPI_DEVICE_NAME = std::string(
"/dev/spidev2.0");
69 const std::string FREQ_BAND_1_SPI_DEVICE_NAME = std::string(
"/dev/spidev1.0");
70 const uint32_t MAX_NUM_FREQ_BANDS = 2;
71 const uint32_t DEFAULT_NUM_FREQ_BANDS = 1;
72 const uint64_t DEFAULT_BANDWIDTH = 16400000;
73 const uint32_t DEFAULT_FILTER_ORDER = 5;
74 const uint64_t DEFAULT_SAMPLING_RATE = 16368000;
75 const uint32_t DEFAULT_PGA_GAIN_VALUE = 0x3A;
77 const uint32_t MAX_PGA_GAIN_VALUE = 0x3F;
79 const uint32_t BUFFER_MONITOR_PERIOD_MS = 1000;
81 const uint32_t BUFFER_MONITOR_INITIAL_DELAY_MS = 2000;
83 const uint32_t MAX2771_NUM_REGS = 11;
85 const uint32_t IDLE = 0x0;
86 const uint32_t MIXPOLE = 0x0;
87 const uint32_t MIXERMODE_HIGH_BAND = 0x0;
88 const uint32_t MIXERMODE_LOW_BAND = 0X1;
89 const uint32_t FCEN = 0x58;
90 const uint32_t FCENX = 0x0;
91 const uint32_t ANAIMON = 0x0;
92 const uint32_t IQEN = 0x1;
93 const uint32_t GAINREF = 0xAA;
94 const uint32_t SPI_SDIO_CONFIG = 0x0;
95 const uint32_t FORMAT = 0x1;
96 const uint32_t BITS = 0x2;
97 const uint32_t DRVCFG = 0x0;
98 const uint32_t DIEID = 0x0;
99 const uint32_t HILOADEN = 0x0;
100 const uint32_t FHIPEN = 0x1;
101 const uint32_t PGAIEN = 0x1;
102 const uint32_t PGAQEN = 0x1;
103 const uint32_t STRMEN = 0x0;
104 const uint32_t STRMSTART = 0x0;
105 const uint32_t STRMSTOP = 0x0;
106 const uint32_t STRMBITS = 0x1;
107 const uint32_t STAMPEN = 0x1;
108 const uint32_t TIMESYNCEN = 0x1;
109 const uint32_t DATASYNCEN = 0x0;
110 const uint32_t STRMRST = 0x0;
111 const uint32_t LOBAND_L1 = 0x0;
112 const uint32_t LOBAND_L5 = 0x1;
113 const uint32_t REFOUTEN = 0x1;
114 const uint32_t IXTAL = 0x1;
115 const uint32_t ICP = 0x0;
116 const uint32_t INT_PLL = 0x1;
117 const uint32_t PWRSAV = 0x0;
118 const uint32_t RDIV = 0x10;
119 const uint32_t FDIV = 0x80000;
120 const uint32_t EXTADCCLK = 0x0;
121 const uint32_t REFCLK_L_CNT = 0x100;
122 const uint32_t REFCLK_M_CNT = 0x61B;
123 const uint32_t FCLKIN = 0x0;
124 const uint32_t ADCCLK = 0x0;
125 const uint32_t MODE = 0x0;
126 const uint32_t ADCCLK_L_CNT = 0x100;
127 const uint32_t ADCCLK_M_CNT = 0x61B;
128 const uint32_t PRE_FRACDIV_SEL = 0x0;
129 const uint32_t CLKOUT_SEL = 0x1;
131 const uint32_t TEST_MODE_1_REG_VAL = 0x01E0F401;
132 const uint32_t TEST_MODE_2_REG_VAL = 0x00000002;
134 bool configure(std::vector<uint32_t> register_values);
135 void run_buffer_monitor_process();
137 mutable std::mutex buffer_monitor_mutex;
139 std::thread thread_buffer_monitor;
141 std::shared_ptr<Fpga_buffer_monitor> buffer_monitor_fpga;
142 std::shared_ptr<Fpga_spidev> spidev_fpga;
147 uint64_t sample_rate_;
149 uint32_t RF_channels_;
151 uint32_t out_stream_;
153 uint32_t filter_order_;
159 bool if_filter_gain_;
162 bool enable_ovf_check_buffer_monitor_active_;