6
* Copyright 2009, Dave Freese, W1HKJ
17
static const char FT747name_[] = "FT-747";
19
static const char *FT747modes_[] = {
20
"LSB", "USB", "CW", "CWN", "AMW", "AMN", "FMW", "FMN", NULL};
21
static const char FT747_mode_type[] = { 'L', 'U', 'U', 'U', 'U', 'U', 'U', 'U' };
23
RIG_FT747::RIG_FT747() {
27
comm_baudrate = BR4800;
44
has_ptt_control = true;
45
has_mode_control = true;
52
void RIG_FT747::init_cmd()
55
for (size_t i = 0; i < 5; i++) cmd[i] = 0;
58
void RIG_FT747::selectA()
63
showresp(INFO, HEX, "select A", cmd, replystr);
66
void RIG_FT747::selectB()
72
showresp(INFO, HEX, "select B", cmd, replystr);
75
void RIG_FT747::set_split(bool val)
79
cmd[3] = val ? 0x01 : 0x00;
83
showresp(INFO, HEX, "set split ON", cmd, replystr);
85
showresp(INFO, HEX, "set split OFF", cmd, replystr);
88
bool RIG_FT747::get_info()
90
long int afreq = A.freq, bfreq = B.freq;
94
int ret = sendCommand(cmd);
95
showresp(DEBUG, HEX, "get info", cmd, replystr);
99
// GET FREQUENCY bytes ARE NOT the same as SET FREQUENCY bytes
100
// returned values are packed BCD
101
// | 00 00 | f2 f3 | f4 f5 | f6 f7 | f8 f9 | where
105
// | 00 00 | 01 04 | 02 05 | 00 00 | 00 00 | = 14.250.000 Hz
107
afreq = fm_bcd(&replybuff[9], 8);
108
bfreq = fm_bcd(&replybuff[16], 8);
110
int md = replybuff[22];
112
case 0x01 : amode = 6; // FMW
114
case 0x81 : amode = 7; // FMN
116
case 0x02 : amode = 4; // AMW
118
case 0x82 : amode = 5; // AMN
120
case 0x04 : amode = 2; // CW
122
case 0x84 : amode = 3; // CWN
124
case 0x08 : amode = 1; // USB
126
case 0x10 : amode = 0; // LSB
147
long RIG_FT747::get_vfoA ()
152
void RIG_FT747::set_vfoA (long freq)
155
freq /=10; // 747 does not support 1 Hz resolution
156
cmd = to_bcd_be(freq, 8);
157
cmd += 0x0A; // SET FREQUENCY
158
SLOG_INFO("cmd: %s", str2hex(cmd.c_str(), cmd.length()));
162
int RIG_FT747::get_modeA()
167
void RIG_FT747::set_modeA(int val)
172
cmd[4] = 0x0C; // MODESEL
173
SLOG_INFO("cmd: %s", str2hex(cmd.c_str(), cmd.length()));
177
long RIG_FT747::get_vfoB ()
182
void RIG_FT747::set_vfoB (long freq)
186
cmd = to_bcd_be(freq, 8);
187
cmd += 0x0A; // SET FREQUENCY
188
SLOG_INFO("cmd: %s", str2hex(cmd.c_str(), cmd.length()));
192
int RIG_FT747::get_modeB()
197
void RIG_FT747::set_modeB(int val)
202
cmd[4] = 0x0C; // MODESEL
203
SLOG_INFO("cmd: %s", str2hex(cmd.c_str(), cmd.length()));
207
void RIG_FT747::set_PTT_control(int val)
210
cmd[3] = val ? 0x01 : 0x00;