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.
bladerf1outputthread.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_BLADERFOUTPUTTHREAD_H
19 #define INCLUDE_BLADERFOUTPUTTHREAD_H
20 
21 #include <QThread>
22 #include <QMutex>
23 #include <QWaitCondition>
24 #include <libbladeRF.h>
25 #include "dsp/samplesourcefifo.h"
26 #include "dsp/interpolators.h"
27 
28 #define BLADERFOUTPUT_BLOCKSIZE (1<<16)
29 
30 class Bladerf1OutputThread : public QThread {
31  Q_OBJECT
32 
33 public:
34  Bladerf1OutputThread(struct bladerf* dev, SampleSourceFifo* sampleFifo, QObject* parent = NULL);
36 
37  void startWork();
38  void stopWork();
39  void setLog2Interpolation(unsigned int log2_interp);
40  bool isRunning() const { return m_running; }
41 
42 private:
44  QWaitCondition m_startWaiter;
45  bool m_running;
46 
47  struct bladerf* m_dev;
50 
51  unsigned int m_log2Interp;
52 
54 
55  void run();
56  void callback(qint16* buf, qint32 len);
57 };
58 
59 #endif // INCLUDE_BLADERFOUTPUTTHREAD_H
QWaitCondition m_startWaiter
#define BLADERFOUTPUT_BLOCKSIZE
qint16 m_buf[2 *BLADERFOUTPUT_BLOCKSIZE]
SampleSourceFifo * m_sampleFifo
void setLog2Interpolation(unsigned int log2_interp)
Bladerf1OutputThread(struct bladerf *dev, SampleSourceFifo *sampleFifo, QObject *parent=NULL)
Interpolators< qint16, SDR_TX_SAMP_SZ, 12 > m_interpolators
void callback(qint16 *buf, qint32 len)