2002-07-06 09:27:38 +00:00
|
|
|
/*
|
|
|
|
* Hamlib GNUradio backend - gnuradio priv structure
|
2003-02-09 22:54:15 +00:00
|
|
|
* Copyright (c) 2001-2003 by Stephane Fillod
|
2002-07-06 09:27:38 +00:00
|
|
|
*
|
2003-09-28 20:51:05 +00:00
|
|
|
* $Id: gr_priv.h,v 1.6 2003-09-28 20:51:05 fillods Exp $
|
2002-07-06 09:27:38 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GR_PRIV_H
|
|
|
|
#define _GR_PRIV_H 1
|
|
|
|
|
|
|
|
#include <VrSigSource.h>
|
|
|
|
#include <VrSink.h>
|
|
|
|
#include <VrMultiTask.h>
|
2003-02-09 22:54:15 +00:00
|
|
|
#include <VrFixOffset.h>
|
2003-09-28 20:51:05 +00:00
|
|
|
#include <GrConvertSF.h>
|
2003-02-09 22:54:15 +00:00
|
|
|
|
2003-09-28 20:51:05 +00:00
|
|
|
#include <VrSource.h>
|
2002-07-06 09:27:38 +00:00
|
|
|
|
2003-09-28 20:51:05 +00:00
|
|
|
#include <pthread.h>
|
2002-07-06 09:27:38 +00:00
|
|
|
|
2003-09-28 20:51:05 +00:00
|
|
|
#include "hamlib/rig.h"
|
|
|
|
#include "demod.h"
|
2003-09-28 15:59:27 +00:00
|
|
|
|
2003-02-09 22:54:15 +00:00
|
|
|
|
|
|
|
#define NUM_CHAN 2 /* VFO A and VFO B */
|
|
|
|
|
2002-07-06 09:27:38 +00:00
|
|
|
struct gnuradio_priv_data {
|
|
|
|
/* current vfo already in rig_state ? */
|
|
|
|
vfo_t curr_vfo;
|
|
|
|
|
|
|
|
value_t parms[RIG_SETTING_MAX];
|
|
|
|
|
2003-02-09 22:54:15 +00:00
|
|
|
channel_t chans[NUM_CHAN];
|
2002-07-06 09:27:38 +00:00
|
|
|
|
2003-02-09 22:54:15 +00:00
|
|
|
/* tuner providing IF */
|
|
|
|
rig_model_t tuner_model;
|
|
|
|
RIG *tuner;
|
|
|
|
shortfreq_t input_rate;
|
|
|
|
shortfreq_t IF_center_freq;
|
|
|
|
|
2003-09-28 20:51:05 +00:00
|
|
|
VrSource<VrComplex> *source;
|
|
|
|
|
|
|
|
/* MC4020 */
|
|
|
|
VrSource<short> *mc4020_source;
|
|
|
|
VrFixOffset<short,short> *offset_fixer;
|
|
|
|
GrConvertSF *convert_SF;
|
|
|
|
|
2003-09-28 15:59:27 +00:00
|
|
|
VrSink<float> *sink; /*< Audio sink */
|
2002-07-06 09:27:38 +00:00
|
|
|
VrMultiTask *m;
|
2003-02-09 22:54:15 +00:00
|
|
|
|
|
|
|
pthread_t process_thread;
|
|
|
|
pthread_mutex_t mutex_process;
|
|
|
|
volatile int do_process; /*< flag to tell process thread to stop */
|
|
|
|
|
2003-09-28 20:51:05 +00:00
|
|
|
DemodChainCF *mods[NUM_CHAN]; /*< Modulation objects and stuff, one per channel */
|
2002-07-06 09:27:38 +00:00
|
|
|
};
|
|
|
|
|
2003-04-06 18:50:21 +00:00
|
|
|
|
2003-09-28 15:59:27 +00:00
|
|
|
//#define GR_MAX_FREQUENCY(priv) ((priv)->input_rate/2)
|
|
|
|
#define GR_MAX_FREQUENCY(priv) ((priv)->input_rate)
|
2002-07-06 09:27:38 +00:00
|
|
|
|
2003-02-09 22:54:15 +00:00
|
|
|
#endif /* _GR_PRIV_H */
|