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
hackrfinput
hackrfinputthread.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_HACKRFINPUTTHREAD_H
19
#define INCLUDE_HACKRFINPUTTHREAD_H
20
21
#include <QThread>
22
#include <QMutex>
23
#include <QWaitCondition>
24
#include <libhackrf/hackrf.h>
25
26
#include "
dsp/samplesinkfifo.h
"
27
#include "
dsp/decimators.h
"
28
29
#define HACKRF_BLOCKSIZE (1<<17)
30
31
class
HackRFInputThread
:
public
QThread {
32
Q_OBJECT
33
34
public
:
35
HackRFInputThread
(hackrf_device* dev,
SampleSinkFifo
* sampleFifo, QObject* parent = NULL);
36
~HackRFInputThread
();
37
38
void
startWork
();
39
void
stopWork
();
40
void
setSamplerate
(
uint32_t
samplerate);
41
void
setLog2Decimation
(
unsigned
int
log2_decim);
42
void
setFcPos
(
int
fcPos);
43
44
private
:
45
QMutex
m_startWaitMutex
;
46
QWaitCondition
m_startWaiter
;
47
bool
m_running
;
48
49
hackrf_device*
m_dev
;
50
qint16
m_buf
[2*
HACKRF_BLOCKSIZE
];
51
SampleVector
m_convertBuffer
;
52
SampleSinkFifo
*
m_sampleFifo
;
53
54
int
m_samplerate
;
55
unsigned
int
m_log2Decim
;
56
int
m_fcPos
;
57
58
Decimators<qint32, qint8, SDR_RX_SAMP_SZ, 8>
m_decimators
;
59
60
void
run
();
61
void
callback
(
const
qint8* buf, qint32 len);
62
static
int
rx_callback
(hackrf_transfer* transfer);
63
};
64
65
#endif // INCLUDE_HACKRFINPUTTHREAD_H
HackRFInputThread::~HackRFInputThread
~HackRFInputThread()
Definition:
hackrfinputthread.cpp:39
HackRFInputThread::setLog2Decimation
void setLog2Decimation(unsigned int log2_decim)
Definition:
hackrfinputthread.cpp:65
SampleVector
std::vector< Sample > SampleVector
Definition:
dsptypes.h:96
HackRFInputThread::startWork
void startWork()
Definition:
hackrfinputthread.cpp:44
samplesinkfifo.h
HackRFInputThread::HackRFInputThread
HackRFInputThread(hackrf_device *dev, SampleSinkFifo *sampleFifo, QObject *parent=NULL)
Definition:
hackrfinputthread.cpp:26
HackRFInputThread::m_startWaitMutex
QMutex m_startWaitMutex
Definition:
hackrfinputthread.h:45
HackRFInputThread::callback
void callback(const qint8 *buf, qint32 len)
Definition:
hackrfinputthread.cpp:125
uint32_t
unsigned int uint32_t
Definition:
rtptypes_win.h:46
HackRFInputThread::m_log2Decim
unsigned int m_log2Decim
Definition:
hackrfinputthread.h:55
HACKRF_BLOCKSIZE
#define HACKRF_BLOCKSIZE
Definition:
hackrfinputthread.h:29
HackRFInputThread
Definition:
hackrfinputthread.h:31
HackRFInputThread::m_fcPos
int m_fcPos
Definition:
hackrfinputthread.h:56
HackRFInputThread::rx_callback
static int rx_callback(hackrf_transfer *transfer)
Definition:
hackrfinputthread.cpp:219
decimators.h
HackRFInputThread::m_sampleFifo
SampleSinkFifo * m_sampleFifo
Definition:
hackrfinputthread.h:52
HackRFInputThread::stopWork
void stopWork()
Definition:
hackrfinputthread.cpp:53
HackRFInputThread::m_startWaiter
QWaitCondition m_startWaiter
Definition:
hackrfinputthread.h:46
HackRFInputThread::m_dev
hackrf_device * m_dev
Definition:
hackrfinputthread.h:49
HackRFInputThread::run
void run()
Definition:
hackrfinputthread.cpp:75
HackRFInputThread::m_samplerate
int m_samplerate
Definition:
hackrfinputthread.h:54
Decimators< qint32, qint8, SDR_RX_SAMP_SZ, 8 >
HackRFInputThread::setSamplerate
void setSamplerate(uint32_t samplerate)
Definition:
hackrfinputthread.cpp:60
HackRFInputThread::m_buf
qint16 m_buf[2 *HACKRF_BLOCKSIZE]
Definition:
hackrfinputthread.h:50
SampleSinkFifo
Definition:
samplesinkfifo.h:28
HackRFInputThread::setFcPos
void setFcPos(int fcPos)
Definition:
hackrfinputthread.cpp:70
HackRFInputThread::m_decimators
Decimators< qint32, qint8, SDR_RX_SAMP_SZ, 8 > m_decimators
Definition:
hackrfinputthread.h:58
HackRFInputThread::m_convertBuffer
SampleVector m_convertBuffer
Definition:
hackrfinputthread.h:51
HackRFInputThread::m_running
bool m_running
Definition:
hackrfinputthread.h:47
Generated on Fri Aug 2 2019 17:56:32 for SDRAngel by
1.8.13