added AR2700 & AR8600

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2028 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.5
Stéphane Fillod, F8CFE 2005-04-20 14:48:49 +00:00
rodzic 50a5c7fb0b
commit 4b3b3c26be
4 zmienionych plików z 453 dodań i 2 usunięć

Wyświetl plik

@ -1,4 +1,5 @@
AORSRCLIST = ar8200.c ar8000.c ar5000.c ar3000.c ar7030.c ar3030.c
AORSRCLIST = ar8200.c ar8000.c ar5000.c ar3000.c ar7030.c ar3030.c \
ar2700.c ar8600.c
lib_LTLIBRARIES = hamlib-aor.la
hamlib_aor_la_SOURCES = $(AORSRCLIST) aor.c

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib AOR backend - main header
* Copyright (c) 2000-2005 by Stephane Fillod
*
* $Id: aor.h,v 1.21 2005-04-15 21:50:27 fillods Exp $
* $Id: aor.h,v 1.22 2005-04-20 14:48:49 fillods Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -62,9 +62,12 @@ int aor_set_bank(RIG *rig, vfo_t vfo, int bank);
int aor_get_channel(RIG *rig, channel_t *chan);
int aor_set_channel(RIG *rig, const channel_t *chan);
int aor_get_chan_all_cb (RIG * rig, chan_cb_t chan_cb, rig_ptr_t);
extern const struct rig_caps ar2700_caps;
extern const struct rig_caps ar8200_caps;
extern const struct rig_caps ar8000_caps;
extern const struct rig_caps ar8600_caps;
extern const struct rig_caps ar5000_caps;
extern const struct rig_caps ar3000a_caps;
extern const struct rig_caps ar7030_caps;

244
aor/ar2700.c 100644
Wyświetl plik

@ -0,0 +1,244 @@
/*
* Hamlib AOR backend - AR2700 description
* Copyright (c) 2000-2005 by Stephane Fillod
*
* $Id: ar2700.c,v 1.1 2005-04-20 14:48:49 fillods Exp $
*
* 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
#include <stdlib.h>
#include <hamlib/rig.h>
#include "aor.h"
#define AR2700_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM)
#define AR2700_FUNC (RIG_FUNC_ABM)
#define AR2700_LEVEL (RIG_LEVEL_ATT|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR)
#define AR2700_PARM (RIG_PARM_APO)
#define AR2700_VFO_OPS (RIG_OP_MCL|RIG_OP_UP|RIG_OP_DOWN)
#define AR2700_VFO_ALL (RIG_VFO_A|RIG_VFO_MEM)
/* TODO: measure and report real values */
#define AR2700_STR_CAL { 2, \
{ \
{ 0x00, -60 }, \
{ 0x3f, 60 } \
} }
#define AR2700_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
.bank_num = 1, \
.tuning_step = 1, \
.flags = 1, \
.levels = RIG_LEVEL_ATT, \
.funcs = RIG_FUNC_ABM, \
}
static int format2700_mode(RIG *rig, char *buf, rmode_t mode, pbwidth_t width);
static int parse2700_aor_mode(RIG *rig, char aormode, char aorwidth, rmode_t *mode, pbwidth_t *width);
static const struct aor_priv_caps ar2700_priv_caps = {
.format_mode = format2700_mode,
.parse_aor_mode = parse2700_aor_mode,
.bank_base1 = '0',
.bank_base2 = '0',
};
/*
* ar2700 rig capabilities.
* Notice that some rigs share the same functions.
* Also this struct is READONLY!
*
* part of info from http://www.aoruk.com/2700.htm
* Interface unit: CU-8232 (or equivalent)
*/
const struct rig_caps ar2700_caps = {
.rig_model = RIG_MODEL_AR2700,
.model_name = "AR2700",
.mfg_name = "AOR",
.version = BACKEND_VER,
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_SCANNER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 2400,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 2,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_XONXOFF,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 400,
.retry = 3,
.has_get_func = AR2700_FUNC,
.has_set_func = AR2700_FUNC,
.has_get_level = AR2700_LEVEL,
.has_set_level = RIG_LEVEL_SET(AR2700_LEVEL),
.has_get_parm = AR2700_PARM,
.has_set_parm = AR2700_PARM, /* FIXME: parms */
.level_gran = {}, /* FIXME: granularity */
.parm_gran = {},
.ctcss_list = NULL, /* FIXME: CTCSS list */
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { 20, RIG_DBLST_END, }, /* TBC */
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.transceive = RIG_TRN_RIG,
.bank_qty = 10,
.chan_desc_sz = 0,
.vfo_ops = AR2700_VFO_OPS,
.str_cal = AR2700_STR_CAL,
.chan_list = {
{ 0, 499, RIG_MTYPE_MEM, AR2700_MEM_CAP }, /* flat space */
RIG_CHAN_END, },
.rx_range_list1 = {
{kHz(500),MHz(1300),AR2700_MODES,-1,-1,AR2700_VFO_ALL},
RIG_FRNG_END,
}, /* rx range */
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{kHz(500),MHz(1300),AR2700_MODES,-1,-1,AR2700_VFO_ALL},
RIG_FRNG_END,
}, /* rx range */
.tx_range_list2 = { RIG_FRNG_END, }, /* no tx range, this is a scanner! */
.tuning_steps = {
{RIG_MODE_AM|RIG_MODE_FM,kHz(5)},
{RIG_MODE_AM|RIG_MODE_FM,kHz(6.25)},
{RIG_MODE_AM|RIG_MODE_FM,kHz(9)},
{RIG_MODE_AM|RIG_MODE_FM,kHz(10)},
{RIG_MODE_AM|RIG_MODE_FM,12500},
{RIG_MODE_AM|RIG_MODE_FM,kHz(20)},
{RIG_MODE_AM|RIG_MODE_FM,kHz(25)},
{RIG_MODE_AM|RIG_MODE_FM,kHz(30)},
{AR2700_MODES,kHz(50)},
{AR2700_MODES,kHz(100)},
RIG_TS_END,
},
/* mode/filter list, .remember = order matters! */
.filters = {
/* mode/filter list, .remember = order matters! */
{RIG_MODE_AM, kHz(9)},
{RIG_MODE_FM, kHz(12)},
{RIG_MODE_WFM, kHz(230)},
RIG_FLT_END,
},
.priv = (void*)&ar2700_priv_caps,
.rig_init = NULL,
.rig_cleanup = NULL,
.rig_open = NULL,
.rig_close = aor_close,
.set_freq = aor_set_freq,
.get_freq = aor_get_freq,
.set_vfo = aor_set_vfo,
.get_vfo = aor_get_vfo,
.set_mode = aor_set_mode,
.get_mode = aor_get_mode,
.set_level = aor_set_level,
.get_level = aor_get_level,
.get_dcd = aor_get_dcd,
.set_ts = aor_set_ts,
.set_powerstat = aor_set_powerstat,
.vfo_op = aor_vfo_op,
.get_info = aor_get_info,
.set_mem = aor_set_mem,
.get_mem = aor_get_mem,
.set_bank = aor_set_bank,
.set_channel = aor_set_channel,
.get_channel = aor_get_channel,
.get_chan_all_cb = aor_get_chan_all_cb,
};
/*
* Function definitions below
*/
/*
* modes in use by the "MD" command of AR2700
*/
#define AR2700_WFM '0'
#define AR2700_NFM '1'
#define AR2700_AM '2'
int format2700_mode(RIG *rig, char *buf, rmode_t mode, pbwidth_t width)
{
int aormode;
switch (mode) {
case RIG_MODE_AM: aormode = AR2700_AM; break;
case RIG_MODE_WFM: aormode = AR2700_WFM; break;
case RIG_MODE_FM: aormode = AR2700_NFM; break;
default:
rig_debug(RIG_DEBUG_ERR,"%s: unsupported mode %d\n",
__FUNCTION__, mode);
return -RIG_EINVAL;
}
return sprintf(buf, "MD%c", aormode);
}
int parse2700_aor_mode(RIG *rig, char aormode, char aorwidth, rmode_t *mode, pbwidth_t *width)
{
switch (aormode) {
case AR2700_NFM: *mode = RIG_MODE_FM; break;
case AR2700_WFM: *mode = RIG_MODE_WFM; break;
case AR2700_AM: *mode = RIG_MODE_AM; break;
default:
rig_debug(RIG_DEBUG_ERR,"%s: unsupported mode '%c'\n",
__FUNCTION__, aormode);
return -RIG_EPROTO;
}
*width = rig_passband_normal(rig, *mode);
return RIG_OK;
}

203
aor/ar8600.c 100644
Wyświetl plik

@ -0,0 +1,203 @@
/*
* Hamlib AOR backend - AR8600 description
* Copyright (c) 2000-2005 by Stephane Fillod
*
* $Id: ar8600.c,v 1.1 2005-04-20 14:48:49 fillods Exp $
*
* 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
#include <stdlib.h>
#include <hamlib/rig.h>
#include "aor.h"
#define AR8600_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_WFM)
#define AR8600_FUNC (RIG_FUNC_TSQL|RIG_FUNC_ABM|RIG_FUNC_AFC)
#define AR8600_LEVEL (RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR)
#define AR8600_PARM (RIG_PARM_APO|RIG_PARM_BACKLIGHT|RIG_PARM_BEEP)
#define AR8600_VFO_OPS (RIG_OP_MCL|RIG_OP_UP|RIG_OP_DOWN|RIG_OP_LEFT|RIG_OP_RIGHT)
#define AR8600_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
/* TODO: measure and report real values */
#define AR8600_STR_CAL { 2, \
{ \
{ 0x00, -60 }, \
{ 0xff, 60 } \
} }
#define AR8600_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
.bank_num = 1, \
.tuning_step = 1, \
.channel_desc = 1, \
.flags = 1, \
.levels = RIG_LEVEL_ATT, \
.funcs = RIG_FUNC_ABM, \
}
static const struct aor_priv_caps ar8600_priv_caps = {
.format_mode = format8k_mode,
.parse_aor_mode = parse8k_aor_mode,
.bank_base1 = 'A',
.bank_base2 = 'a',
};
/*
* ar8600 rig capabilities.
* Notice that some rigs share the same functions.
* Also this struct is READONLY!
*
* part of info from http://www.aoruk.com/8600.htm
*/
const struct rig_caps ar8600_caps = {
.rig_model = RIG_MODEL_AR8600,
.model_name = "AR8600",
.mfg_name = "AOR",
.version = BACKEND_VER,
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_SCANNER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 4800,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 2,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_XONXOFF,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 200,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = AR8600_FUNC,
.has_get_level = AR8600_LEVEL,
.has_set_level = RIG_LEVEL_SET(AR8600_LEVEL),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.level_gran = {}, /* FIXME: granularity */
.parm_gran = {},
.ctcss_list = NULL, /* FIXME: CTCSS list */
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { 20, RIG_DBLST_END, }, /* TBC */
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.transceive = RIG_TRN_RIG,
.bank_qty = 20, /* A through J, and a trough j */
.chan_desc_sz = 12,
.vfo_ops = AR8600_VFO_OPS,
.str_cal = AR8600_STR_CAL,
.chan_list = {
{ 0, 999, RIG_MTYPE_MEM, AR8600_MEM_CAP }, /* flat space */
RIG_CHAN_END, },
.rx_range_list1 = {
{kHz(100),MHz(2040),AR8600_MODES,-1,-1,AR8600_VFO_ALL},
RIG_FRNG_END,
}, /* rx range */
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{kHz(100),MHz(2040),AR8600_MODES,-1,-1,AR8600_VFO_ALL},
RIG_FRNG_END,
}, /* rx range */
.tx_range_list2 = { RIG_FRNG_END, }, /* no tx range, this is a scanner! */
.tuning_steps = {
{AR8600_MODES,50},
{AR8600_MODES,100},
{AR8600_MODES,kHz(1)},
{AR8600_MODES,kHz(5)},
{AR8600_MODES,kHz(9)},
{AR8600_MODES,kHz(10)},
{AR8600_MODES,12500},
{AR8600_MODES,kHz(20)},
{AR8600_MODES,kHz(25)},
{AR8600_MODES,kHz(100)},
{AR8600_MODES,MHz(1)},
#if 0
{AR8600_MODES,0}, /* any tuning step */
#endif
RIG_TS_END,
},
/* mode/filter list, .remember = order matters! */
.filters = {
/* mode/filter list, .remember = order matters! */
{RIG_MODE_AM, kHz(9)},
{RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_AM, kHz(3)},
{RIG_MODE_FM|RIG_MODE_AM, kHz(12)},
{RIG_MODE_FM, kHz(9)},
{RIG_MODE_WFM, kHz(230)}, /* 150kHz at -3dB, 380kHz at -20dB */
RIG_FLT_END,
},
.priv = (void*)&ar8600_priv_caps,
.rig_init = NULL,
.rig_cleanup = NULL,
.rig_open = NULL,
.rig_close = aor_close,
.set_freq = aor_set_freq,
.get_freq = aor_get_freq,
.set_vfo = aor_set_vfo,
.get_vfo = aor_get_vfo,
.set_mode = aor_set_mode,
.get_mode = aor_get_mode,
.set_level = aor_set_level,
.get_level = aor_get_level,
.get_dcd = aor_get_dcd,
.set_ts = aor_set_ts,
.set_powerstat = aor_set_powerstat,
.vfo_op = aor_vfo_op,
.get_info = aor_get_info,
.set_mem = aor_set_mem,
.get_mem = aor_get_mem,
.set_bank = aor_set_bank,
.set_channel = aor_set_channel,
.get_channel = aor_get_channel,
.get_chan_all_cb = aor_get_chan_all_cb,
};
/*
* Function definitions below
*/