GNU Radio's LIMESDR Package
rfe.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2020 Lime Microsystems <info@limemicro.com>
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef INCLUDED_LIMERFE_H
22#define INCLUDED_LIMERFE_H
23
24#include <lime/limeRFE.h>
25#include <limesdr/api.h>
26#include <gnuradio/logger.h>
27#include <string>
28
29namespace gr {
30namespace limesdr {
31
32/*!
33 * \brief Allow directly controlling RFE boards
34 * \ingroup limesdr
35 *
36 */
38{
39public:
40 rfe(int comm_type,
41 std::string device,
42 std::string config_file,
43 char IDRX,
44 char IDTX,
45 char PortRX,
46 char PortTX,
47 char Mode,
48 char Notch,
49 char Atten);
51 /**
52 * Change LimeRFE Mode
53 *
54 * @param mode Mode to be set: RX(0), TX(1), NONE(2), TXRX(3)
55 *
56 * @return 0 on success, other on failure (see LimeRFE error codes)
57 */
58 int change_mode(int mode);
59 /**
60 * Enable or disable fan
61 *
62 * @param enable fan state: 0 - disable; 1 - enable.
63 *
64 * @return 0 on success, other on failure (see LimeRFE error codes)
65 */
66 int set_fan(int enable);
67 /**
68 * Set RX Attenuation value
69 *
70 * @param attenuation Specifies the attenuation in the RX path. Attenuation [dB] =
71 * 2 * attenuation. Value range: [0,7]
72 *
73 * @return 0 on success, other on failure (see LimeRFE error codes)
74 */
75 int set_attenuation(int attenuation);
76 /**
77 * Enable or disable AM/FM notch filter
78 *
79 * @param enable notch state: 0 - disable; 1 - enable
80 *
81 * @note Notch filter is only possible up to HAM 430-440 MHz, or Wideband 1-1000 MHz
82 * @return 0 on success, other on failure (see LimeRFE error codes)
83 */
84 int set_notch(int enable);
85
86private:
87 rfe_dev_t* rfe_dev = nullptr;
88 rfe_boardState boardState = { RFE_CID_WB_1000,
89 RFE_CID_WB_1000,
90 RFE_PORT_1,
91 RFE_PORT_1,
92 RFE_MODE_NONE,
93 RFE_NOTCH_OFF,
94 0,
95 0,
96 0 };
97 int sdr_device_num = 0;
98
99 gr::logger_ptr d_logger;
100 gr::logger_ptr d_debug_logger;
101
102 std::string strerror(int error);
103 void get_board_state();
104};
105
106} // namespace limesdr
107} // namespace gr
108
109#endif /* INCLUDED_LIMERFE_H */
#define LIMESDR_API
Definition: api.h:31
Allow directly controlling RFE boards.
Definition: rfe.h:38
int set_attenuation(int attenuation)
int set_fan(int enable)
rfe(int comm_type, std::string device, std::string config_file, char IDRX, char IDTX, char PortRX, char PortTX, char Mode, char Notch, char Atten)
int set_notch(int enable)
int change_mode(int mode)
Definition: rfe.h:29