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.
plugins
samplesource
limesdrinput
limesdrinputthread.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_LIMESDRINPUT_LIMESDRINPUTTHREAD_H_
19
#define PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTTHREAD_H_
20
21
#include <QThread>
22
#include <QMutex>
23
#include <QWaitCondition>
24
25
#include "lime/LimeSuite.h"
26
27
#include "
dsp/samplesinkfifo.h
"
28
#include "
dsp/decimators.h
"
29
#include "
limesdr/devicelimesdrshared.h
"
30
31
#define LIMESDR_BLOCKSIZE (1<<15) //complex samples per buffer
32
33
class
LimeSDRInputThread
:
public
QThread,
public
DeviceLimeSDRShared::ThreadInterface
34
{
35
Q_OBJECT
36
37
public
:
38
LimeSDRInputThread
(lms_stream_t* stream,
SampleSinkFifo
* sampleFifo, QObject* parent = 0);
39
~LimeSDRInputThread
();
40
41
virtual
void
startWork
();
42
virtual
void
stopWork
();
43
virtual
void
setDeviceSampleRate
(
int
sampleRate) { (void) sampleRate; }
44
virtual
bool
isRunning
() {
return
m_running
; }
45
void
setLog2Decimation
(
unsigned
int
log2_decim);
46
47
private
:
48
QMutex
m_startWaitMutex
;
49
QWaitCondition
m_startWaiter
;
50
bool
m_running
;
51
52
lms_stream_t*
m_stream
;
53
qint16
m_buf
[2*
LIMESDR_BLOCKSIZE
];
//must hold I+Q values of each sample hence 2xcomplex size
54
SampleVector
m_convertBuffer
;
55
SampleSinkFifo
*
m_sampleFifo
;
56
57
unsigned
int
m_log2Decim
;
// soft decimation
58
59
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12>
m_decimators
;
60
61
void
run
();
62
void
callback
(
const
qint16* buf, qint32 len);
63
};
64
65
66
67
#endif
/* PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTTHREAD_H_ */
LimeSDRInputThread::~LimeSDRInputThread
~LimeSDRInputThread()
Definition:
limesdrinputthread.cpp:35
SampleVector
std::vector< Sample > SampleVector
Definition:
dsptypes.h:96
samplesinkfifo.h
DeviceLimeSDRShared::ThreadInterface
Definition:
devicelimesdrshared.h:147
LimeSDRInputThread::m_startWaiter
QWaitCondition m_startWaiter
Definition:
limesdrinputthread.h:49
LimeSDRInputThread::m_buf
qint16 m_buf[2 *LIMESDR_BLOCKSIZE]
Definition:
limesdrinputthread.h:53
LimeSDRInputThread::setDeviceSampleRate
virtual void setDeviceSampleRate(int sampleRate)
Definition:
limesdrinputthread.h:43
LimeSDRInputThread::m_startWaitMutex
QMutex m_startWaitMutex
Definition:
limesdrinputthread.h:48
LimeSDRInputThread
Definition:
limesdrinputthread.h:33
devicelimesdrshared.h
LimeSDRInputThread::stopWork
virtual void stopWork()
Definition:
limesdrinputthread.cpp:58
LimeSDRInputThread::run
void run()
Definition:
limesdrinputthread.cpp:78
LimeSDRInputThread::startWork
virtual void startWork()
Definition:
limesdrinputthread.cpp:40
LimeSDRInputThread::m_sampleFifo
SampleSinkFifo * m_sampleFifo
Definition:
limesdrinputthread.h:55
LimeSDRInputThread::setLog2Decimation
void setLog2Decimation(unsigned int log2_decim)
Definition:
limesdrinputthread.cpp:73
LimeSDRInputThread::LimeSDRInputThread
LimeSDRInputThread(lms_stream_t *stream, SampleSinkFifo *sampleFifo, QObject *parent=0)
Definition:
limesdrinputthread.cpp:24
LimeSDRInputThread::isRunning
virtual bool isRunning()
Definition:
limesdrinputthread.h:44
decimators.h
LimeSDRInputThread::m_log2Decim
unsigned int m_log2Decim
Definition:
limesdrinputthread.h:57
LimeSDRInputThread::m_decimators
Decimators< qint32, qint16, SDR_RX_SAMP_SZ, 12 > m_decimators
Definition:
limesdrinputthread.h:59
LimeSDRInputThread::m_running
bool m_running
Definition:
limesdrinputthread.h:50
LimeSDRInputThread::m_convertBuffer
SampleVector m_convertBuffer
Definition:
limesdrinputthread.h:54
LimeSDRInputThread::m_stream
lms_stream_t * m_stream
Definition:
limesdrinputthread.h:52
Decimators< qint32, qint16, SDR_RX_SAMP_SZ, 12 >
LimeSDRInputThread::callback
void callback(const qint16 *buf, qint32 len)
Definition:
limesdrinputthread.cpp:104
LIMESDR_BLOCKSIZE
#define LIMESDR_BLOCKSIZE
Definition:
limesdrinputthread.h:31
SampleSinkFifo
Definition:
samplesinkfifo.h:28
Generated on Fri Aug 2 2019 17:56:32 for SDRAngel by
1.8.13