SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
bladerf1inputthread.h
Go to the documentation of this file.
1 // Copyright (C) 2015 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #ifndef INCLUDE_BLADERFINPUTTHREAD_H
19 #define INCLUDE_BLADERFINPUTTHREAD_H
20 
21 #include <QThread>
22 #include <QMutex>
23 #include <QWaitCondition>
24 #include <libbladeRF.h>
25 #include "dsp/samplesinkfifo.h"
26 #include "dsp/decimators.h"
27 
28 #define BLADERF_BLOCKSIZE (1<<14)
29 
30 class Bladerf1InputThread : public QThread {
31  Q_OBJECT
32 
33 public:
34  Bladerf1InputThread(struct bladerf* dev, SampleSinkFifo* sampleFifo, QObject* parent = NULL);
36 
37  void startWork();
38  void stopWork();
39  void setLog2Decimation(unsigned int log2_decim);
40  void setFcPos(int fcPos);
41 
42 private:
44  QWaitCondition m_startWaiter;
45  bool m_running;
46 
47  struct bladerf* m_dev;
51 
52  unsigned int m_log2Decim;
53  int m_fcPos;
54 
56 
57  void run();
58  void callback(const qint16* buf, qint32 len);
59 };
60 
61 #endif // INCLUDE_BLADERFINPUTTHREAD_H
void callback(const qint16 *buf, qint32 len)
std::vector< Sample > SampleVector
Definition: dsptypes.h:96
SampleSinkFifo * m_sampleFifo
QWaitCondition m_startWaiter
void setLog2Decimation(unsigned int log2_decim)
Bladerf1InputThread(struct bladerf *dev, SampleSinkFifo *sampleFifo, QObject *parent=NULL)
struct bladerf * m_dev
#define BLADERF_BLOCKSIZE
Decimators< qint32, qint16, SDR_RX_SAMP_SZ, 12 > m_decimators
qint16 m_buf[2 *BLADERF_BLOCKSIZE]
SampleVector m_convertBuffer