forked from g0orx/wdsp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
calcc.h
134 lines (119 loc) · 3.01 KB
/
calcc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/* calcc.h
This file is part of a program that implements a Software-Defined Radio.
Copyright (C) 2013, 2016 Warren Pratt, NR0V
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
The author can be reached by email at
*/
#ifndef _calcc_h
#define _calcc_h
#include "delay.h"
typedef struct _calcc
{
int channel;
int runcal;
int size;
volatile long mox;
volatile long solidmox;
int rate;
int ints;
int spi;
int nsamps;
int npsamps;
int pin;
int map;
int convex;
int stbl;
int scOK;
double hw_scale;
double rx_scale;
double alpha;
double* t;
double* tmap;
double* cm;
double* cc;
double* cs;
double* rxs;
double* txs;
double ptol;
int* info;
int* binfo;
double txdel;
struct _ctrl
{
double moxdelay;
double loopdelay;
int state;
int reset;
int automode;
int mancal;
int turnon;
int moxsamps;
int moxcount;
int count;
int* cpi;
int* sindex;
int* sbase;
int full_ints;
int calcinprogress;
volatile LONG calcdone;
int waitsamps;
int waitcount;
double env_maxtx;
volatile long running;
int bs_count;
volatile long current_state;
} ctrl;
struct _disp
{
double* x;
double* ym;
double* yc;
double* ys;
double* cm;
double* cc;
double* cs;
CRITICAL_SECTION cs_disp;
} disp;
DELAY rxdelay;
DELAY txdelay;
struct _util
{
char savefile[256];
char restfile[256];
int ints;
int channel;
} util;
double* temptx; //////////////////////////////////////////////////// temporary tx complex buffer - remove with new callback3port()
double* temprx; //////////////////////////////////////////////////// temporary rx complex buffer - remove with new callback3port()
} calcc, *CALCC;
extern CALCC create_calcc (int channel, int runcal, int size, int rate, int ints, int spi, double hw_scale,
double moxdelay, double loopdelay, double ptol, int mox, int solidmox, int pin, int map, int stbl,
int npsamps, double alpha);
extern void destroy_calcc (CALCC a);
extern void flush_calcc (CALCC a);
extern __declspec(dllexport) void pscc (int channel, int size, double* tx, double* rx);
#endif
// 'info' assignments:
// 0 - builder for rx_scale
// 1 - builder for cm
// 2 - builder for cc
// 3 - builder for cs
// 4 - feedback level warning
// 5 - count of attempted calibrations
// 6 - results from scheck()
// 7 - results from rxscheck()
//
// 13 - dogcount
// 14 - indicates iqc_Run = 1
// 15 - control state