GNU Radio's HIQSDR Package
source.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013 <+YOU OR YOUR COMPANY+>.
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 
22 #ifndef INCLUDED_HIQSDR_SOURCE_H
23 #define INCLUDED_HIQSDR_SOURCE_H
24 
25 #include <hiqsdr/api.h>
26 #include <gnuradio/sync_block.h>
27 
28 #define RX_CLOCK 122880000LL
29 #define RX_EXT 0x80
30 
31 #define TX_OFF 0
32 #define TX_CW 1
33 #define TX_SSB 2
34 #define USE_EXT_IO 4
35 #define TX_PTT 8
36 
37 #define HIQ_PREAMP 0x10
38 #define HIQ_ANT 0x01
39 
40 #define FILTER_RX 0
41 #define FILTER_TX 1
42 
43 namespace gr {
44  namespace hiqsdr {
45 
46  /*!
47  * \brief <+description of block+>
48  * \ingroup hiqsdr
49  *
50  */
51  class HIQSDR_API source : virtual public gr::sync_block
52  {
53  public:
54  typedef boost::shared_ptr<source> sptr;
55 
56  /*!
57  * \brief Return a shared_ptr to a new instance of hiqsdr::source.
58  *
59  * To avoid accidental use of raw pointers, hiqsdr::source's
60  * constructor is in a private implementation
61  * class. hiqsdr::source::make is the public interface for
62  * creating new instances.
63  */
64  static sptr make(size_t itemsize, const char *host,unsigned short port, unsigned short c_port, unsigned short rx_fir_port, unsigned short tx_fir_port, int payload_size=1472,bool eof=true, bool wait=true, int rxfreq=7000000, int txfreq=7000000, int rate=48000,bool ant=0, int presel=0, int att=0, int txLevel=255, bool ptt=0, int txRate=48000, int clockCorr=0,std::vector<gr_complex> rxFirTaps=std::vector<gr_complex>() , std::vector<gr_complex> txFirTaps=std::vector<gr_complex>(), bool dpd=0);
65  virtual int payload_size()=0;
66  virtual int get_port()=0;
67  virtual void setRXFreq(int f)=0;
68  virtual void setTXFreq(int f)=0;
69  virtual void setSampleRate(int rate)=0;
70  virtual void setAnt(bool)=0;
71  virtual void setPresel(int)=0;
72  virtual void setAttenuator(int)=0;
73  virtual void setTXLevel(int l)=0;
74  virtual void setPtt(bool on)=0;
75  virtual void setTXRate(int)=0;
76  virtual void setCWMode(bool)=0;
77  virtual void setFilter(std::vector<gr_complex> coef, int dest=0)=0;
78  virtual void setClockCorr(int diff)=0;
79  virtual void setDPD(bool)=0;
80  };
81 
82  } // namespace hiqsdr
83 } // namespace gr
84 
85 #endif /* INCLUDED_HIQSDR_SOURCE_H */
86 
boost::shared_ptr< source > sptr
Definition: source.h:54
Definition: sink.h:28
<+description of block+>
Definition: source.h:51
#define HIQSDR_API
Definition: api.h:30