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.
plutosdroutputthread.h
Go to the documentation of this file.
1 // Copyright (C) 2017 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 PLUGINS_SAMPLESOURCE_PLUTOSDROUTPUT_PLUTOSDROUTPUTTHREAD_H_
19 #define PLUGINS_SAMPLESOURCE_PLUTOSDROUTPUT_PLUTOSDROUTPUTTHREAD_H_
20 
21 #include <QThread>
22 #include <QMutex>
23 #include <QWaitCondition>
24 
25 #include "dsp/samplesourcefifo.h"
26 #include "dsp/interpolators.h"
28 
29 class DevicePlutoSDRBox;
30 
32 {
33  Q_OBJECT
34 
35 public:
36  PlutoSDROutputThread(uint32_t blocksize, DevicePlutoSDRBox* plutoBox, SampleSourceFifo* sampleFifo, QObject* parent = 0);
38 
39  virtual void startWork();
40  virtual void stopWork();
41  virtual void setDeviceSampleRate(int sampleRate) { (void) sampleRate; }
42  virtual bool isRunning() { return m_running; }
43  void setLog2Interpolation(unsigned int log2_interp);
44 
45 private:
47  QWaitCondition m_startWaiter;
48  bool m_running;
49 
52 // int16_t *m_bufConv; //!< holds I+Q values of each sample converted to host format via iio_channel_convert
55 
56  unsigned int m_log2Interp; // soft interpolation
57 
59 
60  void run();
61  void convert(qint16* buf, qint32 len);
62 
63 };
64 
65 
66 #endif /* PLUGINS_SAMPLESOURCE_PLUTOSDROUTPUT_PLUTOSDROUTPUTTHREAD_H_ */
short int16_t
Definition: rtptypes_win.h:43
DevicePlutoSDRBox * m_plutoBox
int16_t * m_buf
holds I+Q values of each sample from devce
PlutoSDROutputThread(uint32_t blocksize, DevicePlutoSDRBox *plutoBox, SampleSourceFifo *sampleFifo, QObject *parent=0)
uint32_t m_blockSizeSamples
buffer sizes in number of (I,Q) samples
virtual void setDeviceSampleRate(int sampleRate)
unsigned int uint32_t
Definition: rtptypes_win.h:46
SampleSourceFifo * m_sampleFifo
DSP sample FIFO (I,Q)
Interpolators< qint16, SDR_TX_SAMP_SZ, 16 > m_interpolators
Pluto is on 12 bit but iio_channel_convert_inverse converts from 16 to 12 bits.
void convert(qint16 *buf, qint32 len)
QWaitCondition m_startWaiter
void setLog2Interpolation(unsigned int log2_interp)