kopia lustrzana https://github.com/Hamlib/Hamlib
added Kenwood TRC-80
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2604 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.9
rodzic
acd43cecd2
commit
faf5c7e336
|
@ -3,7 +3,7 @@
|
|||
* Copyright (c) 2000-2003 by Frank Singleton
|
||||
* Copyright (c) 2000-2009 by Stephane Fillod
|
||||
*
|
||||
* $Id: riglist.h,v 1.75 2009-01-11 13:16:54 fillods Exp $
|
||||
* $Id: riglist.h,v 1.76 2009-01-29 22:54:40 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
|
||||
|
@ -127,6 +127,7 @@
|
|||
#define RIG_MODEL_TMV7 RIG_MAKE_MODEL(RIG_KENWOOD, 27)
|
||||
#define RIG_MODEL_TS480 RIG_MAKE_MODEL(RIG_KENWOOD, 28)
|
||||
#define RIG_MODEL_K3 RIG_MAKE_MODEL(RIG_KENWOOD, 29)
|
||||
#define RIG_MODEL_TRC80 RIG_MAKE_MODEL(RIG_KENWOOD, 30)
|
||||
|
||||
/*
|
||||
* Icom
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
TSSRCLIST = ts850.c ts870s.c ts570.c ts450s.c ts950.c ts50s.c \
|
||||
ts790.c ts2000.c k2.c k3.c ts930.c \
|
||||
ts680.c ts690.c ts140.c ts480.c
|
||||
ts680.c ts690.c ts140.c ts480.c trc80.c
|
||||
|
||||
IC10SRCLIST = ts440.c ts940.c ts711.c ts811.c r5000.c
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* Hamlib Kenwood backend - main file
|
||||
* Copyright (c) 2000-2005 by Stephane Fillod and others
|
||||
* Copyright (c) 2000-2009 by Stephane Fillod
|
||||
* Copyright (C) 2009 Alessandro Zummo <a.zummo@towertech.it>
|
||||
*
|
||||
* $Id: kenwood.c,v 1.100 2009-01-29 08:41:57 azummo Exp $
|
||||
* $Id: kenwood.c,v 1.101 2009-01-29 22:54:40 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
|
||||
|
@ -70,6 +70,7 @@ static const struct kenwood_id kenwood_id_list[] = {
|
|||
{ RIG_MODEL_TS450S, 10 },
|
||||
{ RIG_MODEL_TS690S, 11 },
|
||||
{ RIG_MODEL_TS870S, 15 },
|
||||
{ RIG_MODEL_TRC80, 16 },
|
||||
{ RIG_MODEL_TS570D, 17 }, /* Elecraft K2 also returns 17 */
|
||||
{ RIG_MODEL_TS570S, 18 },
|
||||
{ RIG_MODEL_TS2000, 19 },
|
||||
|
@ -200,10 +201,15 @@ transaction_write:
|
|||
retval = -RIG_ENAVAIL;
|
||||
goto transaction_quit;
|
||||
case 'O':
|
||||
/* Too many characters send without a carriage return */
|
||||
/* Too many characters sent without a carriage return */
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Overflow for '%s'\n", __FUNCTION__, cmdstr);
|
||||
retval = -RIG_EPROTO;
|
||||
goto transaction_quit;
|
||||
case 'E':
|
||||
/* Communication error */
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Communication error for '%s'\n", __FUNCTION__, cmdstr);
|
||||
retval = -RIG_EIO;
|
||||
goto transaction_quit;
|
||||
case '?':
|
||||
/* Command not understood by rig */
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unknown command '%s'\n", __FUNCTION__, cmdstr);
|
||||
|
@ -335,8 +341,10 @@ static int kenwood_get_if(RIG *rig)
|
|||
{
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
||||
char cmdbuf[4] = "IF;";
|
||||
|
||||
return kenwood_safe_transaction (rig, "IF", priv->info,
|
||||
cmdbuf[2] = caps->cmdtrm;
|
||||
return kenwood_safe_transaction (rig, cmdbuf, priv->info,
|
||||
KENWOOD_MAX_IF_LEN, caps->if_len);
|
||||
}
|
||||
|
||||
|
@ -434,6 +442,36 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, vfo_t *txvfo)
|
||||
{
|
||||
int retval;
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
|
||||
retval = kenwood_get_if(rig);
|
||||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
switch (priv->info[32]) {
|
||||
case '0':
|
||||
*split = RIG_SPLIT_OFF;
|
||||
break;
|
||||
|
||||
case '1':
|
||||
*split = RIG_SPLIT_ON;
|
||||
break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unsupported split %c\n",
|
||||
__func__, priv->info[32]);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
/* TODO: find where is the txvfo.. */
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* kenwood_get_vfo_if using byte 31 of the IF information field
|
||||
* Assumes rig!=NULL, !vfo
|
||||
|
@ -495,14 +533,30 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
return kenwood_simple_transaction(rig, freqbuf, 0);
|
||||
}
|
||||
|
||||
int kenwood_get_freq_if(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
|
||||
char freqbuf[50];
|
||||
int retval;
|
||||
|
||||
retval = kenwood_get_if(rig);
|
||||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
memcpy(freqbuf, priv->info, 15);
|
||||
freqbuf[14] = '\0';
|
||||
sscanf(freqbuf + 2, "%"SCNfreq, freq);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* kenwood_get_freq
|
||||
* Assumes rig!=NULL, freq!=NULL
|
||||
*/
|
||||
int kenwood_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
|
||||
char freqbuf[50];
|
||||
char cmdbuf[4];
|
||||
int retval;
|
||||
|
@ -514,15 +568,7 @@ int kenwood_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
/* memory frequency cannot be read with an Fx command, use IF */
|
||||
if (tvfo == RIG_VFO_MEM) {
|
||||
|
||||
retval = kenwood_get_if(rig);
|
||||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
memcpy(freqbuf, priv->info, 15);
|
||||
freqbuf[14] = '\0';
|
||||
sscanf(freqbuf + 2, "%"SCNfreq, freq);
|
||||
|
||||
return RIG_OK;
|
||||
return kenwood_get_freq_if(rig, vfo, freq);
|
||||
}
|
||||
|
||||
switch (tvfo) {
|
||||
|
@ -1215,7 +1261,7 @@ int kenwood_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
|||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
*dcd = (busybuf[2] == 0x01) ? RIG_DCD_ON : RIG_DCD_OFF;
|
||||
*dcd = (busybuf[2] == '1') ? RIG_DCD_ON : RIG_DCD_OFF;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -1464,7 +1510,7 @@ int kenwood_get_channel(RIG *rig, channel_t *chan)
|
|||
/* parse from right to left */
|
||||
/* XXX filter cannot be read there. strange. maybe another command? */
|
||||
|
||||
if (buf[19] == '0')
|
||||
if (buf[19] == '0' || buf[19] == ' ')
|
||||
chan->ctcss_tone = 0;
|
||||
else {
|
||||
buf[22]='\0';
|
||||
|
@ -1672,6 +1718,7 @@ DECLARE_INITRIG_BACKEND(kenwood)
|
|||
rig_register(&ts870s_caps);
|
||||
rig_register(&ts930_caps);
|
||||
rig_register(&ts2000_caps);
|
||||
rig_register(&trc80_caps);
|
||||
rig_register(&k2_caps);
|
||||
rig_register(&k3_caps);
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* Hamlib Kenwood backend - main header
|
||||
* Copyright (c) 2000-2008 by Stephane Fillod
|
||||
* Copyright (c) 2000-2009 by Stephane Fillod
|
||||
*
|
||||
* $Id: kenwood.h,v 1.45 2009-01-23 03:24:42 n0nb Exp $
|
||||
* $Id: kenwood.h,v 1.46 2009-01-29 22:54:40 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
|
||||
|
@ -72,9 +72,11 @@ int kenwood_cleanup(RIG *rig);
|
|||
int kenwood_set_vfo(RIG *rig, vfo_t vfo);
|
||||
int kenwood_get_vfo_if(RIG *rig, vfo_t *vfo);
|
||||
int kenwood_set_split_vfo(RIG *rig, vfo_t vfo , split_t split, vfo_t txvfo);
|
||||
int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, vfo_t *txvfo);
|
||||
|
||||
int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
int kenwood_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
int kenwood_get_freq_if(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
int kenwood_set_rit(RIG * rig, vfo_t vfo, shortfreq_t rit);
|
||||
int kenwood_get_rit(RIG *rig, vfo_t vfo, shortfreq_t * rit);
|
||||
int kenwood_set_xit(RIG * rig, vfo_t vfo, shortfreq_t rit);
|
||||
|
@ -126,6 +128,7 @@ extern const struct rig_caps ts930_caps;
|
|||
extern const struct rig_caps ts2000_caps;
|
||||
extern const struct rig_caps k2_caps;
|
||||
extern const struct rig_caps k3_caps;
|
||||
extern const struct rig_caps trc80_caps;
|
||||
|
||||
extern const struct rig_caps thd7a_caps;
|
||||
extern const struct rig_caps tmd700_caps;
|
||||
|
|
|
@ -0,0 +1,183 @@
|
|||
/*
|
||||
* Hamlib Kenwood backend - TRC-80 description
|
||||
* Copyright (c) 2000-2009 by Stephane Fillod
|
||||
*
|
||||
* $Id: trc80.c,v 1.1 2009-01-29 22:54:40 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 "bandplan.h"
|
||||
#include "kenwood.h"
|
||||
|
||||
|
||||
#define TRC80_ALL_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_AM|RIG_MODE_RTTY)
|
||||
#define TRC80_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY)
|
||||
#define TRC80_AM_TX_MODES RIG_MODE_AM
|
||||
|
||||
/* TODO: make sure they are implemented by kenwood generic backend, and compatible */
|
||||
#define TRC80_FUNC_ALL (RIG_FUNC_TUNER|RIG_FUNC_AIP|\
|
||||
RIG_FUNC_TONE|RIG_FUNC_AIP|RIG_FUNC_NB|RIG_FUNC_VOX)
|
||||
|
||||
#define TRC80_LEVEL_ALL (RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_MICGAIN|\
|
||||
RIG_LEVEL_RFPOWER|RIG_LEVEL_CWPITCH|RIG_LEVEL_BKIN_DLYMS|\
|
||||
RIG_LEVEL_SQL|RIG_LEVEL_VOX)
|
||||
|
||||
#define TRC80_PARMS (RIG_PARM_NONE)
|
||||
|
||||
#define TRC80_VFO_OPS (RIG_OP_NONE)
|
||||
#define TRC80_SCAN_OPS (RIG_SCAN_VFO)
|
||||
|
||||
#define TRC80_VFO (RIG_VFO_MEM)
|
||||
#define TRC80_ANTS (0)
|
||||
|
||||
#define TRC80_CHANNEL_CAPS { \
|
||||
.freq=1,\
|
||||
.mode=1,\
|
||||
.tx_freq=1,\
|
||||
.tx_mode=1,\
|
||||
.split=1,\
|
||||
.flags=RIG_CHFLAG_SKIP \
|
||||
}
|
||||
|
||||
static struct kenwood_priv_caps trc80_priv_caps = {
|
||||
.cmdtrm = EOM_KEN,
|
||||
};
|
||||
|
||||
/*
|
||||
* TRC-80/TK-80 rig capabilities.
|
||||
*/
|
||||
const struct rig_caps trc80_caps = {
|
||||
.rig_model = RIG_MODEL_TRC80,
|
||||
.model_name = "TRC-80",
|
||||
.mfg_name = "Kenwood",
|
||||
.version = BACKEND_VER,
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_ALPHA,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
.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,
|
||||
.serial_handshake = RIG_HANDSHAKE_HARDWARE,
|
||||
.write_delay = 0,
|
||||
.post_write_delay = 100,
|
||||
.timeout = 1000,
|
||||
.retry = 3,
|
||||
|
||||
.has_get_func = TRC80_FUNC_ALL,
|
||||
.has_set_func = TRC80_FUNC_ALL,
|
||||
.has_get_level = TRC80_LEVEL_ALL,
|
||||
.has_set_level = RIG_LEVEL_SET(TRC80_LEVEL_ALL),
|
||||
.has_get_parm = TRC80_PARMS,
|
||||
.has_set_parm = RIG_LEVEL_SET(TRC80_PARMS), /* FIXME: parms */
|
||||
.level_gran = {}, /* FIXME: granularity */
|
||||
.parm_gran = {},
|
||||
.preamp = { RIG_DBLST_END, },
|
||||
.attenuator = { RIG_DBLST_END, },
|
||||
.max_rit = kHz(1.1),
|
||||
.max_xit = 0,
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ,
|
||||
.transceive = RIG_TRN_RIG,
|
||||
.bank_qty = 0,
|
||||
.chan_desc_sz = 0,
|
||||
.vfo_ops = TRC80_VFO_OPS,
|
||||
.scan_ops = TRC80_SCAN_OPS,
|
||||
|
||||
.chan_list = {
|
||||
{ 1, 80, RIG_MTYPE_MEM, TRC80_CHANNEL_CAPS },
|
||||
RIG_CHAN_END,
|
||||
},
|
||||
|
||||
.rx_range_list1 = {
|
||||
{kHz(500),MHz(30),TRC80_ALL_MODES,-1,-1,TRC80_VFO},
|
||||
RIG_FRNG_END,
|
||||
}, /* rx range */
|
||||
|
||||
.tx_range_list1 = {
|
||||
{MHz(1.8),MHz(30),TRC80_OTHER_TX_MODES,W(15),W(100),TRC80_VFO,TRC80_ANTS},
|
||||
{MHz(1.8),MHz(30),TRC80_AM_TX_MODES,W(5),W(25),TRC80_VFO,TRC80_ANTS}, /* AM class */
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.rx_range_list2 = {
|
||||
{kHz(500),MHz(30),TRC80_ALL_MODES,-1,-1,TRC80_VFO},
|
||||
RIG_FRNG_END,
|
||||
}, /* rx range */
|
||||
.tx_range_list2 = {
|
||||
{MHz(1.8),MHz(30),TRC80_OTHER_TX_MODES,W(15),W(100),TRC80_VFO,TRC80_ANTS},
|
||||
{MHz(1.8),MHz(30),TRC80_AM_TX_MODES,W(5),W(25),TRC80_VFO,TRC80_ANTS}, /* AM class */
|
||||
RIG_FRNG_END,
|
||||
}, /* tx range */
|
||||
|
||||
.tuning_steps = { /* FIXME: TBC */
|
||||
{TRC80_ALL_MODES,1},
|
||||
{TRC80_ALL_MODES,10},
|
||||
RIG_TS_END,
|
||||
},
|
||||
/* mode/filter list, remember: order matters! */
|
||||
.filters = {
|
||||
{RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_RTTY, kHz(2.2)},
|
||||
{RIG_MODE_AM, kHz(5)},
|
||||
RIG_FLT_END,
|
||||
},
|
||||
.priv = (void *)&trc80_priv_caps,
|
||||
|
||||
.rig_init = kenwood_init,
|
||||
.rig_cleanup = kenwood_cleanup,
|
||||
|
||||
#if 0
|
||||
.set_freq = kenwood_set_freq,
|
||||
#endif
|
||||
.get_freq = kenwood_get_freq_if,
|
||||
.get_split_vfo = kenwood_get_split_vfo_if,
|
||||
.set_rit = kenwood_set_rit,
|
||||
.get_rit = kenwood_get_rit,
|
||||
.set_mode = kenwood_set_mode,
|
||||
.get_mode = kenwood_get_mode,
|
||||
.get_ptt = kenwood_get_ptt,
|
||||
.set_ptt = kenwood_set_ptt,
|
||||
.get_dcd = kenwood_get_dcd,
|
||||
.set_func = kenwood_set_func,
|
||||
.get_func = kenwood_get_func,
|
||||
.set_level = kenwood_set_level,
|
||||
.get_level = kenwood_get_level,
|
||||
.set_mem = kenwood_set_mem,
|
||||
.get_mem = kenwood_get_mem,
|
||||
.get_channel = kenwood_get_channel,
|
||||
.scan = kenwood_scan,
|
||||
.set_powerstat = kenwood_set_powerstat,
|
||||
.get_powerstat = kenwood_get_powerstat,
|
||||
.get_info = kenwood_get_info,
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* Function definitions below
|
||||
*/
|
||||
|
Ładowanie…
Reference in New Issue