2002-07-08 22:10:43 +00:00
|
|
|
/*
|
|
|
|
* Hamlib Drake backend - R-8B description
|
2004-06-04 21:48:05 +00:00
|
|
|
* Copyright (c) 2001-2004 by Stephane Fillod
|
2002-07-08 22:10:43 +00:00
|
|
|
*
|
2005-04-10 21:57:13 +00:00
|
|
|
* $Id: r8b.c,v 1.11 2005-04-10 21:57:13 fillods Exp $
|
2002-07-08 22:10:43 +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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2003-10-01 19:32:04 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2002-07-08 22:10:43 +00:00
|
|
|
#include <hamlib/rig.h>
|
|
|
|
#include "drake.h"
|
|
|
|
|
|
|
|
|
2004-08-12 02:05:02 +00:00
|
|
|
#define R8B_MODES (RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_RTTY|RIG_MODE_AM|RIG_MODE_ECSS|RIG_MODE_FM)
|
2002-07-08 22:10:43 +00:00
|
|
|
|
2004-03-10 23:33:48 +00:00
|
|
|
#define R8B_FUNC (RIG_FUNC_MN|RIG_FUNC_LOCK|RIG_FUNC_NB)
|
2002-07-08 22:10:43 +00:00
|
|
|
|
2004-08-08 20:14:46 +00:00
|
|
|
#define R8B_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH)
|
2002-07-08 22:10:43 +00:00
|
|
|
|
2004-06-04 21:48:05 +00:00
|
|
|
#define R8B_PARM_ALL (RIG_PARM_TIME)
|
2002-07-08 22:10:43 +00:00
|
|
|
|
2004-08-31 03:45:34 +00:00
|
|
|
#define R8B_VFO (RIG_VFO_A|RIG_VFO_B|RIG_VFO_VFO|RIG_VFO_MEM)
|
2002-10-20 20:46:32 +00:00
|
|
|
|
2004-03-10 23:33:48 +00:00
|
|
|
#define R8B_VFO_OPS (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_MCL|RIG_OP_CPY)
|
|
|
|
|
|
|
|
#define R8B_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3)
|
2002-10-20 20:46:32 +00:00
|
|
|
|
2004-08-08 20:14:46 +00:00
|
|
|
#define R8B_STR_CAL { 16, { \
|
|
|
|
{ 0, -60 }, \
|
|
|
|
{ 1, -48 }, \
|
|
|
|
{ 11, -42 }, \
|
|
|
|
{ 27, -36 }, \
|
|
|
|
{ 39, -30 }, \
|
|
|
|
{ 51, -24 }, \
|
|
|
|
{ 64, -18 }, \
|
|
|
|
{ 80, -12 }, \
|
|
|
|
{ 97, -6 }, \
|
|
|
|
{ 116, 0 }, \
|
|
|
|
{ 138, 10 }, \
|
|
|
|
{ 163, 20 }, \
|
|
|
|
{ 195, 30 }, \
|
|
|
|
{ 217, 40 }, \
|
|
|
|
{ 228, 50 }, \
|
|
|
|
{ 255, 60 }, \
|
|
|
|
} }
|
2002-07-08 22:10:43 +00:00
|
|
|
|
2004-09-05 00:33:56 +00:00
|
|
|
/*
|
|
|
|
* channel caps.
|
|
|
|
*/
|
|
|
|
#define DRAKE_MEM_CAP { \
|
|
|
|
.freq = 1, \
|
|
|
|
.mode = 1, \
|
|
|
|
.width = 1, \
|
|
|
|
.ant = 1, \
|
|
|
|
.funcs = 1, \
|
|
|
|
.levels = RIG_LEVEL_AGC|RIG_LEVEL_ATT|RIG_LEVEL_PREAMP, \
|
|
|
|
.channel_desc = 1, \
|
|
|
|
}
|
|
|
|
|
2002-07-08 22:10:43 +00:00
|
|
|
/*
|
|
|
|
* R-8B rig capabilities.
|
|
|
|
*
|
2002-10-20 20:46:32 +00:00
|
|
|
* manual: http://www.rldrake.com/swl/R8B.pdf
|
|
|
|
*
|
2002-07-08 22:10:43 +00:00
|
|
|
*/
|
2002-10-20 20:46:32 +00:00
|
|
|
|
2002-07-08 22:10:43 +00:00
|
|
|
const struct rig_caps r8b_caps = {
|
2002-08-16 17:43:02 +00:00
|
|
|
.rig_model = RIG_MODEL_DKR8B,
|
|
|
|
.model_name = "R-8B",
|
|
|
|
.mfg_name = "Drake",
|
2005-04-10 21:57:13 +00:00
|
|
|
.version = BACKEND_VER,
|
2002-08-16 17:43:02 +00:00
|
|
|
.copyright = "LGPL",
|
2004-06-04 21:48:05 +00:00
|
|
|
.status = RIG_STATUS_UNTESTED,
|
2002-08-16 17:43:02 +00:00
|
|
|
.rig_type = RIG_TYPE_RECEIVER,
|
|
|
|
.ptt_type = RIG_PTT_NONE,
|
|
|
|
.dcd_type = RIG_DCD_NONE,
|
|
|
|
.port_type = RIG_PORT_SERIAL,
|
|
|
|
.serial_rate_min = 9600,
|
|
|
|
.serial_rate_max = 9600,
|
|
|
|
.serial_data_bits = 8,
|
|
|
|
.serial_stop_bits = 1,
|
|
|
|
.serial_parity = RIG_PARITY_NONE,
|
2002-10-20 20:46:32 +00:00
|
|
|
.serial_handshake = RIG_HANDSHAKE_HARDWARE,
|
2002-08-16 17:43:02 +00:00
|
|
|
.write_delay = 0,
|
|
|
|
.post_write_delay = 1,
|
|
|
|
.timeout = 200,
|
|
|
|
.retry = 3,
|
|
|
|
|
|
|
|
.has_get_func = R8B_FUNC,
|
|
|
|
.has_set_func = R8B_FUNC,
|
|
|
|
.has_get_level = R8B_LEVEL_ALL,
|
|
|
|
.has_set_level = RIG_LEVEL_SET(R8B_LEVEL_ALL),
|
|
|
|
.has_get_parm = R8B_PARM_ALL,
|
|
|
|
.has_set_parm = RIG_PARM_SET(R8B_PARM_ALL),
|
|
|
|
.level_gran = {}, /* FIXME: granularity */
|
|
|
|
.parm_gran = {},
|
|
|
|
.ctcss_list = NULL,
|
|
|
|
.dcs_list = NULL,
|
2002-10-20 20:46:32 +00:00
|
|
|
.preamp = { 10, RIG_DBLST_END },
|
|
|
|
.attenuator = { 10, RIG_DBLST_END },
|
2002-08-16 17:43:02 +00:00
|
|
|
.max_rit = Hz(0),
|
|
|
|
.max_xit = Hz(0),
|
|
|
|
.max_ifshift = Hz(0),
|
|
|
|
.targetable_vfo = 0,
|
2002-10-20 20:46:32 +00:00
|
|
|
.transceive = RIG_TRN_OFF, /* TODO: acutally has RIG_TRN_RIG */
|
2002-08-16 17:43:02 +00:00
|
|
|
.bank_qty = 0,
|
2002-10-20 20:46:32 +00:00
|
|
|
.chan_desc_sz = 7,
|
|
|
|
.vfo_ops = R8B_VFO_OPS,
|
2002-08-16 17:43:02 +00:00
|
|
|
|
|
|
|
.chan_list = {
|
2004-09-05 00:33:56 +00:00
|
|
|
{ 0, 999, RIG_MTYPE_MEM, DRAKE_MEM_CAP },
|
2004-03-10 23:33:48 +00:00
|
|
|
RIG_CHAN_END
|
2002-07-08 22:10:43 +00:00
|
|
|
},
|
|
|
|
|
2004-08-08 20:14:46 +00:00
|
|
|
.rx_range_list1 = {
|
2004-03-10 23:33:48 +00:00
|
|
|
{kHz(10),MHz(30),R8B_MODES,-1,-1,R8B_VFO,R8B_ANTS},
|
2002-10-20 20:46:32 +00:00
|
|
|
RIG_FRNG_END,
|
|
|
|
},
|
2002-08-16 17:43:02 +00:00
|
|
|
.tx_range_list1 = { RIG_FRNG_END, },
|
|
|
|
.rx_range_list2 = {
|
2004-03-10 23:33:48 +00:00
|
|
|
{kHz(10),MHz(30),R8B_MODES,-1,-1,R8B_VFO,R8B_ANTS},
|
2002-07-08 22:10:43 +00:00
|
|
|
RIG_FRNG_END,
|
|
|
|
},
|
2002-08-16 17:43:02 +00:00
|
|
|
.tx_range_list2 = { RIG_FRNG_END, },
|
2002-10-20 20:46:32 +00:00
|
|
|
|
2002-08-16 17:43:02 +00:00
|
|
|
.tuning_steps = {
|
2002-10-20 20:46:32 +00:00
|
|
|
{R8B_MODES,10},
|
|
|
|
{R8B_MODES,100},
|
|
|
|
{R8B_MODES,kHz(1)},
|
|
|
|
{R8B_MODES,kHz(10)},
|
2002-07-08 22:10:43 +00:00
|
|
|
RIG_TS_END,
|
|
|
|
},
|
|
|
|
/* mode/filter list, remember: order matters! */
|
2002-08-16 17:43:02 +00:00
|
|
|
.filters = {
|
2002-10-20 20:46:32 +00:00
|
|
|
{RIG_MODE_FM, kHz(12)},
|
2004-08-12 02:05:02 +00:00
|
|
|
{RIG_MODE_AM|RIG_MODE_ECSS, kHz(6)},
|
|
|
|
{RIG_MODE_AM|RIG_MODE_ECSS, kHz(4)},
|
|
|
|
{RIG_MODE_SSB|RIG_MODE_RTTY, kHz(2.3)},
|
|
|
|
{RIG_MODE_SSB|RIG_MODE_RTTY, kHz(1.8)},
|
|
|
|
{RIG_MODE_SSB|RIG_MODE_RTTY, kHz(4)},
|
|
|
|
{RIG_MODE_CW, Hz(500)},
|
|
|
|
{RIG_MODE_CW, kHz(1.8)},
|
2002-07-08 22:10:43 +00:00
|
|
|
RIG_FLT_END,
|
|
|
|
},
|
2004-08-08 20:14:46 +00:00
|
|
|
.str_cal = R8B_STR_CAL,
|
2002-08-16 17:43:02 +00:00
|
|
|
.priv = NULL,
|
2002-07-08 22:10:43 +00:00
|
|
|
|
2004-03-10 23:33:48 +00:00
|
|
|
.rig_init = drake_init,
|
|
|
|
.rig_cleanup = drake_cleanup,
|
|
|
|
|
2002-08-16 17:43:02 +00:00
|
|
|
.set_freq = drake_set_freq,
|
2004-06-04 21:48:05 +00:00
|
|
|
.get_freq = drake_get_freq,
|
2002-10-20 20:46:32 +00:00
|
|
|
.set_vfo = drake_set_vfo,
|
2004-06-04 21:48:05 +00:00
|
|
|
.get_vfo = drake_get_vfo,
|
2002-10-20 20:46:32 +00:00
|
|
|
.set_mode = drake_set_mode,
|
2004-06-04 21:48:05 +00:00
|
|
|
.get_mode = drake_get_mode,
|
2004-03-10 23:33:48 +00:00
|
|
|
.set_func = drake_set_func,
|
2004-06-04 21:48:05 +00:00
|
|
|
.get_func = drake_get_func,
|
2004-03-10 23:33:48 +00:00
|
|
|
.set_level = drake_set_level,
|
2004-06-04 21:48:05 +00:00
|
|
|
.get_level = drake_get_level,
|
|
|
|
.set_ant = drake_set_ant,
|
|
|
|
.get_ant = drake_get_ant,
|
|
|
|
.set_mem = drake_set_mem,
|
|
|
|
.get_mem = drake_get_mem,
|
2004-09-05 00:33:56 +00:00
|
|
|
.set_channel = drake_set_chan,
|
|
|
|
.get_channel = drake_get_chan,
|
2004-06-04 21:48:05 +00:00
|
|
|
.vfo_op = drake_vfo_op,
|
2004-03-10 23:33:48 +00:00
|
|
|
.set_powerstat = drake_set_powerstat,
|
2004-06-04 21:48:05 +00:00
|
|
|
.get_powerstat = drake_get_powerstat,
|
2002-10-20 20:46:32 +00:00
|
|
|
.get_info = drake_get_info,
|
2002-07-08 22:10:43 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Function definitions below
|
|
|
|
*/
|
|
|
|
|