Directory migration to new layout

pull/178/head
Michael Black 2020-01-17 09:22:44 -06:00
rodzic 347e351ea6
commit 8d6e2fc781
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6599353EC683404D
549 zmienionych plików z 144 dodań i 28691 usunięć

Wyświetl plik

@ -14,19 +14,17 @@ doc_DATA = ChangeLog COPYING COPYING.LIB LICENSE \
SUBDIRS = macros include lib \
$(BACKEND_LIST) \
$(RIG_BACKEND_LIST) \
$(ROT_BACKEND_LIST) \
$(AMP_BACKEND_LIST) \
src \
$(BINDINGS) \
tests doc
## Static list of distributed directories. $(BACKEND_LIST) is dynamically
## assigned by 'configure' so list rig backends statically.
DIST_SUBDIRS = macros include lib src c++ bindings tests doc android scripts\
adat alinco aor barrett drake dorji dummy elad flexradio icom icmarine jrc\
kachina kenwood kit lowe pcr prm80 racal rft rs skanti tapr tentec\
tuner uniden wj yaesu winradio\
$(ROT_BACKEND_LIST) $(AMP_BACKEND_LIST)
## Static list of distributed directories.
DIST_SUBDIRS = macros include lib src dummy c++ bindings tests doc android\
scripts \
$(BACKEND_LIST) $(RIG_BACKEND_LIST) $(ROT_BACKEND_LIST) $(AMP_BACKEND_LIST)
# Install any third party macros into our tree for distribution
ACLOCAL_AMFLAGS = -I macros --install

Wyświetl plik

@ -38,75 +38,89 @@ utility), and USB. Other connectivity will follow afterwards.
General Guidelines.
-------------------
0. The top level directory looks like this as of 07 May 2013
(Note, it has grown considerably).
0. The top level directory looks like this as of 2020-01-163
$ tree -d -I .git
.
├── adat
├── alinco
├── amsat
├── amplifiers
│   └── elecraft
├── android
├── aor
├── ars
├── autom4te.cache
├── bindings
├── build-aux
├── c++
├── celestron
├── doc
├── drake
│   ├── man1
│   └── man7
├── dummy
├── easycomm
├── flexradio
├── fodtrack
├── gnuradio
├── gs232a
├── heathkit
├── icom
├── extra
│   ├── gnuradio
│   └── kylix
│   └── tests
├── include
│ └── hamlib
├── jrc
├── kachina
├── kenwood
├── kit
├── kylix
│ └── tests
│   └── hamlib
├── lib
├── lowe
├── m2
├── macros
├── microtune
├── miniVNA
├── pcr
├── perl
├── prm80
├── racal
├── rft
├── rotorez
├── rs
├── sartek
├── rigs
│   ├── adat
│   ├── alinco
│   ├── aor
│   ├── barrett
│   ├── dorji
│   ├── drake
│   ├── elad
│   ├── flexradio
│   ├── icmarine
│   ├── icom
│   ├── jrc
│   ├── kachina
│   ├── kenwood
│   ├── kit
│   ├── lowe
│   ├── pcr
│   ├── prm80
│   ├── racal
│   ├── rft
│   ├── rs
│   ├── skanti
│   ├── tapr
│   ├── tentec
│   ├── tuner
│   ├── uniden
│   ├── winradio
│   │   └── linradio
│   ├── wj
│   └── yaesu
├── rotators
│   ├── amsat
│   ├── ars
│   ├── celestron
│   ├── cnctrk
│   ├── easycomm
│   ├── ether6
│   ├── fodtrack
│   ├── gs232a
│   ├── heathkit
│   ├── ioptron
│   ├── m2
│   ├── meade
│   ├── prosistel
│   ├── rotorez
│   ├── sartek
│   ├── spid
│   └── ts7400
│   └── include
├── scripts
├── skanti
├── spid
├── src
├── tapr
├── tentec
├── tests
│ ├── config
│ ├── rigctl.test
│ ├── testbcd.test
│ ├── testfreq.test
│ └── testloc.test
├── ts7400
│ └── include
├── tuner
├── uniden
├── winradio
│ └── linradio
├── wj
└── yaesu
61 directories
└── tests
├── config
├── rigctl.test
├── testbcd.test
├── testfreq.test
└── testloc.test
77 directories
1. Building

Wyświetl plik

@ -51,8 +51,9 @@ dnl added to AC_CONFIG_FILES near the end of this file. See README.developer
dnl Beware of duplication should a backend directory include both rig and
dnl rotor definitions, e.g. "dummy". Optional backends will not be listed
dnl here but will be added later, e.g. "winradio".
BACKEND_LIST="adat alinco aor barrett dorji drake dummy elad flexradio icom icmarine jrc kachina kenwood kit lowe pcr prm80 racal rft rs skanti tapr tentec tuner uniden wj yaesu"
ROT_BACKEND_LIST="amsat ars celestron cnctrk easycomm ether6 fodtrack gs232a heathkit m2 meade rotorez sartek spid ts7400 prosistel ioptron"
BACKEND_LIST="dummy"
RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/dorji rigs/drake rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/wj rigs/yaesu"
ROT_BACKEND_LIST="rotators/amsat rotators/ars rotators/celestron rotators/cnctrk rotators/easycomm rotators/ether6 rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron"
# Amplifiers are all in the amplifiers directory
AMP_BACKEND_LIST="amplifiers/elecraft"
@ -653,7 +654,7 @@ AC_MSG_RESULT([$cf_with_winradio])
DL_LIBS=""
AS_IF([test x"${cf_with_winradio}" = "xyes"],
[BACKEND_LIST="$BACKEND_LIST winradio"
[RIGS_BACKEND_LIST="$RIGS_BACKEND_LIST rigs/winradio"
dnl Check for libdl and set DL_LIBS if found--used for linradio WR-G313 backend.
AC_CHECK_LIB([dl], [dlopen], [DL_LIBS="-ldl"],
[AC_MSG_WARN([dlopen was not found in libdl--linradio backend will be disabled])])
@ -704,6 +705,10 @@ AM_CONDITIONAL([HAVE_USRP], [test x"${cf_with_usrp}" = "xyes"])
dnl otherwise parallel 'make -jn' will fail
## ---------------------------------- ##
## Prepare toplevel backend dependencies ##
## ---------------------------------- ##
for be in ${BACKEND_LIST} ; do
BACKENDEPS="${BACKENDEPS} \$(top_builddir)/${be}/libhamlib-${be}.la"
done
@ -711,6 +716,18 @@ done
AC_SUBST([BACKEND_LIST])
AC_SUBST([BACKENDEPS])
## ---------------------------------- ##
## Prepare rig backend dependencies ##
## ---------------------------------- ##
for be in ${RIG_BACKEND_LIST} ; do
RIGDIR=`echo $be | awk -F "/" '{print $2}'`
RIG_BACKENDEPS="${RIG_BACKENDEPS} \$(top_builddir)/rigs/${RIGDIR}/libhamlib-${RIGDIR}.la"
done
AC_SUBST([RIG_BACKEND_LIST])
AC_SUBST([RIG_BACKENDEPS])
## ---------------------------------- ##
## Prepare rotor backend dependencies ##
@ -719,7 +736,8 @@ AC_SUBST([BACKENDEPS])
# otherwise parallel 'make -jn' will fail
for be in ${ROT_BACKEND_LIST} ; do
ROT_BACKENDEPS="${ROT_BACKENDEPS} \$(top_builddir)/${be}/libhamlib-${be}.la"
ROTDIR=`echo $be | awk -F "/" '{print $2}'`
ROT_BACKENDEPS="${ROT_BACKENDEPS} \$(top_builddir)/rotators/${ROTDIR}/libhamlib-${ROTDIR}.la"
done
AC_SUBST([ROT_BACKEND_LIST])
@ -756,59 +774,59 @@ macros/Makefile
include/Makefile
lib/Makefile
dummy/Makefile
elad/Makefile
yaesu/Makefile
icom/Makefile
icmarine/Makefile
aor/Makefile
kenwood/Makefile
winradio/Makefile
pcr/Makefile
alinco/Makefile
uniden/Makefile
tentec/Makefile
kachina/Makefile
jrc/Makefile
drake/Makefile
lowe/Makefile
rft/Makefile
rs/Makefile
kit/Makefile
tapr/Makefile
skanti/Makefile
prm80/Makefile
wj/Makefile
racal/Makefile
tuner/Makefile
ars/Makefile
easycomm/Makefile
fodtrack/Makefile
gs232a/Makefile
heathkit/Makefile
spid/Makefile
sartek/Makefile
src/Makefile
c++/Makefile
bindings/Makefile
tests/Makefile
doc/Makefile
doc/hamlib.cfg
rotorez/Makefile
flexradio/Makefile
m2/Makefile
amsat/Makefile
adat/Makefile
ts7400/Makefile
celestron/Makefile
cnctrk/Makefile
ether6/Makefile
rotators/amsat/Makefile
rotators/ars/Makefile
rotators/celestron/Makefile
rotators/cnctrk/Makefile
rotators/easycomm/Makefile
rotators/ether6/Makefile
rotators/fodtrack/Makefile
rotators/gs232a/Makefile
rotators/heathkit/Makefile
rotators/ioptron/Makefile
rotators/m2/Makefile
rotators/meade/Makefile
rotators/prosistel/Makefile
rotators/rotorez/Makefile
rotators/sartek/Makefile
rotators/spid/Makefile
rotators/ts7400/Makefile
rigs/adat/Makefile
rigs/alinco/Makefile
rigs/aor/Makefile
rigs/barrett/Makefile
rigs/dorji/Makefile
rigs/drake/Makefile
rigs/elad/Makefile
rigs/flexradio/Makefile
rigs/icmarine/Makefile
rigs/icom/Makefile
rigs/jrc/Makefile
rigs/kachina/Makefile
rigs/kenwood/Makefile
rigs/kit/Makefile
rigs/lowe/Makefile
rigs/pcr/Makefile
rigs/prm80/Makefile
rigs/racal/Makefile
rigs/rft/Makefile
rigs/rs/Makefile
rigs/skanti/Makefile
rigs/tapr/Makefile
rigs/tentec/Makefile
rigs/tuner/Makefile
rigs/uniden/Makefile
rigs/winradio/Makefile
rigs/wj/Makefile
rigs/yaesu/Makefile
tests/Makefile
scripts/Makefile
android/Makefile
prosistel/Makefile
dorji/Makefile
barrett/Makefile
meade/Makefile
ioptron/Makefile
amplifiers/elecraft/Makefile
hamlib.pc
])

Wyświetl plik

@ -6,6 +6,6 @@ echo "As of cppcheck v1.90 should be one message about missing include files"
echo "This takes several minutes to run"
# We do suppress some errors which are expected or other code
# There are quite a few C++ items to take care of still if anybody cares
SUPPRESS="-i bindings -i lib/getopt.c -i lib/getopt_long.c --suppress=*:gnuradio/demod.h --suppress=*:gnuradio/HrAGC.h --suppress=*:gnuradio/nfm.h --suppress=*:gnuradio/am.h --suppress=*:gnuradio/ssb.h --suppress=*:gnuradio/wfm.h --suppress=*:gnuradio/wfm.h --suppress=*:microtune/i2c.h --suppress=*:microtune/i2cio.h --suppress=*:microtune/i2cio_pp.h --suppress=*:microtune/microtune_4702.h --suppress=*:microtune/microtune_4937.h --suppress=*:microtune/microtune_eval_board.h -i microtune/microtune_eval_board.cc --suppress=*:gnuradio/HrAGC.h --suppress=knownConditionTrueFalse:tests/rotctl.c --suppress=knownConditionTrueFalse:tests/rigctl.c --suppress=knownConditionTrueFalse:tests/ampctl.c --suppress=knownConditionTrueFalse:tests/rotctl_parse.c --suppress=knownConditionTrueFalse:tests/rigctl_parse.c --suppress=knownConditionTrueFalse:tests/ampctl_parse.c"
SUPPRESS="-i bindings -i lib/getopt.c -i lib/getopt_long.c --suppress=*:extra/gnuradio/demod.h --suppress=*:extra/gnuradio/HrAGC.h --suppress=*:extra/gnuradio/nfm.h --suppress=*:extra/gnuradio/am.h --suppress=*:extra/gnuradio/ssb.h --suppress=*:extra/gnuradio/wfm.h --suppress=*:extra/gnuradio/wfm.h --suppress=*:extra/gnuradio/HrAGC.h --suppress=knownConditionTrueFalse:tests/rotctl.c --suppress=knownConditionTrueFalse:tests/rigctl.c --suppress=knownConditionTrueFalse:tests/ampctl.c --suppress=knownConditionTrueFalse:tests/rotctl_parse.c --suppress=knownConditionTrueFalse:tests/rigctl_parse.c --suppress=knownConditionTrueFalse:tests/ampctl_parse.c"
CHECK="-D RIG_LEVEL_LINEOUT=1 -D SIGPIPE -D SIGINT -D IPV6_V6ONLY -D RIG_MODE_WFM -D ABI_VERSION=4 -D F_SETSIG=1 -U O_ASYNC -U SA_SIGINFO -U HASH_BLOOM -U HASH_EMIT_KEYS -U HASH_FUNCTION -U __USEP5P6__"
cppcheck -q --force --enable=all --std=c99 $SUPPRESS $CHECK . &>cppcheck.log

Wyświetl plik

@ -1,168 +0,0 @@
/*
* Hamlib CI-V backend - description of the TenTenc DeltaII
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Delta II (aka TT 536) cloned after Omni VI.
* Needs RS-232 Serial Level Converter Model 305 or equivalent.
*
* For changing CI-V address of the rig, see:
* http://www.tentecwiki.org/doku.php?id=536addr
*/
/* Known problems:
*
* To Do: get the datasheet, and testing on real hardware!!
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "misc.h"
#define DELTAII_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define DELTAII_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define DELTAII_ALL_RX_MODES (DELTAII_OTHER_TX_MODES|RIG_MODE_AM)
#define DELTAII_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
#define DELTAII_STR_CAL { 0, { } }
static const struct icom_priv_caps delta2_priv_caps =
{
0x01, /* default address */
1, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list /* TODO: ts_sc_list */
};
const struct rig_caps delta2_caps =
{
.rig_model = RIG_MODEL_DELTAII,
.model_name = "Delta II",
.mfg_name = "Ten-Tec",
.version = "0.1",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 1200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = DELTAII_VFO_OPS,
.scan_ops = RIG_SCAN_NONE,
.str_cal = DELTAII_STR_CAL,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
/* TODO: 32 simplex, 16 duplex */
{ 0, 47, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
/* These limits measured on Omni VI SN 1A10473 */
.rx_range_list2 = {
{kHz(100), kHz(29999), DELTAII_ALL_RX_MODES, -1, -1, DELTAII_VFO_ALL},
RIG_FRNG_END,
},
/* Note: There is no AM mode. */
.tx_range_list2 = {
{kHz(1800), MHz(2) - 1, DELTAII_OTHER_TX_MODES, 5000, 100000, DELTAII_VFO_ALL},
{kHz(3500), MHz(4) - 1, DELTAII_OTHER_TX_MODES, 5000, 100000, DELTAII_VFO_ALL},
{MHz(7), kHz(7300), DELTAII_OTHER_TX_MODES, 5000, 100000, DELTAII_VFO_ALL},
{kHz(10100), kHz(10150), DELTAII_OTHER_TX_MODES, 5000, 100000, DELTAII_VFO_ALL},
{MHz(14), kHz(14350), DELTAII_OTHER_TX_MODES, 5000, 100000, DELTAII_VFO_ALL},
{kHz(18068), kHz(18168), DELTAII_OTHER_TX_MODES, 5000, 100000, DELTAII_VFO_ALL},
{MHz(21), kHz(21450), DELTAII_OTHER_TX_MODES, 5000, 100000, DELTAII_VFO_ALL},
{kHz(24890), kHz(24990), DELTAII_OTHER_TX_MODES, 5000, 100000, DELTAII_VFO_ALL},
{MHz(28), kHz(29700), DELTAII_OTHER_TX_MODES, 5000, 100000, DELTAII_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{DELTAII_ALL_RX_MODES, Hz(10)}, // This radio has 10 Hz steps.
RIG_TS_END,
},
/* mode/filter list, remember: order matters!
*/
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.4)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& delta2_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo, // icom.c has no get_vfo
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,606 +0,0 @@
/*
* Hamlib CI-V backend - low level communication routines
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <unistd.h> /* UNIX standard function definitions */
#include "hamlib/rig.h"
#include "serial.h"
#include "misc.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
/*
* Build a CI-V frame.
* The whole frame is placed in frame[],
* "re_id" is the transceiver's CI-V address,
* "cmd" is the Command number,
* "subcmd" is the Sub command number, set to -1 if not present in frame,
* if the frame has no data, then the "data" pointer must be NULL,
* and data_len==0.
* "data_len" holds the Data area length pointed by the "data" pointer.
* REM: if "data" is NULL, then "data_len" MUST be 0.
*
* NB: the frame array must be big enough to hold the frame.
* The smallest frame is 6 bytes, the biggest is at least 13 bytes.
*/
int make_cmd_frame(char frame[], char re_id, char ctrl_id, char cmd, int subcmd,
const unsigned char *data, int data_len)
{
int i = 0;
#if 0
frame[i++] = PAD; /* give old rigs a chance to flush their rx buffers */
#endif
frame[i++] = PR; /* Preamble code */
frame[i++] = PR;
frame[i++] = re_id;
frame[i++] = ctrl_id;
frame[i++] = cmd;
if (subcmd != -1)
{
#ifdef MULTIB_SUBCMD
register int j;
if ((j = subcmd & 0xff0000)) /* allows multi-byte subcmd for dsp rigs */
{
frame[i++] = j >> 16;
frame[i++] = (subcmd & 0xff00) >> 8;
}
else if ((j = subcmd & 0xff00)) { frame[i++] = j >> 8; }
#endif
frame[i++] = subcmd & 0xff;
}
if (data_len != 0)
{
memcpy(frame + i, data, data_len);
i += data_len;
}
frame[i++] = FI; /* EOM code */
return i;
}
/*
* icom_one_transaction
*
* We assume that rig!=NULL, rig->state!= NULL, payload!=NULL, data!=NULL, data_len!=NULL
* Otherwise, you'll get a nice seg fault. You've been warned!
* payload can be NULL if payload_len == 0
* subcmd can be equal to -1 (no subcmd wanted)
* if no answer is to be expected, data_len must be set to NULL to tell so
*
* return RIG_OK if transaction completed,
* or a negative value otherwise indicating the error.
*/
int icom_one_transaction(RIG *rig, int cmd, int subcmd,
const unsigned char *payload, int payload_len, unsigned char *data,
int *data_len)
{
struct icom_priv_data *priv;
const struct icom_priv_caps *priv_caps;
struct rig_state *rs;
// this buf needs to be large enough for 0xfe strings for power up
// at 115,200 this is now at least 150
unsigned char buf[200];
unsigned char sendbuf[MAXFRAMELEN];
int frm_len, retval;
int ctrl_id;
rs = &rig->state;
priv = (struct icom_priv_data *)rs->priv;
priv_caps = (struct icom_priv_caps *)rig->caps->priv;
ctrl_id = priv_caps->serial_full_duplex == 0 ? CTRLID : 0x80;
frm_len = make_cmd_frame((char *) sendbuf, priv->re_civ_addr, ctrl_id, cmd,
subcmd, payload, payload_len);
/*
* should check return code and that write wrote cmd_len chars!
*/
Hold_Decode(rig);
serial_flush(&rs->rigport);
retval = write_block(&rs->rigport, (char *) sendbuf, frm_len);
if (retval != RIG_OK)
{
Unhold_Decode(rig);
return retval;
}
if (!priv_caps->serial_full_duplex && !priv->serial_USB_echo_off)
{
/*
* read what we just sent, because TX and RX are looped,
* and discard it...
* - if what we read is not what we sent, then it means
* a collision on the CI-V bus occured!
* - if we get a timeout, then retry to send the frame,
* up to rs->retry times.
*/
retval = read_icom_frame(&rs->rigport, buf, sizeof(buf));
if (retval == -RIG_ETIMEOUT || retval == 0)
{
/* Nothing recieved, CI-V interface is not echoing */
Unhold_Decode(rig);
return -RIG_BUSERROR;
}
if (retval < 0)
{
/* Other error, return it */
Unhold_Decode(rig);
return retval;
}
if (retval < 1)
{
return -RIG_EPROTO;
}
switch (buf[retval - 1])
{
case COL:
/* Collision */
Unhold_Decode(rig);
return -RIG_BUSBUSY;
case FI:
/* Ok, normal frame */
break;
default:
/* Timeout after reading at least one character */
/* Problem on ci-v bus? */
Unhold_Decode(rig);
return -RIG_BUSERROR;
}
if (retval != frm_len)
{
/* Not the same length??? */
/* Problem on ci-v bus? */
/* Someone else got a packet in? */
Unhold_Decode(rig);
return -RIG_EPROTO;
}
if (memcmp(buf, sendbuf, frm_len))
{
/* Frames are different? */
/* Problem on ci-v bus? */
/* Someone else got a packet in? */
Unhold_Decode(rig);
return -RIG_EPROTO;
}
}
/*
* expect an answer?
*/
if (data_len == NULL)
{
Unhold_Decode(rig);
return RIG_OK;
}
/*
* wait for ACK ...
* FIXME: handle pading/collisions
* ACKFRMLEN is the smallest frame we can expect from the rig
*/
frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf));
if (memcmp(buf, sendbuf, frm_len) == 0 && priv->serial_USB_echo_off)
{
// Hmmm -- got an echo back when not expected so let's change
priv->serial_USB_echo_off = 0;
// And try again
frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf));
}
Unhold_Decode(rig);
if (frm_len < 0)
{
/* RIG_TIMEOUT: timeout getting response, return timeout */
/* other error: return it */
return frm_len;
}
if (frm_len < 1)
{
return -RIG_EPROTO;
}
switch (buf[frm_len - 1])
{
case COL:
/* Collision */
return -RIG_BUSBUSY;
case FI:
/* Ok, normal frame */
break;
default:
/* Timeout after reading at least one character */
/* Problem on ci-v bus? */
return -RIG_EPROTO;
}
if (frm_len < ACKFRMLEN) { return -RIG_EPROTO; }
if (NAK == buf[frm_len - 2]) { return -RIG_ERJCTED; }
*data_len = frm_len - (ACKFRMLEN - 1);
memcpy(data, buf + 4, *data_len);
/*
* TODO: check addresses in reply frame
*/
return RIG_OK;
}
/*
* icom_transaction
*
* This function honors rigport.retry count.
*
* We assume that rig!=NULL, rig->state!= NULL, payload!=NULL, data!=NULL, data_len!=NULL
* Otherwise, you'll get a nice seg fault. You've been warned!
* payload can be NULL if payload_len == 0
* subcmd can be equal to -1 (no subcmd wanted)
*
* return RIG_OK if transaction completed,
* or a negative value otherwise indicating the error.
*/
int icom_transaction(RIG *rig, int cmd, int subcmd,
const unsigned char *payload, int payload_len, unsigned char *data,
int *data_len)
{
int retval, retry;
retry = rig->state.rigport.retry;
do
{
retval = icom_one_transaction(rig, cmd, subcmd, payload, payload_len, data,
data_len);
if (retval == RIG_OK || retval == -RIG_ERJCTED)
{
break;
}
hl_usleep(500*1000); // pause a half second
}
while (retry-- > 0);
if (retval != RIG_OK)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: failed: %s\n", __func__, strerror(retval));
}
return retval;
}
/* used in read_icom_frame as end of block */
static const char icom_block_end[2] = {FI, COL};
#define icom_block_end_length 2
/*
* read_icom_frame
* read a whole CI-V frame (until 0xfd is encountered)
* TODO: strips padding/collisions
* FIXME: check return codes/bytes read
*/
int read_icom_frame(hamlib_port_t *p, unsigned char rxbuffer[],
int rxbuffer_len)
{
int read = 0;
int retries = 10;
char *rx_ptr = (char *)rxbuffer;
/*
* OK, now sometimes we may time out, e.g. the IC7000 can time out
* during a PTT operation. So, we will insure that the last thing we
* read was a proper end marker - if not, we will try again.
*/
do
{
int i = read_string(p, rx_ptr, MAXFRAMELEN - read,
icom_block_end, icom_block_end_length);
if (i < 0) /* die on errors */
{
return i;
}
if (i == 0) /* nothing read?*/
{
if (--retries <= 0) /* Tried enough times? */
{
return read;
}
}
/* OK, we got something. add it in and continue */
read += i;
rx_ptr += i;
}
while ((read < rxbuffer_len) && (rxbuffer[read - 1] != FI)
&& (rxbuffer[read - 1] != COL));
return read;
}
/*
* convert mode and width as expressed by Hamlib frontend
* to mode and passband data understandable by a CI-V rig
*
* if pd == -1, no passband data is to be sent
*
* return RIG_OK if everything's fine, negative value otherwise
*
* TODO: be more exhaustive
* assumes rig!=NULL
*/
int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
unsigned char icmode;
signed char icmode_ext;
pbwidth_t medium_width;
icmode_ext = -1;
switch (mode)
{
case RIG_MODE_AM: icmode = S_AM; break;
case RIG_MODE_AMN: icmode = S_AMN; break;
case RIG_MODE_AMS: icmode = S_AMS; break;
case RIG_MODE_CW: icmode = S_CW; break;
case RIG_MODE_CWR: icmode = S_CWR; break;
case RIG_MODE_USB: icmode = S_USB; break;
case RIG_MODE_PKTUSB: icmode = S_USB; break;
case RIG_MODE_LSB: icmode = S_LSB; break;
case RIG_MODE_PKTLSB: icmode = S_LSB; break;
case RIG_MODE_RTTY: icmode = S_RTTY; break;
case RIG_MODE_RTTYR: icmode = S_RTTYR; break;
case RIG_MODE_PSK: icmode = S_PSK; break;
case RIG_MODE_PSKR: icmode = S_PSKR; break;
case RIG_MODE_FM: icmode = S_FM; break;
case RIG_MODE_FMN: icmode = S_FMN; break;
case RIG_MODE_WFM: icmode = S_WFM; break;
case RIG_MODE_P25: icmode = S_P25; break;
case RIG_MODE_DSTAR: icmode = S_DSTAR; break;
case RIG_MODE_DPMR: icmode = S_DPMR; break;
case RIG_MODE_NXDNVN: icmode = S_NXDNVN; break;
case RIG_MODE_NXDN_N: icmode = S_NXDN_N; break;
case RIG_MODE_DCR: icmode = S_DCR; break;
case RIG_MODE_DD: icmode = S_DD; break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported Hamlib mode %s\n", __func__,
rig_strrmode(mode));
return -RIG_EINVAL;
}
if (width != RIG_PASSBAND_NOCHANGE)
{
medium_width = rig_passband_normal(rig, mode);
if (width == medium_width || width == RIG_PASSBAND_NORMAL)
{
icmode_ext =
-1; /* medium, no passband data-> rig default. Is medium always the default? */
}
else if (width < medium_width)
{
icmode_ext = PD_NARROW_3;
}
else
{
icmode_ext = PD_WIDE_3;
}
if (rig->caps->rig_model == RIG_MODEL_ICR7000)
{
if (mode == RIG_MODE_USB || mode == RIG_MODE_LSB)
{
icmode = S_R7000_SSB;
icmode_ext = 0x00;
}
else if (mode == RIG_MODE_AM && icmode_ext == -1)
{
icmode_ext = PD_WIDE_3; /* default to Wide */
}
}
}
*md = icmode;
*pd = icmode_ext;
return RIG_OK;
}
/*
* assumes rig!=NULL, mode!=NULL, width!=NULL
*/
void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode,
pbwidth_t *width)
{
*width = RIG_PASSBAND_NORMAL;
switch (md)
{
case S_AM: if (rig->caps->rig_model == RIG_MODEL_ICR30 && pd == 0x02)
{
*mode = RIG_MODE_AMN;
}
else
{
*mode = RIG_MODE_AM;
} break;
case S_AMS: *mode = RIG_MODE_AMS; break;
case S_CW: *mode = RIG_MODE_CW; break;
case S_CWR: *mode = RIG_MODE_CWR; break;
case S_FM: if (rig->caps->rig_model == RIG_MODEL_ICR7000
&& pd == 0x00)
{
*mode = RIG_MODE_USB;
*width = rig_passband_normal(rig, RIG_MODE_USB);
return;
}
else if (rig->caps->rig_model == RIG_MODEL_ICR30 && pd == 0x02)
{
*mode = RIG_MODE_FMN;
}
else
{
*mode = RIG_MODE_FM;
} break;
case S_WFM: *mode = RIG_MODE_WFM; break;
case S_USB: *mode = RIG_MODE_USB; break;
case S_LSB: *mode = RIG_MODE_LSB; break;
case S_RTTY: *mode = RIG_MODE_RTTY; break;
case S_RTTYR: *mode = RIG_MODE_RTTYR; break;
case S_PSK: *mode = RIG_MODE_PSK; break;
case S_PSKR: *mode = RIG_MODE_PSKR; break;
case S_DSTAR: *mode = RIG_MODE_DSTAR; break;
case S_P25: *mode = RIG_MODE_P25; break;
case S_DPMR: *mode = RIG_MODE_DPMR; break;
case S_NXDNVN: *mode = RIG_MODE_NXDNVN; break;
case S_NXDN_N: *mode = RIG_MODE_NXDN_N; break;
case S_DCR: *mode = RIG_MODE_DCR; break;
case 0xff: *mode = RIG_MODE_NONE; break; /* blank mem channel */
default:
rig_debug(RIG_DEBUG_ERR, "icom: Unsupported Icom mode %#.2x\n",
md);
*mode = RIG_MODE_NONE;
}
/* Most rigs return 1-wide, 2-narrow; or if it has 3 filters: 1-wide, 2-middle,
3-narrow. (Except for the 706 mkIIg 0-wide, 1-middle, 2-narrow.) For DSP
rigs these are presets, which can be programmed for 30 - 41 bandwidths,
depending on mode */
if (rig->caps->rig_model == RIG_MODEL_IC706MKIIG ||
rig->caps->rig_model == RIG_MODEL_IC706 ||
rig->caps->rig_model == RIG_MODEL_IC706MKII) { pd++; }
switch (pd)
{
case 0x01:
/* if no wide filter defined it's the default */
if (!(*width = rig_passband_wide(rig, *mode)))
{
*width = rig_passband_normal(rig, *mode);
}
break;
case 0x02:
if ((*width = rig_passband_wide(rig, *mode)))
{
*width = rig_passband_normal(rig, *mode);
}
else
/* This really just depends on how you program the table. */
{
*width = rig_passband_narrow(rig, *mode);
}
break;
case 0x03:
*width = rig_passband_narrow(rig, *mode);
break;
case -1:
break; /* no passband data */
default:
rig_debug(RIG_DEBUG_ERR, "icom: Unsupported Icom mode width %#.2x\n", pd);
}
return ;
}

Wyświetl plik

@ -1,38 +0,0 @@
/*
* Hamlib CI-V backend - low level communication header
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _FRAME_H
#define _FRAME_H 1
#define MAXFRAMELEN 56
/*
* helper functions
*/
int make_cmd_frame(char frame[], char re_id, char ctrl_id, char cmd, int subcmd, const unsigned char *data, int data_len);
int icom_transaction (RIG *rig, int cmd, int subcmd, const unsigned char *payload, int payload_len, unsigned char *data, int *data_len);
int read_icom_frame(hamlib_port_t *p, unsigned char rxbuffer[], int rxbuffer_len);
int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width, unsigned char *md, signed char *pd);
void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode, pbwidth_t *width);
#endif /* _FRAME_H */

Wyświetl plik

@ -1,145 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-1275 and variations
* Copyright (c) 2000-2012 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#define IC1275_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC1275_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC1275_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
static const struct icom_priv_caps ic1275_priv_caps =
{
0x18, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic1275_caps =
{
.rig_model = RIG_MODEL_IC1275,
.model_name = "IC-1275",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC1275_VFO_OPS,
.scan_ops = RIG_SCAN_NONE,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
{ 100, 101, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
{ 102, 102, RIG_MTYPE_CALL, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = { {MHz(1240), MHz(1300), IC1275_MODES, -1, -1, IC1275_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = { {MHz(1240), MHz(1300), IC1275_MODES, W(1), W(10), IC1275_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = { {MHz(1240), MHz(1300), IC1275_MODES, -1, -1, IC1275_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { {MHz(1240), MHz(1300), IC1275_MODES, W(1), W(10), IC1275_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC1275_MODES, 10}, /* TBC: does this rig supports settin tuning step? */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.3)},
{RIG_MODE_CW, Hz(500)}, /* optional FL-83 CW narrow filter */
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic1275_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,155 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-271 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#define IC271_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC271_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC271_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
/*
* IC-271 A/E
* IC-271 H is high power (75W)
*
* Independant transmit/receive
*
* specs: http://www.qsl.net/sm7vhs/radio/icom/Ic271/specs.htm
*
* Please report testing / patches. Some capabilities may be missing too. --sf
*/
static const struct icom_priv_caps ic271_priv_caps =
{
0x20, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic271_caps =
{
.rig_model = RIG_MODEL_IC271,
.model_name = "IC-271",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC271_VFO_OPS,
.scan_ops = RIG_SCAN_NONE,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 32, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(144), MHz(146), IC271_MODES, -1, -1, IC271_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(144), MHz(146), IC271_MODES, W(2.5), W(25), IC271_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{MHz(143.8), MHz(148.2), IC271_MODES, -1, -1, IC271_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
{MHz(144), MHz(148), IC271_MODES, W(2.5), W(25), IC271_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC271_MODES, 10}, /* TBC: does this rig supports settin tuning step? */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.4)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic271_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,211 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-2730 and variations
* Copyright (c) 2015 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "idx_builtin.h"
#include "icom.h"
#define IC2730_MODES (RIG_MODE_FM)
#define IC2730_ALL_RX_MODES (RIG_MODE_AM|IC2730_MODES)
#define IC2730_VFO_ALL (RIG_VFO_MAIN|RIG_VFO_SUB)
#define IC2730_SCAN_OPS RIG_SCAN_NONE
#define IC2730_VFO_OPS RIG_OP_NONE
#define IC2730_FUNC_ALL ( \
RIG_FUNC_TONE| \
RIG_FUNC_TSQL| \
RIG_FUNC_VOX)
#define IC2730_LEVEL_ALL (RIG_LEVEL_AF| \
RIG_LEVEL_SQL| \
RIG_LEVEL_RFPOWER| \
RIG_LEVEL_MICGAIN| \
RIG_LEVEL_VOXGAIN)
#define IC2730_PARM_ALL RIG_PARM_NONE
/*
* FIXME: real measurement
*/
#define IC2730_STR_CAL UNKNOWN_IC_STR_CAL
static const struct icom_priv_caps ic2730_priv_caps =
{
0x90, /* default address */
0, /* 731 mode */
1, /* no XCHG */
};
const struct rig_caps ic2730_caps =
{
.rig_model = RIG_MODEL_IC2730,
.model_name = "IC-2730",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_RIG,
.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 = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC2730_FUNC_ALL,
.has_set_func = IC2730_FUNC_ALL,
.has_get_level = IC2730_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(IC2730_LEVEL_ALL),
.has_get_parm = IC2730_PARM_ALL,
.has_set_parm = IC2730_PARM_ALL,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = full_dcs_list,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC2730_VFO_OPS,
.scan_ops = IC2730_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
// There's no memory support through CI-V,
// but there is a clone mode apart.
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(118), MHz(174), IC2730_ALL_RX_MODES, -1, -1, IC2730_VFO_ALL},
{MHz(375), MHz(550), IC2730_ALL_RX_MODES, -1, -1, IC2730_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(144), MHz(146), IC2730_MODES, W(5), W(25), IC2730_VFO_ALL},
{MHz(430), MHz(440), IC2730_MODES, W(5), W(25), IC2730_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{MHz(118), MHz(174), IC2730_ALL_RX_MODES, -1, -1, IC2730_VFO_ALL},
{MHz(375), MHz(550), IC2730_ALL_RX_MODES, -1, -1, IC2730_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
{MHz(144), MHz(148), IC2730_MODES, W(5), W(50), IC2730_VFO_ALL},
{MHz(430), MHz(450), IC2730_MODES, W(5), W(50), IC2730_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
// Rem: no support for changing tuning step
{IC2730_ALL_RX_MODES, kHz(5)},
{IC2730_ALL_RX_MODES, kHz(6.25)},
// The 8.33 kHz step is not selectable, depending on the operating band or mode.
{IC2730_ALL_RX_MODES, kHz(8.33)},
{IC2730_ALL_RX_MODES, kHz(10)},
{IC2730_ALL_RX_MODES, 12500},
{IC2730_ALL_RX_MODES, kHz(15)},
{IC2730_ALL_RX_MODES, kHz(20)},
{IC2730_ALL_RX_MODES, kHz(25)},
{IC2730_ALL_RX_MODES, kHz(30)},
{IC2730_ALL_RX_MODES, kHz(50)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_FM | RIG_MODE_AM, kHz(12)},
{RIG_MODE_FM | RIG_MODE_AM, kHz(6)},
RIG_FLT_END,
},
.str_cal = IC2730_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic2730_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.decode_event = icom_decode_event,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_sql = icom_set_dcs_code,
.get_dcs_sql = icom_get_dcs_code,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
};

Wyświetl plik

@ -1,148 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-275 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#define IC275_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC275_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC275_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
/*
* FIXME: this appears to be the IC-275A/E
* what about the IC-275H ? please give it a fix. --SF
*/
static const struct icom_priv_caps ic275_priv_caps =
{
0x10, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic275_caps =
{
.rig_model = RIG_MODEL_IC275,
.model_name = "IC-275",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC275_VFO_OPS,
.scan_ops = RIG_SCAN_NONE,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
{ 100, 101, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
{ 102, 102, RIG_MTYPE_CALL, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = { {MHz(138), MHz(174), IC275_MODES, -1, -1, IC275_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = { {MHz(144), MHz(146), IC275_MODES, W(2.5), W(25), IC275_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = { {MHz(138), MHz(174), IC275_MODES, -1, -1, IC275_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { {MHz(144), MHz(148), IC275_MODES, W(2.5), W(25), IC275_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC275_MODES, 10}, /* TBC: does this rig supports settin tuning step? */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.2)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic275_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,154 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-471 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#define IC471_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC471_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC471_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
#define IC471_STR_CAL { 0, { } }
/*
* IC-471 A/E
* IC-471 H is high power (75W)
* specs: http://www.qsl.net/sm7vhs/radio/icom/ic471/specs.htm
*
* Please report testing / patches. Some capabilities may be missing too. --sf
*/
static const struct icom_priv_caps ic471_priv_caps =
{
0x22, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic471_caps =
{
.rig_model = RIG_MODEL_IC471,
.model_name = "IC-471",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC471_VFO_OPS,
.scan_ops = RIG_SCAN_NONE,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 38, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(430), MHz(450), IC471_MODES, -1, -1, IC471_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(430), MHz(440), IC471_MODES, W(2.5), W(25), IC471_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{MHz(430), MHz(450), IC471_MODES, -1, -1, IC471_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
{MHz(430), MHz(450), IC471_MODES, W(2.5), W(25), IC471_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC471_MODES, 10}, /* TBC: does this rig supports settin tuning step? */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.3)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic471_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,148 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-475 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#define IC475_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC475_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC475_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
/*
* FIXME: this appears to be the IC-475A/E
* what about the IC-475H ? please give it a fix. --SF
*/
static const struct icom_priv_caps ic475_priv_caps =
{
0x14, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic475_caps =
{
.rig_model = RIG_MODEL_IC475,
.model_name = "IC-475",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC475_VFO_OPS,
.scan_ops = RIG_SCAN_NONE,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
{ 100, 101, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
{ 102, 102, RIG_MTYPE_CALL, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = { {MHz(430), MHz(450), IC475_MODES, -1, -1, IC475_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = { {MHz(430), MHz(440), IC475_MODES, W(2.5), W(25), IC475_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = { {MHz(430), MHz(450), IC475_MODES, -1, -1, IC475_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { {MHz(430), MHz(450), IC475_MODES, W(2.5), W(25), IC475_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC475_MODES, 10}, /* TBC: does this rig supports settin tuning step? */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.3)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic475_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,367 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-7000 and variations
* Adapted from IC-7800 code 2006 by Kent Hill
* Copyright (c) 2004-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <hamlib/rig.h>
#include "token.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "misc.h"
#include "bandplan.h"
#define IC7000_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_WFM)
#define IC7000_1HZ_TS_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define IC7000_NOT_TS_MODES (IC7000_ALL_RX_MODES &~IC7000_1HZ_TS_MODES)
#define IC7000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM)
#define IC7000_AM_TX_MODES (RIG_MODE_AM)
#define IC7000_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK|RIG_FUNC_ARO)
#define IC7000_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
#define IC7000_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC7000_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_APO|RIG_PARM_TIME|RIG_PARM_BEEP)
#define IC7000_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
#define IC7000_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_SLCT|RIG_SCAN_PRIO)
#define IC7000_ANTS (RIG_ANT_1|RIG_ANT_2) /* ant-1 is Hf-6m, ant-2 is 2m-70cm */
/*
* Measurement by Mark, WA0TOP
*
* s/n 0503103.
* Preamp off, ATT off, mode AM, f=10 MHz
*/
#define IC7000_STR_CAL { 14, \
{ \
{ 0, -54 }, /* first one is made up */ \
{ 5, -29 }, \
{ 15, -27 }, \
{ 43, -22 }, \
{ 68, -17 }, \
{ 92, -12 }, \
{ 120, -6 }, \
{ 141, 2 }, \
{ 162, 13 }, \
{ 182, 25 }, \
{ 202, 38 }, \
{ 222, 47 }, \
{ 241, 57 }, \
{ 255, 63 } \
} }
#define IC7000_SWR_CAL { 5, \
{ \
{ 0, 1.0f }, \
{ 48, 1.5f }, \
{ 80, 2.0f }, \
{ 120, 3.0f }, \
{ 240, 6.0f } \
} }
#define IC7000_ALC_CAL { 2, \
{ \
{ 0, 0.0f }, \
{ 120, 1.0f } \
} }
#define IC7000_RFPOWER_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 143, 0.5f }, \
{ 213, 1.0f } \
} }
#define IC7000_COMP_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 130, 15.0f }, \
{ 241, 30.0f } \
} }
/*
*
* IC7000 channel caps.
*/
#define IC7000_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
.split = 1, \
.tx_freq = 1, \
.tx_mode = 1, \
.tx_width = 1, \
.rptr_offs = 1, \
.rptr_shift = 1, \
.ctcss_tone = 1, \
.ctcss_sql = 1, \
.funcs = IC7000_FUNCS, \
.levels = RIG_LEVEL_SET(IC7000_LEVELS), \
}
int ic7000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ic7000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
/*
* IC-7000 rig capabilities.
*/
static const struct icom_priv_caps IC7000_priv_caps =
{
0x70, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic7000_ts_sc_list,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
{ .level = RIG_AGC_MEDIUM, .icom_level = 2 },
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
{ .level = -1, .icom_level = 0 },
},
};
const struct rig_caps ic7000_caps =
{
.rig_model = RIG_MODEL_IC7000,
.model_name = "IC-7000",
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC7000_FUNCS,
.has_set_func = IC7000_FUNCS,
.has_get_level = IC7000_LEVELS,
.has_set_level = RIG_LEVEL_SET(IC7000_LEVELS),
.has_get_parm = IC7000_PARMS,
.has_set_parm = RIG_PARM_SET(IC7000_PARMS),
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = common_dcs_list,
.preamp = { 10, RIG_DBLST_END, }, /* FIXME: TBC it's a guess*/
.attenuator = { 12, RIG_DBLST_END, },
.max_rit = Hz(9999),
.max_xit = Hz(9999),
.max_ifshift = Hz(0), /* TODO */
.targetable_vfo = 0,
.vfo_ops = IC7000_VFO_OPS,
.scan_ops = IC7000_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 5,
.chan_desc_sz = 0, /* TODO */
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, IC7000_MEM_CAP },
{ 100, 105, RIG_MTYPE_EDGE, IC7000_MEM_CAP }, /* two by two */
{ 106, 107, RIG_MTYPE_CALL, IC7000_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(199.999999), IC7000_ALL_RX_MODES, -1, -1, IC7000_VFOS},
{MHz(400), MHz(470), IC7000_ALL_RX_MODES, -1, -1, IC7000_VFOS}, RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC7000_OTHER_TX_MODES, W(2), W(100), IC7000_VFOS, RIG_ANT_1),
FRQ_RNG_6m(1, IC7000_OTHER_TX_MODES, W(2), W(100), IC7000_VFOS, RIG_ANT_1),
FRQ_RNG_2m(1, IC7000_OTHER_TX_MODES, W(2), W(50), IC7000_VFOS, RIG_ANT_2),
FRQ_RNG_70cm(1, IC7000_OTHER_TX_MODES, W(2), W(35), IC7000_VFOS, RIG_ANT_2),
FRQ_RNG_HF(1, IC7000_AM_TX_MODES, W(1), W(40), IC7000_VFOS, RIG_ANT_1), /* AM class */
FRQ_RNG_6m(1, IC7000_AM_TX_MODES, W(1), W(40), IC7000_VFOS, RIG_ANT_1), /* AM class */
FRQ_RNG_2m(1, IC7000_AM_TX_MODES, W(2), W(20), IC7000_VFOS, RIG_ANT_2),
FRQ_RNG_70cm(1, IC7000_OTHER_TX_MODES, W(2), W(14), IC7000_VFOS, RIG_ANT_2),
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(199.999999), IC7000_ALL_RX_MODES, -1, -1, IC7000_VFOS},
{MHz(400), MHz(470), IC7000_ALL_RX_MODES, -1, -1, IC7000_VFOS}, RIG_FRNG_END,
},
.tx_range_list2 = { /* needs the 5 mhz channels added */
FRQ_RNG_HF(2, IC7000_OTHER_TX_MODES, W(2), W(100), IC7000_VFOS, RIG_ANT_1),
FRQ_RNG_6m(2, IC7000_OTHER_TX_MODES, W(2), W(100), IC7000_VFOS, RIG_ANT_1),
FRQ_RNG_2m(2, IC7000_OTHER_TX_MODES, W(2), W(50), IC7000_VFOS, RIG_ANT_2),
FRQ_RNG_70cm(2, IC7000_OTHER_TX_MODES, W(2), W(35), IC7000_VFOS, RIG_ANT_2),
FRQ_RNG_HF(2, IC7000_AM_TX_MODES, W(1), W(40), IC7000_VFOS, RIG_ANT_1), /* AM class */
FRQ_RNG_6m(2, IC7000_AM_TX_MODES, W(1), W(40), IC7000_VFOS, RIG_ANT_1), /* AM class */
FRQ_RNG_2m(2, IC7000_AM_TX_MODES, W(2), W(20), IC7000_VFOS, RIG_ANT_2),
FRQ_RNG_70cm(2, IC7000_OTHER_TX_MODES, W(2), W(14), IC7000_VFOS, RIG_ANT_2),
RIG_FRNG_END,
},
.tuning_steps = {
{IC7000_1HZ_TS_MODES, 1},
{IC7000_NOT_TS_MODES, 10},
{IC7000_ALL_RX_MODES, Hz(100)},
{IC7000_ALL_RX_MODES, kHz(1)},
{IC7000_ALL_RX_MODES, kHz(5)},
{IC7000_ALL_RX_MODES, kHz(9)},
{IC7000_ALL_RX_MODES, kHz(10)},
{IC7000_ALL_RX_MODES, kHz(12.5)},
{IC7000_ALL_RX_MODES, kHz(20)},
{IC7000_ALL_RX_MODES, kHz(25)},
{IC7000_ALL_RX_MODES, kHz(100)},
{IC7000_NOT_TS_MODES, MHz(1)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! But duplication may speed up search. Put the most commonly used modes first! Remember these are defaults, with dsp rigs you can change them to anything you want except FM and WFM which are fixed */
.filters = {
{RIG_MODE_SSB, kHz(2.4)},
{RIG_MODE_SSB, kHz(1.8)},
{RIG_MODE_SSB, kHz(3)},
{RIG_MODE_FM, kHz(10)},
{RIG_MODE_FM, kHz(15)},
{RIG_MODE_FM, kHz(7)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(500)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(250)},
{RIG_MODE_CW | RIG_MODE_CWR, kHz(1.2)},
{RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_AM, kHz(3)},
{RIG_MODE_AM, kHz(9)},
{RIG_MODE_WFM, kHz(280)},
RIG_FLT_END,
},
.str_cal = IC7000_STR_CAL,
.swr_cal = IC7000_SWR_CAL,
.alc_cal = IC7000_ALC_CAL,
.rfpower_meter_cal = IC7000_RFPOWER_METER_CAL,
.comp_meter_cal = IC7000_COMP_METER_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& IC7000_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_ant = NULL, /*automatically set by rig depending band */
.get_ant = NULL,
.decode_event = icom_decode_event,
.set_level = ic7000_set_level,
.get_level = ic7000_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = NULL,
.get_parm = NULL,
.set_mem = icom_set_mem,
.set_bank = icom_set_bank,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = NULL,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = NULL,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_code = icom_set_dcs_code,
.get_dcs_code = icom_get_dcs_code,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = NULL,
};
int ic7000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x17;
return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val);
default:
return icom_set_level(rig, vfo, level, val);
}
}
int ic7000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x17;
return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val);
default:
return icom_get_level(rig, vfo, level, val);
}
}

Wyświetl plik

@ -1,228 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-703
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#include "bandplan.h"
#include "idx_builtin.h"
#define IC703_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM)
#define IC703_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM)
#define IC703_AM_TX_MODES (RIG_MODE_AM)
#define IC703_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_ANF|RIG_FUNC_MON)
#define IC703_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_RAWSTR|RIG_LEVEL_ALC|RIG_LEVEL_SWR|RIG_LEVEL_METER|RIG_LEVEL_COMP|RIG_LEVEL_RF|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_RF|RIG_LEVEL_AF|RIG_LEVEL_SQL|RIG_LEVEL_NR|RIG_LEVEL_IF|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT)
#define IC703_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC703_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define IC703_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM)
#define IC703_ANTS (RIG_ANT_1)
/*
* IC703_REAL_STR_CAL is accurate measurements
* IC703_STR_CAL is what the S-meter displays
*
* FIXME: calibration data cloned from IC706
*/
#define IC703_STR_CAL { 17, \
{ \
{ 45, -60 }, \
{ 46, -54 }, /* S0 */ \
{ 54, -48 }, \
{ 64, -42 }, \
{ 76, -36 }, \
{ 84, -30 }, \
{ 94, -24 }, \
{ 104, -18 }, \
{ 113, -12 }, \
{ 123, -6 }, \
{ 133, 0 }, /* S9 */ \
{ 144, 10 }, /* +10 */ \
{ 156, 20 }, /* +20 */ \
{ 170, 30 }, /* +30 */ \
{ 181, 40 }, /* +40 */ \
{ 192, 50 }, /* +50 */ \
{ 204, 60 } /* +60 */ \
} }
/*
* ic703 rigs capabilities.
*/
static const struct icom_priv_caps ic703_priv_caps =
{
0x68, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic706_ts_sc_list
};
const struct rig_caps ic703_caps =
{
.rig_model = RIG_MODEL_IC703,
.model_name = "IC-703",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC703_FUNC_ALL,
.has_set_func = IC703_FUNC_ALL,
.has_get_level = IC703_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(IC703_LEVEL_ALL),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = NULL,
.preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: 2 levels */
.attenuator = { 20, RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC703_VFO_OPS,
.scan_ops = IC703_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 105, RIG_MTYPE_EDGE }, /* two by two */
{ 106, 107, RIG_MTYPE_CALL },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(30), MHz(60), IC703_ALL_RX_MODES, -1, -1, IC703_VFO_ALL, IC703_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC703_OTHER_TX_MODES, W(0.1), W(10), IC703_VFO_ALL, IC703_ANTS),
FRQ_RNG_6m(1, IC703_OTHER_TX_MODES, W(0.1), W(10), IC703_VFO_ALL, IC703_ANTS),
FRQ_RNG_HF(1, IC703_AM_TX_MODES, W(0.1), W(4), IC703_VFO_ALL, IC703_ANTS), /* AM class */
FRQ_RNG_6m(1, IC703_AM_TX_MODES, W(0.1), W(4), IC703_VFO_ALL, IC703_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(30), MHz(60), IC703_ALL_RX_MODES, -1, -1, IC703_VFO_ALL, IC703_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC703_OTHER_TX_MODES, W(0.1), W(10), IC703_VFO_ALL, IC703_ANTS),
FRQ_RNG_6m(2, IC703_OTHER_TX_MODES, W(0.1), W(10), IC703_VFO_ALL, IC703_ANTS),
FRQ_RNG_HF(2, IC703_AM_TX_MODES, W(0.1), W(4), IC703_VFO_ALL, IC703_ANTS), /* AM class */
FRQ_RNG_6m(2, IC703_AM_TX_MODES, W(0.1), W(4), IC703_VFO_ALL, IC703_ANTS), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = {
{IC703_ALL_RX_MODES, 10},
{IC703_ALL_RX_MODES, 100},
{IC703_ALL_RX_MODES, kHz(1)},
{IC703_ALL_RX_MODES, kHz(5)},
{IC703_ALL_RX_MODES, kHz(9)},
{IC703_ALL_RX_MODES, kHz(10)},
{IC703_ALL_RX_MODES, 12500},
{IC703_ALL_RX_MODES, kHz(20)},
{IC703_ALL_RX_MODES, kHz(25)},
{IC703_ALL_RX_MODES, kHz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY | RIG_MODE_CWR | RIG_MODE_RTTYR, kHz(2.4)}, /* bultin FL-272 */
{RIG_MODE_AM, kHz(9)}, /* mid w/ bultin FL-94 */
{RIG_MODE_AM, kHz(2.4)}, /* narrow w/ bultin FL-272 */
{RIG_MODE_FM, kHz(15)}, /* ?? TBC, mid w/ bultin FL-23+SFPC455E */
{RIG_MODE_FM, kHz(9)}, /* narrow w/ bultin FL-94 */
RIG_FLT_END,
},
.str_cal = IC703_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic703_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.set_rptr_shift = icom_set_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
};

Wyświetl plik

@ -1,616 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-706 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "idx_builtin.h"
#include "bandplan.h"
/*
* This function does the special bandwidth coding for IC-706, IC-706MKII
* and IC-706MKIIG
* (0 - wide, 1 - normal, 2 - narrow)
*/
static int ic706_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
if (err != RIG_OK)
{
return err;
}
if (width != RIG_PASSBAND_NOCHANGE)
{
if (*pd == -1)
{
*pd = PD_MEDIUM_2;
}
else
{
(*pd)--;
}
}
return RIG_OK;
}
#define IC706_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_WFM)
#define IC706_1MHZ_TS_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM)
#define IC706_1HZ_TS_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY)
/* tx doesn't have WFM.
* 100W in all modes but AM (40W)
*/
#define IC706_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_USB|RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM)
#define IC706_AM_TX_MODES (RIG_MODE_AM)
#define IC706IIG_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN)
#define IC706IIG_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_RAWSTR)
#define IC706_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC706_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define IC706_SCAN_OPS (RIG_SCAN_MEM)
/*
* IC706IIG_REAL_STR_CAL is accurate measurements
* IC706IIG_STR_CAL is what the S-meter displays
*
* calibration data was obtained from W8WWV
* http://www.seed-solutions.com/gregordy/
*/
#define IC706IIG_REAL_STR_CAL { 16, \
{ \
{ 46, -27 }, /* S0 */ \
{ 54, -25 }, \
{ 64, -24 }, \
{ 76, -23 }, \
{ 84, -22 }, \
{ 94, -20 }, \
{ 104, -16 }, \
{ 113, -11 }, \
{ 123, -5 }, \
{ 133, 0 }, /* S9 */ \
{ 144, 5 }, /* +10 */ \
{ 156, 10 }, /* +20 */ \
{ 170, 16 }, /* +30 */ \
{ 181, 21 }, /* +40 */ \
{ 192, 26 }, /* +50 */ \
{ 204, 35 } /* +60 */ \
} }
#define IC706IIG_STR_CAL { 17, \
{ \
{ 45, -60 }, \
{ 46, -54 }, /* S0 */ \
{ 54, -48 }, \
{ 64, -42 }, \
{ 76, -36 }, \
{ 84, -30 }, \
{ 94, -24 }, \
{ 104, -18 }, \
{ 113, -12 }, \
{ 123, -6 }, \
{ 133, 0 }, /* S9 */ \
{ 144, 10 }, /* +10 */ \
{ 156, 20 }, /* +20 */ \
{ 170, 30 }, /* +30 */ \
{ 181, 40 }, /* +40 */ \
{ 192, 50 }, /* +50 */ \
{ 204, 60 } /* +60 */ \
} }
/*
* ic706 rigs capabilities.
* Notice that some rigs share the same functions.
* Also this struct is READONLY!
*/
static const struct icom_priv_caps ic706_priv_caps =
{
0x48, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic706_ts_sc_list,
.serial_USB_echo_check = 1, /* USB CI-V may not echo */
.r2i_mode = ic706_r2i_mode
};
const struct rig_caps ic706_caps =
{
.rig_model = RIG_MODEL_IC706,
.model_name = "IC-706",
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.level_gran = {}, /* granularity */
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { 10, RIG_DBLST_END, },
.attenuator = { 20, RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC706_VFO_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = { RIG_CHAN_END, }, /* FIXME: memory channel list */
.rx_range_list1 = { RIG_FRNG_END, }, /* FIXME: enter region 1 setting */
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = { {kHz(30), 199999999, IC706_ALL_RX_MODES, -1, -1, IC706_VFO_ALL}, RIG_FRNG_END, }, /* rx range */
.tx_range_list2 = { {kHz(1800), 1999999, IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL}, /* 100W class */
{kHz(1800), 1999999, IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL}, /* 40W class */
{kHz(3500), 3999999, IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(3500), 3999999, IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(7), kHz(7300), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(7), kHz(7300), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{kHz(10100), kHz(10150), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(10100), kHz(10150), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(14), kHz(14350), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(14), kHz(14350), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{kHz(18068), kHz(18168), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(18068), kHz(18168), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(21), kHz(21450), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(21), kHz(21450), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{kHz(24890), kHz(24990), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(24890), kHz(24990), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(28), kHz(29700), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(28), kHz(29700), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(50), MHz(54), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(50), MHz(54), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(144), MHz(148), IC706_OTHER_TX_MODES, 5000, 20000, IC706_VFO_ALL}, /* not sure.. */
{MHz(144), MHz(148), IC706_AM_TX_MODES, 2000, 8000, IC706_VFO_ALL}, /* anyone? */
RIG_FRNG_END,
},
.tuning_steps = {{IC706_1HZ_TS_MODES, 1},
{IC706_ALL_RX_MODES, 10},
{IC706_ALL_RX_MODES, 100},
{IC706_ALL_RX_MODES, kHz(1)},
{IC706_ALL_RX_MODES, kHz(5)},
{IC706_ALL_RX_MODES, kHz(9)},
{IC706_ALL_RX_MODES, kHz(10)},
{IC706_ALL_RX_MODES, 12500},
{IC706_ALL_RX_MODES, kHz(20)},
{IC706_ALL_RX_MODES, kHz(25)},
{IC706_ALL_RX_MODES, kHz(100)},
{IC706_1MHZ_TS_MODES, MHz(1)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.4)}, /* bultin FL-272 */
{RIG_MODE_AM, kHz(8)}, /* mid w/ bultin FL-94 */
{RIG_MODE_AM, kHz(2.4)}, /* narrow w/ bultin FL-272 */
{RIG_MODE_FM, kHz(15)}, /* ?? TBC, mid w/ bultin FL-23+SFPC455E */
{RIG_MODE_FM, kHz(8)}, /* narrow w/ bultin FL-94 */
{RIG_MODE_WFM, kHz(230)}, /* WideFM, filter FL?? */
RIG_FLT_END,
},
.str_cal = IC706IIG_STR_CAL,
.priv = (void *)& ic706_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = icom_rig_open,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ts = icom_set_ts,
.set_rptr_shift = icom_set_rptr_shift,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
};
static const struct icom_priv_caps ic706mkii_priv_caps =
{
0x4e, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic706_ts_sc_list,
.serial_USB_echo_check = 1, /* USB CI-V may not echo */
.r2i_mode = ic706_r2i_mode
};
const struct rig_caps ic706mkii_caps =
{
.rig_model = RIG_MODEL_IC706MKII,
.model_name = "IC-706MkII",
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.level_gran = {}, /* granularity */
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { 10, RIG_DBLST_END, },
.attenuator = { 20, RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC706_VFO_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = { RIG_CHAN_END, }, /* FIXME: memory channel list */
.rx_range_list1 = { RIG_FRNG_END, }, /* FIXME: enter region 1 setting */
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = { {kHz(30), 199999999, IC706_ALL_RX_MODES, -1, -1, IC706_VFO_ALL},
RIG_FRNG_END,
}, /* rx range */
.tx_range_list2 = { {kHz(1800), 1999999, IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL}, /* 100W class */
{kHz(1800), 1999999, IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL}, /* 40W class */
{kHz(3500), 3999999, IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(3500), 3999999, IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(7), kHz(7300), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(7), kHz(7300), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{kHz(10100), kHz(10150), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(10100), kHz(10150), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(14), kHz(14350), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(14), kHz(14350), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{kHz(18068), kHz(18168), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(18068), kHz(18168), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(21), kHz(21450), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(21), kHz(21450), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{kHz(24890), kHz(24990), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(24890), kHz(24990), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(28), kHz(29700), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(28), kHz(29700), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(50), MHz(54), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(50), MHz(54), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(144), MHz(148), IC706_OTHER_TX_MODES, 5000, 20000, IC706_VFO_ALL}, /* not sure.. */
{MHz(144), MHz(148), IC706_AM_TX_MODES, 2000, 8000, IC706_VFO_ALL}, /* anyone? */
RIG_FRNG_END,
},
.tuning_steps = {
{IC706_1HZ_TS_MODES, 1},
{IC706_ALL_RX_MODES, 10},
{IC706_ALL_RX_MODES, 100},
{IC706_ALL_RX_MODES, kHz(1)},
{IC706_ALL_RX_MODES, kHz(5)},
{IC706_ALL_RX_MODES, kHz(9)},
{IC706_ALL_RX_MODES, kHz(10)},
{IC706_ALL_RX_MODES, 12500},
{IC706_ALL_RX_MODES, kHz(20)},
{IC706_ALL_RX_MODES, kHz(25)},
{IC706_ALL_RX_MODES, kHz(100)},
{IC706_1MHZ_TS_MODES, MHz(1)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.4)}, /* bultin FL-272 */
{RIG_MODE_AM, kHz(8)}, /* mid w/ bultin FL-94 */
{RIG_MODE_AM, kHz(2.4)}, /* narrow w/ bultin FL-272 */
{RIG_MODE_FM, kHz(15)}, /* ?? TBC, mid w/ bultin FL-23+SFPC455E */
{RIG_MODE_FM, kHz(8)}, /* narrow w/ bultin FL-94 */
{RIG_MODE_WFM, kHz(230)}, /* WideFM, filter FL?? */
RIG_FLT_END,
},
.str_cal = IC706IIG_STR_CAL,
.priv = (void *)& ic706mkii_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = icom_rig_open,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ts = icom_set_ts,
.set_rptr_shift = icom_set_rptr_shift,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
};
/*
* IC706MkIIG channel caps.
*/
#define IC706MKIIG_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
.split = 1, \
.tx_freq = 1, \
.tx_mode = 1, \
.tx_width = 1, \
.rptr_offs = 1, \
.rptr_shift = 1, /* only set */ \
.funcs = IC706IIG_FUNC_ALL, \
.levels = RIG_LEVEL_SET(IC706IIG_LEVEL_ALL), \
}
/*
* Basically, the IC706MKIIG is an IC706MKII plus UHF, a DSP
* and 50W VHF
*/
static const struct icom_priv_caps ic706mkiig_priv_caps =
{
0x58, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic706_ts_sc_list,
.serial_USB_echo_check = 1, /* USB CI-V may not echo */
.r2i_mode = ic706_r2i_mode
};
const struct rig_caps ic706mkiig_caps =
{
.rig_model = RIG_MODEL_IC706MKIIG,
.model_name = "IC-706MkIIG",
.mfg_name = "Icom",
.version = BACKEND_VER ".3",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC706IIG_FUNC_ALL,
.has_set_func = IC706IIG_FUNC_ALL,
.has_get_level = IC706IIG_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(IC706IIG_LEVEL_ALL),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = NULL,
.preamp = { 10, RIG_DBLST_END, },
.attenuator = { 20, RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC706_VFO_OPS,
.scan_ops = IC706_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, IC706MKIIG_MEM_CAP },
{ 100, 105, RIG_MTYPE_EDGE, IC706MKIIG_MEM_CAP }, /* two by two */
{ 106, 107, RIG_MTYPE_CALL, IC706MKIIG_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(200) - 1, IC706_ALL_RX_MODES, -1, -1, IC706_VFO_ALL}, /* this trx also has UHF */
{MHz(400), MHz(470), IC706_ALL_RX_MODES, -1, -1, IC706_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC706_OTHER_TX_MODES, W(5), W(100), IC706_VFO_ALL, RIG_ANT_1),
FRQ_RNG_HF(1, IC706_AM_TX_MODES, W(2), W(40), IC706_VFO_ALL, RIG_ANT_1), /* AM class */
FRQ_RNG_6m(1, IC706_OTHER_TX_MODES, W(5), W(100), IC706_VFO_ALL, RIG_ANT_1),
FRQ_RNG_6m(1, IC706_AM_TX_MODES, W(2), W(40), IC706_VFO_ALL, RIG_ANT_1), /* AM class */
FRQ_RNG_2m(1, IC706_OTHER_TX_MODES, W(5), W(50), IC706_VFO_ALL, RIG_ANT_1),
FRQ_RNG_2m(1, IC706_AM_TX_MODES, W(2), W(20), IC706_VFO_ALL, RIG_ANT_1), /* AM class */
FRQ_RNG_70cm(1, IC706_OTHER_TX_MODES, W(5), W(20), IC706_VFO_ALL, RIG_ANT_1),
FRQ_RNG_70cm(1, IC706_AM_TX_MODES, W(2), W(8), IC706_VFO_ALL, RIG_ANT_1), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(200) - 1, IC706_ALL_RX_MODES, -1, -1, IC706_VFO_ALL}, /* this trx also has UHF */
{MHz(400), MHz(470), IC706_ALL_RX_MODES, -1, -1, IC706_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { {kHz(1800), MHz(2) - 1, IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL}, /* 100W class */
{kHz(1800), MHz(2) - 1, IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL}, /* 40W class */
{kHz(3500), MHz(4) - 1, IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(3500), MHz(4) - 1, IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(7), kHz(7300), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(7), kHz(7300), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{kHz(10100), kHz(10150), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(10100), kHz(10150), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(14), kHz(14350), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(14), kHz(14350), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{kHz(18068), kHz(18168), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(18068), kHz(18168), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(21), kHz(21450), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(21), kHz(21450), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{kHz(24890), kHz(24990), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{kHz(24890), kHz(24990), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(28), kHz(29700), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(28), kHz(29700), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(50), MHz(54), IC706_OTHER_TX_MODES, 5000, 100000, IC706_VFO_ALL},
{MHz(50), MHz(54), IC706_AM_TX_MODES, 2000, 40000, IC706_VFO_ALL},
{MHz(144), MHz(148), IC706_OTHER_TX_MODES, 5000, 50000, IC706_VFO_ALL}, /* 50W */
{MHz(144), MHz(148), IC706_AM_TX_MODES, 2000, 20000, IC706_VFO_ALL}, /* AM VHF is 20W */
{MHz(430), MHz(450), IC706_OTHER_TX_MODES, 5000, 20000, IC706_VFO_ALL},
{MHz(430), MHz(450), IC706_AM_TX_MODES, 2000, 8000, IC706_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC706_1HZ_TS_MODES, 1},
{IC706_ALL_RX_MODES, 10},
{IC706_ALL_RX_MODES, 100},
{IC706_ALL_RX_MODES, kHz(1)},
{IC706_ALL_RX_MODES, kHz(5)},
{IC706_ALL_RX_MODES, kHz(9)},
{IC706_ALL_RX_MODES, kHz(10)},
{IC706_ALL_RX_MODES, 12500},
{IC706_ALL_RX_MODES, kHz(20)},
{IC706_ALL_RX_MODES, kHz(25)},
{IC706_ALL_RX_MODES, kHz(100)},
{IC706_1MHZ_TS_MODES, MHz(1)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.4)}, /* bultin FL-272 */
{RIG_MODE_AM, kHz(8)}, /* mid w/ bultin FL-94 */
{RIG_MODE_AM, kHz(2.4)}, /* narrow w/ bultin FL-272 */
{RIG_MODE_FM, kHz(15)}, /* ?? TBC, mid w/ bultin FL-23+SFPC455E */
{RIG_MODE_FM, kHz(8)}, /* narrow w/ bultin FL-94 */
{RIG_MODE_WFM, kHz(230)}, /* WideFM, filter FL?? */
RIG_FLT_END,
},
.str_cal = IC706IIG_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic706mkiig_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = icom_rig_open,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.set_rptr_shift = icom_set_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_mem_get_split_vfo,
};

Wyświetl plik

@ -1,172 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-707
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "bandplan.h"
#include "icom.h"
#define IC707_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
/*
* IC-707
* specs: http://www.qsl.net/sm7vhs/radio/icom/ic707/specs.htm
*
*/
#define IC707_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC707_AM_TX_MODES (RIG_MODE_AM)
#define IC707_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC707_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY|RIG_OP_MCL)
#define IC707_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM) /* TBC */
#define IC707_ANTS RIG_ANT_1
/*
*/
static const struct icom_priv_caps ic707_priv_caps =
{
0x3e, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic707_caps =
{
.rig_model = RIG_MODEL_IC707,
.model_name = "IC-707",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 2,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC707_VFO_OPS,
.scan_ops = IC707_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 26, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
{ 27, 30, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
{ 31, 35, RIG_MTYPE_SAT, IC_MIN_MEM_CAP }, /* split ? */
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(500), MHz(30), IC707_ALL_RX_MODES, -1, -1, IC707_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC707_OTHER_TX_MODES, W(5), W(100), IC707_VFO_ALL, IC707_ANTS),
FRQ_RNG_HF(1, IC707_AM_TX_MODES, W(5), W(25), IC707_VFO_ALL, IC707_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(500), MHz(30), IC707_ALL_RX_MODES, -1, -1, IC707_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC707_OTHER_TX_MODES, W(5), W(100), IC707_VFO_ALL, IC707_ANTS),
FRQ_RNG_HF(2, IC707_AM_TX_MODES, W(5), W(25), IC707_VFO_ALL, IC707_ANTS), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = {
{IC707_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.1)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(12)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic707_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_split_vfo = icom_set_split_vfo,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.scan = icom_scan,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,409 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-9100 (HF/VHF/UHF All-Mode Tranceiver)
* Copyright (c) 2000-2011 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "idx_builtin.h"
#include "bandplan.h"
#define IC7100_MODES (RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_CWR|\
RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR|\
RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTAM|RIG_MODE_PKTFM|\
RIG_MODE_DSTAR)
#define IC7100_OTHER_TX_MODES ((IC7100_MODES) & ~(RIG_MODE_AM|RIG_MODE_PKTAM))
#define IC7100_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM)
#define IC7100_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM|RIG_SCAN_SLCT|RIG_SCAN_PRIO)
#define IC7100_VFO_OPS (RIG_OP_FROM_VFO| \
RIG_OP_TO_VFO| \
RIG_OP_CPY| \
RIG_OP_MCL| \
RIG_OP_XCHG| \
RIG_OP_TUNE)
#define IC7100_FUNC_ALL (RIG_FUNC_NB| \
RIG_FUNC_NR| \
RIG_FUNC_ANF| \
RIG_FUNC_TONE| \
RIG_FUNC_TSQL| \
RIG_FUNC_COMP| \
RIG_FUNC_VOX| \
RIG_FUNC_FBKIN| \
RIG_FUNC_AFC| \
RIG_FUNC_SATMODE| \
RIG_FUNC_VSC| \
RIG_FUNC_MN| \
RIG_FUNC_LOCK| \
RIG_FUNC_SCOPE| \
RIG_FUNC_TUNER)
#define IC7100_LEVEL_ALL (RIG_LEVEL_AF| \
RIG_LEVEL_RF| \
RIG_LEVEL_SQL| \
RIG_LEVEL_IF| \
RIG_LEVEL_NR| \
RIG_LEVEL_CWPITCH| \
RIG_LEVEL_RFPOWER| \
RIG_LEVEL_MICGAIN| \
RIG_LEVEL_KEYSPD| \
RIG_LEVEL_COMP| \
RIG_LEVEL_VOXGAIN| \
RIG_LEVEL_VOXDELAY| \
RIG_LEVEL_ANTIVOX| \
RIG_LEVEL_APF| \
RIG_LEVEL_AGC| \
RIG_LEVEL_PBT_IN| \
RIG_LEVEL_PBT_OUT| \
RIG_LEVEL_NOTCHF_RAW| \
RIG_LEVEL_ATT| \
RIG_LEVEL_PREAMP| \
RIG_LEVEL_RAWSTR| \
RIG_LEVEL_STRENGTH| \
RIG_LEVEL_SWR| \
RIG_LEVEL_ALC| \
RIG_LEVEL_RFPOWER_METER| \
RIG_LEVEL_COMP_METER| \
RIG_LEVEL_VD_METER| \
RIG_LEVEL_ID_METER| \
RIG_LEVEL_MONITOR_GAIN| \
RIG_LEVEL_NB)
#define IC7100_PARM_ALL (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
// IC-7100 S-meter calibration data based on manual
#define IC7100_STR_CAL { 14, \
{ \
{ 0, -54 }, \
{ 120, 0 }, \
{ 241, 60 } \
} }
#define IC7100_SWR_CAL { 5, \
{ \
{ 0, 1.0f }, \
{ 48, 1.5f }, \
{ 80, 2.0f }, \
{ 120, 3.0f }, \
{ 240, 6.0f } \
} }
#define IC7100_ALC_CAL { 2, \
{ \
{ 0, 0.0f }, \
{ 120, 1.0f } \
} }
#define IC7100_RFPOWER_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 143, 0.5f }, \
{ 213, 1.0f } \
} }
#define IC7100_COMP_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 130, 15.0f }, \
{ 241, 30.0f } \
} }
#define IC7100_VD_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 13, 10.0f }, \
{ 241, 16.0f } \
} }
#define IC7100_ID_METER_CAL { 4, \
{ \
{ 0, 0.0f }, \
{ 97, 10.0f }, \
{ 146, 15.0f }, \
{ 241, 25.0f } \
} }
#define IC7100_HF_ANTS (RIG_ANT_1|RIG_ANT_2)
int ic7100_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ic7100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
/*
* IC-7100 rig capabilities.
*/
static const struct icom_priv_caps ic7100_priv_caps =
{
0x88, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic7100_ts_sc_list, /* FIXME */
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
{ .level = RIG_AGC_MEDIUM, .icom_level = 2 },
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
{ .level = -1, .icom_level = 0 },
},
};
const struct rig_caps ic7100_caps =
{
.rig_model = RIG_MODEL_IC7100,
.model_name = "IC-7100",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC7100_FUNC_ALL,
.has_set_func = IC7100_FUNC_ALL | RIG_FUNC_RESUME,
.has_get_level = IC7100_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(IC7100_LEVEL_ALL),
.has_get_parm = IC7100_PARM_ALL,
.has_set_parm = IC7100_PARM_ALL,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = common_dcs_list,
.preamp = {20, RIG_DBLST_END, },
.attenuator = {20, RIG_DBLST_END, },
.max_rit = kHz(9.999),
.max_xit = kHz(9.999),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC7100_VFO_OPS,
.scan_ops = IC7100_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 9, /* TODO */
.chan_list = { /* TBC */
{ 1, 396, RIG_MTYPE_MEM },
{ 397, 400, RIG_MTYPE_CALL },
{ 401, 424, RIG_MTYPE_EDGE },
RIG_CHAN_END,
},
.rx_range_list1 = { /* Europe */
{kHz(30), MHz(60), IC7100_MODES, -1, -1, IC7100_VFO_ALL, IC7100_HF_ANTS},
{kHz(136), MHz(174), IC7100_MODES, -1, -1, IC7100_VFO_ALL, RIG_ANT_3},
{MHz(420), MHz(480), IC7100_MODES, -1, -1, IC7100_VFO_ALL, RIG_ANT_4},
{MHz(1240), MHz(1320), IC7100_MODES, -1, -1, IC7100_VFO_ALL, RIG_ANT_5},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC7100_OTHER_TX_MODES, W(2), W(100), IC7100_VFO_ALL, IC7100_HF_ANTS),
FRQ_RNG_HF(1, RIG_MODE_AM, W(2), W(25), IC7100_VFO_ALL, IC7100_HF_ANTS), /* only HF */
FRQ_RNG_6m(1, IC7100_OTHER_TX_MODES, W(2), W(100), IC7100_VFO_ALL, IC7100_HF_ANTS),
FRQ_RNG_2m(1, IC7100_OTHER_TX_MODES, W(2), W(100), IC7100_VFO_ALL, RIG_ANT_3),
FRQ_RNG_70cm(1, IC7100_OTHER_TX_MODES, W(2), W(75), IC7100_VFO_ALL, RIG_ANT_4),
/* option */
FRQ_RNG_23cm_REGION1(IC7100_OTHER_TX_MODES, W(1), W(10), IC7100_VFO_ALL, RIG_ANT_5),
RIG_FRNG_END,
},
.rx_range_list2 = { /* USA */
{kHz(30), MHz(60), IC7100_MODES, -1, -1, IC7100_VFO_ALL, IC7100_HF_ANTS},
{kHz(136), MHz(174), IC7100_MODES, -1, -1, IC7100_VFO_ALL, RIG_ANT_3},
{MHz(420), MHz(480), IC7100_MODES, -1, -1, IC7100_VFO_ALL, RIG_ANT_4},
{MHz(1240), MHz(1320), IC7100_MODES, -1, -1, IC7100_VFO_ALL, RIG_ANT_5},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC7100_OTHER_TX_MODES, W(2), W(100), IC7100_VFO_ALL, IC7100_HF_ANTS),
FRQ_RNG_HF(2, RIG_MODE_AM, W(2), W(25), IC7100_VFO_ALL, IC7100_HF_ANTS), /* only HF */
/* USA only, TBC: end of range and modes */
{MHz(5.255), MHz(5.405), IC7100_OTHER_TX_MODES, W(2), W(100), IC7100_VFO_ALL, IC7100_HF_ANTS}, /* USA only */
{MHz(5.255), MHz(5.405), RIG_MODE_AM, W(2), W(100), IC7100_VFO_ALL, IC7100_HF_ANTS}, /* USA only */
FRQ_RNG_6m(2, IC7100_OTHER_TX_MODES, W(2), W(100), IC7100_VFO_ALL, IC7100_HF_ANTS),
FRQ_RNG_2m(2, IC7100_OTHER_TX_MODES, W(2), W(100), IC7100_VFO_ALL, RIG_ANT_3),
FRQ_RNG_70cm(2, IC7100_OTHER_TX_MODES, W(2), W(75), IC7100_VFO_ALL, RIG_ANT_4),
/* option */
FRQ_RNG_23cm_REGION2(IC7100_OTHER_TX_MODES, W(1), W(10), IC7100_VFO_ALL, RIG_ANT_5),
RIG_FRNG_END,
},
.tuning_steps = {
{RIG_MODE_SSB | RIG_MODE_CW, 1},
{RIG_MODE_SSB | RIG_MODE_CW, 10},
{RIG_MODE_SSB | RIG_MODE_CW, 50},
{RIG_MODE_SSB | RIG_MODE_CW, 100},
{RIG_MODE_FM, kHz(0.1)},
{RIG_MODE_FM, kHz(5)},
{RIG_MODE_FM, kHz(6.25)},
{RIG_MODE_FM, kHz(10)},
{RIG_MODE_FM, kHz(12.5)},
{RIG_MODE_FM, kHz(20)},
{RIG_MODE_FM, kHz(25)},
{RIG_MODE_FM, kHz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(2.4)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(1.8)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(3)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(10)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(15)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(7)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(500)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(250)},
{RIG_MODE_CW | RIG_MODE_CWR, kHz(1.2)},
{RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(6)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(3)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(9)},
RIG_FLT_END,
},
.str_cal = IC7100_STR_CAL,
.swr_cal = IC7100_SWR_CAL,
.alc_cal = IC7100_ALC_CAL,
.rfpower_meter_cal = IC7100_RFPOWER_METER_CAL,
.comp_meter_cal = IC7100_COMP_METER_CAL,
.vd_meter_cal = IC7100_VD_METER_CAL,
.id_meter_cal = IC7100_ID_METER_CAL,
.priv = (void *)& ic7100_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.get_freq = icom_get_freq,
.set_freq = icom_set_freq,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode_with_data,
.get_vfo = NULL,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.get_ts = icom_get_ts,
.set_ts = icom_set_ts,
.get_func = icom_get_func,
.set_func = icom_set_func,
.get_level = ic7100_get_level,
.set_level = ic7100_set_level,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.set_rit = icom_set_rit,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_sql = icom_set_dcs_code,
.get_dcs_sql = icom_get_dcs_code,
.set_parm = icom_set_parm,
.get_parm = icom_get_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.get_dcd = icom_get_dcd,
.decode_event = icom_decode_event,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.send_morse = icom_send_morse
};
int ic7100_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x65;
return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val);
default:
return icom_set_level(rig, vfo, level, val);
}
}
int ic7100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x65;
return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val);
default:
return icom_get_level(rig, vfo, level, val);
}
}

Wyświetl plik

@ -1,209 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-718 caps
* Copyright (c) 2000-2010 by Stephane Fillod
* Caps submitted by Chuck Gilkes WD0FCL/4
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#include "idx_builtin.h"
#include "bandplan.h"
#define IC718_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define IC718_1MHZ_TS_MODES (RIG_MODE_AM)
#define IC718_1HZ_TS_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR)
/* tx doesn't have WFM.
* 100W in all modes but AM (40W)
*/
#define IC718_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define IC718_AM_TX_MODES (RIG_MODE_AM)
#define IC718_FUNC_ALL (RIG_FUNC_NR|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_ANF)
#define IC718_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_MICGAIN|RIG_LEVEL_NR|RIG_LEVEL_CWPITCH|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_RAWSTR|RIG_LEVEL_SQL)
#define IC718_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC718_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define IC718_SCAN_OPS (RIG_SCAN_MEM)
/*
* TODO: check whether func and levels are stored in memory
*/
#define IC718_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
.tx_freq = 1, \
.tx_mode = 1, \
.tx_width = 1, \
}
#define IC718_STR_CAL UNKNOWN_IC_STR_CAL
static const struct icom_priv_caps IC718_priv_caps =
{
0x5e, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic718_ts_sc_list
};
const struct rig_caps ic718_caps =
{
.rig_model = RIG_MODEL_IC718,
.model_name = "IC-718",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC718_FUNC_ALL,
.has_set_func = IC718_FUNC_ALL,
.has_get_level = IC718_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(IC718_LEVEL_ALL),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.str_cal = IC718_STR_CAL,
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { 10, RIG_DBLST_END, },
.attenuator = { 20, RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC718_VFO_OPS,
.scan_ops = IC718_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, IC718_MEM_CAP },
{ 100, 101, RIG_MTYPE_EDGE, IC718_MEM_CAP }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(30) - 1, IC718_ALL_RX_MODES, -1, -1, IC718_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC718_OTHER_TX_MODES, W(5), W(100), IC718_VFO_ALL, RIG_ANT_1),
FRQ_RNG_HF(1, IC718_AM_TX_MODES, W(2), W(40), IC718_VFO_ALL, RIG_ANT_1), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(30) - 1, IC718_ALL_RX_MODES, -1, -1, IC718_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC718_OTHER_TX_MODES, W(5), W(100), IC718_VFO_ALL, RIG_ANT_1),
FRQ_RNG_HF(2, IC718_AM_TX_MODES, W(2), W(40), IC718_VFO_ALL, RIG_ANT_1), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = {
{IC718_1HZ_TS_MODES, 1},
{IC718_ALL_RX_MODES, 10},
{IC718_ALL_RX_MODES, 100},
{IC718_ALL_RX_MODES, kHz(1)},
{IC718_ALL_RX_MODES, kHz(5)},
{IC718_ALL_RX_MODES, kHz(9)},
{IC718_ALL_RX_MODES, kHz(10)},
{IC718_ALL_RX_MODES, kHz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.1)}, /* bultin */
{RIG_MODE_CW | RIG_MODE_RTTY, Hz(500)}, /* FL-52A */
{RIG_MODE_CW | RIG_MODE_RTTY, Hz(250)}, /* FL-53A */
{RIG_MODE_SSB, kHz(2.8)}, /* FL-96 */
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(1.8)}, /* FL-222 */
{RIG_MODE_AM, kHz(6)}, /* mid w/ bultin FL-94 */
{RIG_MODE_AM, kHz(2.4)}, /* narrow w/ bultin FL-272 */
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& IC718_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_mem_get_split_vfo,
};

Wyświetl plik

@ -1,303 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-7200 and variations
* Adapted by J.Watson from IC-7000 code (c) 2004 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/*
* 26Mar09: Corrected tuning steps and added data modes.
* 25Mar09: Initial release
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <hamlib/rig.h>
#include "token.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "misc.h"
#include "bandplan.h"
/* AM Data mode needs adding - this would require one more mode 'RIG_MODE_PKTAM' to rig.h */
#define IC7200_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB)
#define IC7200_1HZ_TS_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB)
#define IC7200_NOT_TS_MODES (IC7200_ALL_RX_MODES &~IC7200_1HZ_TS_MODES)
#define IC7200_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define IC7200_AM_TX_MODES (RIG_MODE_AM)
#define IC7200_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_ARO|RIG_FUNC_TUNER)
#define IC7200_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_NB)
#define IC7200_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC7200_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_APO|RIG_PARM_TIME|RIG_PARM_BEEP)
#define IC7200_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
#define IC7200_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_SLCT|RIG_SCAN_PRIO)
#define IC7200_ANTS (RIG_ANT_1) /* ant-1 is Hf-6m */
#define IC7200_STR_CAL { 3, \
{ \
{ 0, -54 }, \
{ 120, 0 }, \
{ 241, 60 } \
} }
#define IC7200_SWR_CAL { 5, \
{ \
{ 0, 1.0f }, \
{ 48, 1.5f }, \
{ 80, 2.0f }, \
{ 120, 3.0f }, \
{ 240, 6.0f } \
} }
#define IC7200_ALC_CAL { 2, \
{ \
{ 0, 0.0f }, \
{ 120, 1.0f } \
} }
#define IC7200_RFPOWER_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 143, 0.5f }, \
{ 213, 1.0f } \
} }
int ic7200_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ic7200_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
/*
* IC-7200 rig capabilities.
*
* TODO: complete command set (esp. the $1A bunch!) and testing..
*/
static const struct icom_priv_caps IC7200_priv_caps =
{
0x76, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic7200_ts_sc_list,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
{ .level = RIG_AGC_FAST, .icom_level = 1 },
{ .level = RIG_AGC_SLOW, .icom_level = 2 },
{ .level = -1, .icom_level = 0 },
},
};
const struct rig_caps ic7200_caps =
{
.rig_model = RIG_MODEL_IC7200,
.model_name = "IC-7200",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC7200_FUNCS,
.has_set_func = IC7200_FUNCS,
.has_get_level = IC7200_LEVELS,
.has_set_level = RIG_LEVEL_SET(IC7200_LEVELS),
.has_get_parm = IC7200_PARMS,
.has_set_parm = RIG_PARM_SET(IC7200_PARMS),
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { 10, RIG_DBLST_END, }, /* FIXME: TBC it's a guess*/
.attenuator = { 20, RIG_DBLST_END, }, /* value taken from p.45 of manual*/
.max_rit = Hz(9999),
.max_xit = Hz(9999),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC7200_VFO_OPS,
.scan_ops = IC7200_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 1,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 199, RIG_MTYPE_MEM },
{ 200, 201, RIG_MTYPE_EDGE }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(60), IC7200_ALL_RX_MODES, -1, -1, IC7200_VFOS}, RIG_FRNG_END, },
.tx_range_list1 = {
FRQ_RNG_HF(1, IC7200_OTHER_TX_MODES, W(2), W(100), IC7200_VFOS, RIG_ANT_1),
FRQ_RNG_6m(1, IC7200_OTHER_TX_MODES, W(2), W(100), IC7200_VFOS, RIG_ANT_1),
FRQ_RNG_HF(1, IC7200_AM_TX_MODES, W(1), W(40), IC7200_VFOS, RIG_ANT_1), /* AM class */
FRQ_RNG_6m(1, IC7200_AM_TX_MODES, W(1), W(40), IC7200_VFOS, RIG_ANT_1), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(60), IC7200_ALL_RX_MODES, -1, -1, IC7200_VFOS}, RIG_FRNG_END, },
.tx_range_list2 = { /* needs the 5 mhz channels added */
FRQ_RNG_HF(2, IC7200_OTHER_TX_MODES, W(2), W(100), IC7200_VFOS, RIG_ANT_1),
FRQ_RNG_6m(2, IC7200_OTHER_TX_MODES, W(2), W(100), IC7200_VFOS, RIG_ANT_1),
FRQ_RNG_HF(2, IC7200_AM_TX_MODES, W(1), W(40), IC7200_VFOS, RIG_ANT_1), /* AM class */
FRQ_RNG_6m(2, IC7200_AM_TX_MODES, W(1), W(40), IC7200_VFOS, RIG_ANT_1), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = {
{IC7200_1HZ_TS_MODES, 1},
{IC7200_NOT_TS_MODES, 10},
{IC7200_ALL_RX_MODES, Hz(100)},
{IC7200_ALL_RX_MODES, kHz(1)},
{IC7200_ALL_RX_MODES, kHz(5)},
{IC7200_ALL_RX_MODES, kHz(9)},
{IC7200_ALL_RX_MODES, kHz(10)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! But duplication may speed up search. Put the most commonly used modes first! Remember these are defaults, with dsp rigs you can change them to anything you want except FM and WFM which are fixed */
.filters = {
{RIG_MODE_SSB, kHz(2.4)},
{RIG_MODE_SSB, kHz(1.8)},
{RIG_MODE_SSB, kHz(3)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(500)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(250)},
{RIG_MODE_CW | RIG_MODE_CWR, kHz(1.2)},
{RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_AM, kHz(3)},
{RIG_MODE_AM, kHz(9)},
RIG_FLT_END,
},
.str_cal = IC7200_STR_CAL,
.swr_cal = IC7200_SWR_CAL,
.alc_cal = IC7200_ALC_CAL,
.rfpower_meter_cal = IC7200_RFPOWER_METER_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& IC7200_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_vfo = icom_set_vfo,
.set_ant = NULL, /*automatically set by rig depending band */
.get_ant = NULL,
.decode_event = icom_decode_event,
.set_level = ic7200_set_level,
.get_level = ic7200_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = NULL,
.get_parm = NULL,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = NULL,
.set_rptr_shift = NULL,
.get_rptr_shift = NULL,
.set_rptr_offs = NULL,
.get_rptr_offs = NULL,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = NULL,
};
int ic7200_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x55;
return icom_set_level_raw(rig, level, C_CTL_MEM, 0x03, 1, cmdbuf, 1, val);
default:
return icom_set_level(rig, vfo, level, val);
}
}
int ic7200_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x55;
return icom_get_level_raw(rig, level, C_CTL_MEM, 0x03, 1, cmdbuf, val);
default:
return icom_get_level(rig, vfo, level, val);
}
}

Wyświetl plik

@ -1,168 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-725 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "bandplan.h"
#include "icom.h"
#define IC725_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
/*
* 100W in all modes but AM (40W)
*/
#define IC725_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC725_AM_TX_MODES (RIG_MODE_AM)
#define IC725_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC725_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY|RIG_OP_MCL)
#define IC725_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM) /* TBC */
#define IC725_ANTS RIG_ANT_1
/*
*/
static const struct icom_priv_caps ic725_priv_caps =
{
0x28, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic725_caps =
{
.rig_model = RIG_MODEL_IC725,
.model_name = "IC-725",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC725_VFO_OPS,
.scan_ops = IC725_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 26, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(30), MHz(33) - 10, IC725_ALL_RX_MODES, -1, -1, IC725_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(2, IC725_OTHER_TX_MODES, W(10), W(100), IC725_VFO_ALL, IC725_ANTS),
FRQ_RNG_HF(2, IC725_AM_TX_MODES, W(10), W(40), IC725_VFO_ALL, IC725_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(30), MHz(33) - 10, IC725_ALL_RX_MODES, -1, -1, IC725_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC725_OTHER_TX_MODES, W(10), W(100), IC725_VFO_ALL, IC725_ANTS),
FRQ_RNG_HF(2, IC725_AM_TX_MODES, W(10), W(40), IC725_VFO_ALL, IC725_ANTS), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = {
{IC725_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.3)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic725_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_split_vfo = icom_set_split_vfo,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.scan = icom_scan,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,176 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-726 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "bandplan.h"
#include "icom.h"
#define IC726_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
/*
* IC-726
* specs: http://www.qsl.net/sm7vhs/radio/icom/ic726/specs.htm
*
*/
#define IC726_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC726_AM_TX_MODES (RIG_MODE_AM)
#define IC726_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC726_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY|RIG_OP_MCL)
#define IC726_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM) /* TBC */
#define IC726_ANTS RIG_ANT_1
/*
*/
static const struct icom_priv_caps ic726_priv_caps =
{
0x30, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic726_caps =
{
.rig_model = RIG_MODEL_IC726,
.model_name = "IC-726",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 1200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC726_VFO_OPS,
.scan_ops = IC726_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 26, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(500), MHz(30), IC726_ALL_RX_MODES, -1, -1, IC726_VFO_ALL},
{MHz(50), MHz(54), IC726_ALL_RX_MODES, -1, -1, IC726_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC726_OTHER_TX_MODES, W(10), W(100), IC726_VFO_ALL, IC726_ANTS),
FRQ_RNG_HF(1, IC726_AM_TX_MODES, W(10), W(40), IC726_VFO_ALL, IC726_ANTS), /* AM class */
FRQ_RNG_6m(1, IC726_OTHER_TX_MODES, W(1), W(10), IC726_VFO_ALL, IC726_ANTS),
FRQ_RNG_6m(1, IC726_AM_TX_MODES, W(1), W(4), IC726_VFO_ALL, IC726_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(500), MHz(30), IC726_ALL_RX_MODES, -1, -1, IC726_VFO_ALL},
{MHz(50), MHz(54), IC726_ALL_RX_MODES, -1, -1, IC726_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC726_OTHER_TX_MODES, W(10), W(100), IC726_VFO_ALL, IC726_ANTS),
FRQ_RNG_HF(2, IC726_AM_TX_MODES, W(10), W(40), IC726_VFO_ALL, IC726_ANTS), /* AM class */
FRQ_RNG_6m(2, IC726_OTHER_TX_MODES, W(1), W(10), IC726_VFO_ALL, IC726_ANTS),
FRQ_RNG_6m(2, IC726_AM_TX_MODES, W(1), W(4), IC726_VFO_ALL, IC726_ANTS), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = {
{IC726_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.3)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic726_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_split_vfo = icom_set_split_vfo,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.scan = icom_scan,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,170 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-728
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "bandplan.h"
#include "icom.h"
#define IC728_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
/*
* IC-728
* specs: http://www.qsl.net/sm7vhs/radio/icom/ic728/specs.htm
*
*/
#define IC728_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC728_AM_TX_MODES (RIG_MODE_AM)
#define IC728_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC728_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY|RIG_OP_MCL)
#define IC728_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM) /* TBC */
#define IC728_ANTS RIG_ANT_1
/*
*/
static const struct icom_priv_caps ic728_priv_caps =
{
0x38, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic728_caps =
{
.rig_model = RIG_MODEL_IC728,
.model_name = "IC-728",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 2,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC728_VFO_OPS,
.scan_ops = IC728_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 26, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(500), MHz(30), IC728_ALL_RX_MODES, -1, -1, IC728_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC728_OTHER_TX_MODES, W(10), W(100), IC728_VFO_ALL, IC728_ANTS),
FRQ_RNG_HF(1, IC728_AM_TX_MODES, W(10), W(40), IC728_VFO_ALL, IC728_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(500), MHz(30), IC728_ALL_RX_MODES, -1, -1, IC728_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC728_OTHER_TX_MODES, W(10), W(100), IC728_VFO_ALL, IC728_ANTS),
FRQ_RNG_HF(2, IC728_AM_TX_MODES, W(10), W(40), IC728_VFO_ALL, IC728_ANTS), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = {
{IC728_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.1)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(12)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic728_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_split_vfo = icom_set_split_vfo,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.scan = icom_scan,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,726 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-7300 and variations
* Adapted by J.Watson from IC-7000 code (c) 2004 by Stephane Fillod
* Adapted from IC-7200 (c) 2016 by Michael Black W9MDB
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <hamlib/rig.h>
#include "token.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "misc.h"
#include "bandplan.h"
#include "tones.h"
#define IC7300_ALL_RX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM)
#define IC7300_1HZ_TS_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM)
#define IC7300_NOT_TS_MODES (IC7300_ALL_RX_MODES &~IC7300_1HZ_TS_MODES)
#define IC7300_OTHER_TX_MODES (RIG_MODE_FM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define IC7300_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
#define IC7300_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_SCOPE|RIG_FUNC_TUNER)
#define IC7300_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
#define IC7300_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC7300_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP)
#define IC7300_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
#define IC7300_SCAN_OPS (RIG_SCAN_STOP|RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_SLCT)
#define IC7300_ANTS (RIG_ANT_1) /* ant-1 is Hf-6m */
/*
* IC-7300 S-meter levels measured from live signals on multiple bands. Provides a good approximation.
*/
#define IC7300_STR_CAL { 7, \
{ \
{ 0, -54 }, \
{ 10, -48 }, \
{ 30, -36 }, \
{ 60, -24 }, \
{ 90, -12 }, \
{ 120, 0 }, \
{ 241, 64 } \
} }
#define IC7300_SWR_CAL { 5, \
{ \
{ 0, 1.0f }, \
{ 48, 1.5f }, \
{ 80, 2.0f }, \
{ 120, 3.0f }, \
{ 240, 6.0f } \
} }
#define IC7300_ALC_CAL { 2, \
{ \
{ 0, 0.0f }, \
{ 120, 1.0f } \
} }
#define IC7300_RFPOWER_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 143, 0.5f }, \
{ 213, 1.0f } \
} }
#define IC7300_COMP_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 130, 15.0f }, \
{ 241, 30.0f } \
} }
#define IC7300_VD_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 13, 10.0f }, \
{ 241, 16.0f } \
} }
#define IC7300_ID_METER_CAL { 4, \
{ \
{ 0, 0.0f }, \
{ 97, 10.0f }, \
{ 146, 15.0f }, \
{ 241, 25.0f } \
} }
/*
* IC9700 items that differ from IC7300
*/
#define IC9700_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM|RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
#define IC9700_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_SCOPE|RIG_FUNC_SATMODE|RIG_FUNC_AFC)
#define IC9700_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define IC9700_ALL_TX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR|RIG_MODE_DD)
#define IC9700_ALL_RX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR|RIG_MODE_DD)
#define IC9700_STR_CAL { 7, \
{ \
{ 0, -54 }, \
{ 10, -48 }, \
{ 30, -36 }, \
{ 60, -24 }, \
{ 90, -12 }, \
{ 120, 0 }, \
{ 241, 64 } \
} }
#define IC9700_SWR_CAL { 5, \
{ \
{ 0, 1.0f }, \
{ 48, 1.5f }, \
{ 80, 2.0f }, \
{ 120, 3.0f }, \
{ 240, 6.0f } \
} }
#define IC9700_ALC_CAL { 2, \
{ \
{ 0, 0.0f }, \
{ 120, 1.0f } \
} }
#define IC9700_RFPOWER_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 143, 0.5f }, \
{ 213, 1.0f } \
} }
#define IC9700_COMP_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 130, 15.0f }, \
{ 210, 25.5f } \
} }
#define IC9700_VD_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 13, 10.0f }, \
{ 241, 16.0f } \
} }
#define IC9700_ID_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 121, 10.0f }, \
{ 241, 20.0f } \
} }
/*
* IC-7300 rig capabilities.
*/
static const struct icom_priv_caps IC7300_priv_caps =
{
0x94, /* default address */
0, /* 731 mode */
1, /* no XCHG to avoid display flickering */
ic7300_ts_sc_list,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
{ .level = RIG_AGC_MEDIUM, .icom_level = 2 },
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
{ .level = -1, .icom_level = 0 },
},
};
static const struct icom_priv_caps IC9700_priv_caps =
{
0xA2, /* default address */
0, /* 731 mode */
1, /* no XCHG to avoid display flickering */
ic7300_ts_sc_list,
.serial_USB_echo_check = 1, /* USB CI-V may not echo */
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
{ .level = RIG_AGC_MEDIUM, .icom_level = 2 },
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
{ .level = -1, .icom_level = 0 },
},
};
int ic7300_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ic7300_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int ic9700_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ic9700_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int ic7300_set_parm(RIG *rig, setting_t parm, value_t val);
int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val);
const struct rig_caps ic7300_caps =
{
.rig_model = RIG_MODEL_IC7300,
.model_name = "IC-7300",
.mfg_name = "Icom",
.version = BACKEND_VER ".5",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.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 = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC7300_FUNCS,
.has_set_func = IC7300_FUNCS,
.has_get_level = IC7300_LEVELS,
.has_set_level = RIG_LEVEL_SET(IC7300_LEVELS),
.has_get_parm = IC7300_PARMS,
.has_set_parm = RIG_PARM_SET(IC7300_PARMS),
.level_gran = {
[LVL_RAWSTR] = {.min = {.i = 0}, .max = {.i = 255}},
[LVL_VOXDELAY] = {.min = {.i = 0}, .max = {.i = 20}, .step = {.i = 1}},
[LVL_KEYSPD] = {.min = {.i = 6}, .max = {.i = 48}, .step = {.i = 1}},
[LVL_CWPITCH] = {.min = {.i = 300}, .max = {.i = 900}, .step = {.i = 1}},
},
.parm_gran = {},
.extlevels = NULL,
.ctcss_list = full_ctcss_list,
.dcs_list = NULL,
.preamp = { 1, 2, RIG_DBLST_END, },
.attenuator = { 20, RIG_DBLST_END, },
.max_rit = Hz(9999),
.max_xit = Hz(9999),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC7300_VFO_OPS,
.scan_ops = IC7300_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 1,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 101, RIG_MTYPE_EDGE }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(74.8), IC7300_ALL_RX_MODES, -1, -1, IC7300_VFOS}, RIG_FRNG_END, },
.tx_range_list1 = {
FRQ_RNG_HF(1, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
FRQ_RNG_60m(1, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
FRQ_RNG_6m(1, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
FRQ_RNG_4m(1, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
FRQ_RNG_HF(1, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
FRQ_RNG_60m(1, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
FRQ_RNG_6m(1, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
FRQ_RNG_4m(1, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(74.8), IC7300_ALL_RX_MODES, -1, -1, IC7300_VFOS}, RIG_FRNG_END, },
.tx_range_list2 = {
FRQ_RNG_HF(2, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
FRQ_RNG_60m(2, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
FRQ_RNG_6m(2, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
FRQ_RNG_HF(2, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
FRQ_RNG_60m(2, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
FRQ_RNG_6m(2, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = {
{IC7300_ALL_RX_MODES, Hz(1)},
{IC7300_ALL_RX_MODES, kHz(1)},
{IC7300_ALL_RX_MODES, kHz(5)},
{IC7300_ALL_RX_MODES, kHz(9)},
{IC7300_ALL_RX_MODES, kHz(10)},
{IC7300_ALL_RX_MODES, kHz(12.5)},
{IC7300_ALL_RX_MODES, kHz(20)},
{IC7300_ALL_RX_MODES, kHz(25)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! But duplication may speed up search. Put the most commonly used modes first! Remember these are defaults, with dsp rigs you can change them to anything you want except FM and WFM which are fixed */
.filters = {
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(2.4)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(1.8)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(3)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(500)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(250)},
{RIG_MODE_CW | RIG_MODE_CWR, kHz(1.2)},
{RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(6)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(3)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(9)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(10)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(7)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(15)},
RIG_FLT_END,
},
.str_cal = IC7300_STR_CAL,
.swr_cal = IC7300_SWR_CAL,
.alc_cal = IC7300_ALC_CAL,
.rfpower_meter_cal = IC7300_RFPOWER_METER_CAL,
.comp_meter_cal = IC7300_COMP_METER_CAL,
.vd_meter_cal = IC7300_VD_METER_CAL,
.id_meter_cal = IC7300_ID_METER_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& IC7300_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = icom_rig_open,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
//.get_vfo = icom_get_vfo,
.set_vfo = icom_set_vfo,
.set_ant = NULL,
.get_ant = NULL,
.set_rit = icom_set_rit_new,
.get_rit = icom_get_rit_new,
.get_xit = icom_get_rit_new,
.set_xit = icom_set_xit_new,
.decode_event = icom_decode_event,
.set_level = ic7300_set_level,
.get_level = ic7300_get_level,
.set_ext_level = icom_set_ext_level,
.get_ext_level = icom_get_ext_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = ic7300_set_parm,
.get_parm = ic7300_get_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.power2mW = icom_power2mW,
.mW2power = icom_mW2power,
.send_morse = icom_send_morse
};
const struct rig_caps ic9700_caps =
{
.rig_model = RIG_MODEL_IC9700,
.model_name = "IC-9700",
.mfg_name = "Icom",
.version = BACKEND_VER ".3",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 4800,
.serial_rate_max = 38400,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC9700_FUNCS,
.has_set_func = IC9700_FUNCS,
.has_get_level = IC7300_LEVELS,
.has_set_level = RIG_LEVEL_SET(IC7300_LEVELS),
.has_get_parm = IC7300_PARMS,
.has_set_parm = RIG_PARM_SET(IC7300_PARMS),
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = {.min = {.i = 6}, .max = {.i = 48}, .step = {.i = 1}},
[LVL_CWPITCH] = {.min = {.i = 300}, .max = {.i = 900}, .step = {.i = 1}},
},
.parm_gran = {},
.extlevels = NULL,
.ctcss_list = full_ctcss_list,
.dcs_list = NULL,
.preamp = { 1, 2, 3, RIG_DBLST_END, },
.attenuator = { 10, RIG_DBLST_END, },
.max_rit = Hz(9999),
.max_xit = Hz(9999),
.max_ifshift = Hz(0),
.targetable_vfo = RIG_TARGETABLE_FREQ,
.vfo_ops = IC9700_VFO_OPS,
.scan_ops = IC7300_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 1,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 101, RIG_MTYPE_EDGE }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(74.8), IC7300_ALL_RX_MODES, -1, -1, IC9700_VFOS}, RIG_FRNG_END, },
.tx_range_list1 = {
FRQ_RNG_2m(1, IC9700_ALL_TX_MODES, W(2), W(100), IC9700_VFOS, RIG_ANT_2),
FRQ_RNG_70cm(1, IC9700_ALL_TX_MODES, W(2), W(75), IC9700_VFOS, RIG_ANT_2),
FRQ_RNG_23cm(1, IC9700_ALL_TX_MODES, W(2), W(23), IC9700_VFOS, RIG_ANT_3),
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(74.8), IC7300_ALL_RX_MODES, -1, -1, IC9700_VFOS}, RIG_FRNG_END, },
.tx_range_list2 = {
FRQ_RNG_2m(1, IC9700_ALL_TX_MODES, W(2), W(100), IC9700_VFOS, RIG_ANT_2),
FRQ_RNG_70cm(1, IC9700_ALL_TX_MODES, W(2), W(75), IC9700_VFOS, RIG_ANT_2),
FRQ_RNG_23cm(1, IC9700_ALL_TX_MODES, W(2), W(23), IC9700_VFOS, RIG_ANT_3),
RIG_FRNG_END,
},
.tuning_steps = {
{IC9700_ALL_RX_MODES, Hz(1)},
{IC9700_ALL_RX_MODES, Hz(10)},
{IC9700_ALL_RX_MODES, Hz(100)},
{IC9700_ALL_RX_MODES, Hz(500)},
{IC9700_ALL_RX_MODES, kHz(1)},
{IC9700_ALL_RX_MODES, kHz(5)},
{IC9700_ALL_RX_MODES, kHz(6.25)},
{IC9700_ALL_RX_MODES, kHz(10)},
{IC9700_ALL_RX_MODES, kHz(12.5)},
{IC9700_ALL_RX_MODES, kHz(20)},
{IC9700_ALL_RX_MODES, kHz(25)},
{IC9700_ALL_RX_MODES, kHz(50)},
{IC9700_ALL_RX_MODES, kHz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! But duplication may speed up search. Put the most commonly used modes first! Remember these are defaults, with dsp rigs you can change them to anything you want except FM and WFM which are fixed */
.filters = {
{RIG_MODE_SSB, kHz(2.4)},
{RIG_MODE_SSB, kHz(1.8)},
{RIG_MODE_SSB, kHz(3)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(500)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(250)},
{RIG_MODE_CW | RIG_MODE_CWR, kHz(1.2)},
{RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(6)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(3)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(9)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(15)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(7)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(10)},
RIG_FLT_END,
},
.str_cal = IC9700_STR_CAL,
.swr_cal = IC9700_SWR_CAL,
.alc_cal = IC9700_ALC_CAL,
.rfpower_meter_cal = IC9700_RFPOWER_METER_CAL,
.comp_meter_cal = IC9700_COMP_METER_CAL,
.vd_meter_cal = IC9700_VD_METER_CAL,
.id_meter_cal = IC9700_ID_METER_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& IC9700_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = icom_rig_open,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
//.get_vfo = icom_get_vfo,
.set_vfo = icom_set_vfo,
.set_ant = NULL,
.get_ant = NULL,
.set_rit = icom_set_rit_new,
.get_rit = icom_get_rit_new,
.decode_event = icom_decode_event,
.set_level = ic9700_set_level,
.get_level = ic9700_get_level,
.set_ext_level = icom_set_ext_level,
.get_ext_level = icom_get_ext_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = icom_set_parm,
.get_parm = icom_get_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.power2mW = icom_power2mW,
.mW2power = icom_mW2power,
.send_morse = icom_send_morse
};
int ic7300_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x91;
return icom_set_level_raw(rig, level, C_CTL_MEM, S_MEM_PARM, 2, cmdbuf, 1, val);
default:
return icom_set_level(rig, vfo, level, val);
}
}
int ic7300_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x91;
return icom_get_level_raw(rig, level, C_CTL_MEM, S_MEM_PARM, 2, cmdbuf, val);
default:
return icom_get_level(rig, vfo, level, val);
}
}
int ic9700_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x03;
cmdbuf[1] = 0x30;
return icom_set_level_raw(rig, level, C_CTL_MEM, S_MEM_PARM, 2, cmdbuf, 1, val);
default:
return ic7300_set_level(rig, vfo, level, val);
}
}
int ic9700_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x03;
cmdbuf[1] = 0x30;
return icom_get_level_raw(rig, level, C_CTL_MEM, S_MEM_PARM, 2, cmdbuf, val);
default:
return ic7300_get_level(rig, vfo, level, val);
}
}
int ic7300_set_parm(RIG *rig, setting_t parm, value_t val)
{
unsigned char parmbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (parm)
{
case RIG_PARM_BEEP:
parmbuf[0] = 0x00;
parmbuf[1] = 0x23;
return icom_set_custom_parm(rig, 2, parmbuf, 1, val.i ? 1 : 0);
case RIG_PARM_BACKLIGHT:
parmbuf[0] = 0x00;
parmbuf[1] = 0x81;
return icom_set_custom_parm(rig, 2, parmbuf, 2, (int)(val.f * 255.0f));
case RIG_PARM_TIME:
parmbuf[0] = 0x00;
parmbuf[1] = 0x95;
return icom_set_custom_parm_time(rig, 2, parmbuf, val.i);
default:
return icom_set_parm(rig, parm, val);
}
}
int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val)
{
unsigned char parmbuf[MAXFRAMELEN];
int retval;
int icom_val;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (parm)
{
case RIG_PARM_BEEP:
parmbuf[0] = 0x00;
parmbuf[1] = 0x23;
retval = icom_get_custom_parm(rig, 2, parmbuf, &icom_val);
if (retval != RIG_OK)
{
return retval;
}
val->i = icom_val ? 1 : 0;
break;
case RIG_PARM_BACKLIGHT:
parmbuf[0] = 0x00;
parmbuf[1] = 0x81;
retval = icom_get_custom_parm(rig, 2, parmbuf, &icom_val);
if (retval != RIG_OK)
{
return retval;
}
val->f = (float) icom_val / 255.0f;
break;
case RIG_PARM_TIME:
parmbuf[0] = 0x00;
parmbuf[1] = 0x95;
return icom_get_custom_parm_time(rig, 2, parmbuf, &val->i);
default:
return icom_get_parm(rig, parm, val);
}
return RIG_OK;
}

Wyświetl plik

@ -1,174 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-735 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "icom.h"
#include "bandplan.h"
#define IC735_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
/*
* 100W in all modes but AM (40W)
*/
#define IC735_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC735_AM_TX_MODES (RIG_MODE_AM)
#define IC735_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC735_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
#define IC735_ANTS RIG_ANT_1
/*
*/
static const struct icom_priv_caps ic735_priv_caps =
{
0x04, /* default address */
1, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic735_caps =
{
.rig_model = RIG_MODEL_IC735,
.model_name = "IC-735",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC735_VFO_OPS,
.scan_ops = RIG_SCAN_NONE,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 10, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
{ 11, 12, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(30), IC735_ALL_RX_MODES, -1, -1, IC735_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC735_OTHER_TX_MODES, W(10), W(100), IC735_VFO_ALL, IC735_ANTS),
FRQ_RNG_HF(1, IC735_AM_TX_MODES, W(10), W(40), IC735_VFO_ALL, IC735_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(30), IC735_ALL_RX_MODES, -1, -1, IC735_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { {kHz(1800), MHz(2) - 1, IC735_OTHER_TX_MODES, 5000, 100000, IC735_VFO_ALL}, /* 100W class */
{kHz(1800), MHz(2) - 1, IC735_AM_TX_MODES, 2000, 40000, IC735_VFO_ALL}, /* 40W class */
{kHz(3500), MHz(4) - 1, IC735_OTHER_TX_MODES, 5000, 100000, IC735_VFO_ALL},
{kHz(3500), MHz(4) - 1, IC735_AM_TX_MODES, 2000, 40000, IC735_VFO_ALL},
{MHz(7), kHz(7300), IC735_OTHER_TX_MODES, 5000, 100000, IC735_VFO_ALL},
{MHz(7), kHz(7300), IC735_AM_TX_MODES, 2000, 40000, IC735_VFO_ALL},
{kHz(10100), kHz(10150), IC735_OTHER_TX_MODES, 5000, 100000, IC735_VFO_ALL},
{kHz(10100), kHz(10150), IC735_AM_TX_MODES, 2000, 40000, IC735_VFO_ALL},
{MHz(14), kHz(14350), IC735_OTHER_TX_MODES, 5000, 100000, IC735_VFO_ALL},
{MHz(14), kHz(14350), IC735_AM_TX_MODES, 2000, 40000, IC735_VFO_ALL},
{kHz(18068), kHz(18168), IC735_OTHER_TX_MODES, 5000, 100000, IC735_VFO_ALL},
{kHz(18068), kHz(18168), IC735_AM_TX_MODES, 2000, 40000, IC735_VFO_ALL},
{MHz(21), kHz(21450), IC735_OTHER_TX_MODES, 5000, 100000, IC735_VFO_ALL},
{MHz(21), kHz(21450), IC735_AM_TX_MODES, 2000, 40000, IC735_VFO_ALL},
{kHz(24890), kHz(24990), IC735_OTHER_TX_MODES, 5000, 100000, IC735_VFO_ALL},
{kHz(24890), kHz(24990), IC735_AM_TX_MODES, 2000, 40000, IC735_VFO_ALL},
{MHz(28), kHz(29700), IC735_OTHER_TX_MODES, 5000, 100000, IC735_VFO_ALL},
{MHz(28), kHz(29700), IC735_AM_TX_MODES, 2000, 40000, IC735_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC735_ALL_RX_MODES, 1},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.4)},
{RIG_MODE_AM, kHz(8)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic735_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,193 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-736 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include <bandplan.h>
#include "icom.h"
/*
* IC-736
*/
#define IC736_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
/*
* 100W in all modes but AM (40W)
*/
#define IC736_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC736_AM_TX_MODES (RIG_MODE_AM)
#define IC736_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC736_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY)
#define IC736_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_VFO)
#define IC736_ANTS 0 /* FIXME: declare both antenna connectors */
#define IC736_STR_CAL { 0, { } }
/*
*/
static const struct icom_priv_caps ic736_priv_caps =
{
0x40, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic736_caps =
{
.rig_model = RIG_MODEL_IC736,
.model_name = "IC-736",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC736_VFO_OPS,
.scan_ops = IC736_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 89, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
{ 90, 99, RIG_MTYPE_MEM, IC_MIN_MEM_CAP }, /* FIXME: split */
{ 100, 101, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(500), MHz(30), IC736_ALL_RX_MODES, -1, -1, IC736_VFO_ALL, IC736_ANTS},
{MHz(50), MHz(54), IC736_ALL_RX_MODES, -1, -1, IC736_VFO_ALL, IC736_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC736_OTHER_TX_MODES, W(5), W(100), IC736_VFO_ALL, IC736_ANTS),
FRQ_RNG_6m(1, IC736_OTHER_TX_MODES, W(5), W(100), IC736_VFO_ALL, IC736_ANTS),
FRQ_RNG_HF(1, IC736_AM_TX_MODES, W(4), W(40), IC736_VFO_ALL, IC736_ANTS), /* AM class */
FRQ_RNG_6m(1, IC736_AM_TX_MODES, W(4), W(40), IC736_VFO_ALL, IC736_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(500), MHz(30), IC736_ALL_RX_MODES, -1, -1, IC736_VFO_ALL, IC736_ANTS},
{MHz(50), MHz(54), IC736_ALL_RX_MODES, -1, -1, IC736_VFO_ALL, IC736_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC736_OTHER_TX_MODES, W(5), W(100), IC736_VFO_ALL, IC736_ANTS),
FRQ_RNG_6m(2, IC736_OTHER_TX_MODES, W(5), W(100), IC736_VFO_ALL, IC736_ANTS),
FRQ_RNG_HF(2, IC736_AM_TX_MODES, W(4), W(40), IC736_VFO_ALL, IC736_ANTS), /* AM class */
FRQ_RNG_6m(2, IC736_AM_TX_MODES, W(4), W(40), IC736_VFO_ALL, IC736_ANTS), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = { /* TBC */
{IC736_ALL_RX_MODES, 10},
{IC736_ALL_RX_MODES, kHz(1)},
{IC736_ALL_RX_MODES, kHz(2)},
{IC736_ALL_RX_MODES, kHz(3)},
{IC736_ALL_RX_MODES, kHz(4)},
{IC736_ALL_RX_MODES, kHz(5)},
{IC736_ALL_RX_MODES, kHz(6)},
{IC736_ALL_RX_MODES, kHz(7)},
{IC736_ALL_RX_MODES, kHz(8)},
{IC736_ALL_RX_MODES, kHz(9)},
{IC736_ALL_RX_MODES, kHz(10)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.1)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(12)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic736_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ts = icom_set_ts,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
};

Wyświetl plik

@ -1,184 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-737
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include <bandplan.h>
#include "icom.h"
/*
* IC-737
*/
#define IC737_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
/*
* 100W in all modes but AM (40W)
*/
#define IC737_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC737_AM_TX_MODES (RIG_MODE_AM)
#define IC737_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC737_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY)
#define IC737_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_VFO)
#define IC737_ANTS (RIG_ANT_1|RIG_ANT_2)
static const struct icom_priv_caps ic737_priv_caps =
{
0x3c, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic737_caps =
{
.rig_model = RIG_MODEL_IC737,
.model_name = "IC-737",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC737_VFO_OPS,
.scan_ops = IC737_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 100, RIG_MTYPE_MEM },
{ 101, 101, RIG_MTYPE_EDGE },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(30), MHz(30), IC737_ALL_RX_MODES, -1, -1, IC737_VFO_ALL, IC737_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC737_OTHER_TX_MODES, W(10), W(100), IC737_VFO_ALL, IC737_ANTS),
FRQ_RNG_HF(1, IC737_AM_TX_MODES, W(10), W(40), IC737_VFO_ALL, IC737_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(30), MHz(30), IC737_ALL_RX_MODES, -1, -1, IC737_VFO_ALL, IC737_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC737_OTHER_TX_MODES, W(10), W(100), IC737_VFO_ALL, IC737_ANTS),
FRQ_RNG_HF(2, IC737_AM_TX_MODES, W(10), W(40), IC737_VFO_ALL, IC737_ANTS), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = {
{IC737_ALL_RX_MODES, 10},
{IC737_ALL_RX_MODES, kHz(1)},
{IC737_ALL_RX_MODES, kHz(2)},
{IC737_ALL_RX_MODES, kHz(3)},
{IC737_ALL_RX_MODES, kHz(4)},
{IC737_ALL_RX_MODES, kHz(5)},
{IC737_ALL_RX_MODES, kHz(6)},
{IC737_ALL_RX_MODES, kHz(7)},
{IC737_ALL_RX_MODES, kHz(8)},
{IC737_ALL_RX_MODES, kHz(9)},
{IC737_ALL_RX_MODES, kHz(10)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.1)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(12)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic737_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ts = icom_set_ts,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
};

Wyświetl plik

@ -1,189 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-738 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include <bandplan.h>
#include "icom.h"
/*
* IC-738, like the IC-736 but without 6m
*/
#define IC738_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
/*
* 100W in all modes but AM (40W)
*/
#define IC738_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC738_AM_TX_MODES (RIG_MODE_AM)
#define IC738_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC738_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY)
#define IC738_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_VFO)
#define IC738_ANTS 0 /* TODO: declare both antenna connectors? */
#define IC738_STR_CAL { 0, { } }
/*
*/
static const struct icom_priv_caps ic738_priv_caps =
{
0x44, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic738_caps =
{
.rig_model = RIG_MODEL_IC738,
.model_name = "IC-738",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC738_VFO_OPS,
.scan_ops = IC738_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 89, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
{ 90, 99, RIG_MTYPE_MEM, IC_MIN_MEM_CAP }, /* FIXME: split */
{ 100, 101, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(500), MHz(30), IC738_ALL_RX_MODES, -1, -1, IC738_VFO_ALL, IC738_ANTS},
{MHz(50), MHz(54), IC738_ALL_RX_MODES, -1, -1, IC738_VFO_ALL, IC738_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC738_OTHER_TX_MODES, W(5), W(100), IC738_VFO_ALL, IC738_ANTS),
FRQ_RNG_HF(1, IC738_AM_TX_MODES, W(4), W(40), IC738_VFO_ALL, IC738_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(500), MHz(30), IC738_ALL_RX_MODES, -1, -1, IC738_VFO_ALL, IC738_ANTS},
{MHz(50), MHz(54), IC738_ALL_RX_MODES, -1, -1, IC738_VFO_ALL, IC738_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC738_OTHER_TX_MODES, W(5), W(100), IC738_VFO_ALL, IC738_ANTS),
FRQ_RNG_HF(2, IC738_AM_TX_MODES, W(4), W(40), IC738_VFO_ALL, IC738_ANTS), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = { /* TBC */
{IC738_ALL_RX_MODES, 10},
{IC738_ALL_RX_MODES, kHz(1)},
{IC738_ALL_RX_MODES, kHz(2)},
{IC738_ALL_RX_MODES, kHz(3)},
{IC738_ALL_RX_MODES, kHz(4)},
{IC738_ALL_RX_MODES, kHz(5)},
{IC738_ALL_RX_MODES, kHz(6)},
{IC738_ALL_RX_MODES, kHz(7)},
{IC738_ALL_RX_MODES, kHz(8)},
{IC738_ALL_RX_MODES, kHz(9)},
{IC738_ALL_RX_MODES, kHz(10)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.1)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(12)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic738_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ts = icom_set_ts,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
};

Wyświetl plik

@ -1,307 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-7410
* Copyright (c) 2011 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <hamlib/rig.h>
#include "token.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "misc.h"
#include "bandplan.h"
#define IC7410_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM)
#define IC7410_AM_TX_MODES (RIG_MODE_AM)
#define IC7410_ALL_RX_MODES IC7410_OTHER_TX_MODES | IC7410_AM_TX_MODES
#define IC7410_1HZ_TS_MODES IC7410_ALL_RX_MODES
#define IC7410_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK|RIG_FUNC_TUNER)
#define IC7410_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER)
#define IC7410_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC7410_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
#define IC7410_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
#define IC7410_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_PROG|RIG_SCAN_DELTA|RIG_SCAN_PRIO)
#define IC7410_ANTS (RIG_ANT_1|RIG_ANT_2)
/*
* Guess from IC7600
*/
#define IC7410_STR_CAL { 16, \
{ \
{ 0, -54 }, /* S0 */ \
{ 124, 0 }, /* S9 */ \
{ 246, 60 } /* S9+60dB */ \
} }
#define IC7410_SWR_CAL { 5, \
{ \
{ 0, 1.0f }, \
{ 48, 1.5f }, \
{ 80, 2.0f }, \
{ 120, 3.0f }, \
{ 240, 6.0f } \
} }
#define IC7410_ALC_CAL { 2, \
{ \
{ 0, 0.0f }, \
{ 120, 1.0f } \
} }
#define IC7410_RFPOWER_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 143, 0.5f }, \
{ 213, 1.0f } \
} }
int ic7410_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ic7410_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
/*
* IC-7410 rig capabilities.
*/
static const struct icom_priv_caps ic7410_priv_caps =
{
0x80, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
{ .level = RIG_AGC_SLOW, .icom_level = 1 },
{ .level = RIG_AGC_MEDIUM, .icom_level = 2 },
{ .level = RIG_AGC_FAST, .icom_level = 3 },
{ .level = -1, .icom_level = 0 },
},
};
const struct rig_caps ic7410_caps =
{
.rig_model = RIG_MODEL_IC7410,
.model_name = "IC-7410",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC7410_FUNCS,
.has_set_func = IC7410_FUNCS,
.has_get_level = IC7410_LEVELS,
.has_set_level = RIG_LEVEL_SET(IC7410_LEVELS),
.has_get_parm = IC7410_PARMS,
.has_set_parm = RIG_PARM_SET(IC7410_PARMS), /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = NULL,
.preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */
.attenuator = { 6, 12, 18, RIG_DBLST_END, },
.max_rit = Hz(9999),
.max_xit = Hz(9999),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC7410_VFO_OPS,
.scan_ops = IC7410_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 101, RIG_MTYPE_EDGE }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(60), IC7410_ALL_RX_MODES, -1, -1, IC7410_VFOS, IC7410_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC7410_OTHER_TX_MODES, W(2), W(100), IC7410_VFOS, IC7410_ANTS),
FRQ_RNG_6m(1, IC7410_OTHER_TX_MODES, W(2), W(100), IC7410_VFOS, IC7410_ANTS),
FRQ_RNG_HF(1, IC7410_AM_TX_MODES, W(1), W(27), IC7410_VFOS, IC7410_ANTS), /* AM class */
FRQ_RNG_6m(1, IC7410_AM_TX_MODES, W(1), W(27), IC7410_VFOS, IC7410_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(60), IC7410_ALL_RX_MODES, -1, -1, IC7410_VFOS, IC7410_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC7410_OTHER_TX_MODES, W(2), W(100), IC7410_VFOS, IC7410_ANTS),
FRQ_RNG_6m(2, IC7410_OTHER_TX_MODES, W(2), W(100), IC7410_VFOS, IC7410_ANTS),
FRQ_RNG_HF(2, IC7410_AM_TX_MODES, W(2), W(27), IC7410_VFOS, IC7410_ANTS), /* AM class */
FRQ_RNG_6m(2, IC7410_AM_TX_MODES, W(2), W(27), IC7410_VFOS, IC7410_ANTS), /* AM class */
/* USA only, TBC: end of range and modes */
{MHz(5.33050), MHz(5.33350), IC7410_OTHER_TX_MODES, W(2), W(100), IC7410_VFOS, IC7410_ANTS}, /* USA only */
{MHz(5.34650), MHz(5.34950), IC7410_OTHER_TX_MODES, W(2), W(100), IC7410_VFOS, IC7410_ANTS}, /* USA only */
{MHz(5.36650), MHz(5.36950), IC7410_OTHER_TX_MODES, W(2), W(100), IC7410_VFOS, IC7410_ANTS}, /* USA only */
{MHz(5.37150), MHz(5.37450), IC7410_OTHER_TX_MODES, W(2), W(100), IC7410_VFOS, IC7410_ANTS}, /* USA only */
{MHz(5.40350), MHz(5.40650), IC7410_OTHER_TX_MODES, W(2), W(100), IC7410_VFOS, IC7410_ANTS}, /* USA only */
RIG_FRNG_END,
},
.tuning_steps = {
{IC7410_1HZ_TS_MODES, 1},
{IC7410_ALL_RX_MODES, Hz(100)},
{IC7410_ALL_RX_MODES, kHz(1)},
{IC7410_ALL_RX_MODES, kHz(5)},
{IC7410_ALL_RX_MODES, kHz(9)},
{IC7410_ALL_RX_MODES, kHz(10)},
{IC7410_ALL_RX_MODES, kHz(12.5)},
{IC7410_ALL_RX_MODES, kHz(20)},
{IC7410_ALL_RX_MODES, kHz(25)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_CW | RIG_MODE_CWR, Hz(500)},
{RIG_MODE_CW | RIG_MODE_CWR, Hz(350)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_AM, kHz(2.4)},
{RIG_MODE_FM, kHz(12)},
{RIG_MODE_FM, kHz(8)}, /* TBC */
RIG_FLT_END,
},
.str_cal = IC7410_STR_CAL,
.swr_cal = IC7410_SWR_CAL,
.alc_cal = IC7410_ALC_CAL,
.rfpower_meter_cal = IC7410_RFPOWER_METER_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic7410_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.set_rit = icom_set_rit,
.decode_event = icom_decode_event,
.set_level = ic7410_set_level,
.get_level = ic7410_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = icom_set_parm,
.get_parm = icom_get_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_mem_get_split_vfo,
.send_morse = icom_send_morse,
};
int ic7410_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x75;
return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 1, cmdbuf, 1, val);
default:
return icom_set_level(rig, vfo, level, val);
}
}
int ic7410_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x75;
return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 1, cmdbuf, val);
default:
return icom_get_level(rig, vfo, level, val);
}
}

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1,230 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-751 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "bandplan.h"
#include "icom.h"
#include "idx_builtin.h"
/*
* FM is an option on the Icom IC-751, and built-in in the Icom IC-751A
*/
#define IC751_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM)
/*
* 200W in all modes but AM (40W)
*/
#define IC751_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM)
#define IC751_AM_TX_MODES (RIG_MODE_AM)
#define IC751_VFO_ALL (RIG_VFO_A|RIG_VFO_MEM)
#define IC751_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
#define IC751_SCAN_OPS (RIG_SCAN_NONE)
#define IC751_ANTS RIG_ANT_1
/*
* S-Meter measurements
* (Only the Piexx UX-14px rev.2 and up has an S-meter option.)
* Values based on the readings of my IC-751A S-meter, i.e. not
* actual signal strength. -- Lars, sm6rpz
*/
#define IC751_STR_CAL { 16, { \
{ 3, -52 }, /* S0.5 */ \
{ 12, -48 }, /* S1 */ \
{ 33, -42 }, /* S2 */ \
{ 45, -36 }, /* S3 */ \
{ 60, -30 }, /* S4 */ \
{ 73, -24 }, /* S5 */ \
{ 86, -18 }, /* S6 */ \
{ 100, -12 }, /* S7 */ \
{ 115, -6 }, /* S8 */ \
{ 129, 0 }, /* S9 */ \
{ 160, 10 }, /* S9+10 */ \
{ 186, 20 }, /* S9+20 */ \
{ 208, 30 }, /* S9+30 */ \
{ 226, 40 }, /* S9+40 */ \
{ 241, 50 }, /* S9+50 */ \
{ 255, 60 } /* S9+60 */ \
} }
/*
*/
static const struct icom_priv_caps ic751_priv_caps =
{
0x1c, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic751_caps =
{
.rig_model = RIG_MODEL_IC751,
.model_name = "IC-751",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG, /* Piexx UX-14px has a PTT option */
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600, /* Piexx UX-14px can use 9600 */
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
/* Piexx UX-14px has an S-meter option */
.has_get_level = (RIG_LEVEL_RAWSTR | RIG_LEVEL_STRENGTH),
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC751_VFO_OPS,
.scan_ops = IC751_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 32, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(100), MHz(30), IC751_ALL_RX_MODES, -1, -1, IC751_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(1.8), MHz(1.99999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL}, /* 100W class */
{MHz(1.8), MHz(1.99999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL}, /* 40W class */
{MHz(3.45), MHz(4.09999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(3.45), MHz(4.09999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(6.95), MHz(7.49999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(6.95), MHz(7.49999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(9.95), MHz(10.49999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(9.95), MHz(10.49999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(13.95), MHz(14.49999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(13.95), MHz(14.49999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(17.95), MHz(18.49999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(17.95), MHz(18.49999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(20.95), MHz(21.49999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(20.95), MHz(21.49999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(24.45), MHz(25.09999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(24.45), MHz(25.09999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(27.95), MHz(30), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(27.95), MHz(30), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(100), MHz(30), IC751_ALL_RX_MODES, -1, -1, IC751_VFO_ALL},
RIG_FRNG_END,
},
/* weird transmit ranges ... --sf */
.tx_range_list2 = {
{MHz(1.8), MHz(1.99999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL}, /* 100W class */
{MHz(1.8), MHz(1.99999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL}, /* 40W class */
{MHz(3.45), MHz(4.09999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(3.45), MHz(4.09999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(6.95), MHz(7.49999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(6.95), MHz(7.49999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(9.95), MHz(10.49999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(9.95), MHz(10.49999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(13.95), MHz(14.49999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(13.95), MHz(14.49999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(17.95), MHz(18.49999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(17.95), MHz(18.49999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(20.95), MHz(21.49999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(20.95), MHz(21.49999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(24.45), MHz(25.09999), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(24.45), MHz(25.09999), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
{MHz(27.95), MHz(30), IC751_OTHER_TX_MODES, W(10), W(200), IC751_VFO_ALL},
{MHz(27.95), MHz(30), IC751_AM_TX_MODES, W(10), W(40), IC751_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC751_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB, kHz(2.3)},
{RIG_MODE_RTTY | RIG_MODE_CW, Hz(500)},
{RIG_MODE_RTTY | RIG_MODE_CW, Hz(250)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.str_cal = IC751_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic751_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.get_level = icom_get_level,
.set_ptt = icom_set_ptt,/* Piexx UX-14px has no get_ptt only set_ptt */
};

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1,460 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-7600
* Copyright (c) 2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <hamlib/rig.h>
#include "token.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "misc.h"
#include "bandplan.h"
#define IC7600_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTAM|RIG_MODE_PKTFM)
#define IC7600_1HZ_TS_MODES IC7600_ALL_RX_MODES
#define IC7600_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM)
#define IC7600_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
#define IC7600_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF|RIG_FUNC_DUAL_WATCH)
#define IC7600_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
#define IC7600_VFOS (RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM)
#define IC7600_PARMS (RIG_PARM_ANN|RIG_PARM_BEEP|RIG_PARM_TIME|RIG_PARM_BACKLIGHT|RIG_PARM_KEYLIGHT)
#define IC7600_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
#define IC7600_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_PROG|RIG_SCAN_DELTA|RIG_SCAN_PRIO)
#define IC7600_ANTS (RIG_ANT_1|RIG_ANT_2)
/*
* Measurement by Roeland, PA3MET
*/
#define IC7600_STR_CAL { 16, \
{ \
{ 0, -54 }, /* S0 */ \
{ 11, -48 }, \
{ 21, -42 }, \
{ 34, -36 }, \
{ 50, -30 }, \
{ 59, -24 }, \
{ 75, -18 }, \
{ 93, -12 }, \
{ 103, -6 }, \
{ 124, 0 }, /* S9 */ \
{ 145, 10 }, \
{ 160, 20 }, \
{ 183, 30 }, \
{ 204, 40 }, \
{ 222, 50 }, \
{ 246, 60 } /* S9+60dB */ \
} }
#define IC7600_SWR_CAL { 5, \
{ \
{ 0, 1.0f }, \
{ 48, 1.5f }, \
{ 80, 2.0f }, \
{ 120, 3.0f }, \
{ 240, 6.0f } \
} }
#define IC7600_ALC_CAL { 2, \
{ \
{ 0, 0.0f }, \
{ 120, 1.0f } \
} }
#define IC7600_RFPOWER_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 143, 0.5f }, \
{ 213, 1.0f } \
} }
#define IC7600_COMP_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 130, 15.0f }, \
{ 241, 30.0f } \
} }
#define IC7600_VD_METER_CAL { 4, \
{ \
{ 0, 0.0f }, \
{ 152, 10.0f }, \
{ 181, 13.0f }, \
{ 212, 16.0f } \
} }
#define IC7600_ID_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 97, 10.0f }, \
{ 241, 25.0f } \
} }
int ic7600_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ic7600_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int ic7600_set_parm(RIG *rig, setting_t parm, value_t val);
int ic7600_get_parm(RIG *rig, setting_t parm, value_t *val);
/*
* IC-7600 rig capabilities.
*
* TODO: complete command set (esp. the $1A bunch!) and testing..
*/
static const struct icom_priv_caps ic7600_priv_caps =
{
0x7a, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
{ .level = RIG_AGC_MEDIUM, .icom_level = 2 },
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
{ .level = -1, .icom_level = 0 },
},
};
const struct confparams ic7600_ext_levels[] =
{
{
TOK_DRIVE_GAIN, "drive_gain", "Drive gain", "Drive gain",
NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } },
},
{ RIG_CONF_END, NULL, }
};
const struct rig_caps ic7600_caps =
{
.rig_model = RIG_MODEL_IC7600,
.model_name = "IC-7600",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC7600_FUNCS,
.has_set_func = IC7600_FUNCS,
.has_get_level = IC7600_LEVELS,
.has_set_level = RIG_LEVEL_SET(IC7600_LEVELS),
.has_get_parm = IC7600_PARMS,
.has_set_parm = RIG_PARM_SET(IC7600_PARMS),
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
},
.parm_gran = {},
.extlevels = ic7600_ext_levels,
.ctcss_list = common_ctcss_list,
.dcs_list = NULL,
.preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */
.attenuator = { 6, 12, 18, RIG_DBLST_END, },
.max_rit = Hz(9999),
.max_xit = Hz(9999),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC7600_VFO_OPS,
.scan_ops = IC7600_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 101, RIG_MTYPE_EDGE }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(60), IC7600_ALL_RX_MODES, -1, -1, IC7600_VFOS, IC7600_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC7600_OTHER_TX_MODES, W(2), W(100), IC7600_VFOS, IC7600_ANTS),
FRQ_RNG_6m(1, IC7600_OTHER_TX_MODES, W(2), W(100), IC7600_VFOS, IC7600_ANTS),
FRQ_RNG_HF(1, IC7600_AM_TX_MODES, W(1), W(30), IC7600_VFOS, IC7600_ANTS), /* AM class */
FRQ_RNG_6m(1, IC7600_AM_TX_MODES, W(1), W(30), IC7600_VFOS, IC7600_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(60), IC7600_ALL_RX_MODES, -1, -1, IC7600_VFOS, IC7600_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC7600_OTHER_TX_MODES, W(2), W(100), IC7600_VFOS, IC7600_ANTS),
FRQ_RNG_6m(2, IC7600_OTHER_TX_MODES, W(2), W(100), IC7600_VFOS, IC7600_ANTS),
FRQ_RNG_HF(2, IC7600_AM_TX_MODES, W(1), W(30), IC7600_VFOS, IC7600_ANTS), /* AM class */
FRQ_RNG_6m(2, IC7600_AM_TX_MODES, W(1), W(30), IC7600_VFOS, IC7600_ANTS), /* AM class */
/* USA only, TBC: end of range and modes */
{MHz(5.33050), MHz(5.33350), IC7600_OTHER_TX_MODES, W(2), W(100), IC7600_VFOS, IC7600_ANTS}, /* USA only */
{MHz(5.34650), MHz(5.34950), IC7600_OTHER_TX_MODES, W(2), W(100), IC7600_VFOS, IC7600_ANTS}, /* USA only */
{MHz(5.36650), MHz(5.36950), IC7600_OTHER_TX_MODES, W(2), W(100), IC7600_VFOS, IC7600_ANTS}, /* USA only */
{MHz(5.37150), MHz(5.37450), IC7600_OTHER_TX_MODES, W(2), W(100), IC7600_VFOS, IC7600_ANTS}, /* USA only */
{MHz(5.40350), MHz(5.40650), IC7600_OTHER_TX_MODES, W(2), W(100), IC7600_VFOS, IC7600_ANTS}, /* USA only */
RIG_FRNG_END,
},
.tuning_steps = {
{IC7600_1HZ_TS_MODES, 1},
{IC7600_ALL_RX_MODES, Hz(100)},
{IC7600_ALL_RX_MODES, kHz(1)},
{IC7600_ALL_RX_MODES, kHz(5)},
{IC7600_ALL_RX_MODES, kHz(9)},
{IC7600_ALL_RX_MODES, kHz(10)},
{IC7600_ALL_RX_MODES, kHz(12.5)},
{IC7600_ALL_RX_MODES, kHz(20)},
{IC7600_ALL_RX_MODES, kHz(25)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! But duplication may speed up search. Put the most commonly used modes first! Remember these are defaults, with dsp rigs you can change them to anything you want except FM and WFM which are fixed */
.filters = {
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(2.4)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(1.8)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(3)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(500)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(250)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_PSK | RIG_MODE_PSKR, kHz(1.2)},
{RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(6)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(3)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(9)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(10)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(7)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(15)},
RIG_FLT_END,
},
.str_cal = IC7600_STR_CAL,
.swr_cal = IC7600_SWR_CAL,
.alc_cal = IC7600_ALC_CAL,
.rfpower_meter_cal = IC7600_RFPOWER_METER_CAL,
.comp_meter_cal = IC7600_COMP_METER_CAL,
.vd_meter_cal = IC7600_VD_METER_CAL,
.id_meter_cal = IC7600_ID_METER_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic7600_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.set_rit = icom_set_rit_new,
.get_rit = icom_get_rit_new,
.get_xit = icom_get_rit_new,
.set_xit = icom_set_xit_new,
.decode_event = icom_decode_event,
.set_level = ic7600_set_level,
.get_level = ic7600_get_level,
.set_ext_level = icom_set_ext_level,
.get_ext_level = icom_get_ext_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = ic7600_set_parm,
.get_parm = ic7600_get_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.send_morse = icom_send_morse
};
int ic7600_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x67;
return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val);
default:
return icom_set_level(rig, vfo, level, val);
}
}
int ic7600_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x67;
return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val);
default:
return icom_get_level(rig, vfo, level, val);
}
}
int ic7600_set_parm(RIG *rig, setting_t parm, value_t val)
{
unsigned char parmbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (parm)
{
case RIG_PARM_BEEP:
parmbuf[0] = 0x00;
parmbuf[1] = 0x59;
return icom_set_custom_parm(rig, 2, parmbuf, 1, val.i ? 1 : 0);
case RIG_PARM_BACKLIGHT:
parmbuf[0] = 0x00;
parmbuf[1] = 0x38;
return icom_set_custom_parm(rig, 2, parmbuf, 2, (int)(val.f * 255.0f));
case RIG_PARM_KEYLIGHT:
parmbuf[0] = 0x00;
parmbuf[1] = 0x39;
return icom_set_custom_parm(rig, 2, parmbuf, 2, val.f != 0 ? 255 : 0);
case RIG_PARM_TIME:
parmbuf[0] = 0x00;
parmbuf[1] = 0x54;
return icom_set_custom_parm_time(rig, 2, parmbuf, val.i);
default:
return icom_set_parm(rig, parm, val);
}
}
int ic7600_get_parm(RIG *rig, setting_t parm, value_t *val)
{
unsigned char parmbuf[MAXFRAMELEN];
int retval;
int icom_val;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (parm)
{
case RIG_PARM_BEEP:
parmbuf[0] = 0x00;
parmbuf[1] = 0x59;
retval = icom_get_custom_parm(rig, 2, parmbuf, &icom_val);
if (retval != RIG_OK)
{
return retval;
}
val->i = icom_val ? 1 : 0;
break;
case RIG_PARM_BACKLIGHT:
parmbuf[0] = 0x00;
parmbuf[1] = 0x38;
retval = icom_get_custom_parm(rig, 2, parmbuf, &icom_val);
if (retval != RIG_OK)
{
return retval;
}
val->f = (float) icom_val / 255.0f;
break;
case RIG_PARM_KEYLIGHT:
parmbuf[0] = 0x00;
parmbuf[1] = 0x39;
retval = icom_get_custom_parm(rig, 2, parmbuf, &icom_val);
if (retval != RIG_OK)
{
return retval;
}
val->f = icom_val > 0 ? 1 : 0;
break;
case RIG_PARM_TIME:
parmbuf[0] = 0x00;
parmbuf[1] = 0x54;
return icom_get_custom_parm_time(rig, 2, parmbuf, &val->i);
default:
return icom_get_parm(rig, parm, val);
}
return RIG_OK;
}

Wyświetl plik

@ -1,195 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-761 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "bandplan.h"
#include "icom.h"
#define IC761_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM)
/*
* 100W in all modes but AM (40W)
*/
#define IC761_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM)
#define IC761_AM_TX_MODES (RIG_MODE_AM)
#define IC761_VFO_ALL (RIG_VFO_A|RIG_VFO_MEM)
#define IC761_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
#define IC761_SCAN_OPS (RIG_SCAN_NONE)
#define IC761_ANTS RIG_ANT_1
/*
*/
static const struct icom_priv_caps ic761_priv_caps =
{
0x1e, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic761_caps =
{
.rig_model = RIG_MODEL_IC761,
.model_name = "IC-761",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC761_VFO_OPS,
.scan_ops = IC761_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 26, RIG_MTYPE_MEM, IC_MIN_MEM_CAP }, /* TBC */
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(100), MHz(30), IC761_ALL_RX_MODES, -1, -1, IC761_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(1.8), MHz(1.99999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL}, /* 100W class */
{MHz(1.8), MHz(1.99999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL}, /* 40W class */
{MHz(3.45), MHz(4.09999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(3.45), MHz(4.09999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(6.95), MHz(7.49999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(6.95), MHz(7.49999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(9.95), MHz(10.49999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(9.95), MHz(10.49999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(13.95), MHz(14.49999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(13.95), MHz(14.49999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(17.95), MHz(18.49999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(17.95), MHz(18.49999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(20.95), MHz(21.49999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(20.95), MHz(21.49999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(24.45), MHz(25.09999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(24.45), MHz(25.09999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(27.95), MHz(30), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(27.95), MHz(30), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(100), MHz(30), IC761_ALL_RX_MODES, -1, -1, IC761_VFO_ALL},
RIG_FRNG_END,
},
/* weird transmit ranges ... --sf */
.tx_range_list2 = {
{MHz(1.8), MHz(1.99999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL}, /* 100W class */
{MHz(1.8), MHz(1.99999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL}, /* 40W class */
{MHz(3.45), MHz(4.09999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(3.45), MHz(4.09999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(6.95), MHz(7.49999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(6.95), MHz(7.49999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(9.95), MHz(10.49999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(9.95), MHz(10.49999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(13.95), MHz(14.49999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(13.95), MHz(14.49999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(17.95), MHz(18.49999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(17.95), MHz(18.49999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(20.95), MHz(21.49999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(20.95), MHz(21.49999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(24.45), MHz(25.09999), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(24.45), MHz(25.09999), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
{MHz(27.95), MHz(30), IC761_OTHER_TX_MODES, W(10), W(100), IC761_VFO_ALL},
{MHz(27.95), MHz(30), IC761_AM_TX_MODES, W(10), W(40), IC761_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC761_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.4)},
{RIG_MODE_RTTY | RIG_MODE_CW, Hz(500)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic761_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,374 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-7610
* Stolen from IC7610.c by Michael Black W9MDB
* Copyright (c) 2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <hamlib/rig.h>
#include "token.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "misc.h"
#include "bandplan.h"
#define IC7610_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTAM|RIG_MODE_PKTFM)
#define IC7610_1HZ_TS_MODES IC7610_ALL_RX_MODES
#define IC7610_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM)
#define IC7610_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
#define IC7610_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF|RIG_FUNC_DUAL_WATCH)
#define IC7610_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
#define IC7610_VFOS (RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM)
#define IC7610_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
#define IC7610_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
#define IC7610_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_PROG|RIG_SCAN_DELTA|RIG_SCAN_PRIO)
#define IC7610_ANTS (RIG_ANT_1|RIG_ANT_2)
/*
* Measurement by Roeland, PA3MET
*/
#define IC7610_STR_CAL { 16, \
{ \
{ 0, -54 }, /* S0 */ \
{ 11, -48 }, \
{ 21, -42 }, \
{ 34, -36 }, \
{ 50, -30 }, \
{ 59, -24 }, \
{ 75, -18 }, \
{ 93, -12 }, \
{ 103, -6 }, \
{ 124, 0 }, /* S9 */ \
{ 145, 10 }, \
{ 160, 20 }, \
{ 183, 30 }, \
{ 204, 40 }, \
{ 222, 50 }, \
{ 246, 60 } /* S9+60dB */ \
} }
#define IC7610_SWR_CAL { 5, \
{ \
{ 0, 1.0f }, \
{ 48, 1.5f }, \
{ 80, 2.0f }, \
{ 120, 3.0f }, \
{ 240, 6.0f } \
} }
#define IC7610_ALC_CAL { 2, \
{ \
{ 0, 0.0f }, \
{ 120, 1.0f } \
} }
#define IC7610_RFPOWER_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 143, 0.5f }, \
{ 212, 1.0f } \
} }
#define IC7610_COMP_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 130, 15.0f }, \
{ 241, 30.0f } \
} }
#define IC7610_VD_METER_CAL { 4, \
{ \
{ 0, 0.0f }, \
{ 151, 10.0f }, \
{ 211, 16.0f } \
} }
#define IC7610_ID_METER_CAL { 4, \
{ \
{ 0, 0.0f }, \
{ 77, 10.0f }, \
{ 165, 20.0f }, \
{ 241, 30.0f } \
} }
int ic7610_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ic7610_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
/*
* IC-7610 rig capabilities.
*
* TODO: complete command set (esp. the $1A bunch!) and testing..
*/
static const struct icom_priv_caps ic7610_priv_caps =
{
0x98, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
{ .level = RIG_AGC_MEDIUM, .icom_level = 2 },
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
{ .level = -1, .icom_level = 0 },
},
};
const struct confparams ic7610_ext_levels[] =
{
{
TOK_DRIVE_GAIN, "drive_gain", "Drive gain", "Drive gain",
NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } },
},
{
TOK_DIGI_SEL_FUNC, "digi_sel", "DIGI-SEL enable", "DIGI-SEL enable",
NULL, RIG_CONF_CHECKBUTTON, { },
},
{
TOK_DIGI_SEL_LEVEL, "digi_sel_level", "DIGI-SEL level", "DIGI-SEL level",
NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } },
},
{ RIG_CONF_END, NULL, }
};
const struct rig_caps ic7610_caps =
{
.rig_model = RIG_MODEL_IC7610,
.model_name = "IC-7610",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 115200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC7610_FUNCS,
.has_set_func = IC7610_FUNCS,
.has_get_level = IC7610_LEVELS,
.has_set_level = RIG_LEVEL_SET(IC7610_LEVELS),
.has_get_parm = IC7610_PARMS,
.has_set_parm = RIG_PARM_SET(IC7610_PARMS), /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
},
.parm_gran = {},
.extlevels = ic7610_ext_levels,
.ctcss_list = common_ctcss_list,
.dcs_list = NULL,
.preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */
.attenuator = { 6, 12, 18, RIG_DBLST_END, },
.max_rit = Hz(9999),
.max_xit = Hz(9999),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC7610_VFO_OPS,
.scan_ops = IC7610_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 101, RIG_MTYPE_EDGE }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(60), IC7610_ALL_RX_MODES, -1, -1, IC7610_VFOS, IC7610_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC7610_OTHER_TX_MODES, W(2), W(100), IC7610_VFOS, IC7610_ANTS),
FRQ_RNG_6m(1, IC7610_OTHER_TX_MODES, W(2), W(100), IC7610_VFOS, IC7610_ANTS),
FRQ_RNG_HF(1, IC7610_AM_TX_MODES, W(1), W(30), IC7610_VFOS, IC7610_ANTS), /* AM class */
FRQ_RNG_6m(1, IC7610_AM_TX_MODES, W(1), W(30), IC7610_VFOS, IC7610_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(60), IC7610_ALL_RX_MODES, -1, -1, IC7610_VFOS, IC7610_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC7610_OTHER_TX_MODES, W(2), W(100), IC7610_VFOS, IC7610_ANTS),
FRQ_RNG_6m(2, IC7610_OTHER_TX_MODES, W(2), W(100), IC7610_VFOS, IC7610_ANTS),
FRQ_RNG_HF(2, IC7610_AM_TX_MODES, W(1), W(30), IC7610_VFOS, IC7610_ANTS), /* AM class */
FRQ_RNG_6m(2, IC7610_AM_TX_MODES, W(1), W(30), IC7610_VFOS, IC7610_ANTS), /* AM class */
/* USA only, TBC: end of range and modes */
{MHz(5.33050), MHz(5.33350), IC7610_OTHER_TX_MODES, W(2), W(100), IC7610_VFOS, IC7610_ANTS}, /* USA only */
{MHz(5.34650), MHz(5.34950), IC7610_OTHER_TX_MODES, W(2), W(100), IC7610_VFOS, IC7610_ANTS}, /* USA only */
{MHz(5.36650), MHz(5.36950), IC7610_OTHER_TX_MODES, W(2), W(100), IC7610_VFOS, IC7610_ANTS}, /* USA only */
{MHz(5.37150), MHz(5.37450), IC7610_OTHER_TX_MODES, W(2), W(100), IC7610_VFOS, IC7610_ANTS}, /* USA only */
{MHz(5.40350), MHz(5.40650), IC7610_OTHER_TX_MODES, W(2), W(100), IC7610_VFOS, IC7610_ANTS}, /* USA only */
RIG_FRNG_END,
},
.tuning_steps = {
{IC7610_1HZ_TS_MODES, 1},
{IC7610_ALL_RX_MODES, Hz(100)},
{IC7610_ALL_RX_MODES, kHz(1)},
{IC7610_ALL_RX_MODES, kHz(5)},
{IC7610_ALL_RX_MODES, kHz(9)},
{IC7610_ALL_RX_MODES, kHz(10)},
{IC7610_ALL_RX_MODES, kHz(12.5)},
{IC7610_ALL_RX_MODES, kHz(20)},
{IC7610_ALL_RX_MODES, kHz(25)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! But duplication may speed up search. Put the most commonly used modes first! Remember these are defaults, with dsp rigs you can change them to anything you want except FM and WFM which are fixed */
.filters = {
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(2.4)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(1.8)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(3)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(500)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(250)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_PSK | RIG_MODE_PSKR, kHz(1.2)},
{RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(6)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(3)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(9)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(10)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(7)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(15)},
RIG_FLT_END,
},
.str_cal = IC7610_STR_CAL,
.swr_cal = IC7610_SWR_CAL,
.alc_cal = IC7610_ALC_CAL,
.rfpower_meter_cal = IC7610_RFPOWER_METER_CAL,
.comp_meter_cal = IC7610_COMP_METER_CAL,
.vd_meter_cal = IC7610_VD_METER_CAL,
.id_meter_cal = IC7610_ID_METER_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic7610_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = icom_rig_open,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.set_rit = icom_set_rit_new,
.get_rit = icom_get_rit_new,
.get_xit = icom_get_rit_new,
.set_xit = icom_set_xit_new,
.decode_event = icom_decode_event,
.set_level = ic7610_set_level,
.get_level = ic7610_get_level,
.set_ext_level = icom_set_ext_level,
.get_ext_level = icom_get_ext_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = icom_set_parm,
.get_parm = icom_get_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.send_morse = icom_send_morse
};
int ic7610_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x02;
cmdbuf[1] = 0x92;
return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val);
default:
return icom_set_level(rig, vfo, level, val);
}
}
int ic7610_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x02;
cmdbuf[1] = 0x92;
return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val);
default:
return icom_get_level(rig, vfo, level, val);
}
}

Wyświetl plik

@ -1,190 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-765 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "bandplan.h"
#include "icom.h"
#define IC765_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY)
/*
* IC-765
* specs: http://www.qsl.net/sm7vhs/radio/icom/ic765/specs.htm
*
*/
#define IC765_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY)
#define IC765_AM_TX_MODES (RIG_MODE_AM)
#define IC765_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC765_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY|RIG_OP_MCL)
#define IC765_SCAN_OPS (RIG_SCAN_PROG|RIG_SCAN_MEM)
#define IC765_ANTS RIG_ANT_1
/*
*/
static const struct icom_priv_caps ic765_priv_caps =
{
0x2c, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic765_caps =
{
.rig_model = RIG_MODEL_IC765,
.model_name = "IC-765",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC765_VFO_OPS,
.scan_ops = IC765_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
{ 100, 101, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(100), MHz(30), IC765_ALL_RX_MODES, -1, -1, IC765_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC765_OTHER_TX_MODES, W(10), W(100), IC765_VFO_ALL, IC765_ANTS),
FRQ_RNG_HF(1, IC765_AM_TX_MODES, W(10), W(40), IC765_VFO_ALL, IC765_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(100), MHz(30), IC765_ALL_RX_MODES, -1, -1, IC765_VFO_ALL},
RIG_FRNG_END,
},
/* weird transmit ranges ... --sf */
.tx_range_list2 = {
{kHz(1800), 1999999, IC765_OTHER_TX_MODES, 5000, 100000, IC765_VFO_ALL}, /* 100W class */
{kHz(1800), 1999999, IC765_AM_TX_MODES, 2000, 40000, IC765_VFO_ALL}, /* 40W class */
{kHz(3400), 4099999, IC765_OTHER_TX_MODES, 5000, 100000, IC765_VFO_ALL},
{kHz(3400), 4099999, IC765_AM_TX_MODES, 2000, 40000, IC765_VFO_ALL},
{MHz(6.9), kHz(7499.99), IC765_OTHER_TX_MODES, 5000, 100000, IC765_VFO_ALL},
{MHz(6.9), kHz(7499.99), IC765_AM_TX_MODES, 2000, 40000, IC765_VFO_ALL},
{MHz(9.9), MHz(1049999), IC765_OTHER_TX_MODES, 5000, 100000, IC765_VFO_ALL},
{MHz(9.9), MHz(1049999), IC765_AM_TX_MODES, 2000, 40000, IC765_VFO_ALL},
{MHz(13.9), kHz(14.49999), IC765_OTHER_TX_MODES, 5000, 100000, IC765_VFO_ALL},
{MHz(13.9), kHz(14.49999), IC765_AM_TX_MODES, 2000, 40000, IC765_VFO_ALL},
{kHz(17900), kHz(18499.99), IC765_OTHER_TX_MODES, 5000, 100000, IC765_VFO_ALL},
{kHz(17900), kHz(18499.99), IC765_AM_TX_MODES, 2000, 40000, IC765_VFO_ALL},
{MHz(20.9), kHz(21499.99), IC765_OTHER_TX_MODES, 5000, 100000, IC765_VFO_ALL},
{MHz(20.9), kHz(21499.99), IC765_AM_TX_MODES, 2000, 40000, IC765_VFO_ALL},
{kHz(24400), kHz(25099.99), IC765_OTHER_TX_MODES, 5000, 100000, IC765_VFO_ALL},
{kHz(24400), kHz(25099.99), IC765_AM_TX_MODES, 2000, 40000, IC765_VFO_ALL},
{MHz(28), MHz(30), IC765_OTHER_TX_MODES, 5000, 100000, IC765_VFO_ALL},
{MHz(28), MHz(30), IC765_AM_TX_MODES, 2000, 40000, IC765_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC765_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.2)},
{RIG_MODE_CW | RIG_MODE_RTTY, Hz(500)}, /* narrow */
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic765_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_split_vfo = icom_set_split_vfo,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.scan = icom_scan,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,359 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-7700 and variations
* Copyright (c) 2009-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Stre<et, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <hamlib/rig.h>
#include "token.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "misc.h"
#include "bandplan.h"
#define IC7700_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PSK|RIG_MODE_PSKR)
#define IC7700_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
#define IC7700_ALL_RX_MODES IC7700_OTHER_TX_MODES | IC7700_AM_TX_MODES
#define IC7700_1HZ_TS_MODES IC7700_ALL_RX_MODES
#define IC7700_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF)
#define IC7700_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_APF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
#define IC7700_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC7700_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
#define IC7700_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
#define IC7700_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_PROG|RIG_SCAN_DELTA|RIG_SCAN_PRIO)
#define IC7700_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4)
// IC-7700 S-meter calibration data based on manual
#define IC7700_STR_CAL { 3, \
{ \
{ 0,-54 }, \
{ 120, 0 }, \
{ 241, 60 } \
} }
#define IC7700_SWR_CAL { 5, \
{ \
{ 0, 1.0f }, \
{ 48, 1.5f }, \
{ 80, 2.0f }, \
{ 120, 3.0f }, \
{ 240, 6.0f } \
} }
#define IC7700_ALC_CAL { 2, \
{ \
{ 0, 0.0f }, \
{ 120, 1.0f } \
} }
#define IC7700_RFPOWER_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 143, 0.5f }, \
{ 213, 1.0f } \
} }
#define IC7700_COMP_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 130, 15.0f }, \
{ 241, 30.0f } \
} }
#define IC7700_VD_METER_CAL { 4, \
{ \
{ 0, 0.0f }, \
{ 151, 44.0f }, \
{ 180, 48.0f }, \
{ 211, 52.0f } \
} }
#define IC7700_ID_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 165, 10.0f }, \
{ 241, 15.0f } \
} }
int ic7700_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ic7700_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
/*
* IC-7700 rig capabilities.
*
* TODO: complete command set (esp. the $1A bunch!) and testing..
*/
static const struct icom_priv_caps ic7700_priv_caps =
{
0x74, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
{ .level = RIG_AGC_FAST, .icom_level = 1 },
{ .level = RIG_AGC_MEDIUM, .icom_level = 2 },
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
{ .level = -1, .icom_level = 0 },
},
};
const struct confparams ic7700_ext_levels[] =
{
{
TOK_DRIVE_GAIN, "drive_gain", "Drive gain", "Drive gain",
NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } },
},
{
TOK_DIGI_SEL_FUNC, "digi_sel", "DIGI-SEL enable", "DIGI-SEL enable",
NULL, RIG_CONF_CHECKBUTTON, { },
},
{
TOK_DIGI_SEL_LEVEL, "digi_sel_level", "DIGI-SEL level", "DIGI-SEL level",
NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } },
},
{ RIG_CONF_END, NULL, }
};
const struct rig_caps ic7700_caps =
{
.rig_model = RIG_MODEL_IC7700,
.model_name = "IC-7700",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC7700_FUNCS,
.has_set_func = IC7700_FUNCS,
.has_get_level = IC7700_LEVELS,
.has_set_level = RIG_LEVEL_SET(IC7700_LEVELS),
.has_get_parm = IC7700_PARMS,
.has_set_parm = RIG_PARM_SET(IC7700_PARMS), /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
},
.parm_gran = {},
.extlevels = ic7700_ext_levels,
.ctcss_list = common_ctcss_list,
.dcs_list = NULL,
.preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */
.attenuator = { 6, 12, 18, RIG_DBLST_END, },
.max_rit = Hz(9999),
.max_xit = Hz(9999),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC7700_VFO_OPS,
.scan_ops = IC7700_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 101, RIG_MTYPE_EDGE }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(60), IC7700_ALL_RX_MODES, -1, -1, IC7700_VFOS, IC7700_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC7700_OTHER_TX_MODES, W(5), W(200), IC7700_VFOS, IC7700_ANTS),
FRQ_RNG_6m(1, IC7700_OTHER_TX_MODES, W(5), W(200), IC7700_VFOS, IC7700_ANTS),
FRQ_RNG_HF(1, IC7700_AM_TX_MODES, W(5), W(50), IC7700_VFOS, IC7700_ANTS), /* AM class */
FRQ_RNG_6m(1, IC7700_AM_TX_MODES, W(5), W(50), IC7700_VFOS, IC7700_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(60), IC7700_ALL_RX_MODES, -1, -1, IC7700_VFOS, IC7700_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC7700_OTHER_TX_MODES, W(5), W(200), IC7700_VFOS, IC7700_ANTS),
FRQ_RNG_6m(2, IC7700_OTHER_TX_MODES, W(5), W(200), IC7700_VFOS, IC7700_ANTS),
FRQ_RNG_HF(2, IC7700_AM_TX_MODES, W(5), W(50), IC7700_VFOS, IC7700_ANTS), /* AM class */
FRQ_RNG_6m(2, IC7700_AM_TX_MODES, W(5), W(50), IC7700_VFOS, IC7700_ANTS), /* AM class */
/* USA only, TBC: end of range and modes */
{MHz(5.33050), MHz(5.33350), IC7700_OTHER_TX_MODES, W(5), W(200), IC7700_VFOS, IC7700_ANTS}, /* USA only */
{MHz(5.34650), MHz(5.34950), IC7700_OTHER_TX_MODES, W(5), W(200), IC7700_VFOS, IC7700_ANTS}, /* USA only */
{MHz(5.36650), MHz(5.36950), IC7700_OTHER_TX_MODES, W(5), W(200), IC7700_VFOS, IC7700_ANTS}, /* USA only */
{MHz(5.37150), MHz(5.37450), IC7700_OTHER_TX_MODES, W(5), W(200), IC7700_VFOS, IC7700_ANTS}, /* USA only */
{MHz(5.40350), MHz(5.40650), IC7700_OTHER_TX_MODES, W(5), W(200), IC7700_VFOS, IC7700_ANTS}, /* USA only */
RIG_FRNG_END,
},
.tuning_steps = {
{IC7700_1HZ_TS_MODES, 1},
{IC7700_ALL_RX_MODES, Hz(100)},
{IC7700_ALL_RX_MODES, kHz(1)},
{IC7700_ALL_RX_MODES, kHz(5)},
{IC7700_ALL_RX_MODES, kHz(9)},
{IC7700_ALL_RX_MODES, kHz(10)},
{IC7700_ALL_RX_MODES, kHz(12.5)},
{IC7700_ALL_RX_MODES, kHz(20)},
{IC7700_ALL_RX_MODES, kHz(25)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(2.4)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(1.8)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(3)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(400)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(50)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_PSK | RIG_MODE_PSKR, kHz(1.0)},
{RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(6)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(3)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(9)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(12)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(8)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(15)},
RIG_FLT_END,
},
.str_cal = IC7700_STR_CAL,
.swr_cal = IC7700_SWR_CAL,
.alc_cal = IC7700_ALC_CAL,
.rfpower_meter_cal = IC7700_RFPOWER_METER_CAL,
.comp_meter_cal = IC7700_COMP_METER_CAL,
.vd_meter_cal = IC7700_VD_METER_CAL,
.id_meter_cal = IC7700_ID_METER_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic7700_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.set_rit = icom_set_rit_new,
.get_rit = icom_get_rit_new,
.get_xit = icom_get_rit_new,
.set_xit = icom_set_xit_new,
.decode_event = icom_decode_event,
.set_level = ic7700_set_level,
.get_level = ic7700_get_level,
.set_ext_level = icom_set_ext_level,
.get_ext_level = icom_get_ext_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = icom_set_parm,
.get_parm = icom_get_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.send_morse = icom_send_morse
};
int ic7700_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x82;
return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val);
default:
return icom_set_level(rig, vfo, level, val);
}
}
int ic7700_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x82;
return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val);
default:
return icom_get_level(rig, vfo, level, val);
}
}

Wyświetl plik

@ -1,187 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-775 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "icom.h"
#include "bandplan.h"
#define IC775_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM)
#define IC775_1MHZ_TS_MODES (RIG_MODE_AM|RIG_MODE_FM)
#define IC775_1HZ_TS_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY)
/*
* 100W in all modes but AM (40W)
*/
#define IC775_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM)
#define IC775_AM_TX_MODES (RIG_MODE_AM)
#define IC775_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC775_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
#define IC775_ANTS RIG_ANT_1
/*
*/
static const struct icom_priv_caps ic775_priv_caps =
{
0x46, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic775_caps =
{
.rig_model = RIG_MODEL_IC775,
.model_name = "IC-775",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC775_VFO_OPS,
.scan_ops = RIG_SCAN_NONE,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 10, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
{ 11, 12, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(30), IC775_ALL_RX_MODES, -1, -1, IC775_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC775_OTHER_TX_MODES, W(10), W(100), IC775_VFO_ALL, IC775_ANTS),
FRQ_RNG_HF(1, IC775_AM_TX_MODES, W(10), W(40), IC775_VFO_ALL, IC775_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(30), IC775_ALL_RX_MODES, -1, -1, IC775_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { {kHz(1800), MHz(2) - 1, IC775_OTHER_TX_MODES, 5000, 100000, IC775_VFO_ALL}, /* 100W class */
{kHz(1800), MHz(2) - 1, IC775_AM_TX_MODES, 2000, 40000, IC775_VFO_ALL}, /* 40W class */
{kHz(3500), MHz(4) - 1, IC775_OTHER_TX_MODES, 5000, 100000, IC775_VFO_ALL},
{kHz(3500), MHz(4) - 1, IC775_AM_TX_MODES, 2000, 40000, IC775_VFO_ALL},
{MHz(7), kHz(7300), IC775_OTHER_TX_MODES, 5000, 100000, IC775_VFO_ALL},
{MHz(7), kHz(7300), IC775_AM_TX_MODES, 2000, 40000, IC775_VFO_ALL},
{kHz(10100), kHz(10150), IC775_OTHER_TX_MODES, 5000, 100000, IC775_VFO_ALL},
{kHz(10100), kHz(10150), IC775_AM_TX_MODES, 2000, 40000, IC775_VFO_ALL},
{MHz(14), kHz(14350), IC775_OTHER_TX_MODES, 5000, 100000, IC775_VFO_ALL},
{MHz(14), kHz(14350), IC775_AM_TX_MODES, 2000, 40000, IC775_VFO_ALL},
{kHz(18068), kHz(18168), IC775_OTHER_TX_MODES, 5000, 100000, IC775_VFO_ALL},
{kHz(18068), kHz(18168), IC775_AM_TX_MODES, 2000, 40000, IC775_VFO_ALL},
{MHz(21), kHz(21450), IC775_OTHER_TX_MODES, 5000, 100000, IC775_VFO_ALL},
{MHz(21), kHz(21450), IC775_AM_TX_MODES, 2000, 40000, IC775_VFO_ALL},
{kHz(24890), kHz(24990), IC775_OTHER_TX_MODES, 5000, 100000, IC775_VFO_ALL},
{kHz(24890), kHz(24990), IC775_AM_TX_MODES, 2000, 40000, IC775_VFO_ALL},
{MHz(28), kHz(29700), IC775_OTHER_TX_MODES, 5000, 100000, IC775_VFO_ALL},
{MHz(28), kHz(29700), IC775_AM_TX_MODES, 2000, 40000, IC775_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC775_1HZ_TS_MODES, 1},
{IC775_ALL_RX_MODES, 10},
{IC775_ALL_RX_MODES, 100},
{IC775_ALL_RX_MODES, kHz(1)},
{IC775_ALL_RX_MODES, kHz(5)},
{IC775_ALL_RX_MODES, kHz(9)},
{IC775_ALL_RX_MODES, kHz(10)},
{IC775_ALL_RX_MODES, 12500},
{IC775_ALL_RX_MODES, kHz(20)},
{IC775_ALL_RX_MODES, kHz(25)},
{IC775_ALL_RX_MODES, kHz(100)},
{IC775_1MHZ_TS_MODES, MHz(1)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.4)}, /* bultin FL-272 */
{RIG_MODE_AM, kHz(8)}, /* mid w/ bultin FL-94 */
{RIG_MODE_AM, kHz(2.4)}, /* narrow w/ bultin FL-272 */
{RIG_MODE_FM, kHz(15)}, /* ?? TBC, mid w/ bultin FL-23+SFPC455E */
{RIG_MODE_FM, kHz(8)}, /* narrow w/ bultin FL-94 */
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic775_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,190 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-78
* Copyright (c) 2004 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#include "bandplan.h"
#include "idx_builtin.h"
#define IC78_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define IC78_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define IC78_AM_TX_MODES (RIG_MODE_AM)
#define IC78_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP)
#define IC78_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_RAWSTR|RIG_LEVEL_RF|RIG_LEVEL_AF|RIG_LEVEL_SQL)
#define IC78_VFO_ALL (RIG_VFO_A|RIG_VFO_MEM)
#define IC78_VFO_OPS (RIG_OP_NONE)
#define IC78_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM)
#define IC78_ANTS (RIG_ANT_1)
/*
* IC78_STR_CAL is what the S-meter displays
*
* FIXME: real measures!
*/
#define IC78_STR_CAL { 2, \
{ \
{ 0, -60 }, \
{ 255, 60 } \
} }
/*
* ic78 rigs capabilities.
*/
static const struct icom_priv_caps ic78_priv_caps =
{
0x62, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic706_ts_sc_list
};
const struct rig_caps ic78_caps =
{
.rig_model = RIG_MODEL_IC78,
.model_name = "IC-78",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC78_FUNC_ALL,
.has_set_func = IC78_FUNC_ALL,
.has_get_level = IC78_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(IC78_LEVEL_ALL),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.preamp = { 10, 20, RIG_DBLST_END, },
.attenuator = { 20, RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC78_VFO_OPS,
.scan_ops = IC78_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 100, RIG_MTYPE_CALL },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(30), MHz(30) - 1, IC78_ALL_RX_MODES, -1, -1, IC78_VFO_ALL, IC78_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC78_OTHER_TX_MODES, W(2), W(100), IC78_VFO_ALL, IC78_ANTS),
FRQ_RNG_HF(1, IC78_AM_TX_MODES, W(2), W(40), IC78_VFO_ALL, IC78_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(30), MHz(30) - 1, IC78_ALL_RX_MODES, -1, -1, IC78_VFO_ALL, IC78_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC78_OTHER_TX_MODES, W(2), W(100), IC78_VFO_ALL, IC78_ANTS),
FRQ_RNG_HF(2, IC78_AM_TX_MODES, W(2), W(40), IC78_VFO_ALL, IC78_ANTS), /* AM class */
RIG_FRNG_END,
},
.tuning_steps = {
{IC78_ALL_RX_MODES, 10},
{IC78_ALL_RX_MODES, 100},
{IC78_ALL_RX_MODES, kHz(1)},
{IC78_ALL_RX_MODES, kHz(5)},
{IC78_ALL_RX_MODES, kHz(9)},
{IC78_ALL_RX_MODES, kHz(10)},
{IC78_ALL_RX_MODES, 12500},
{IC78_ALL_RX_MODES, kHz(20)},
{IC78_ALL_RX_MODES, kHz(25)},
{IC78_ALL_RX_MODES, kHz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY | RIG_MODE_CWR | RIG_MODE_RTTYR | RIG_MODE_AM, kHz(2.4)},
RIG_FLT_END,
},
.str_cal = IC78_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic78_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_mem = icom_set_mem,
.scan = icom_scan,
.get_dcd = icom_get_dcd,
};

Wyświetl plik

@ -1,407 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-7800 and variations
* Copyright (c) 2009-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <hamlib/rig.h>
#include "token.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "misc.h"
#include "bandplan.h"
#define IC7800_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTAM|RIG_MODE_PKTFM)
#define IC7800_1HZ_TS_MODES IC7800_ALL_RX_MODES
#define IC7800_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM)
#define IC7800_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
#define IC7800_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF|RIG_FUNC_DUAL_WATCH)
#define IC7800_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_APF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
#define IC7800_VFOS (RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM)
#define IC7800_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
#define IC7800_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
#define IC7800_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_PROG|RIG_SCAN_DELTA|RIG_SCAN_PRIO)
#define IC7800_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4)
// IC-7800 S-meter calibration data based on manual
#define IC7800_STR_CAL { 3, \
{ \
{ 0, -54 }, /* S0 */ \
{ 120, 0 }, /* S9 */ \
{ 241, 60 } /* S9+60 */ \
} }
#define IC7800_SWR_CAL { 5, \
{ \
{ 0, 1.0f }, \
{ 48, 1.5f }, \
{ 80, 2.0f }, \
{ 120, 3.0f }, \
{ 240, 6.0f } \
} }
#define IC7800_ALC_CAL { 2, \
{ \
{ 0, 0.0f }, \
{ 120, 1.0f } \
} }
#define IC7800_RFPOWER_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 143, 0.5f }, \
{ 213, 1.0f } \
} }
#define IC7800_COMP_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 130, 15.0f }, \
{ 241, 30.0f } \
} }
#define IC7800_VD_METER_CAL { 4, \
{ \
{ 0, 0.0f }, \
{ 151, 44.0f }, \
{ 180, 48.0f }, \
{ 211, 52.0f } \
} }
#define IC7800_ID_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 165, 10.0f }, \
{ 241, 15.0f } \
} }
int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ic7800_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
/*
* IC-7800 rig capabilities.
*
* TODO: complete command set (esp. the $1A bunch!) and testing..
*/
static const struct icom_priv_caps ic7800_priv_caps =
{
0x6a, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
{ .level = RIG_AGC_FAST, .icom_level = 1 },
{ .level = RIG_AGC_MEDIUM, .icom_level = 2 },
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
{ .level = -1, .icom_level = 0 },
},
};
const struct confparams ic7800_ext_levels[] =
{
{
TOK_DRIVE_GAIN, "drive_gain", "Drive gain", "Drive gain",
NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } },
},
{
TOK_DIGI_SEL_FUNC, "digi_sel", "DIGI-SEL enable", "DIGI-SEL enable",
NULL, RIG_CONF_CHECKBUTTON, { },
},
{
TOK_DIGI_SEL_LEVEL, "digi_sel_level", "DIGI-SEL level", "DIGI-SEL level",
NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } },
},
{ RIG_CONF_END, NULL, }
};
const struct rig_caps ic7800_caps =
{
.rig_model = RIG_MODEL_IC7800,
.model_name = "IC-7800",
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC7800_FUNCS,
.has_set_func = IC7800_FUNCS,
.has_get_level = IC7800_LEVELS,
.has_set_level = RIG_LEVEL_SET(IC7800_LEVELS),
.has_get_parm = IC7800_PARMS,
.has_set_parm = RIG_PARM_SET(IC7800_PARMS), /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
},
.parm_gran = {},
.extlevels = ic7800_ext_levels,
.ctcss_list = common_ctcss_list,
.dcs_list = NULL,
.preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */
.attenuator = { 3, 6, 9, 12, 15, 18, 21, RIG_DBLST_END, },
.max_rit = Hz(9999),
.max_xit = Hz(9999),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC7800_VFO_OPS,
.scan_ops = IC7800_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 101, RIG_MTYPE_EDGE }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(60), IC7800_ALL_RX_MODES, -1, -1, IC7800_VFOS, IC7800_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC7800_OTHER_TX_MODES, W(5), W(200), IC7800_VFOS, IC7800_ANTS),
FRQ_RNG_6m(1, IC7800_OTHER_TX_MODES, W(5), W(200), IC7800_VFOS, IC7800_ANTS),
FRQ_RNG_HF(1, IC7800_AM_TX_MODES, W(5), W(50), IC7800_VFOS, IC7800_ANTS), /* AM class */
FRQ_RNG_6m(1, IC7800_AM_TX_MODES, W(5), W(50), IC7800_VFOS, IC7800_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(60), IC7800_ALL_RX_MODES, -1, -1, IC7800_VFOS, IC7800_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC7800_OTHER_TX_MODES, W(5), W(200), IC7800_VFOS, IC7800_ANTS),
FRQ_RNG_6m(2, IC7800_OTHER_TX_MODES, W(5), W(200), IC7800_VFOS, IC7800_ANTS),
FRQ_RNG_HF(2, IC7800_AM_TX_MODES, W(5), W(50), IC7800_VFOS, IC7800_ANTS), /* AM class */
FRQ_RNG_6m(2, IC7800_AM_TX_MODES, W(5), W(50), IC7800_VFOS, IC7800_ANTS), /* AM class */
/* USA only, TBC: end of range and modes */
{MHz(5.33050), MHz(5.33350), IC7800_OTHER_TX_MODES, W(2), W(100), IC7800_VFOS, IC7800_ANTS}, /* USA only */
{MHz(5.34650), MHz(5.34950), IC7800_OTHER_TX_MODES, W(2), W(100), IC7800_VFOS, IC7800_ANTS}, /* USA only */
{MHz(5.36650), MHz(5.36950), IC7800_OTHER_TX_MODES, W(2), W(100), IC7800_VFOS, IC7800_ANTS}, /* USA only */
{MHz(5.37150), MHz(5.37450), IC7800_OTHER_TX_MODES, W(2), W(100), IC7800_VFOS, IC7800_ANTS}, /* USA only */
{MHz(5.40350), MHz(5.40650), IC7800_OTHER_TX_MODES, W(2), W(100), IC7800_VFOS, IC7800_ANTS}, /* USA only */
RIG_FRNG_END,
},
.tuning_steps = {
{IC7800_1HZ_TS_MODES, 1},
{IC7800_ALL_RX_MODES, Hz(100)},
{IC7800_ALL_RX_MODES, kHz(1)},
{IC7800_ALL_RX_MODES, kHz(5)},
{IC7800_ALL_RX_MODES, kHz(9)},
{IC7800_ALL_RX_MODES, kHz(10)},
{IC7800_ALL_RX_MODES, kHz(12.5)},
{IC7800_ALL_RX_MODES, kHz(20)},
{IC7800_ALL_RX_MODES, kHz(25)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(2.4)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(1.8)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(3)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(400)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(50)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_PSK | RIG_MODE_PSKR, kHz(1.0)},
{RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(6)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(3)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(9)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(12)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(8)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(15)},
RIG_FLT_END,
},
.str_cal = IC7800_STR_CAL,
.swr_cal = IC7800_SWR_CAL,
.alc_cal = IC7800_ALC_CAL,
.rfpower_meter_cal = IC7800_RFPOWER_METER_CAL,
.comp_meter_cal = IC7800_COMP_METER_CAL,
.vd_meter_cal = IC7800_VD_METER_CAL,
.id_meter_cal = IC7800_ID_METER_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic7800_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.set_rit = icom_set_rit_new,
.get_rit = icom_get_rit_new,
.get_xit = icom_get_rit_new,
.set_xit = icom_set_xit_new,
.decode_event = icom_decode_event,
.set_level = ic7800_set_level,
.get_level = ic7800_get_level,
.set_ext_level = icom_set_ext_level,
.get_ext_level = icom_get_ext_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = icom_set_parm,
.get_parm = icom_get_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.send_morse = icom_send_morse
};
/*
* IC-7800 has 0x11 command using index instead of backend's real dB value
*
* c.f. http://www.plicht.de/ekki/civ/civ-p42.html
*/
int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_ATT:
if (val.i != 0)
{
/* Convert dB to index */
int i;
for (i = 0; i < 7; i++)
{
if (val.i == rig->state.attenuator[i])
{
val.i = i + 1;
break;
}
}
/* TODO: Should fail when not found? */
}
return icom_set_level(rig, vfo, level, val);
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x83;
return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val);
default:
return icom_set_level(rig, vfo, level, val);
}
}
/*
* IC-7800 has 0x11 command using index instead of backend's real dB value
*/
int ic7800_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
int retval;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_ATT:
retval = icom_get_level(rig, vfo, level, val);
if (retval != RIG_OK)
{
return retval;
}
/* Convert index to dB
* Rem: ATT index 0 means attenuator Off
*/
if (val->i > 0 && val->i <= 7)
{
val->i = rig->state.attenuator[val->i - 1];
}
break;
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x83;
return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val);
default:
return icom_get_level(rig, vfo, level, val);
}
return RIG_OK;
}

Wyświetl plik

@ -1,194 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-781 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "bandplan.h"
#include "icom.h"
#define IC781_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY)
/*
* IC-781
* specs: http://www.qsl.net/sm7vhs/radio/icom/ic781/specs.htm
*
* TODO: selected memory scan, delta-f scan, dual watch
*/
#define IC781_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY)
#define IC781_AM_TX_MODES (RIG_MODE_AM)
#define IC781_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC781_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY|RIG_OP_MCL|RIG_OP_XCHG)
#define IC781_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM) /* TBC */
#define IC781_ANTS RIG_ANT_1
/*
*/
static const struct icom_priv_caps ic781_priv_caps =
{
0x26, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic781_caps =
{
.rig_model = RIG_MODEL_IC781,
.model_name = "IC-781",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC781_VFO_OPS,
.scan_ops = IC781_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
{ 100, 101, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(100), MHz(30), IC781_ALL_RX_MODES, -1, -1, IC781_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC781_OTHER_TX_MODES, W(10), W(150), IC781_VFO_ALL, IC781_ANTS),
FRQ_RNG_HF(1, IC781_AM_TX_MODES, W(10), W(75), IC781_VFO_ALL, IC781_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = {
{kHz(100), MHz(30), IC781_ALL_RX_MODES, -1, -1, IC781_VFO_ALL},
RIG_FRNG_END,
},
/* weird transmit ranges ... --sf */
.tx_range_list2 = {
{kHz(1800), 1999999, IC781_OTHER_TX_MODES, 5000, 150000, IC781_VFO_ALL}, /* 150W class */
{kHz(1800), 1999999, IC781_AM_TX_MODES, 2000, 75000, IC781_VFO_ALL}, /* 75W class */
{kHz(3400), 4099999, IC781_OTHER_TX_MODES, 5000, 150000, IC781_VFO_ALL},
{kHz(3400), 4099999, IC781_AM_TX_MODES, 2000, 75000, IC781_VFO_ALL},
{MHz(6.9), kHz(7499.99), IC781_OTHER_TX_MODES, 5000, 150000, IC781_VFO_ALL},
{MHz(6.9), kHz(7499.99), IC781_AM_TX_MODES, 2000, 75000, IC781_VFO_ALL},
{MHz(9.9), MHz(1049999), IC781_OTHER_TX_MODES, 5000, 150000, IC781_VFO_ALL},
{MHz(9.9), MHz(1049999), IC781_AM_TX_MODES, 2000, 75000, IC781_VFO_ALL},
{MHz(13.9), kHz(14.49999), IC781_OTHER_TX_MODES, 5000, 150000, IC781_VFO_ALL},
{MHz(13.9), kHz(14.49999), IC781_AM_TX_MODES, 2000, 75000, IC781_VFO_ALL},
{kHz(17900), kHz(18499.99), IC781_OTHER_TX_MODES, 5000, 150000, IC781_VFO_ALL},
{kHz(17900), kHz(18499.99), IC781_AM_TX_MODES, 2000, 75000, IC781_VFO_ALL},
{MHz(20.9), kHz(21499.99), IC781_OTHER_TX_MODES, 5000, 150000, IC781_VFO_ALL},
{MHz(20.9), kHz(21499.99), IC781_AM_TX_MODES, 2000, 75000, IC781_VFO_ALL},
{kHz(24400), kHz(25099.99), IC781_OTHER_TX_MODES, 5000, 150000, IC781_VFO_ALL},
{kHz(24400), kHz(25099.99), IC781_AM_TX_MODES, 2000, 75000, IC781_VFO_ALL},
{MHz(27.9), MHz(30), IC781_OTHER_TX_MODES, 5000, 150000, IC781_VFO_ALL},
{MHz(27.9), MHz(30), IC781_AM_TX_MODES, 2000, 75000, IC781_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC781_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY | RIG_MODE_AM, kHz(2.4)},
{RIG_MODE_CW | RIG_MODE_RTTY, Hz(500)}, /* narrow */
{RIG_MODE_CW | RIG_MODE_RTTY, Hz(250)}, /* narrow, with [CW250Hz] ON */
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic781_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_split_vfo = icom_set_split_vfo,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.scan = icom_scan,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
/* TODO: more capabilities */
};

Wyświetl plik

@ -1,365 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-785x and variations
* Derived from ic7800.c by W9MDB -- needs testing
* Copyright (c) 2009-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <hamlib/rig.h>
#include "token.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "misc.h"
#include "bandplan.h"
#define IC785x_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTAM|RIG_MODE_PKTFM)
#define IC785x_1HZ_TS_MODES IC785x_ALL_RX_MODES
#define IC785x_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM)
#define IC785x_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
#define IC785x_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF|RIG_FUNC_DUAL_WATCH)
#define IC785x_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_APF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
#define IC785x_VFOS (RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM)
#define IC785x_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
#define IC785x_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
#define IC785x_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_PROG|RIG_SCAN_DELTA|RIG_SCAN_PRIO)
#define IC785x_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4)
// IC-785x S-meter calibration data based on manual
#define IC785x_STR_CAL { 3, \
{ \
{ 0, -54 }, /* S0 */ \
{ 120, 0 }, /* S9 */ \
{ 241, 60 } /* S9+60 */ \
} }
#define IC785x_SWR_CAL { 5, \
{ \
{ 0, 1.0f }, \
{ 48, 1.5f }, \
{ 80, 2.0f }, \
{ 120, 3.0f }, \
{ 240, 6.0f } \
} }
#define IC785x_ALC_CAL { 2, \
{ \
{ 0, 0.0f }, \
{ 120, 1.0f } \
} }
#define IC785x_RFPOWER_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 143, 0.5f }, \
{ 213, 1.0f } \
} }
#define IC785x_COMP_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
{ 130, 15.0f }, \
{ 241, 30.0f } \
} }
#define IC785x_VD_METER_CAL { 4, \
{ \
{ 0, 0.0f }, \
{ 151, 44.0f }, \
{ 180, 48.0f }, \
{ 211, 52.0f } \
} }
#define IC785x_ID_METER_CAL { 4, \
{ \
{ 0, 0.0f }, \
{ 97, 10.0f }, \
{ 146, 15.0f }, \
{ 241, 25.0f } \
} }
extern int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
extern int ic7800_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int ic785x_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ic785x_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
/*
* IC-785x rig capabilities.
*
* TODO: complete command set (esp. the $1A bunch!) and testing..
*/
static const struct icom_priv_caps ic785x_priv_caps =
{
0x8e, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
{ .level = RIG_AGC_FAST, .icom_level = 1 },
{ .level = RIG_AGC_MEDIUM, .icom_level = 2 },
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
{ .level = -1, .icom_level = 0 },
},
};
const struct confparams ic785x_ext_levels[] =
{
{
TOK_DRIVE_GAIN, "drive_gain", "Drive gain", "Drive gain",
NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } },
},
{
TOK_DIGI_SEL_FUNC, "digi_sel", "DIGI-SEL enable", "DIGI-SEL enable",
NULL, RIG_CONF_CHECKBUTTON, { },
},
{
TOK_DIGI_SEL_LEVEL, "digi_sel_level", "DIGI-SEL level", "DIGI-SEL level",
NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } },
},
{ RIG_CONF_END, NULL, }
};
const struct rig_caps ic785x_caps =
{
.rig_model = RIG_MODEL_IC785x,
.model_name = "IC-785x",
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC785x_FUNCS,
.has_set_func = IC785x_FUNCS,
.has_get_level = IC785x_LEVELS,
.has_set_level = RIG_LEVEL_SET(IC785x_LEVELS),
.has_get_parm = IC785x_PARMS,
.has_set_parm = RIG_PARM_SET(IC785x_PARMS), /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
},
.parm_gran = {},
.extlevels = ic785x_ext_levels,
.ctcss_list = common_ctcss_list,
.dcs_list = NULL,
.preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */
.attenuator = { 3, 6, 9, 12, 15, 18, 21, RIG_DBLST_END, },
.max_rit = Hz(9999),
.max_xit = Hz(9999),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC785x_VFO_OPS,
.scan_ops = IC785x_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 101, RIG_MTYPE_EDGE }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { {kHz(30), MHz(60), IC785x_ALL_RX_MODES, -1, -1, IC785x_VFOS, IC785x_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC785x_OTHER_TX_MODES, W(5), W(200), IC785x_VFOS, IC785x_ANTS),
FRQ_RNG_6m(1, IC785x_OTHER_TX_MODES, W(5), W(200), IC785x_VFOS, IC785x_ANTS),
FRQ_RNG_HF(1, IC785x_AM_TX_MODES, W(5), W(50), IC785x_VFOS, IC785x_ANTS), /* AM class */
FRQ_RNG_6m(1, IC785x_AM_TX_MODES, W(5), W(50), IC785x_VFOS, IC785x_ANTS), /* AM class */
RIG_FRNG_END,
},
.rx_range_list2 = { {kHz(30), MHz(60), IC785x_ALL_RX_MODES, -1, -1, IC785x_VFOS, IC785x_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC785x_OTHER_TX_MODES, W(5), W(200), IC785x_VFOS, IC785x_ANTS),
FRQ_RNG_6m(2, IC785x_OTHER_TX_MODES, W(5), W(200), IC785x_VFOS, IC785x_ANTS),
FRQ_RNG_HF(2, IC785x_AM_TX_MODES, W(5), W(50), IC785x_VFOS, IC785x_ANTS), /* AM class */
FRQ_RNG_6m(2, IC785x_AM_TX_MODES, W(5), W(50), IC785x_VFOS, IC785x_ANTS), /* AM class */
/* USA only, TBC: end of range and modes */
{MHz(5.33050), MHz(5.33350), IC785x_OTHER_TX_MODES, W(2), W(100), IC785x_VFOS, IC785x_ANTS}, /* USA only */
{MHz(5.34650), MHz(5.34950), IC785x_OTHER_TX_MODES, W(2), W(100), IC785x_VFOS, IC785x_ANTS}, /* USA only */
{MHz(5.36650), MHz(5.36950), IC785x_OTHER_TX_MODES, W(2), W(100), IC785x_VFOS, IC785x_ANTS}, /* USA only */
{MHz(5.37150), MHz(5.37450), IC785x_OTHER_TX_MODES, W(2), W(100), IC785x_VFOS, IC785x_ANTS}, /* USA only */
{MHz(5.40350), MHz(5.40650), IC785x_OTHER_TX_MODES, W(2), W(100), IC785x_VFOS, IC785x_ANTS}, /* USA only */
RIG_FRNG_END,
},
.tuning_steps = {
{IC785x_1HZ_TS_MODES, 1},
{IC785x_ALL_RX_MODES, Hz(100)},
{IC785x_ALL_RX_MODES, kHz(1)},
{IC785x_ALL_RX_MODES, kHz(5)},
{IC785x_ALL_RX_MODES, kHz(9)},
{IC785x_ALL_RX_MODES, kHz(10)},
{IC785x_ALL_RX_MODES, kHz(12.5)},
{IC785x_ALL_RX_MODES, kHz(20)},
{IC785x_ALL_RX_MODES, kHz(25)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(2.4)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(1.8)},
{RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(3)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(400)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(50)},
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_PSK | RIG_MODE_PSKR, kHz(1.0)},
{RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(6)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(3)},
{RIG_MODE_AM | RIG_MODE_PKTAM, kHz(9)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(12)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(8)},
{RIG_MODE_FM | RIG_MODE_PKTFM, kHz(15)},
RIG_FLT_END,
},
.str_cal = IC785x_STR_CAL,
.swr_cal = IC785x_SWR_CAL,
.alc_cal = IC785x_ALC_CAL,
.rfpower_meter_cal = IC785x_RFPOWER_METER_CAL,
.comp_meter_cal = IC785x_COMP_METER_CAL,
.vd_meter_cal = IC785x_VD_METER_CAL,
.id_meter_cal = IC785x_ID_METER_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic785x_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = icom_rig_open,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode_with_data,
.get_mode = icom_get_mode_with_data,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.set_rit = icom_set_rit_new,
.get_rit = icom_get_rit_new,
.get_xit = icom_get_rit_new,
.set_xit = icom_set_xit_new,
.decode_event = icom_decode_event,
.set_level = ic785x_set_level,
.get_level = ic785x_get_level,
.set_ext_level = icom_set_ext_level,
.get_ext_level = icom_get_ext_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = icom_set_parm,
.get_parm = icom_get_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.send_morse = icom_send_morse
};
int ic785x_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x03;
cmdbuf[1] = 0x09;
return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val);
default:
return ic7800_set_level(rig, vfo, level, val);
}
}
int ic785x_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x03;
cmdbuf[1] = 0x09;
return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val);
default:
return ic7800_get_level(rig, vfo, level, val);
}
}

Wyświetl plik

@ -1,178 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-820H (VHF/UHF All-Mode Tranceiver)
* Contributed by Francois Retief <fgretief@sun.ac.za>
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "icom.h"
#define IC820H_MODES (RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_FM)
#define IC820H_VFO_ALL (RIG_VFO_A|RIG_VFO_C|RIG_VFO_MEM)
/* FIXME: What about MAIN/SUB mode? And satellite mode? */
#define IC820H_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY|RIG_OP_MCL)
#define IC820H_SCAN_OPS (RIG_SCAN_MEM)
/* FIXME: Manual talks about 3 modes: Programmed scan, Memory scan and
* Mode select memory scan operation. How do i encode these?
*/
#define IC820H_STR_CAL { 0, { } }
/*
*/
static const struct icom_priv_caps ic820h_priv_caps =
{
0x42, /* default address */
1, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic820h_caps =
{
.rig_model = RIG_MODEL_IC820,
.model_name = "IC-820H",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, }, /* Attanuator 15dB for each band. manual button */
.max_rit = Hz(0), /* SSB,CW: +-1.0kHz FM: +-5.0kHz */
.max_xit = Hz(0),
.max_ifshift = Hz(0), /* 1.2kHz manual knob */
.targetable_vfo = 0,
.vfo_ops = IC820H_VFO_OPS,
.scan_ops = IC820H_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
/* FIXME: Each band has 80 channels (2*80) ?? */
{ 1, 80, RIG_MTYPE_MEM },
{ 81, 82, RIG_MTYPE_EDGE },
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(136), MHz(174), IC820H_MODES, -1, -1, IC820H_VFO_ALL},
{MHz(430), MHz(450), IC820H_MODES, -1, -1, IC820H_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(144), MHz(146), RIG_MODE_SSB, W(6), W(35), IC820H_VFO_ALL},
{MHz(144), MHz(146), RIG_MODE_FM | RIG_MODE_CW, W(6), W(45), IC820H_VFO_ALL},
{MHz(430), MHz(440), RIG_MODE_SSB, W(6), W(30), IC820H_VFO_ALL},
{MHz(430), MHz(440), RIG_MODE_FM | RIG_MODE_CW, W(6), W(40), IC820H_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{MHz(136), MHz(174), IC820H_MODES, -1, -1, IC820H_VFO_ALL},
{MHz(430), MHz(450), IC820H_MODES, -1, -1, IC820H_VFO_ALL},
RIG_FRNG_END,
},
/*
* From manual: VHF UHF
* USA 144.0-148.0 MHz 430.0-450.0 MHz
* Europe 144.0-146.0 MHz 430.0-440.0 MHz
* Australia 144.0-148.0 MHz 430.0-450.0 MHz
* Sweden 144.0-146.0 MHz 432.0-438.0 MHz
*/
.tx_range_list2 = {
{MHz(144), MHz(148), RIG_MODE_SSB, W(6), W(35), IC820H_VFO_ALL},
{MHz(144), MHz(148), RIG_MODE_FM | RIG_MODE_CW, W(6), W(45), IC820H_VFO_ALL},
{MHz(430), MHz(450), RIG_MODE_SSB, W(6), W(30), IC820H_VFO_ALL},
{MHz(430), MHz(450), RIG_MODE_FM | RIG_MODE_CW, W(6), W(40), IC820H_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{RIG_MODE_SSB | RIG_MODE_CW, 1},
{RIG_MODE_SSB | RIG_MODE_CW, 10},
{RIG_MODE_SSB | RIG_MODE_CW, 50},
{RIG_MODE_SSB | RIG_MODE_CW, 100},
{RIG_MODE_FM, kHz(5)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_CW | RIG_MODE_SSB, kHz(2.3)}, /* builtin */
{RIG_MODE_FM, kHz(15)}, /* builtin */
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic820h_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
};

Wyświetl plik

@ -1,178 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-821H (VHF/UHF All-Mode Tranceiver)
* Contributed by Francois Retief <fgretief@sun.ac.za>
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "icom.h"
#define IC821H_MODES (RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_FM)
#define IC821H_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM|RIG_VFO_MAIN|RIG_VFO_SUB)
/* FIXME: What about MAIN/SUB mode? And satellite mode? */
#define IC821H_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY|RIG_OP_MCL)
#define IC821H_SCAN_OPS (RIG_SCAN_MEM)
/* FIXME: Manual talks about 3 modes: Programmed scan, Memory scan and
* Mode select memory scan operation. How do i encode these?
*/
#define IC821H_STR_CAL { 0, { } }
/*
*/
static const struct icom_priv_caps ic821h_priv_caps =
{
0x4c, /* default address */
1, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic821h_caps =
{
.rig_model = RIG_MODEL_IC821H,
.model_name = "IC-821H",
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, }, /* Attanuator 15dB for each band. manual button */
.max_rit = Hz(0), /* SSB,CW: +-1.0kHz FM: +-5.0kHz */
.max_xit = Hz(0),
.max_ifshift = Hz(0), /* 1.2kHz manual knob */
.targetable_vfo = 0,
.vfo_ops = IC821H_VFO_OPS,
.scan_ops = IC821H_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
/* FIXME: Each band has 80 channels (2*80) */
{ 1, 80, RIG_MTYPE_MEM },
{ 81, 82, RIG_MTYPE_EDGE },
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(136), MHz(174), IC821H_MODES, -1, -1, IC821H_VFO_ALL},
{MHz(430), MHz(450), IC821H_MODES, -1, -1, IC821H_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(144), MHz(146), RIG_MODE_SSB, W(6), W(35), IC821H_VFO_ALL},
{MHz(144), MHz(146), RIG_MODE_FM | RIG_MODE_CW, W(6), W(45), IC821H_VFO_ALL},
{MHz(430), MHz(440), RIG_MODE_SSB, W(6), W(30), IC821H_VFO_ALL},
{MHz(430), MHz(440), RIG_MODE_FM | RIG_MODE_CW, W(6), W(40), IC821H_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{MHz(136), MHz(174), IC821H_MODES, -1, -1, IC821H_VFO_ALL},
{MHz(430), MHz(450), IC821H_MODES, -1, -1, IC821H_VFO_ALL},
RIG_FRNG_END,
},
/*
* From manual: VHF UHF
* USA 144.0-148.0 MHz 430.0-450.0 MHz
* Europe 144.0-146.0 MHz 430.0-440.0 MHz
* Australia 144.0-148.0 MHz 430.0-450.0 MHz
* Sweden 144.0-146.0 MHz 432.0-438.0 MHz
*/
.tx_range_list2 = {
{MHz(144), MHz(148), RIG_MODE_SSB, W(6), W(35), IC821H_VFO_ALL},
{MHz(144), MHz(148), RIG_MODE_FM | RIG_MODE_CW, W(6), W(45), IC821H_VFO_ALL},
{MHz(430), MHz(450), RIG_MODE_SSB, W(6), W(30), IC821H_VFO_ALL},
{MHz(430), MHz(450), RIG_MODE_FM | RIG_MODE_CW, W(6), W(40), IC821H_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{RIG_MODE_SSB | RIG_MODE_CW, 1},
{RIG_MODE_SSB | RIG_MODE_CW, 10},
{RIG_MODE_SSB | RIG_MODE_CW, 50},
{RIG_MODE_SSB | RIG_MODE_CW, 100},
{RIG_MODE_FM, kHz(5)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_CW | RIG_MODE_SSB, kHz(2.3)}, /* buildin */
{RIG_MODE_FM, kHz(15)}, /* buildin */
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic821h_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
};

Wyświetl plik

@ -1,597 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-910 (VHF/UHF All-Mode Transceiver)
* Contributed by Francois Retief <fgretief@sun.ac.za>
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "misc.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "idx_builtin.h"
/*
* It seems some IC910 out there have weird firmware. Uncomment the following
* if your modes are wrong, and please report to hamlib-developer maillist
* with firmware number. That'd be interesting to have a word from Icom
* on this subject, and if firmware updates are possible.
*/
#ifdef HAVE_WEIRD_IC910_MODES
static int ic910_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
/* FIX: The IC-910 has "Set FM" = 4, which is RTTY in for other radios */
if (mode == RIG_MODE_FM)
{
mode = RIG_MODE_RTTY;
}
return icom_set_mode(rig, vfo, mode, width);
}
static int ic910_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
/* FIX: The IC-910 has "Set FM" = 4, which is RTTY in for other radios */
int retval = icom_get_mode(rig, vfo, mode, width);
if (*mode == RIG_MODE_RTTY)
{
*mode = RIG_MODE_FM;
}
return retval;
}
#endif /* HAVE_WEIRD_IC910_MODES */
/* this function compares 2 frequencies
* returns 1 if they are in the same band
* returns 0 if they are in different bands
*/
static int compareFrequencies(RIG *rig, freq_t freq1, freq_t freq2)
{
int freq1band = 0, freq2band = 0;
freq_range_t noband = RIG_FRNG_END;
while (rig->caps->rx_range_list1[freq1band].startf != noband.startf)
{
if (freq1 >= rig->caps->rx_range_list1[freq1band].startf &&
freq1 <= rig->caps->rx_range_list1[freq1band].endf)
{
break;
}
++freq1band;
//fprintf(stderr, "%i\n", freq1band);
}
while (rig->caps->rx_range_list1[freq2band].startf != noband.startf)
{
if (freq2 >= rig->caps->rx_range_list1[freq2band].startf &&
freq2 <= rig->caps->rx_range_list1[freq2band].endf)
{
break;
}
++freq2band;
}
if (freq2band == freq1band) { return 1; }
else { return 0; }
}
static int ic910_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
int retval;
freq_t otherfreq;
freq_t origfreq;
if ((retval = icom_get_freq(rig, RIG_VFO_CURR, &origfreq)) != RIG_OK) { return retval; }
if (compareFrequencies(rig, freq, origfreq))
{
/* correct band already */
if (RIG_VFO_A == vfo || RIG_VFO_B == vfo)
{
/* switch to desired VFO and read its frequency */
if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; }
if ((retval = icom_get_freq(rig, vfo, &otherfreq)) != RIG_OK) { return retval; }
retval = icom_set_freq(rig, RIG_VFO_CURR, freq);
if (otherfreq != origfreq)
{
/* swap VFOs back as original was the other one */
icom_set_vfo(rig, RIG_VFO_A == vfo ? RIG_VFO_B : RIG_VFO_A);
}
}
else if (RIG_VFO_MAIN == vfo || RIG_VFO_SUB == vfo)
{
/* switch to the desired of MAIN and SUB and read its frequency */
if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; }
if ((retval = icom_get_freq(rig, vfo, &otherfreq)) != RIG_OK) { return retval; }
if (otherfreq != origfreq)
{
/* started on a different so band exchange MAIN and SUB */
if ((retval = icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG)) != RIG_OK) { return retval; }
retval = icom_set_freq(rig, RIG_VFO_CURR, freq);
/* swap MAIN/SUB back as original was the other one */
icom_set_vfo(rig, RIG_VFO_MAIN == vfo ? RIG_VFO_SUB : RIG_VFO_MAIN);
}
else
{
/* already correct one of MAIN and SUB */
retval = icom_set_freq(rig, RIG_VFO_CURR, freq);
}
}
else if (RIG_VFO_CURR == vfo)
{
retval = icom_set_freq(rig, RIG_VFO_CURR, freq);
}
else { retval = -RIG_EVFO; }
}
else
{
/* wrong band */
if (RIG_VFO_A == vfo || RIG_VFO_B == vfo)
{
/* try and set frequency, may fail if band is already on other of MAIN/SUB */
retval = icom_set_freq(rig, RIG_VFO_CURR, freq);
if (-RIG_ERJCTED == retval)
{
/* exchange MAIN & SUB */
if ((retval = icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG)) != RIG_OK) { return retval; }
if ((retval = icom_get_freq(rig, vfo, &origfreq)) != RIG_OK) { return retval; }
if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; }
if ((retval = icom_get_freq(rig, vfo, &otherfreq)) != RIG_OK) { return retval; }
retval = icom_set_freq(rig, RIG_VFO_CURR, freq);
if (-RIG_ERJCTED == retval)
{
/* band not fitted so swap MAIN & SUB back and give up */
icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG);
return retval;
}
else if (retval != RIG_OK) { return retval; }
if (otherfreq != origfreq)
{
/* swap VFOs back as original was the other one */
icom_set_vfo(rig, RIG_VFO_A == vfo ? RIG_VFO_B : RIG_VFO_A);
}
/* we do not exchange bands back as this is taken to
mean set VFOA/B on MAIN to the specified frequency
as Hamlib does not recognize A on MAIN or B on SUB
etc. This is probably reasonable since we cannot Tx
on SUB */
return retval;
}
/* we changed band to the "third band" which always makes
VFO A current so just make the requested one the
specified frequency as well if it is VFO B. There is no
way of going to the "third band" without changing VFO
A */
if (RIG_VFO_B == vfo)
{
if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; }
retval = icom_set_freq(rig, RIG_VFO_CURR, freq);
icom_set_vfo(rig, RIG_VFO_A);
}
}
else if (RIG_VFO_MAIN == vfo || RIG_VFO_SUB == vfo)
{
if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; }
if ((retval = icom_get_freq(rig, vfo, &otherfreq)) != RIG_OK) { return retval; }
retval = icom_set_freq(rig, RIG_VFO_CURR, freq);
if (-RIG_ERJCTED == retval)
{
/* required band is on other of MAIN or SUB */
if ((retval = icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG)) != RIG_OK) { return retval; }
retval = icom_set_freq(rig, RIG_VFO_CURR, freq);
}
else if (retval != RIG_OK) { return retval; }
if (otherfreq != origfreq)
{
/* started on other of MAIN & SUB so switch back */
icom_set_vfo(rig,
RIG_VFO_MAIN == vfo ?
RIG_VFO_SUB : RIG_VFO_MAIN);
}
}
else if (RIG_VFO_CURR == vfo)
{
retval = icom_set_freq(rig, RIG_VFO_CURR, freq);
if (-RIG_ERJCTED == retval)
{
/* exchange MAIN & SUB */
if ((retval = icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG)) != RIG_OK) { return retval; }
retval = icom_set_freq(rig, RIG_VFO_CURR, freq);
if (-RIG_ERJCTED == retval)
{
/* band not fitted so swap MAIN & SUB back and give up */
icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG);
return retval;
}
}
}
else { retval = -RIG_EVFO; }
}
return retval;
}
static int ic910_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
int retval;
freq_t origfreq;
/* start off by reading the current VFO frequency */
if ((retval = icom_get_freq(rig, RIG_VFO_CURR, &origfreq)) != RIG_OK) { return retval; }
if (RIG_VFO_A == vfo || RIG_VFO_B == vfo)
{
/* switch to desired VFO and read its frequency */
if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; }
if ((retval = icom_get_freq(rig, vfo, freq)) != RIG_OK) { return retval; }
if (*freq != origfreq)
{
/* swap VFOs back as original was the other one */
icom_set_vfo(rig, RIG_VFO_A == vfo ? RIG_VFO_B : RIG_VFO_A);
}
}
else if (RIG_VFO_MAIN == vfo || RIG_VFO_SUB == vfo)
{
/* switch to the desired of MAIN and SUB and read its frequency */
if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; }
if ((retval = icom_get_freq(rig, vfo, freq)) != RIG_OK) { return retval; }
if (*freq != origfreq)
{
/* started on a different so switch back MAIN or SUB */
icom_set_vfo(rig, RIG_VFO_MAIN == vfo ? RIG_VFO_SUB : RIG_VFO_MAIN);
}
}
else if (RIG_VFO_CURR == vfo)
{
*freq = origfreq;
}
else { retval = -RIG_EVFO; }
return retval;
}
/*
* This function does the special bandwidth coding for IC-910
* (1 - normal, 2 - narrow)
*/
static int ic910_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
if (*pd == PD_NARROW_3)
{
*pd = PD_NARROW_2;
}
return err;
}
#define IC910_MODES (RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_FM)
#define IC910_MODES (RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_FM)
#define IC910_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM|RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
#define IC910_SCAN_OPS (RIG_SCAN_MEM)
#define IC910_VFO_OPS (RIG_OP_FROM_VFO| \
RIG_OP_TO_VFO| \
RIG_OP_CPY| \
RIG_OP_MCL| \
RIG_OP_XCHG)
#define IC910_FUNC_ALL (RIG_FUNC_NB| \
RIG_FUNC_NR| \
RIG_FUNC_ANF| \
RIG_FUNC_TONE| \
RIG_FUNC_TSQL| \
RIG_FUNC_COMP| \
RIG_FUNC_VOX| \
RIG_FUNC_FBKIN| \
RIG_FUNC_AFC| \
RIG_FUNC_SATMODE| \
RIG_FUNC_SCOPE)
#define IC910_LEVEL_ALL (RIG_LEVEL_AF| \
RIG_LEVEL_RF| \
RIG_LEVEL_SQL| \
RIG_LEVEL_IF| \
RIG_LEVEL_NR| \
RIG_LEVEL_CWPITCH| \
RIG_LEVEL_RFPOWER| \
RIG_LEVEL_MICGAIN| \
RIG_LEVEL_KEYSPD| \
RIG_LEVEL_COMP| \
RIG_LEVEL_VOXGAIN| \
RIG_LEVEL_VOXDELAY| \
RIG_LEVEL_ANTIVOX| \
RIG_LEVEL_ATT| \
RIG_LEVEL_PREAMP)
#define IC910_STR_CAL UNKNOWN_IC_STR_CAL /* FIXME */
static const struct icom_priv_caps ic910_priv_caps =
{
0x60, /* default address */
0, /* 731 mode */
1, /* no XCHG to avoid display flicker */
ic910_ts_sc_list,
.r2i_mode = ic910_r2i_mode
};
int ic910_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
{
switch (func)
{
case RIG_FUNC_SCOPE:
return icom_set_raw(rig, C_CTL_MEM, S_MEM_BANDSCOPE, 0, NULL, 1,
status ? 1 : 0);
case RIG_FUNC_SATMODE:
return icom_set_raw(rig, C_CTL_MEM, S_MEM_SATMODE910, 0, NULL, 1,
status ? 1 : 0);
default:
return icom_set_func(rig, vfo, func, status);
}
}
int ic910_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
{
switch (func)
{
case RIG_FUNC_SCOPE:
return icom_get_raw(rig, C_CTL_MEM, S_MEM_BANDSCOPE, 0, NULL, status);
case RIG_FUNC_SATMODE:
return icom_get_raw(rig, C_CTL_MEM, S_MEM_SATMODE910, 0, NULL, status);
default:
return icom_get_func(rig, vfo, func, status);
}
}
int ic910_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
return icom_set_level_raw(rig, level, C_CTL_MEM, S_MEM_VOXDELAY, 0, NULL, 1,
val);
default:
return icom_set_level(rig, vfo, level, val);
}
}
int ic910_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
return icom_get_level_raw(rig, level, C_CTL_MEM, S_MEM_VOXDELAY, 0, NULL, val);
default:
return icom_get_level(rig, vfo, level, val);
}
}
const struct rig_caps ic910_caps =
{
.rig_model = RIG_MODEL_IC910,
.model_name = "IC-910",
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC910_FUNC_ALL,
.has_set_func = IC910_FUNC_ALL | RIG_FUNC_RESUME,
.has_get_level = IC910_LEVEL_ALL | (RIG_LEVEL_RAWSTR),
.has_set_level = IC910_LEVEL_ALL,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = NULL,
.preamp = { 20, RIG_DBLST_END, },
.attenuator = { 20, RIG_DBLST_END, },
.max_rit = Hz(0), /* SSB,CW: +-1.0kHz FM: +-5.0kHz */
.max_xit = Hz(0),
.max_ifshift = Hz(0), /* 1.2kHz manual knob */
.targetable_vfo = RIG_TARGETABLE_FREQ,
.vfo_ops = IC910_VFO_OPS,
.scan_ops = IC910_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 105, RIG_MTYPE_EDGE },
{ 106, 106, RIG_MTYPE_CALL },
RIG_CHAN_END,
},
.rx_range_list1 = { /* USA */
{MHz(144), MHz(148), IC910_MODES, -1, -1, IC910_VFO_ALL},
{MHz(430), MHz(450), IC910_MODES, -1, -1, IC910_VFO_ALL},
{MHz(1240), MHz(1300), IC910_MODES, -1, -1, IC910_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(144), MHz(148), IC910_MODES, W(5), W(100), IC910_VFO_ALL},
{MHz(430), MHz(450), IC910_MODES, W(5), W(75), IC910_VFO_ALL},
{MHz(1240), MHz(1300), IC910_MODES, -1, -1, IC910_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = { /* Europe */
{MHz(144), MHz(146), IC910_MODES, -1, -1, IC910_VFO_ALL},
{MHz(430), MHz(440), IC910_MODES, -1, -1, IC910_VFO_ALL},
{MHz(1240), MHz(1300), IC910_MODES, -1, -1, IC910_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
{MHz(144), MHz(146), IC910_MODES, W(5), W(100), IC910_VFO_ALL},
{MHz(430), MHz(440), IC910_MODES, W(5), W(75), IC910_VFO_ALL},
{MHz(1240), MHz(1300), IC910_MODES, -1, -1, IC910_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{RIG_MODE_SSB | RIG_MODE_CW, 1},
{RIG_MODE_SSB | RIG_MODE_CW, 10},
{RIG_MODE_SSB | RIG_MODE_CW, 50},
{RIG_MODE_SSB | RIG_MODE_CW, 100},
{RIG_MODE_FM, kHz(0.1)},
{RIG_MODE_FM, kHz(5)},
{RIG_MODE_FM, kHz(6.25)},
{RIG_MODE_FM, kHz(10)},
{RIG_MODE_FM, kHz(12.5)},
{RIG_MODE_FM, kHz(20)},
{RIG_MODE_FM, kHz(25)},
{RIG_MODE_FM, kHz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_CW | RIG_MODE_SSB, kHz(2.3)}, /* builtin */
{RIG_MODE_CW, Hz(600)}, /* with optional FL-132/Fl133 CW filters */
{RIG_MODE_FM, kHz(15)}, /* builtin */
{RIG_MODE_FM, kHz(6)}, /* builtin */
RIG_FLT_END,
},
.str_cal = IC910_STR_CAL,
.priv = &ic910_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.get_freq = ic910_get_freq,
.set_freq = ic910_set_freq,
#ifdef HAVE_WEIRD_IC910_MODES
.get_mode = ic910_get_mode,
.set_mode = ic910_set_mode,
#else
.get_mode = icom_get_mode,
.set_mode = icom_set_mode,
#endif
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.set_vfo = icom_set_vfo,
.get_ts = icom_get_ts,
.set_ts = icom_set_ts,
.get_func = ic910_get_func,
.set_func = ic910_set_func,
.get_level = ic910_get_level,
.set_level = ic910_set_level,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.get_dcd = icom_get_dcd,
.decode_event = icom_decode_event,
.set_split_vfo = icom_set_split_vfo,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_freq_mode = icom_set_split_freq_mode,
.get_split_freq_mode = icom_get_split_freq_mode,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_rptr_shift = icom_set_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
};

Wyświetl plik

@ -1,323 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-9100 (HF/VHF/UHF All-Mode Tranceiver)
* Copyright (c) 2000-2011 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "idx_builtin.h"
#include "bandplan.h"
#define IC9100_MODES (RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_CWR|\
RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define IC9100_OTHER_TX_MODES ((IC9100_MODES) & ~RIG_MODE_AM)
#define IC9100_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM|RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
#define IC9100_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM|RIG_SCAN_SLCT|RIG_SCAN_PRIO)
#define IC9100_VFO_OPS (RIG_OP_FROM_VFO| \
RIG_OP_TO_VFO| \
RIG_OP_CPY| \
RIG_OP_MCL| \
RIG_OP_XCHG| \
RIG_OP_TUNE)
#define IC9100_FUNC_ALL (RIG_FUNC_NB| \
RIG_FUNC_NR| \
RIG_FUNC_ANF| \
RIG_FUNC_TONE| \
RIG_FUNC_TSQL| \
RIG_FUNC_COMP| \
RIG_FUNC_VOX| \
RIG_FUNC_FBKIN| \
RIG_FUNC_AFC| \
RIG_FUNC_SATMODE| \
RIG_FUNC_VSC| \
RIG_FUNC_MN| \
RIG_FUNC_LOCK| \
RIG_FUNC_SCOPE)
#define IC9100_LEVEL_ALL (RIG_LEVEL_AF| \
RIG_LEVEL_RF| \
RIG_LEVEL_SQL| \
RIG_LEVEL_IF| \
RIG_LEVEL_NR| \
RIG_LEVEL_CWPITCH| \
RIG_LEVEL_RFPOWER| \
RIG_LEVEL_MICGAIN| \
RIG_LEVEL_KEYSPD| \
RIG_LEVEL_COMP| \
RIG_LEVEL_VOXGAIN| \
RIG_LEVEL_VOXDELAY| \
RIG_LEVEL_ANTIVOX| \
RIG_LEVEL_APF| \
RIG_LEVEL_AGC| \
RIG_LEVEL_PBT_IN| \
RIG_LEVEL_PBT_OUT| \
RIG_LEVEL_NOTCHF_RAW| \
RIG_LEVEL_ATT| \
RIG_LEVEL_PREAMP| \
RIG_LEVEL_MONITOR_GAIN)
#define IC9100_PARM_ALL (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
#define IC9100_STR_CAL UNKNOWN_IC_STR_CAL /* FIXME */
#define IC9100_HF_ANTS (RIG_ANT_1|RIG_ANT_2)
/*
*/
static const struct icom_priv_caps ic9100_priv_caps =
{
0x7c, /* default address */
0, /* 731 mode */
1, /* no XCHG to avoid display flicker */
ic910_ts_sc_list, /* FIXME */
};
const struct rig_caps ic9100_caps =
{
.rig_model = RIG_MODEL_IC9100,
.model_name = "IC-9100",
.mfg_name = "Icom",
.version = BACKEND_VER".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC9100_FUNC_ALL,
.has_set_func = IC9100_FUNC_ALL | RIG_FUNC_RESUME,
.has_get_level = IC9100_LEVEL_ALL | RIG_LEVEL_RAWSTR | RIG_LEVEL_SWR,
.has_set_level = IC9100_LEVEL_ALL,
.has_get_parm = IC9100_PARM_ALL,
.has_set_parm = IC9100_PARM_ALL,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = common_dcs_list,
.preamp = {20, RIG_DBLST_END, },
.attenuator = {20, RIG_DBLST_END, },
.max_rit = kHz(9.999),
.max_xit = kHz(9.999),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC9100_VFO_OPS,
.scan_ops = IC9100_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 9, /* TODO */
.chan_list = { /* TBC */
{ 1, 396, RIG_MTYPE_MEM },
{ 397, 400, RIG_MTYPE_CALL },
{ 401, 424, RIG_MTYPE_EDGE },
RIG_CHAN_END,
},
.rx_range_list1 = { /* Europe */
{kHz(30), MHz(60), IC9100_MODES, -1, -1, IC9100_VFO_ALL, IC9100_HF_ANTS},
{kHz(136), MHz(174), IC9100_MODES, -1, -1, IC9100_VFO_ALL, RIG_ANT_3},
{MHz(420), MHz(480), IC9100_MODES, -1, -1, IC9100_VFO_ALL, RIG_ANT_4},
{MHz(1240), MHz(1320), IC9100_MODES, -1, -1, IC9100_VFO_ALL, RIG_ANT_5},
RIG_FRNG_END,
},
.tx_range_list1 = {
FRQ_RNG_HF(1, IC9100_OTHER_TX_MODES, W(2), W(100), IC9100_VFO_ALL, IC9100_HF_ANTS),
FRQ_RNG_HF(1, RIG_MODE_AM, W(2), W(25), IC9100_VFO_ALL, IC9100_HF_ANTS), /* only HF */
FRQ_RNG_6m(1, IC9100_OTHER_TX_MODES, W(2), W(100), IC9100_VFO_ALL, IC9100_HF_ANTS),
FRQ_RNG_2m(1, IC9100_OTHER_TX_MODES, W(2), W(100), IC9100_VFO_ALL, RIG_ANT_3),
FRQ_RNG_70cm(1, IC9100_OTHER_TX_MODES, W(2), W(75), IC9100_VFO_ALL, RIG_ANT_4),
/* option */
FRQ_RNG_23cm_REGION1(IC9100_OTHER_TX_MODES, W(1), W(10), IC9100_VFO_ALL, RIG_ANT_5),
RIG_FRNG_END,
},
.rx_range_list2 = { /* USA */
{kHz(30), MHz(60), IC9100_MODES, -1, -1, IC9100_VFO_ALL, IC9100_HF_ANTS},
{kHz(136), MHz(174), IC9100_MODES, -1, -1, IC9100_VFO_ALL, RIG_ANT_3},
{MHz(420), MHz(480), IC9100_MODES, -1, -1, IC9100_VFO_ALL, RIG_ANT_4},
{MHz(1240), MHz(1320), IC9100_MODES, -1, -1, IC9100_VFO_ALL, RIG_ANT_5},
RIG_FRNG_END,
},
.tx_range_list2 = {
FRQ_RNG_HF(2, IC9100_OTHER_TX_MODES, W(2), W(100), IC9100_VFO_ALL, IC9100_HF_ANTS),
FRQ_RNG_HF(2, RIG_MODE_AM, W(2), W(25), IC9100_VFO_ALL, IC9100_HF_ANTS), /* only HF */
/* USA only, TBC: end of range and modes */
{MHz(5.255), MHz(5.405), IC9100_OTHER_TX_MODES, W(2), W(100), IC9100_VFO_ALL, IC9100_HF_ANTS}, /* USA only */
{MHz(5.255), MHz(5.405), RIG_MODE_AM, W(2), W(100), IC9100_VFO_ALL, IC9100_HF_ANTS}, /* USA only */
FRQ_RNG_6m(2, IC9100_OTHER_TX_MODES, W(2), W(100), IC9100_VFO_ALL, IC9100_HF_ANTS),
FRQ_RNG_2m(2, IC9100_OTHER_TX_MODES, W(2), W(100), IC9100_VFO_ALL, RIG_ANT_3),
FRQ_RNG_70cm(2, IC9100_OTHER_TX_MODES, W(2), W(75), IC9100_VFO_ALL, RIG_ANT_4),
/* option */
FRQ_RNG_23cm_REGION2(IC9100_OTHER_TX_MODES, W(1), W(10), IC9100_VFO_ALL, RIG_ANT_5),
RIG_FRNG_END,
},
.tuning_steps = {
{RIG_MODE_SSB | RIG_MODE_CW, 1},
{RIG_MODE_SSB | RIG_MODE_CW, 10},
{RIG_MODE_SSB | RIG_MODE_CW, 50},
{RIG_MODE_SSB | RIG_MODE_CW, 100},
{RIG_MODE_FM, kHz(0.1)},
{RIG_MODE_FM, kHz(5)},
{RIG_MODE_FM, kHz(6.25)},
{RIG_MODE_FM, kHz(10)},
{RIG_MODE_FM, kHz(12.5)},
{RIG_MODE_FM, kHz(20)},
{RIG_MODE_FM, kHz(25)},
{RIG_MODE_FM, kHz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_CW | RIG_MODE_SSB | RIG_MODE_RTTY, kHz(2.4)}, /* builtin */
{RIG_MODE_CW | RIG_MODE_RTTY, Hz(500)},
{RIG_MODE_FM, kHz(15)}, /* builtin */
{RIG_MODE_FM | RIG_MODE_AM, kHz(6)}, /* builtin */
RIG_FLT_END,
},
.str_cal = IC9100_STR_CAL,
.priv = (void *)& ic9100_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.get_freq = icom_get_freq,
.set_freq = icom_set_freq,
.get_mode = icom_get_mode_with_data,
.set_mode = icom_set_mode_with_data,
.get_vfo = NULL,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.get_ts = icom_get_ts,
.set_ts = icom_set_ts,
.get_func = icom_get_func,
.set_func = icom_set_func,
.get_level = icom_get_level,
.set_level = icom_set_level,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.set_rit = icom_set_rit,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_sql = icom_set_dcs_code,
.get_dcs_sql = icom_get_dcs_code,
.set_parm = icom_set_parm,
.get_parm = icom_get_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.get_dcd = icom_get_dcd,
.decode_event = icom_decode_event,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.set_split_freq = icom_set_split_freq,
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
};
#ifdef XXREMOVEDXX
// Not referenced anywhere
int ic9100_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x27;
return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val);
default:
return icom_set_level(rig, vfo, level, val);
}
}
#endif
#ifdef XXREMOVEDXX
// Not referenced anywhere
int ic9100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char cmdbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (level)
{
case RIG_LEVEL_VOXDELAY:
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x27;
return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val);
default:
return icom_get_level(rig, vfo, level, val);
}
}
#endif

Wyświetl plik

@ -1,255 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-E92D/IC-92AD and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "idx_builtin.h"
#include "icom.h"
#include "frame.h"
#include "icom_defs.h"
/* TODO: DV (GMSK 4.8 kbps voice) */
#define IC92D_MODES (RIG_MODE_FM)
#define IC92D_MODES_TX (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM)
#define IC92D_FUNC_ALL (RIG_FUNC_MUTE|RIG_FUNC_MON|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|RIG_FUNC_AFC)
#define IC92D_LEVEL_ALL (RIG_LEVEL_AF|RIG_LEVEL_SQL|RIG_LEVEL_RFPOWER|RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_RAWSTR)
#define IC92D_PARM_ALL (RIG_PARM_BEEP|RIG_PARM_BACKLIGHT)
#define IC92D_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC92D_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define IC92D_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM)
/*
* FIXME: real measurement
*/
#define IC92D_STR_CAL UNKNOWN_IC_STR_CAL
/* FIXME */
#define IC92D_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
.rptr_offs = 1, \
.rptr_shift = 1, \
.funcs = IC92D_FUNC_ALL, \
.levels = RIG_LEVEL_SET(IC92D_LEVEL_ALL), \
}
static const char *ic92d_get_info(RIG *rig);
/* FIXME: tuning step sub-commands */
const struct ts_sc_list ic92d_ts_sc_list[] =
{
{ kHz(5), 0x00 },
{ kHz(6.25), 0x01 },
{ kHz(8.33), 0x02 },
{ kHz(9), 0x03 },
{ kHz(10), 0x04 },
{ kHz(12.5), 0x05 },
{ kHz(15), 0x06 },
{ kHz(20), 0x07 },
{ kHz(25), 0x08 },
{ kHz(30), 0x09 },
{ kHz(50), 0x0a },
{ kHz(100), 0x0b },
{ kHz(125), 0x0c },
{ kHz(200), 0x0d },
{ 0, 0 },
};
/*
*/
static const struct icom_priv_caps ic92d_priv_caps =
{
0x01, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic92d_ts_sc_list,
.serial_full_duplex = 1
};
const struct rig_caps ic92d_caps =
{
.rig_model = RIG_MODEL_IC92D,
.model_name = "IC-92D", /* IC-E92D/IC-92AD */
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_HANDHELD,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 38400,
.serial_rate_max = 38400,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = IC92D_FUNC_ALL,
.has_set_func = IC92D_FUNC_ALL,
.has_get_level = IC92D_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(IC92D_LEVEL_ALL),
.has_get_parm = IC92D_PARM_ALL,
.has_set_parm = IC92D_PARM_ALL,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = full_dcs_list,
.preamp = { RIG_DBLST_END, },
.attenuator = { 10, RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC92D_VFO_OPS,
.scan_ops = IC92D_SCAN_OPS,
.transceive = RIG_TRN_OFF,
.bank_qty = 26,
.chan_desc_sz = 8,
/* The IC-E92D has a total 1304 memory channels with 26 memory banks.
* The VFO A has 800 regular channels, 50 scan edges and 2 call channels,
* while the VFO B has 400 regular, 50 scan edges and 2 call channels.
*/
.chan_list = {
{ 1, 1200, RIG_MTYPE_MEM, IC92D_MEM_CAP },
{ 1201, 1300, RIG_MTYPE_EDGE, IC92D_MEM_CAP },
{ 1301, 1304, RIG_MTYPE_CALL, IC92D_MEM_CAP },
RIG_CHAN_END,
},
/* IC-E92D */
.rx_range_list1 = {
{kHz(495), MHz(999.99), RIG_MODE_AM | RIG_MODE_FM | RIG_MODE_WFM, -1, -1, RIG_VFO_A},
{MHz(118), MHz(174), RIG_MODE_AM | RIG_MODE_FM, -1, -1, RIG_VFO_B}, // TODO: MODE_DV
{MHz(350), MHz(470), RIG_MODE_AM | RIG_MODE_FM, -1, -1, RIG_VFO_B}, // TODO: MODE_DV
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(144), MHz(146) - 1, IC92D_MODES_TX, mW(100), W(5), IC92D_VFO_ALL},
{MHz(430), MHz(440) - 1, IC92D_MODES_TX, mW(100), W(5), IC92D_VFO_ALL},
RIG_FRNG_END,
},
/* IC-92AD */
.rx_range_list2 = {
{kHz(495), MHz(999.99), RIG_MODE_AM | RIG_MODE_FM | RIG_MODE_WFM, -1, -1, RIG_VFO_A},
{MHz(118), MHz(174), RIG_MODE_AM | RIG_MODE_FM, -1, -1, RIG_VFO_B}, // TODO: MODE_DV
{MHz(350), MHz(470), RIG_MODE_AM | RIG_MODE_FM, -1, -1, RIG_VFO_B}, // TODO: MODE_DV
RIG_FRNG_END,
},
.tx_range_list2 = {
{MHz(144), MHz(148) - 1, IC92D_MODES_TX, mW(100), W(5), IC92D_VFO_ALL},
{MHz(430), MHz(440) - 1, IC92D_MODES_TX, mW(100), W(5), IC92D_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC92D_MODES, kHz(5)},
{IC92D_MODES, kHz(6.25)},
{IC92D_MODES, kHz(8.33)},
{IC92D_MODES, kHz(9)},
{IC92D_MODES, kHz(10)},
{IC92D_MODES, 12500},
{IC92D_MODES, kHz(15)},
{IC92D_MODES, kHz(20)},
{IC92D_MODES, kHz(25)},
{IC92D_MODES, kHz(50)},
{IC92D_MODES, kHz(100)},
{IC92D_MODES, kHz(125)},
{IC92D_MODES, kHz(200)},
RIG_TS_END,
},
/* FIXME: mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_FM, kHz(12)},
{RIG_MODE_FM | RIG_MODE_AM, kHz(9)}, /* N-FM & AM */
{RIG_MODE_WFM, kHz(230)},
RIG_FLT_END,
},
.str_cal = IC92D_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic92d_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.get_info = ic92d_get_info,
};
const char *ic92d_get_info(RIG *rig)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char ackbuf[16];
int ack_len, retval;
static char info[64];
rs = &rig->state;
priv = (struct icom_priv_data *)rs->priv;
// 018019fd
priv->re_civ_addr = 0x01;
retval = icom_transaction(rig, C_RD_TRXID, -1,
NULL, 0, ackbuf, &ack_len);
if (retval != RIG_OK)
{
return NULL;
}
if (ack_len <= 3)
{
rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), "
"len=%d\n", __func__, ackbuf[0], ack_len);
return NULL;
}
sprintf(info, "ID %02x%02x%02x\n", ackbuf[1], ackbuf[2], ackbuf[3]);
return info;
}

Wyświetl plik

@ -1,164 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-970 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "icom.h"
#define IC970_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define IC970_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define IC970_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
#define IC970_STR_CAL { 0, { } }
/*
* FIXME: this appears to be the IC-970A/E
* what about the IC-970H ? please give it a fix. --SF
*/
static const struct icom_priv_caps ic970_priv_caps =
{
0x2e, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps ic970_caps =
{
.rig_model = RIG_MODEL_IC970,
.model_name = "IC-970",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = IC970_VFO_OPS,
.scan_ops = RIG_SCAN_NONE,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 101, RIG_MTYPE_EDGE },
{ 102, 102, RIG_MTYPE_CALL },
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(144), MHz(146), IC970_MODES, -1, -1, IC970_VFO_ALL},
{MHz(430), MHz(440), IC970_MODES, -1, -1, IC970_VFO_ALL},
/* 1200MHz band module is optional */
// {MHz(1240),MHz(1300),IC970_MODES,-1,-1,IC970_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(144), MHz(146), IC970_MODES, W(3.5), W(25), IC970_VFO_ALL},
{MHz(430), MHz(440), IC970_MODES, W(3.5), W(25), IC970_VFO_ALL},
// {MHz(1240),MHz(1300),IC970_MODES,W(1),W(10),IC970_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{MHz(144), MHz(150), IC970_MODES, -1, -1, IC970_VFO_ALL},
{MHz(430), MHz(450), IC970_MODES, -1, -1, IC970_VFO_ALL},
/* 1200MHz band module is optional */
// {MHz(1240),MHz(1300),IC970_MODES,-1,-1,IC970_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
{MHz(144), MHz(150), IC970_MODES, W(3.5), W(25), IC970_VFO_ALL},
{MHz(430), MHz(450), IC970_MODES, W(3.5), W(25), IC970_VFO_ALL},
// {MHz(1240),MHz(1300),IC970_MODES,W(1),W(10),IC970_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{IC970_MODES, 10}, /* TBC: does this rig supports settin tuning step? */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.3)},
// {RIG_MODE_FM, Hz(500)}, /* optional CW NARROW FILTER */
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& ic970_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1,345 +0,0 @@
/*
* Hamlib CI-V backend - main header
* Copyright (c) 2000-2016 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _ICOM_H
#define _ICOM_H 1
#include "hamlib/rig.h"
#include "cal.h"
#include "tones.h"
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#define BACKEND_VER "0.22"
/*
* defines used by comp_cal_str in rig.c
* STR_CAL_LENGTH is the length of the S Meter calibration table
* STR_CAL_S0 is the value in dB of the lowest value (not even in table)
* MULTIB_SUBCMD allows the dsp rigs ie pro models to use multibyte subcommands for all the extra
* parameters and levels.
*/
#define STR_CAL_LENGTH 16
#define STR_CAL_S0 -54
#define MULTIB_SUBCMD
/*
* minimal channel caps.
* If your rig has better/lesser, don't modify this define but clone it,
* so you don't change other rigs.
*/
#define IC_MIN_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
}
/*
* common channel caps.
* If your rig has better/lesser, don't modify this define but clone it,
* so you don't change other rigs.
*/
#define IC_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
.tx_freq = 1, \
.tx_mode = 1, \
.tx_width = 1, \
.rptr_offs = 1, \
}
/*
* S-Meter data for uncalibrated rigs
*/
#define UNKNOWN_IC_STR_CAL { 2, {{ 0, -60}, { 255, 60}} }
struct ts_sc_list
{
shortfreq_t ts; /* tuning step */
unsigned char sc; /* sub command */
};
/**
* \brief Pipelined tuning state data structure.
*/
typedef struct rig_pltstate
{
freq_t freq;
freq_t next_freq;
rmode_t mode;
rmode_t next_mode;
pbwidth_t width;
pbwidth_t next_width;
struct timeval timer_start;
struct timeval timer_current;
int usleep_time; /* dependent on radio module & serial data rate */
} pltstate_t;
struct icom_agc_level
{
enum agc_level_e
level; /* Hamlib AGC level from agc_level_e enum, the last entry should have level -1 */
unsigned char
icom_level; /* Icom AGC level for C_CTL_FUNC (0x16), S_FUNC_AGC (0x12) command */
};
struct icom_priv_caps
{
unsigned char re_civ_addr; /* the remote dlft equipment's CI-V address*/
int civ_731_mode; /* Off: freqs on 10 digits, On: freqs on 8 digits */
int no_xchg; /* Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */
const struct ts_sc_list *ts_sc_list;
int settle_time; /*!< Receiver settle time, in ms */
int (*r2i_mode)(RIG *rig, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd); /*< backend specific code
to convert bandwidth and
mode to cmd tokens */
void (*i2r_mode)(RIG *rig, unsigned char md, int pd,
rmode_t *mode, pbwidth_t *width); /*< backend specific code
to convert response
tokens to bandwidth and
mode */
int serial_full_duplex; /*!< Whether RXD&TXD are not tied together */
int offs_len; /* Number of bytes in offset frequency field. 0 defaults to 3 */
int serial_USB_echo_check; /* Flag to test USB echo state */
int agc_levels_present; /* Flag to indicate that agc_levels array is populated */
struct icom_agc_level agc_levels[RIG_AGC_LAST +
1]; /* Icom rig-specific AGC levels, the last entry should have level -1 */
};
struct icom_priv_data
{
unsigned char re_civ_addr; /* the remote equipment's CI-V address*/
int civ_731_mode; /* Off: freqs on 10 digits, On: freqs on 8 digits */
int no_xchg; /* Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */
int no_1a_03_cmd; /* rig doesn't tell IF widths */
int split_on; /* record split state */
pltstate_t *pltstate; /* only on optoscan */
int serial_USB_echo_off; /* USB is not set to echo */
/* we track vfos internallhy for use with different functions like split */
/* this allows queries using CURR_VFO and Main/Sub to behave */
vfo_t curr_vfo;
vfo_t rx_vfo;
vfo_t tx_vfo;
};
extern const struct ts_sc_list r8500_ts_sc_list[];
extern const struct ts_sc_list r8600_ts_sc_list[];
extern const struct ts_sc_list ic737_ts_sc_list[];
extern const struct ts_sc_list r75_ts_sc_list[];
extern const struct ts_sc_list r7100_ts_sc_list[];
extern const struct ts_sc_list r9000_ts_sc_list[];
extern const struct ts_sc_list r9500_ts_sc_list[];
extern const struct ts_sc_list ic756_ts_sc_list[];
extern const struct ts_sc_list ic756pro_ts_sc_list[];
extern const struct ts_sc_list ic706_ts_sc_list[];
extern const struct ts_sc_list ic7000_ts_sc_list[];
extern const struct ts_sc_list ic7100_ts_sc_list[];
extern const struct ts_sc_list ic7200_ts_sc_list[];
extern const struct ts_sc_list ic7300_ts_sc_list[];
extern const struct ts_sc_list ic910_ts_sc_list[];
extern const struct ts_sc_list ic718_ts_sc_list[];
extern const struct ts_sc_list x108g_ts_sc_list[];
extern const pbwidth_t
rtty_fil[]; /* rtty filter passband width; available on 746pro and 756pro rigs */
pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode);
int icom_init(RIG *rig);
int icom_rig_open(RIG *rig);
int icom_cleanup(RIG *rig);
int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
int icom_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
int icom_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *ts);
int icom_set_rit_new(RIG *rig, vfo_t vfo, shortfreq_t ts);
int icom_set_xit_new(RIG *rig, vfo_t vfo, shortfreq_t ts);
int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode,
pbwidth_t *width);
int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int icom_get_vfo(RIG *rig, vfo_t *vfo);
int icom_set_vfo(RIG *rig, vfo_t vfo);
int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs);
int icom_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs);
int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq);
int icom_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
pbwidth_t tx_width);
int icom_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
pbwidth_t *tx_width);
int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq,
rmode_t tx_mode, pbwidth_t tx_width);
int icom_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *tx_freq,
rmode_t *tx_mode, pbwidth_t *tx_width);
int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
int icom_mem_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
int icom_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts);
int icom_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts);
int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
int icom_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
int icom_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone);
int icom_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone);
int icom_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone);
int icom_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone);
int icom_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code);
int icom_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code);
int icom_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code);
int icom_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code);
int icom_set_bank(RIG *rig, vfo_t vfo, int bank);
int icom_set_mem(RIG *rig, vfo_t vfo, int ch);
int icom_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);
int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int icom_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val);
int icom_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val);
int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
int icom_set_parm(RIG *rig, setting_t parm, value_t val);
int icom_get_parm(RIG *rig, setting_t parm, value_t *val);
int icom_set_conf(RIG *rig, token_t token, const char *val);
int icom_get_conf(RIG *rig, token_t token, char *val);
int icom_set_powerstat(RIG *rig, powerstat_t status);
int icom_get_powerstat(RIG *rig, powerstat_t *status);
int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant);
int icom_get_ant(RIG *rig, vfo_t vfo, ant_t *ant);
int icom_decode_event(RIG *rig);
int icom_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
rmode_t mode);
int icom_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq,
rmode_t mode);
int icom_send_morse(RIG *rig, vfo_t vfo, const char *msg);
/* Exposed routines */
int icom_get_split_vfos(const RIG *rig, vfo_t *rx_vfo, vfo_t *tx_vfo);
int icom_set_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen,
unsigned char *subcmdbuf, int val_bytes, int val);
int icom_get_raw_buf(RIG *rig, int cmd, int subcmd, int subcmdbuflen,
unsigned char *subcmdbuf, int *reslen, unsigned char *res);
int icom_get_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen,
unsigned char *subcmdbuf, int *val);
int icom_set_level_raw(RIG *rig, setting_t level, int cmd, int subcmd,
int subcmdbuflen, unsigned char *subcmdbuf, int val_bytes, value_t val);
int icom_get_level_raw(RIG *rig, setting_t level, int cmd, int subcmd,
int subcmdbuflen, unsigned char *subcmdbuf, value_t *val);
int icom_set_custom_parm(RIG *rig, int parmbuflen, unsigned char *parmbuf,
int val_bytes, int value);
int icom_get_custom_parm(RIG *rig, int parmbuflen, unsigned char *parmbuf,
int *value);
int icom_set_custom_parm_time(RIG *rig, int parmbuflen, unsigned char *parmbuf,
int seconds);
int icom_get_custom_parm_time(RIG *rig, int parmbuflen, unsigned char *parmbuf,
int *seconds);
extern const struct confparams icom_cfg_params[];
extern const struct rig_caps ic703_caps;
extern const struct rig_caps ic706_caps;
extern const struct rig_caps ic706mkii_caps;
extern const struct rig_caps ic706mkiig_caps;
extern const struct rig_caps ic707_caps;
extern const struct rig_caps ic718_caps;
extern const struct rig_caps ic725_caps;
extern const struct rig_caps ic726_caps;
extern const struct rig_caps ic728_caps;
extern const struct rig_caps ic735_caps;
extern const struct rig_caps ic736_caps;
extern const struct rig_caps ic737_caps;
extern const struct rig_caps ic738_caps;
extern const struct rig_caps ic746_caps;
extern const struct rig_caps ic7410_caps;
extern const struct rig_caps ic746pro_caps;
extern const struct rig_caps ic756_caps;
extern const struct rig_caps ic756pro_caps;
extern const struct rig_caps ic756pro2_caps;
extern const struct rig_caps ic756pro3_caps;
extern const struct rig_caps ic751_caps;
extern const struct rig_caps ic7600_caps;
extern const struct rig_caps ic7610_caps;
extern const struct rig_caps ic761_caps;
extern const struct rig_caps ic765_caps;
extern const struct rig_caps ic7700_caps;
extern const struct rig_caps ic775_caps;
extern const struct rig_caps ic78_caps;
extern const struct rig_caps ic7800_caps;
extern const struct rig_caps ic785x_caps;
extern const struct rig_caps ic7000_caps;
extern const struct rig_caps ic7100_caps;
extern const struct rig_caps ic7200_caps;
extern const struct rig_caps ic7300_caps;
extern const struct rig_caps ic781_caps;
extern const struct rig_caps ic820h_caps;
extern const struct rig_caps ic821h_caps;
extern const struct rig_caps ic910_caps;
extern const struct rig_caps ic9100_caps;
extern const struct rig_caps ic970_caps;
extern const struct rig_caps ic9700_caps;
extern const struct rig_caps icrx7_caps;
extern const struct rig_caps icr10_caps;
extern const struct rig_caps icr20_caps;
extern const struct rig_caps icr6_caps;
extern const struct rig_caps icr71_caps;
extern const struct rig_caps icr72_caps;
extern const struct rig_caps icr75_caps;
extern const struct rig_caps icr7000_caps;
extern const struct rig_caps icr7100_caps;
extern const struct rig_caps icr8500_caps;
extern const struct rig_caps icr9000_caps;
extern const struct rig_caps icr9500_caps;
extern const struct rig_caps ic271_caps;
extern const struct rig_caps ic275_caps;
extern const struct rig_caps ic471_caps;
extern const struct rig_caps ic475_caps;
extern const struct rig_caps ic1275_caps;
extern const struct rig_caps omnivip_caps;
extern const struct rig_caps delta2_caps;
extern const struct rig_caps os456_caps;
extern const struct rig_caps os535_caps;
extern const struct rig_caps ic92d_caps;
extern const struct rig_caps id1_caps;
extern const struct rig_caps id31_caps;
extern const struct rig_caps id51_caps;
extern const struct rig_caps id4100_caps;
extern const struct rig_caps id5100_caps;
extern const struct rig_caps ic2730_caps;
extern const struct rig_caps perseus_caps;
extern const struct rig_caps x108g_caps;
extern const struct rig_caps icr8600_caps;
extern const struct rig_caps icr30_caps;
#endif /* _ICOM_H */

Wyświetl plik

@ -1,506 +0,0 @@
/*
* Hamlib CI-V backend - defines for the ICOM "CI-V" interface.
* Copyright (c) 2000-2016 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _ICOM_DEFS_H
#define _ICOM_DEFS_H 1
/*
* CI-V frame codes
*/
#define PR 0xfe /* Preamble code */
#define CTRLID 0xe0 /* Controllers's default address */
#define BCASTID 0x00 /* Broadcast address */
#define FI 0xfd /* End of message code */
#define ACK 0xfb /* OK code */
#define NAK 0xfa /* NG code */
#define COL 0xfc /* CI-V bus collision detected */
#define PAD 0xff /* Transmit padding */
#define ACKFRMLEN 6 /* reply frame length */
#define S_NONE -1
/*
* Arguments length in bytes
*/
#define CHAN_NB_LEN 2
#define BANK_NB_LEN 2
#define OFFS_LEN 3
/*
* Cn controller commands
*
Most radios have 2 or 3 receive passbands available. Where only 2 are available they
are selected by 01 for wide and 02 for narrow Actual bandwidth is determined by the filters
installed. With the newer DSP rigs there are 3 presets 01 = wide 02 = middle and 03 = narrow.
Actually, you can set change any of these presets to any thing you want.
* Notes:
* The following only applies to IC-706.
* 1. When wide or normal op available: add "00" for wide, "01" normal
* Normal or narrow op: add "00" for normal, "01" for narrow
* Wide, normal or narrow op: add "00" for wide, "01" normal, "02" narrow
* 2. Memory channel number 1A=0100/1b=0101, 2A=0102/2b=0103,
* 3A=0104/3b=0105, C1=0106, C2=0107
*/
#define C_SND_FREQ 0x00 /* Send frequency data transceive mode does not ack*/
#define C_SND_MODE 0x01 /* Send mode data, Sc for transceive mode does not ack */
#define C_RD_BAND 0x02 /* Read band edge frequencies */
#define C_RD_FREQ 0x03 /* Read display frequency */
#define C_RD_MODE 0x04 /* Read display mode */
#define C_SET_FREQ 0x05 /* Set frequency data(1) */
#define C_SET_MODE 0x06 /* Set mode data, Sc */
#define C_SET_VFO 0x07 /* Set VFO */
#define C_SET_MEM 0x08 /* Set channel, Sc(2) */
#define C_WR_MEM 0x09 /* Write memory */
#define C_MEM2VFO 0x0a /* Memory to VFO */
#define C_CLR_MEM 0x0b /* Memory clear */
#define C_RD_OFFS 0x0c /* Read duplex offset frequency; default changes with HF/6M/2M */
#define C_SET_OFFS 0x0d /* Set duplex offset frequency */
#define C_CTL_SCAN 0x0e /* Control scan, Sc */
#define C_CTL_SPLT 0x0f /* Control split, and duplex mode Sc */
#define C_SET_TS 0x10 /* Set tuning step, Sc */
#define C_CTL_ATT 0x11 /* Set/get attenuator, Sc */
#define C_CTL_ANT 0x12 /* Set/get antenna, Sc */
#define C_CTL_ANN 0x13 /* Control announce (speech synth.), Sc */
#define C_CTL_LVL 0x14 /* Set AF/RF/squelch, Sc */
#define C_RD_SQSM 0x15 /* Read squelch condition/S-meter level, Sc */
#define C_CTL_FUNC 0x16 /* Function settings (AGC,NB,etc.), Sc */
#define C_SND_CW 0x17 /* Send CW message */
#define C_SET_PWR 0x18 /* Set Power ON/OFF, Sc */
#define C_RD_TRXID 0x19 /* Read transceiver ID code */
#define C_CTL_MEM 0x1a /* Misc memory/bank/rig control functions, Sc */
#define C_SET_TONE 0x1b /* Set tone frequency */
#define C_CTL_PTT 0x1c /* Control Transmit On/Off, Sc */
#define C_CTL_DIG 0x20 /* Digital modes settings & status */
#define C_CTL_RIT 0x21 /* RIT/XIT control */
#define C_SEND_SEL_FREQ 0x25 /* Send/Recv sel/unsel VFO frequency */
#define C_CTL_MTEXT 0x70 /* Microtelecom Extension */
#define C_CTL_MISC 0x7f /* Miscellaneous control, Sc */
/*
* Sc controller sub commands
*/
/*
* Set mode data (C_SET_MODE) sub commands
*/
#define S_LSB 0x00 /* Set to LSB */
#define S_USB 0x01 /* Set to USB */
#define S_AM 0x02 /* Set to AM */
#define S_AMN 0x02 /* Set to AM-N */
#define S_CW 0x03 /* Set to CW */
#define S_RTTY 0x04 /* Set to RTTY */
#define S_FM 0x05 /* Set to FM */
#define S_FMN 0x05 /* Set to FM-N */
#define S_WFM 0x06 /* Set to Wide FM */
#define S_CWR 0x07 /* Set to CW Reverse */
#define S_RTTYR 0x08 /* Set to RTTY Reverse */
#define S_AMS 0x11 /* Set to AMS */
#define S_PSK 0x12 /* 7800 PSK USB */
#define S_PSKR 0x13 /* 7800 PSK LSB */
#define S_SAML 0x14 /* Set to AMS-L */
#define S_SAMU 0x15 /* Set to AMS-U */
#define S_P25 0x16 /* Set to P25 */
#define S_DSTAR 0x17 /* Set to D-STAR */
#define S_DPMR 0x18 /* Set to dPMR */
#define S_NXDNVN 0x19 /* Set to NXDN_VN */
#define S_NXDN_N 0x20 /* Set to NXDN-N */
#define S_DCR 0x21 /* Set to DCR */
#define S_DD 0x22 /* Set to DD 1200Mhz only? */
#define S_R7000_SSB 0x05 /* Set to SSB on R-7000 */
/* filter width coding for older ICOM rigs with 2 filter width */
/* there is no special 'wide' for that rigs */
#define PD_MEDIUM_2 0x01 /* Medium */
#define PD_NARROW_2 0x02 /* Narrow */
/* filter width coding for newer ICOM rigs with 3 filter width */
#define PD_WIDE_3 0x01 /* Wide */
#define PD_MEDIUM_3 0x02 /* Medium */
#define PD_NARROW_3 0x03 /* Narrow */
/*
* Set VFO (C_SET_VFO) sub commands
*/
#define S_VFOA 0x00 /* Set to VFO A */
#define S_VFOB 0x01 /* Set to VFO B */
#define S_BTOA 0xa0 /* VFO A=B */
#define S_XCHNG 0xb0 /* Switch VFO A and B */
#define S_SUBTOMAIN 0xb1 /* MAIN = SUB */
#define S_DUAL_OFF 0xc0 /* Dual watch off */
#define S_DUAL_ON 0xc1 /* Dual watch on */
#define S_DUAL 0xc2 /* Dual watch (0 = off, 1 = on) */
#define S_MAIN 0xd0 /* Select MAIN band */
#define S_SUB 0xd1 /* Select SUB band */
#define S_SUB_SEL 0xd2 /* Read/Set Main/Sub selection */
#define S_FRONTWIN 0xe0 /* Select front window */
/*
* Set MEM (C_SET_MEM) sub commands
*/
#define S_BANK 0xa0 /* Select memory bank (aka 'memory group' with IC-R8600) */
/*
* Scan control (C_CTL_SCAN) subcommands
*/
#define S_SCAN_STOP 0x00 /* Stop scan/window scan */
#define S_SCAN_START 0x01 /* Programmed/Memory scan */
#define S_SCAN_PROG 0x02 /* Programmed scan */
#define S_SCAN_DELTA 0x03 /* Delta-f scan */
#define S_SCAN_WRITE 0x04 /* auto memory-write scan */
#define S_SCAN_FPROG 0x12 /* Fine programmed scan */
#define S_SCAN_FDELTA 0x13 /* Fine delta-f scan */
#define S_SCAN_MEM2 0x22 /* Memory scan */
#define S_SCAN_SLCTN 0x23 /* Selected number memory scan */
#define S_SCAN_SLCTM 0x24 /* Selected mode memory scan */
#define S_SCAN_PRIO 0x42 /* Priority / window scan */
#define S_SCAN_FDFOF 0xA0 /* Fix dF OFF */
#define S_SCAN_FDF5I 0xA1 /* Fix range +/-5kHz */
#define S_SCAN_FDF1X 0xA2 /* Fix range +/-10kHz */
#define S_SCAN_FDF2X 0xA3 /* Fix range +/-20kHz */
#define S_SCAN_FDF5X 0xA4 /* Fix range +/-50kHz */
#define S_SCAN_FDF1C 0xA5 /* Fix range +/-100kHz */
#define S_SCAN_FDF5C 0xA6 /* Fix range +/-500kHz */
#define S_SCAN_FDF1M 0xA7 /* Fix range +/-1MHz */
#define S_SCAN_FDFON 0xAA /* Fix dF ON */
#define S_SCAN_NSLCT 0xB0 /* Set as non select channel */
#define S_SCAN_SLCT 0xB1 /* Set as select channel */
#define S_SCAN_SL_NUM 0xB2 /* select programed mem scan 7800 only */
#define S_SCAN_RSMOFF 0xD0 /* Set scan resume OFF */
#define S_SCAN_RSMONP 0xD1 /* Set scan resume ON + pause time */
#define S_SCAN_RSMON 0xD3 /* Set scan resume ON */
/*
* Split control (S_CTL_SPLT) subcommands
*/
#define S_SPLT_OFF 0x00 /* Split OFF */
#define S_SPLT_ON 0x01 /* Split ON */
#define S_DUP_OFF 0x10 /* Simplex mode */
#define S_DUP_M 0x11 /* Duplex - mode */
#define S_DUP_P 0x12 /* Duplex + mode */
/*
* Set Attenuator (C_CTL_ATT) subcommands
*/
#define S_ATT_RD -1 /* Without subcommand, reads out setting */
#define S_ATT_OFF 0x00 /* Off */
#define S_ATT_6dB 0x06 /* 6 dB, IC-756Pro */
#define S_ATT_10dB 0x10 /* 10 dB */
#define S_ATT_12dB 0x12 /* 12 dB, IC-756Pro */
#define S_ATT_18dB 0x18 /* 18 dB, IC-756Pro */
#define S_ATT_20dB 0x20 /* 20 dB */
#define S_ATT_30dB 0x30 /* 30 dB, or Att on for IC-R75 */
/*
* Set Preamp (S_FUNC_PAMP) data
*/
#define D_PAMP_OFF 0x00
#define D_PAMP1 0x01
#define D_PAMP2 0x02
/*
* Set AGC (S_FUNC_AGC) data
*/
#define D_AGC_FAST 0x00
#define D_AGC_MID 0x01
#define D_AGC_SLOW 0x02
#define D_AGC_SUPERFAST 0x03 /* IC746 pro */
/*
* Set antenna (C_SET_ANT) subcommands
*/
#define S_ANT_RD -1 /* Without subcommand, reads out setting */
#define S_ANT1 0x00 /* Antenna 1 */
#define S_ANT2 0x01 /* Antenna 2 */
/*
* Announce control (C_CTL_ANN) subcommands
*/
#define S_ANN_ALL 0x00 /* Announce all */
#define S_ANN_FREQ 0x01 /* Announce freq */
#define S_ANN_MODE 0x02 /* Announce operating mode */
/*
* Function settings (C_CTL_LVL) subcommands
*/
#define S_LVL_AF 0x01 /* AF level setting */
#define S_LVL_RF 0x02 /* RF level setting */
#define S_LVL_SQL 0x03 /* SQL level setting */
#define S_LVL_IF 0x04 /* IF shift setting */
#define S_LVL_APF 0x05 /* APF level setting */
#define S_LVL_NR 0x06 /* NR level setting */
#define S_LVL_PBTIN 0x07 /* Twin PBT setting (inside) */
#define S_LVL_PBTOUT 0x08 /* Twin PBT setting (outside) */
#define S_LVL_CWPITCH 0x09 /* CW pitch setting */
#define S_LVL_RFPOWER 0x0a /* RF power setting */
#define S_LVL_MICGAIN 0x0b /* MIC gain setting */
#define S_LVL_KEYSPD 0x0c /* Key Speed setting */
#define S_LVL_NOTCHF 0x0d /* Notch freq. setting */
#define S_LVL_COMP 0x0e /* Compressor level setting */
#define S_LVL_BKINDL 0x0f /* BKin delay setting */
#define S_LVL_BALANCE 0x10 /* Balance setting (Dual watch) */
#define S_LVL_AGC 0x11 /* AGC (7800) */
#define S_LVL_NB 0x12 /* NB setting */
#define S_LVL_DIGI 0x13 /* DIGI-SEL (7800) */
#define S_LVL_DRIVE 0x14 /* DRIVE gain setting */
#define S_LVL_MON 0x15 /* Monitor gain setting */
#define S_LVL_VOXGAIN 0x16 /* VOX gain setting */
#define S_LVL_ANTIVOX 0x17 /* Anti VOX gain setting */
#define S_LVL_CONTRAST 0x18 /* CONTRAST level setting */
#define S_LVL_BRIGHT 0x19 /* BRIGHT level setting */
#define S_LVL_BASS 0x1B /* Bass level setting */
#define S_LVL_TREBLE 0x1C /* Treble level setting */
#define S_LVL_SCNSPD 0x1D /* Scan speed */
#define S_LVL_SCNDEL 0x1E /* Scan delay */
#define S_LVL_PRIINT 0x1F /* PRIO interval */
#define S_LVL_RESTIM 0x20 /* Resume time */
/*
* Read squelch condition/S-meter level/other meter levels (C_RD_SQSM) subcommands
*/
#define S_SQL 0x01 /* Read squelch condition */
#define S_SML 0x02 /* Read S-meter level */
#define S_SMF 0x03 /* Read S-meter level in AAAABBCC format */
#define S_CML 0x04 /* Read centre -meter level */
#define S_CSQL 0x05 /* Read combined squelch conditions */
#define S_SAMS 0x06 /* Read S-AM Sync indicator */
#define S_OVF 0x07 /* Read OVF indicator status */
#define S_RFML 0x11 /* Read RF-meter level */
#define S_SWR 0x12 /* Read SWR-meter level */
#define S_ALC 0x13 /* Read ALC-meter level */
#define S_CMP 0x14 /* Read COMP-meter level */
#define S_VD 0x15 /* Read Vd-meter level */
#define S_ID 0x16 /* Read Id-meter level */
/*
* Function settings (C_CTL_FUNC) subcommands Set and Read
*/
#define S_FUNC_PAMP 0x02 /* Preamp setting */
#define S_FUNC_AGCOFF 0x10 /* IC-R8500 only */
#define S_FUNC_AGCON 0x11 /* IC-R8500 only */
#define S_FUNC_AGC 0x12 /* AGC setting presets: the dsp models allow these to be modified */
#define S_FUNC_NBOFF 0x20 /* IC-R8500 only */
#define S_FUNC_NBON 0x21 /* IC-R8500 only */
#define S_FUNC_NB 0x22 /* NB setting */
#define S_FUNC_APFOFF 0x30 /* IC-R8500 only */
#define S_FUNC_APFON 0x31 /* IC-R8500 only */
#define S_FUNC_APF 0x32 /* APF setting */
#define S_FUNC_NR 0x40 /* NR setting */
#define S_FUNC_ANF 0x41 /* ANF setting */
#define S_FUNC_TONE 0x42 /* TONE setting */
#define S_FUNC_TSQL 0x43 /* TSQL setting */
#define S_FUNC_COMP 0x44 /* COMP setting */
#define S_FUNC_MON 0x45 /* Monitor setting */
#define S_FUNC_VOX 0x46 /* VOX setting */
#define S_FUNC_BKIN 0x47 /* BK-IN setting */
#define S_FUNC_MN 0x48 /* Manual notch setting */
#define S_FUNC_RF 0x49 /* RTTY Filter setting */
#define S_FUNC_AFC 0x4A /* Auto Frequency Control (AFC) setting */
#define S_FUNC_CSQL 0x4B /* DTCS tone code squelch setting*/
#define S_FUNC_VSC 0x4C /* voice squelch control useful for scanning*/
#define S_FUNC_MANAGC 0x4D /* manual AGC */
#define S_FUNC_DIGISEL 0x4E /* DIGI-SEL */
#define S_FUNC_TW_PK 0x4F /* RTTY Twin Peak filter 0= off 1 = on */
#define S_FUNC_DIAL_LK 0x50 /* Dial lock */
#define S_FUNC_P25SQL 0x52 /* P25 DSQL */
#define S_FUNC_ANTRX 0x53 /* ANT-RX */
#define S_FUNC_IF1F 0x55 /* 1st IF filter */
#define S_FUNC_DSPF 0x56 /* DSP filter */
#define S_FUNC_MANN 0x57 /* Manual notch width */
#define S_FUNC_SSBT 0x58 /* SSB Tx bandwidth */
#define S_FUNC_SUBB 0x59 /* Sub band */
#define S_FUNC_SATM 0x5A /* Satellite mode */
#define S_FUNC_DSSQL 0x5B /* D-STAR DSQL */
#define S_FUNC_DPSQL 0x5F /* dPMR DSQL */
#define S_FUNC_NXSQL 0x60 /* NXDN DSQL */
#define S_FUNC_DCSQL 0x61 /* DCR DSQL */
#define S_FUNC_DPSCM 0x62 /* dPMR scrambler */
#define S_FUNC_NXENC 0x63 /* NXDN encryption */
#define S_FUNC_DCENC 0x64 /* DCR encryption */
#define S_FUNC_IPP 0x65 /* IP+ setting */
/*
* Set Power On/Off (C_SET_PWR) subcommands
*/
#define S_PWR_OFF 0x00
#define S_PWR_ON 0x01
#define S_PWR_STDBY 0x02
/*
* Transmit control (C_CTL_PTT) subcommands
*/
#define S_PTT 0x00
#define S_ANT_TUN 0x01 /* Auto tuner 0=OFF, 1 = ON, 2=Start Tuning */
/*
* RIT/XIT control (C_CTL_RIT) subcommands
*/
#define S_RIT_FREQ 0x00
#define S_RIT 0x01 /* RIT 0 = OFF, 1 = ON */
#define S_XIT 0x02 /* XIT (delta TX) 0 = OFF, 1 = ON */
/*
* Misc contents (C_CTL_MEM) subcommands applies to newer rigs.
*
* Beware the IC-7200 which is non-standard.
*/
#define S_MEM_CNTNT 0x00 /* Memory content 2 bigendian */
#define S_MEM_BAND_REG 0x01 /* band stacking register */
#define S_MEM_FILT_WDTH 0x03 /* current passband filter width */
#define S_MEM_PARM 0x05 /* rig parameters; extended parm # + param value: should be coded */
/* in the rig files because they are different for each rig */
#define S_MEM_DATA_MODE 0x06 /* data mode */
#define S_MEM_TX_PB 0x07 /* SSB tx passband */
#define S_MEM_FLTR_SHAPE 0x08 /* DSP filter shape 0=sharp 1=soft */
/* Icr75c */
#define S_MEM_CNTNT_SLCT 0x01
#define S_MEM_FLT_SLCT 0x01
#define S_MEM_MODE_SLCT 0x02
/* For IC-910H rig. */
#define S_MEM_RDWR_MEM 0x00 /* Read/write memory channel */
#define S_MEM_SATMEM 0x01 /* Satellite memory */
#define S_MEM_VOXGAIN 0x02 /* VOX gain level (0=0%, 255=100%) */
#define S_MEM_VOXDELAY 0x03 /* VOX delay (0=0.0 sec, 20=2.0 sec) */
#define S_MEM1_VOXDELAY 0x05 /* VOX delay (0=0.0 sec, 20=2.0 sec) */
#define S_MEM_ANTIVOX 0x04 /* anti VOX setting */
#define S_MEM_RIT 0x06 /* RIT (0=off, 1=on, 2=sub dial) */
#define S_MEM_SATMODE910 0x07 /* Satellite mode (on/off) */
#define S_MEM_BANDSCOPE 0x08 /* Simple bandscope (on/off) */
/* For IC9700 and IC9100 and likely future Icoms */
#define S_MEM_SATMODE 0x5a /* Satellite mode (on/off) */
/* IC-R8600 and others */
#define S_MEM_SKIP_SLCT_OFF 0x00
#define S_MEM_SKIP_SLCT_ON 0x10
#define S_MEM_PSKIP_SLCT_ON 0x20
#define S_MEM_DUP_OFF 0x00
#define S_MEM_DUP_MINUS 0x01
#define S_MEM_DUP_PLUS 0x02
#define S_MEM_TSTEP_OFF 0x00
#define S_MEM_TSTEP_ON 0x01
#define S_FUNC_IPPLUS 0x07 /* IP+ subcommand 0x1a 0x07 */
/* IC-R6 */
#define S_MEM_AFLT 0x00 /* AF LPF Off/On */
/* IC-R30 */
#define S_MEM_ANL 0x00 /* ANL Off/On */
/*
* Tone control (C_SET_TONE) subcommands
*/
#define S_TONE_RPTR 0x00 /* Tone frequency setting for repeater receive */
#define S_TONE_SQL 0x01 /* Tone frequency setting for squelch */
#define S_TONE_DTCS 0x02 /* DTCS code and polarity for squelch */
#define S_TONE_P25NAC 0x03 /* P25 NAC */
#define S_TONE_DSCSQL 0x07 /* D-STAR CSQL */
#define S_TONE_DPCOM 0x08 /* dPMR COM ID */
#define S_TONE_DPCC 0x09 /* dPMR CC */
#define S_TONE_NXRAN 0x0A /* NXDN RAN */
#define S_TONE_DCUC 0x0B /* DCR UC */
#define S_TONE_DPSCK 0x0C /* dPMR scrambler key */
#define S_TONE_NXENK 0x0D /* NXDN encryption key */
#define S_TONE_DCENK 0x0E /* DCR encryption key */
/*
* Transceiver ID (C_RD_TRXID) subcommands
*/
#define S_RD_TRXID 0x00
/*
* Digital modes settings & status subcommands
*/
#define S_DIG_DSCALS 0x00 /* D-STAR Call sign */
#define S_DIG_DSMESS 0x01 /* D-STAR Message */
#define S_DIG_DSRSTS 0x02 /* D-STAR Rx status */
#define S_DIG_DSGPSD 0x03 /* D-STAR GPS data */
#define S_DIG_DSGPSM 0x04 /* D-STAR GPS message */
#define S_DIG_DSCSQL 0x05 /* D-STAR CSQL */
#define S_DIG_P25ID 0x06 /* P25 ID */
#define S_DIG_P25STS 0x07 /* P25 Rx status */
#define S_DIG_DPRXID 0x08 /* dPMR Rx ID */
#define S_DIG_DPRSTS 0x09 /* dPMR Rx status */
#define S_DIG_NXRXID 0x0A /* NXDN Rx ID */
#define S_DIG_NXRSTS 0x0B /* NXDN Rx status */
#define S_DIG_DCRXID 0x0C /* DCR Rx ID */
#define S_DIG_DCRSTS 0x0D /* DCR Rx status */
/*
* C_CTL_MISC OptoScan extension
*/
#define S_OPTO_LOCAL 0x01
#define S_OPTO_REMOTE 0x02
#define S_OPTO_TAPE_ON 0x03
#define S_OPTO_TAPE_OFF 0x04
#define S_OPTO_RDSTAT 0x05
#define S_OPTO_RDCTCSS 0x06
#define S_OPTO_RDDCS 0x07
#define S_OPTO_RDDTMF 0x08
#define S_OPTO_RDID 0x09
#define S_OPTO_SPKRON 0x0a
#define S_OPTO_SPKROFF 0x0b
#define S_OPTO_5KSCON 0x0c
#define S_OPTO_5KSCOFF 0x0d
#define S_OPTO_NXT 0x0e
#define S_OPTO_SCON 0x0f
#define S_OPTO_SCOFF 0x10
/*
* OmniVIPlus (Omni VI) extensions
*/
#define C_OMNI6_XMT 0x16
/*
* S_MEM_MODE_SLCT Misc CI-V Mode settings
*/
#define S_PRM_BEEP 0x02
#define S_PRM_CWPITCH 0x10
#define S_PRM_LANG 0x15
#define S_PRM_BACKLT 0x21
#define S_PRM_SLEEP 0x32
#define S_PRM_SLPTM 0x33
#define S_PRM_TIME 0x27
/*
* Tokens for Extra Level and Parameters common to multiple rigs. Use token # > 99. Defined here so they
* will be available in ICOM name space. They have different internal commands primarily in dsp rigs. These
* tokens are used ext_lvl and ext_parm funtions in the individual rig files.
* Extra parameters which are rig specific should be coded in the individual rig files and token #s < 100.
*/
#define TOKEN_BACKEND(t) (t)
#define TOK_RTTY_FLTR TOKEN_BACKEND(100)
#define TOK_SSBBASS TOKEN_BACKEND(101)
#define TOK_SQLCTRL TOKEN_BACKEND(102)
#define TOK_DRIVE_GAIN TOKEN_BACKEND(103)
#define TOK_DIGI_SEL_FUNC TOKEN_BACKEND(104)
#define TOK_DIGI_SEL_LEVEL TOKEN_BACKEND(105)
#endif /* _ICOM_DEFS_H */

Wyświetl plik

@ -1,156 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-R10
* Copyright (c) 2000-2004 by Stephane Fillod
* Copyright (c) 2017 Malcolm Herring
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#include "idx_builtin.h"
#define ICR10_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_WFM)
#define ICR10_FUNC_ALL (RIG_FUNC_NONE)
#define ICR10_LEVEL_ALL (RIG_LEVEL_RAWSTR)
#define ICR10_VFO_ALL (RIG_VFO_A)
#define ICR10_VFO_OPS (RIG_OP_NONE)
#define ICR10_SCAN_OPS (RIG_SCAN_NONE)
#define ICR10_STR_CAL { 2, \
{ \
{ 0, -60 }, /* S0 */ \
{ 160, 60 } /* +60 */ \
} }
static const struct icom_priv_caps icr10_priv_caps =
{
0x52, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r8500_ts_sc_list /* wrong, but don't have set_ts anyway */
};
const struct rig_caps icr10_caps =
{
.rig_model = RIG_MODEL_ICR10,
.model_name = "IC-R10",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ICR10_FUNC_ALL,
.has_set_func = ICR10_FUNC_ALL,
.has_get_level = ICR10_LEVEL_ALL,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR10_VFO_OPS,
.scan_ops = ICR10_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(500), GHz(1.3), ICR10_MODES, -1, -1, ICR10_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{kHz(500), MHz(823.9999), ICR10_MODES, -1, -1, ICR10_VFO_ALL},
{MHz(849), MHz(868.9999), ICR10_MODES, -1, -1, ICR10_VFO_ALL},
{MHz(894), GHz(1.3), ICR10_MODES, -1, -1, ICR10_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, },
.tuning_steps = {
{ICR10_MODES, Hz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(4)},
{RIG_MODE_AM | RIG_MODE_FM, kHz(15)},
{RIG_MODE_WFM, kHz(150)},
RIG_FLT_END,
},
.str_cal = ICR10_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr10_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode, /* TODO: do not pass bandwidth data */
.get_mode = icom_get_mode,
.decode_event = icom_decode_event,
.get_level = icom_get_level,
.get_dcd = icom_get_dcd,
};

Wyświetl plik

@ -1,162 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-R20
* Copyright (c) 2004 by Stephane Fillod
* Copyright (c) 2004 by Malcolm Herring
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#include "idx_builtin.h"
#define ICR20_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_WFM)
#define ICR20_FUNC_ALL (RIG_FUNC_NONE)
#define ICR20_LEVEL_ALL (RIG_LEVEL_RAWSTR)
#define ICR20_VFO_ALL (RIG_VFO_A)
#define ICR20_VFO_OPS (RIG_OP_NONE)
#define ICR20_SCAN_OPS (RIG_SCAN_NONE)
#define ICR20_STR_CAL { 2, \
{ \
{ 0, -60 }, /* S0 */ \
{ 255, 60 } /* +60 */ \
} }
static const struct icom_priv_caps icr20_priv_caps =
{
0x6c, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r8500_ts_sc_list /* wrong, but don't have set_ts anyway */
};
const struct rig_caps icr20_caps =
{
.rig_model = RIG_MODEL_ICR20,
.model_name = "IC-R20",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ICR20_FUNC_ALL,
.has_set_func = ICR20_FUNC_ALL,
.has_get_level = ICR20_LEVEL_ALL,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR20_VFO_OPS,
.scan_ops = ICR20_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
/* Only through cloning mode OPC-1382 */
.chan_list = {
{ 1, 999, RIG_MTYPE_MEM }, /* TBC */
{ 1000, 1199, RIG_MTYPE_MEM }, /* auto-write */
{ 1200, 1249, RIG_MTYPE_EDGE }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { /* Other countries but France */
{kHz(150), GHz(3.304999), ICR20_MODES, -1, -1, ICR20_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = { /* USA */
{kHz(150), MHz(821.999), ICR20_MODES, -1, -1, ICR20_VFO_ALL},
{MHz(851), MHz(866.999), ICR20_MODES, -1, -1, ICR20_VFO_ALL},
{MHz(896), GHz(1.304999), ICR20_MODES, -1, -1, ICR20_VFO_ALL},
{GHz(1.305), GHz(3.304999), ICR20_MODES, -1, -1, ICR20_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, },
.tuning_steps = {
{ICR20_MODES, Hz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(1.8)},
{RIG_MODE_AM | RIG_MODE_FM, kHz(12)},
{RIG_MODE_WFM, kHz(150)},
RIG_FLT_END,
},
.str_cal = ICR20_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr20_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode, /* TODO: do not pass bandwidth data */
.get_mode = icom_get_mode,
/* .set_vfo = icom_set_vfo, */
.decode_event = icom_decode_event,
.get_level = icom_get_level,
.get_dcd = icom_get_dcd,
};

Wyświetl plik

@ -1,236 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-R30
* Copyright (c) 2018 Malcolm Herring
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#include "idx_builtin.h"
#include "icom_defs.h"
#include "frame.h"
#define ICR30_MODES (RIG_MODE_LSB|RIG_MODE_USB|RIG_MODE_AM|RIG_MODE_AMN|\
RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_FMN|RIG_MODE_WFM|\
RIG_MODE_RTTYR|RIG_MODE_SAM|RIG_MODE_SAL|RIG_MODE_SAH|RIG_MODE_P25|\
RIG_MODE_DSTAR|RIG_MODE_DPMR|RIG_MODE_NXDNVN|RIG_MODE_NXDN_N|RIG_MODE_DCR)
#define ICR30_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_TSQL|RIG_FUNC_AFC|RIG_FUNC_VSC|\
RIG_FUNC_CSQL|RIG_FUNC_DSQL|RIG_FUNC_ANL|RIG_FUNC_CSQL|RIG_FUNC_SCEN)
#define ICR30_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_AF|RIG_LEVEL_RF|\
RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH)
#define ICR30_VFO_ALL (RIG_VFO_A)
#define ICR30_VFO_OPS (RIG_VFO_MAIN|RIG_VFO_SUB)
#define ICR30_SCAN_OPS (RIG_SCAN_NONE)
#define ICR30_STR_CAL { 2, \
{ \
{ 0, -60 }, /* S0 */ \
{ 255, 60 } /* +60 */ \
} }
/*
* This function does the special bandwidth coding for IC-R30
* (1 - normal, 2 - narrow)
*/
static int icr30_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
if (*pd == PD_NARROW_3)
{
*pd = PD_NARROW_2;
}
return err;
}
/*
* This function handles the -N modes for IC-R30
*/
int icr30_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
if (mode & (RIG_MODE_AMN | RIG_MODE_FMN))
{
return icom_set_mode(rig, vfo, mode, (pbwidth_t)1);
}
else
{
return icom_set_mode(rig, vfo, mode, width);
}
}
static const struct icom_priv_caps icr30_priv_caps =
{
0x9c, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r8500_ts_sc_list, /* wrong, but don't have set_ts anyway */
.r2i_mode = icr30_r2i_mode,
.offs_len = 4
};
const struct rig_caps icr30_caps =
{
.rig_model = RIG_MODEL_ICR30,
.model_name = "IC-R30",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ICR30_FUNC_ALL,
.has_set_func = ICR30_FUNC_ALL,
.has_get_level = ICR30_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ICR30_LEVEL_ALL),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = common_dcs_list,
.preamp = { RIG_DBLST_END, },
.attenuator = { 15, 30, 35, RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR30_VFO_OPS,
.scan_ops = ICR30_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 999, RIG_MTYPE_MEM }, /* TBC */
{ 1000, 1199, RIG_MTYPE_MEM }, /* auto-write */
{ 1200, 1299, RIG_MTYPE_EDGE }, /* two by two */
RIG_CHAN_END,
},
.rx_range_list1 = { /* Other countries but France */
{kHz(100), GHz(3.3049999), ICR30_MODES, -1, -1, ICR30_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = { /* USA */
{kHz(100), MHz(821.995), ICR30_MODES, -1, -1, ICR30_VFO_ALL},
{MHz(851), MHz(866.995), ICR30_MODES, -1, -1, ICR30_VFO_ALL},
{MHz(896), GHz(3.3049999), ICR30_MODES, -1, -1, ICR30_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, },
.tuning_steps = {
{ICR30_MODES, Hz(10)},
{ICR30_MODES, Hz(100)},
{ICR30_MODES, Hz(1000)},
{ICR30_MODES, Hz(3125)},
{ICR30_MODES, Hz(5000)},
{ICR30_MODES, Hz(6250)},
{ICR30_MODES, Hz(8330)},
{ICR30_MODES, Hz(9000)},
{ICR30_MODES, Hz(10000)},
{ICR30_MODES, Hz(12500)},
{ICR30_MODES, kHz(15)},
{ICR30_MODES, kHz(20)},
{ICR30_MODES, kHz(25)},
{ICR30_MODES, kHz(30)},
{ICR30_MODES, kHz(50)},
{ICR30_MODES, kHz(100)},
{ICR30_MODES, kHz(125)},
{ICR30_MODES, kHz(200)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_USB | RIG_MODE_LSB, kHz(1.8)},
{RIG_MODE_AM | RIG_MODE_FM | RIG_MODE_AMN | RIG_MODE_FMN, kHz(12)},
{RIG_MODE_AM | RIG_MODE_FM | RIG_MODE_AMN | RIG_MODE_FMN, kHz(6)},
{RIG_MODE_WFM, kHz(150)},
RIG_FLT_END,
},
.str_cal = ICR30_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr30_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icr30_set_mode,
.get_mode = icom_get_mode,
.vfo_op = icom_vfo_op,
.set_vfo = icom_set_vfo,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.set_bank = icom_set_bank,
.set_mem = icom_set_mem,
.decode_event = icom_decode_event,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.get_dcd = icom_get_dcd,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_sql = icom_set_dcs_sql,
.get_dcs_sql = icom_get_dcs_sql,
};

Wyświetl plik

@ -1,173 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-R6
* Copyright (c) 2017 Malcolm Herring
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#include "idx_builtin.h"
#define ICR6_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM)
#define ICR6_FUNC_ALL (RIG_FUNC_TSQL|RIG_FUNC_VSC|RIG_FUNC_CSQL|RIG_FUNC_AFLT|RIG_FUNC_DSQL)
#define ICR6_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_AF|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH)
#define ICR6_VFO_ALL (RIG_VFO_A)
#define ICR6_VFO_OPS (RIG_OP_NONE)
#define ICR6_SCAN_OPS (RIG_SCAN_NONE)
#define ICR6_STR_CAL { 2, \
{ \
{ 0, -60 }, /* S0 */ \
{ 255, 60 } /* +60 */ \
} }
static const struct icom_priv_caps icr6_priv_caps =
{
0x7e, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r8500_ts_sc_list /* wrong, but don't have set_ts anyway */
};
const struct rig_caps icr6_caps =
{
.rig_model = RIG_MODEL_ICR6,
.model_name = "IC-R6",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ICR6_FUNC_ALL,
.has_set_func = ICR6_FUNC_ALL,
.has_get_level = ICR6_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ICR6_LEVEL_ALL),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = common_dcs_list,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR6_VFO_OPS,
.scan_ops = ICR6_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {RIG_CHAN_END,},
.rx_range_list1 = { /* Other countries but France */
{kHz(100), GHz(1.309995), ICR6_MODES, -1, -1, ICR6_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = { /* USA */
{kHz(100), MHz(821.995), ICR6_MODES, -1, -1, ICR6_VFO_ALL},
{MHz(851), MHz(866.995), ICR6_MODES, -1, -1, ICR6_VFO_ALL},
{MHz(896), GHz(1.309995), ICR6_MODES, -1, -1, ICR6_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, },
.tuning_steps = {
{ICR6_MODES, Hz(5000)},
{ICR6_MODES, Hz(6250)},
{ICR6_MODES, Hz(10000)},
{ICR6_MODES, Hz(12500)},
{ICR6_MODES, kHz(15)},
{ICR6_MODES, kHz(20)},
{ICR6_MODES, kHz(25)},
{ICR6_MODES, kHz(30)},
{ICR6_MODES, kHz(50)},
{ICR6_MODES, kHz(100)},
{ICR6_MODES, kHz(125)},
{ICR6_MODES, kHz(200)},
/* Air band only */
{ICR6_MODES, Hz(8330)},
/* AM broadcast band only */
{ICR6_MODES, Hz(9000)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_AM | RIG_MODE_FM, kHz(12)},
{RIG_MODE_WFM, kHz(150)},
RIG_FLT_END,
},
.str_cal = ICR6_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr6_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.decode_event = icom_decode_event,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.get_dcd = icom_get_dcd,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_sql = icom_set_dcs_sql,
.get_dcs_sql = icom_get_dcs_sql,
};

Wyświetl plik

@ -1,321 +0,0 @@
/*
* Hamlib CI-V backend - IC-R7000 and IC-R7100 descriptions
* Copyright (c) 2000-2004 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "serial.h"
#include "misc.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#define ICR7000_MODES (RIG_MODE_AM|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_WFM)
#define ICR7000_OPS (RIG_OP_FROM_VFO|RIG_OP_MCL)
static int r7000_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
#define ICR7100_FUNCS (RIG_FUNC_VSC)
#define ICR7100_LEVELS (RIG_LEVEL_ATT|RIG_LEVEL_AF|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR)
#define ICR7100_PARMS (RIG_PARM_ANN)
#define ICR7100_SCAN_OPS (RIG_SCAN_MEM) /* TBC */
/* FIXME: S-Meter measurements */
#define ICR7100_STR_CAL UNKNOWN_IC_STR_CAL
static const struct icom_priv_caps icr7000_priv_caps =
{
0x08, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r7100_ts_sc_list
};
/*
* ICR7000 rigs capabilities.
*/
const struct rig_caps icr7000_caps =
{
.rig_model = RIG_MODEL_ICR7000,
.model_name = "IC-R7000",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_RECEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 1200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR7000_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(25), MHz(1000), ICR7000_MODES, -1, -1, RIG_VFO_A},
{MHz(1025), MHz(2000), ICR7000_MODES, -1, -1, RIG_VFO_A},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{MHz(25), MHz(1000), ICR7000_MODES, -1, -1, RIG_VFO_A},
{MHz(1025), MHz(2000), ICR7000_MODES, -1, -1, RIG_VFO_A},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, }, /* no TX ranges, this is a receiver */
.tuning_steps = {
{ICR7000_MODES, 100}, /* resolution */
#if 0
{ICR7000_MODES, kHz(1)},
{ICR7000_MODES, kHz(5)},
{ICR7000_MODES, kHz(10)},
{ICR7000_MODES, 12500},
{ICR7000_MODES, kHz(25)},
#endif
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB, kHz(2.8)},
{RIG_MODE_FM | RIG_MODE_AM, kHz(15)},
{RIG_MODE_FM | RIG_MODE_AM, kHz(6)}, /* narrow */
{RIG_MODE_WFM, kHz(150)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr7000_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = r7000_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};
static const struct icom_priv_caps icr7100_priv_caps =
{
0x34, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r7100_ts_sc_list
};
/*
* ICR7100A rig capabilities.
*/
const struct rig_caps icr7100_caps =
{
.rig_model = RIG_MODEL_ICR7100,
.model_name = "IC-R7100",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_RECEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 1200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ICR7100_FUNCS,
.has_set_func = ICR7100_FUNCS,
.has_get_level = ICR7100_LEVELS,
.has_set_level = RIG_LEVEL_SET(ICR7100_LEVELS),
.has_get_parm = ICR7100_PARMS,
.has_set_parm = RIG_PARM_SET(ICR7100_PARMS),
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END },
.attenuator = { 20, RIG_DBLST_END },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR7000_OPS,
.scan_ops = ICR7100_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM }, /* TBC */
{ 0x0900, 0x0909, RIG_MTYPE_EDGE }, /* 2 by 2 */
{ 0x0910, 0x0919, RIG_MTYPE_EDGE }, /* 2 by 2 */
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(25), MHz(1999.9999), ICR7000_MODES, -1, -1, RIG_VFO_A},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{MHz(25), MHz(1999.9999), ICR7000_MODES, -1, -1, RIG_VFO_A},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, }, /* no TX ranges, this is a receiver */
.tuning_steps = {
{ICR7000_MODES, 100}, /* resolution */
{ICR7000_MODES, kHz(1)},
{ICR7000_MODES, kHz(5)},
{ICR7000_MODES, kHz(10)},
{ICR7000_MODES, 12500},
{ICR7000_MODES, kHz(20)},
{ICR7000_MODES, kHz(25)},
{ICR7000_MODES, kHz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB, kHz(2.4)},
{RIG_MODE_FM | RIG_MODE_AM, kHz(15)},
{RIG_MODE_FM | RIG_MODE_AM, kHz(6)}, /* narrow */
{RIG_MODE_WFM, kHz(150)},
RIG_FLT_END,
},
.str_cal = ICR7100_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr7100_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = r7000_set_freq, /* TBC for R7100 */
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_level = icom_set_level,
.get_level = icom_get_level,
#ifdef XXREMOVEDXX
.set_parm = icom_set_parm,
.get_parm = icom_get_parm,
#endif
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.get_dcd = icom_get_dcd,
};
/*
* Function definitions below
*/
/*
* r7000_set_freq
*/
static int r7000_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
long long f = (long long)freq;
/*
* The R7000 cannot set freqencies higher than 1GHz,
* this is done by flipping a switch on the front panel and
* stripping the most significant digit.
* This is the only change with the common icom_set_freq
*/
f %= (long long)GHz(1);
return icom_set_freq(rig, vfo, (freq_t)f);
}

Wyświetl plik

@ -1,146 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-R71
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
/* FM optional */
#define ICR71_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY)
#define ICR71_FUNC_ALL (RIG_FUNC_NONE)
#define ICR71_LEVEL_ALL (RIG_LEVEL_NONE)
#define ICR71_VFO_ALL (RIG_VFO_A|RIG_VFO_MEM)
#define ICR71_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
#define ICR71_SCAN_OPS (RIG_SCAN_NONE)
static const struct icom_priv_caps icr71_priv_caps =
{
0x1a, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list /* none actually */
};
const struct rig_caps icr71_caps =
{
.rig_model = RIG_MODEL_ICR71,
.model_name = "IC-R71",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_RECEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 1200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ICR71_FUNC_ALL,
.has_set_func = ICR71_FUNC_ALL,
.has_get_level = ICR71_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ICR71_LEVEL_ALL),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR71_VFO_OPS,
.scan_ops = ICR71_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(100), MHz(30), ICR71_MODES, -1, -1, ICR71_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{kHz(100), MHz(30), ICR71_MODES, -1, -1, ICR71_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, },
.tuning_steps = {
{ICR71_MODES, Hz(10)}, /* resolution */
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.3)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(15)}, /* optional w/ IC-EX257 unit */
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr71_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};

Wyświetl plik

@ -1,161 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-R72
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#define ICR72_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY)
#define ICR72_FUNC_ALL (RIG_FUNC_NONE)
#define ICR72_LEVEL_ALL (RIG_LEVEL_NONE)
#define ICR72_VFO_OPS (RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_MCL)
#define ICR72_VFO_ALL (RIG_VFO_A|RIG_VFO_MEM)
#define ICR71_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define ICR72_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_SLCT|RIG_SCAN_PRIO)
static const struct icom_priv_caps icr72_priv_caps =
{
0x32, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
};
const struct rig_caps icr72_caps =
{
.rig_model = RIG_MODEL_ICR72,
.model_name = "IC-R72",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_RECEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ICR72_FUNC_ALL,
.has_set_func = ICR72_FUNC_ALL,
.has_get_level = ICR72_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ICR72_LEVEL_ALL),
.has_get_parm = RIG_PARM_ANN,
.has_set_parm = RIG_PARM_ANN,
.level_gran = {}, /* granularity */
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR72_VFO_OPS,
.scan_ops = ICR72_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(100), MHz(30), ICR72_MODES, -1, -1, ICR72_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{kHz(100), MHz(30), ICR72_MODES, -1, -1, ICR72_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, },
.tuning_steps = {
{ICR72_MODES, Hz(10)},
{ICR72_MODES, kHz(1)},
{ICR72_MODES, kHz(2)},
{ICR72_MODES, kHz(3)},
{ICR72_MODES, kHz(4)},
{ICR72_MODES, kHz(5)},
{ICR72_MODES, kHz(6)},
{ICR72_MODES, kHz(7)},
{ICR72_MODES, kHz(8)},
{ICR72_MODES, kHz(9)},
{ICR72_MODES, kHz(10)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.3)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr72_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.get_level = icom_get_level,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.scan = icom_scan,
};

Wyświetl plik

@ -1,605 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-R75
* Copyright (c) 2000-2004 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "hamlib/rig.h"
#include "misc.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
/*
* IC-R75
*
* TODO:
* $1A command:
* - set_parm, set_trn, IF filter setting, etc.
*/
#define ICR75_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_AMS)
#define ICR75_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_NR)
#define ICR75_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_PREAMP|RIG_LEVEL_AGC|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH)
#define ICR75_PARM_ALL (RIG_PARM_ANN|RIG_PARM_APO|RIG_PARM_BACKLIGHT|RIG_PARM_BEEP|RIG_PARM_TIME)
#define ICR75_VFO_ALL (RIG_VFO_VFO|RIG_VFO_MEM)
#define ICR75_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define ICR75_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO)
#define ICR75_ANTS (RIG_ANT_1|RIG_ANT_2)
#define ICR75_STR_CAL { 17, { \
{ 0, -60 }, \
{ 37, -54 }, \
{ 52, -48 }, \
{ 61, -42 }, \
{ 72, -36 }, \
{ 86, -30 }, \
{ 95, -24 }, \
{ 109, -18 }, \
{ 124, -12 }, \
{ 128, -6 }, \
{ 146, 0 }, \
{ 166, 10 }, \
{ 186, 20 }, \
{ 199, 30 }, \
{ 225, 40 }, \
{ 233, 50 }, \
{ 255, 60 }, \
} }
/*
* channel caps.
*/
#define ICR75_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
.ant = 1, \
.levels = RIG_LEVEL_ATT|RIG_LEVEL_PREAMP, \
.channel_desc = 1, \
.flags = 1, \
}
static int icr75_set_channel(RIG *rig, const channel_t *chan);
static int icr75_get_channel(RIG *rig, channel_t *chan);
int icr75_set_parm(RIG *rig, setting_t parm, value_t val);
int icr75_get_parm(RIG *rig, setting_t parm, value_t *val);
static const struct icom_priv_caps icr75_priv_caps =
{
0x5a, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r75_ts_sc_list
};
const struct rig_caps icr75_caps =
{
.rig_model = RIG_MODEL_ICR75,
.model_name = "IC-R75",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_RECEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 1,
.timeout = 1000,
.retry = 3,
.has_get_func = ICR75_FUNC_ALL,
.has_set_func = ICR75_FUNC_ALL,
.has_get_level = ICR75_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ICR75_LEVEL_ALL),
.has_get_parm = ICR75_PARM_ALL,
.has_set_parm = RIG_PARM_SET(ICR75_PARM_ALL),
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_PBT_IN] = { .min = { .f = -1280 }, .max = { .f = +1280 }, .step = { .f = 15 } },
[LVL_PBT_OUT] = { .min = { .f = -1280 }, .max = { .f = +1280 }, .step = { .f = 15 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 10 } },
[LVL_NR] = { .min = { .f = 0.0 }, .max = { .f = 1.0 }, .step = { .f = 0.066666667 } },
},
.parm_gran = {
[PARM_APO] = { .min = { .i = 1 }, .max = { .i = 1439} },
[PARM_TIME] = { .min = { .i = 0 }, .max = { .i = 86399} },
},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { 10, 20, RIG_DBLST_END, }, /* TBC */
.attenuator = { 20, RIG_DBLST_END, }, /* TBC */
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR75_VFO_OPS,
.scan_ops = ICR75_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 8,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, ICR75_MEM_CAP },
{ 100, 101, RIG_MTYPE_EDGE, ICR75_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(30), MHz(60), ICR75_MODES, -1, -1, ICR75_VFO_ALL, ICR75_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{kHz(30), MHz(60), ICR75_MODES, -1, -1, ICR75_VFO_ALL, ICR75_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, },
.tuning_steps = {
{ICR75_MODES, Hz(10)},
{ICR75_MODES, Hz(100)},
{ICR75_MODES, kHz(1)},
{ICR75_MODES, kHz(5)},
{ICR75_MODES, kHz(6.25)},
{ICR75_MODES, kHz(9)},
{ICR75_MODES, kHz(10)},
{ICR75_MODES, kHz(12.5)},
{ICR75_MODES, kHz(20)},
{ICR75_MODES, kHz(25)},
{ICR75_MODES, kHz(100)},
{ICR75_MODES, MHz(1)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(1.9)},
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(6)},
{RIG_MODE_AM | RIG_MODE_AMS, kHz(6)},
{RIG_MODE_AM | RIG_MODE_AMS, kHz(2.4)},
{RIG_MODE_AM | RIG_MODE_AMS, kHz(15)},
{RIG_MODE_FM, kHz(15)},
{RIG_MODE_FM, kHz(6)},
RIG_FLT_END,
},
.str_cal = ICR75_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr75_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.decode_event = icom_decode_event,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_parm = icr75_set_parm,
.get_parm = icr75_get_parm,
.get_dcd = icom_get_dcd,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ts = icom_set_ts,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.set_channel = icr75_set_channel,
.get_channel = icr75_get_channel,
};
/*
* icr75_set_channel
* Assumes rig!=NULL, rig->state.priv!=NULL, chan!=NULL
* TODO: still a WIP --SF
*/
int icr75_set_channel(RIG *rig, const channel_t *chan)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char chanbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
int chan_len, freq_len, ack_len, retval;
unsigned char icmode;
signed char icmode_ext;
int err;
rs = &rig->state;
priv = (struct icom_priv_data *)rs->priv;
to_bcd_be(chanbuf, chan->channel_num, 4);
chanbuf[2] = S_MEM_CNTNT_SLCT;
freq_len = priv->civ_731_mode ? 4 : 5;
/*
* to_bcd requires nibble len
*/
to_bcd(chanbuf + 3, chan->freq, freq_len * 2);
chan_len = 2 + freq_len + 1;
err = rig2icom_mode(rig, chan->mode, chan->width,
&icmode, &icmode_ext);
if (err != RIG_OK)
{
return err;
}
chanbuf[chan_len++] = icmode;
chanbuf[chan_len++] = icmode_ext;
to_bcd_be(chanbuf + chan_len++,
chan->levels[rig_setting2idx(RIG_LEVEL_ATT)].i, 2);
to_bcd_be(chanbuf + chan_len++,
chan->levels[rig_setting2idx(RIG_LEVEL_PREAMP)].i, 2);
to_bcd_be(chanbuf + chan_len++, chan->ant, 2);
memset(chanbuf + chan_len, 0, 8);
snprintf((char *)(chanbuf + chan_len), 9, "%.8s", chan->channel_desc);
chan_len += 8;
retval = icom_transaction(rig, C_CTL_MEM, S_MEM_CNTNT,
chanbuf, chan_len, ackbuf, &ack_len);
if (retval != RIG_OK)
{
return retval;
}
if (ack_len != 1 || ackbuf[0] != ACK)
{
rig_debug(RIG_DEBUG_ERR, "icom_set_channel: ack NG (%#.2x), "
"len=%d\n", ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
return RIG_OK;
}
/*
* icr75_get_channel
* Assumes rig!=NULL, rig->state.priv!=NULL, chan!=NULL
* TODO: still a WIP --SF
*/
int icr75_get_channel(RIG *rig, channel_t *chan)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char chanbuf[24];
int chan_len, freq_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data *)rs->priv;
to_bcd_be(chanbuf, chan->channel_num, 4);
chan_len = 2;
freq_len = priv->civ_731_mode ? 4 : 5;
retval = icom_transaction(rig, C_CTL_MEM, S_MEM_CNTNT,
chanbuf, chan_len, chanbuf, &chan_len);
if (retval != RIG_OK)
{
return retval;
}
chan->vfo = RIG_VFO_MEM;
chan->ant = RIG_ANT_NONE;
chan->freq = 0;
chan->mode = RIG_MODE_NONE;
chan->width = RIG_PASSBAND_NORMAL;
chan->tx_freq = 0;
chan->tx_mode = RIG_MODE_NONE;
chan->tx_width = RIG_PASSBAND_NORMAL;
chan->split = RIG_SPLIT_OFF;
chan->tx_vfo = RIG_VFO_NONE;
chan->rptr_shift = RIG_RPT_SHIFT_NONE;
chan->rptr_offs = 0;
chan->tuning_step = 0;
chan->rit = 0;
chan->xit = 0;
chan->funcs = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_PREAMP)].i = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_ATT)].i = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_AF)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_RF)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_SQL)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_NR)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_PBT_IN)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_PBT_OUT)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_CWPITCH)].i = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_AGC)].i = RIG_AGC_OFF;
chan->ctcss_tone = 0;
chan->ctcss_sql = 0;
chan->dcs_code = 0;
chan->dcs_sql = 0;
chan->scan_group = 0;
chan->flags = RIG_CHFLAG_SKIP;
strcpy(chan->channel_desc, " ");
/*
* freqbuf should contain Cn,Data area
*/
if ((chan_len != freq_len + 18) && (chan_len != 5))
{
rig_debug(RIG_DEBUG_ERR, "icr75_get_channel: wrong frame len=%d\n",
chan_len);
return -RIG_ERJCTED;
}
/* do this only if not a blank channel */
if (chan_len != 5)
{
/*
* from_bcd requires nibble len
*/
chan->flags = RIG_CHFLAG_NONE;
chan->freq = from_bcd(chanbuf + 5, freq_len * 2);
chan_len = 4 + freq_len + 1;
icom2rig_mode(rig, chanbuf[chan_len], chanbuf[chan_len + 1],
&chan->mode, &chan->width);
chan_len += 2;
if (from_bcd_be(chanbuf + chan_len++, 2) != 0)
{
chan->levels[rig_setting2idx(RIG_LEVEL_ATT)].i = 20;
}
if (from_bcd_be(chanbuf + chan_len++, 2) != 0)
{
chan->levels[rig_setting2idx(RIG_LEVEL_PREAMP)].i = 20;
}
chan->ant = from_bcd_be(chanbuf + chan_len++, 2);
strncpy(chan->channel_desc, (char *)(chanbuf + chan_len), 8);
}
return RIG_OK;
}
int icr75_set_parm(RIG *rig, setting_t parm, value_t val)
{
unsigned char prmbuf[MAXFRAMELEN];
int min, hr, sec;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (parm)
{
case RIG_PARM_ANN:
{
int ann_mode = -1;
int ann_lang = -1;
switch (val.i)
{
case RIG_ANN_OFF:
ann_mode = S_ANN_ALL;
break;
case RIG_ANN_FREQ:
ann_mode = S_ANN_FREQ;
break;
case RIG_ANN_RXMODE:
ann_mode = S_ANN_MODE;
break;
case RIG_ANN_ENG:
case RIG_ANN_JAP:
ann_lang = (val.i == RIG_ANN_ENG) ? 0 : 1;
break;
default:
rig_debug(RIG_DEBUG_ERR, "Unsupported RIG_PARM_ANN %d\n", val.i);
return -RIG_EINVAL;
}
if (ann_mode >= 0)
{
return icom_set_raw(rig, C_CTL_ANN, ann_mode, 0, NULL, 0, 0);
}
else if (ann_lang >= 0)
{
prmbuf[0] = S_PRM_LANG;
prmbuf[1] = ann_lang;
return icom_set_raw(rig, C_CTL_MEM, S_MEM_MODE_SLCT, 2, prmbuf, 0, 0);
}
rig_debug(RIG_DEBUG_ERR, "Unsupported RIG_PARM_ANN %d\n", val.i);
return -RIG_EINVAL;
}
case RIG_PARM_APO:
prmbuf[0] = S_PRM_SLPTM;
hr = (int)((float) val.i / 60.0f);
min = val.i - (hr * 60);
to_bcd_be(prmbuf + 1, (long long) hr, 2);
to_bcd_be(prmbuf + 2, (long long) min, 2);
return icom_set_raw(rig, C_CTL_MEM, S_MEM_MODE_SLCT, 3, prmbuf, 0, 0);
case RIG_PARM_BACKLIGHT:
prmbuf[0] = S_PRM_BACKLT;
to_bcd_be(prmbuf + 1, (long long)(val.f * 255.0f), 2 * 2);
return icom_set_raw(rig, C_CTL_MEM, S_MEM_MODE_SLCT, 3, prmbuf, 0, 0);
case RIG_PARM_BEEP:
prmbuf[0] = S_PRM_BEEP;
prmbuf[1] = val.i ? 1 : 0;
return icom_set_raw(rig, C_CTL_MEM, S_MEM_MODE_SLCT, 2, prmbuf, 0, 0);
case RIG_PARM_TIME:
hr = (int)((float) val.i / 3600.0);
min = (int)((float)(val.i - (hr * 3600)) / 60.0);
sec = (val.i - (hr * 3600) - (min * 60));
prmbuf[0] = S_PRM_TIME;
to_bcd_be(prmbuf + 1, (long long) hr, 2);
to_bcd_be(prmbuf + 2, (long long) min, 2);
to_bcd_be(prmbuf + 3, (long long) sec, 2);
return icom_set_raw(rig, C_CTL_MEM, S_MEM_MODE_SLCT, 4, prmbuf, 0, 0);
default:
rig_debug(RIG_DEBUG_ERR, "Unsupported set_parm %s\n", rig_strparm(parm));
return -RIG_EINVAL;
}
}
int icr75_get_parm(RIG *rig, setting_t parm, value_t *val)
{
unsigned char prmbuf[MAXFRAMELEN], resbuf[MAXFRAMELEN];
int prm_len, res_len;
int prm_cn, prm_sc;
int icom_val = 0;
int cmdhead;
int retval;
int min, hr, sec;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (parm)
{
case RIG_PARM_APO:
prm_cn = C_CTL_MEM;
prm_sc = S_MEM_MODE_SLCT;
prm_len = 1;
prmbuf[0] = S_PRM_SLPTM;
break;
case RIG_PARM_BACKLIGHT:
prm_cn = C_CTL_MEM;
prm_sc = S_MEM_MODE_SLCT;
prm_len = 1;
prmbuf[0] = S_PRM_BACKLT;
break;
case RIG_PARM_BEEP:
prm_cn = C_CTL_MEM;
prm_sc = S_MEM_MODE_SLCT;
prm_len = 1;
prmbuf[0] = S_PRM_BEEP;
break;
case RIG_PARM_TIME:
prm_cn = C_CTL_MEM;
prm_sc = S_MEM_MODE_SLCT;
prm_len = 1;
prmbuf[0] = S_PRM_TIME;
break;
default:
rig_debug(RIG_DEBUG_ERR, "Unsupported get_parm %s", rig_strparm(parm));
return -RIG_EINVAL;
}
retval = icom_transaction(rig, prm_cn, prm_sc, prmbuf, prm_len, resbuf,
&res_len);
if (retval != RIG_OK)
{
return retval;
}
cmdhead = 3;
res_len -= cmdhead;
if (resbuf[0] != ACK && resbuf[0] != prm_cn)
{
rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, resbuf[0],
res_len);
return -RIG_ERJCTED;
}
switch (parm)
{
case RIG_PARM_APO:
hr = from_bcd_be(resbuf + cmdhead, 2);
min = from_bcd_be(resbuf + cmdhead + 1, 2);
icom_val = (hr * 60) + min;
val->i = icom_val;
break;
case RIG_PARM_TIME:
hr = from_bcd_be(resbuf + cmdhead, 2);
min = from_bcd_be(resbuf + cmdhead + 1, 2);
sec = from_bcd_be(resbuf + cmdhead + 2, 2);
icom_val = (hr * 3600) + (min * 60) + sec;
val->i = icom_val;
break;
case RIG_PARM_BACKLIGHT:
icom_val = from_bcd_be(resbuf + cmdhead, res_len * 2);
val->f = (float) icom_val / 255.0;
break;
case RIG_PARM_BEEP:
icom_val = from_bcd_be(resbuf + cmdhead, res_len * 2);
val->i = icom_val;
break;
}
rig_debug(RIG_DEBUG_TRACE, "%s: %d %d %d %f\n", __func__, res_len, icom_val,
val->i, val->f);
return RIG_OK;
}

Wyświetl plik

@ -1,224 +0,0 @@
/*
* Hamlib CI-V backend - IC-R8500 description
* Copyright (c) 2000-2004 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#define ICR8500_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_WFM)
#define ICR8500_1MHZ_TS_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM)
#define ICR8500_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_TSQL|RIG_FUNC_APF)
#define ICR8500_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_APF|RIG_LEVEL_SQL|RIG_LEVEL_IF|RIG_LEVEL_RAWSTR)
#define ICR8500_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define ICR8500_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_SLCT|RIG_SCAN_PRIO)
/* FIXME: real measure */
#define ICR8500_STR_CAL { 16, { \
{ 0, -54 }, /* S0 */ \
{ 10, -48 }, \
{ 32, -42 }, \
{ 46, -36 }, \
{ 62, -30 }, \
{ 82, -24 }, \
{ 98, -18 }, \
{ 112, -12 }, \
{ 124, -6 }, \
{ 134, 0 }, /* S9 */ \
{ 156, 10 }, \
{ 177, 20 }, \
{ 192, 30 }, \
{ 211, 40 }, \
{ 228, 50 }, \
{ 238, 60 }, \
} }
int icr8500_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
static const struct icom_priv_caps icr8500_priv_caps =
{
0x4a, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r8500_ts_sc_list
};
/*
* IC-R8500 rig capabilities.
*/
const struct rig_caps icr8500_caps =
{
.rig_model = RIG_MODEL_ICR8500,
.model_name = "ICR-8500",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_RECEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = ICR8500_FUNC_ALL,
.has_get_level = ICR8500_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ICR8500_LEVEL_ALL | RIG_LEVEL_AF),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_IF] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 1 } },
},
.parm_gran = {},
.ctcss_list = NULL, /* FIXME: CTCSS/DCS list */
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { 10, 20, 30, RIG_DBLST_END, },
.max_rit = Hz(9999),
.max_xit = Hz(0),
.max_ifshift = kHz(1.2),
.targetable_vfo = 0,
.vfo_ops = ICR8500_OPS,
.scan_ops = ICR8500_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 12,
.chan_desc_sz = 0,
.str_cal = ICR8500_STR_CAL,
.chan_list = { /* FIXME: memory channel list */
{ 1, 999, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(100), MHz(824) - 10, ICR8500_MODES, -1, -1, RIG_VFO_A},
{MHz(849) + 10, MHz(869) - 10, ICR8500_MODES, -1, -1, RIG_VFO_A},
{MHz(894) + 10, GHz(2) - 10, ICR8500_MODES, -1, -1, RIG_VFO_A},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{kHz(100), MHz(824) - 10, ICR8500_MODES, -1, -1, RIG_VFO_A},
{MHz(849) + 10, MHz(869) - 10, ICR8500_MODES, -1, -1, RIG_VFO_A},
{MHz(894) + 10, GHz(2) - 10, ICR8500_MODES, -1, -1, RIG_VFO_A},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, }, /* no TX ranges, this is a receiver */
.tuning_steps = {
{ICR8500_MODES, 10},
{ICR8500_MODES, 50},
{ICR8500_MODES, 100},
{ICR8500_MODES, kHz(1)},
{ICR8500_MODES, 2500},
{ICR8500_MODES, kHz(5)},
{ICR8500_MODES, kHz(9)},
{ICR8500_MODES, kHz(10)},
{ICR8500_MODES, 12500},
{ICR8500_MODES, kHz(20)},
{ICR8500_MODES, kHz(25)},
{ICR8500_MODES, kHz(100)},
{ICR8500_1MHZ_TS_MODES, MHz(1)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
/* FIXME: To be confirmed! --SF */
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.4)},
{RIG_MODE_AM, kHz(8)},
{RIG_MODE_AM, kHz(2.4)}, /* narrow */
{RIG_MODE_AM, kHz(15)}, /* wide */
{RIG_MODE_FM, kHz(15)},
{RIG_MODE_FM, kHz(8)}, /* narrow */
{RIG_MODE_WFM, kHz(230)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr8500_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_func = icr8500_set_func,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.get_dcd = icom_get_dcd,
};
int icr8500_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
{
switch (func)
{
case RIG_FUNC_NB:
return icom_set_raw(rig, C_CTL_FUNC, status ? S_FUNC_NBON : S_FUNC_NBOFF, 0,
NULL, 0, 0);
case RIG_FUNC_FAGC:
return icom_set_raw(rig, C_CTL_FUNC, status ? S_FUNC_AGCON : S_FUNC_AGCOFF, 0,
NULL, 0, 0);
case RIG_FUNC_APF:
return icom_set_raw(rig, C_CTL_FUNC, status ? S_FUNC_APFON : S_FUNC_APFOFF, 0,
NULL, 0, 0);
default:
return icom_set_func(rig, vfo, func, status);
}
}

Wyświetl plik

@ -1,329 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-R8600
* Copyright (c) 2000-2004 by Stephane Fillod
* Copyright (c) 2018 by Ekki Plicht
* Copyright (c) 2019 by Malcolm Herring
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "hamlib/rig.h"
#include "misc.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#define ICR8600_MODES (RIG_MODE_LSB|RIG_MODE_USB|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_RTTY|\
RIG_MODE_FM|RIG_MODE_WFM|RIG_MODE_CWR|RIG_MODE_RTTYR|RIG_MODE_SAM|RIG_MODE_SAL|\
RIG_MODE_SAH|RIG_MODE_P25|RIG_MODE_DSTAR|RIG_MODE_DPMR|RIG_MODE_NXDNVN|\
RIG_MODE_NXDN_N|RIG_MODE_DCR)
#define ICR8600_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MN|RIG_FUNC_AFC|\
RIG_FUNC_NR|RIG_FUNC_AIP|RIG_FUNC_LOCK|RIG_FUNC_VSC|RIG_FUNC_RESUME|RIG_FUNC_TSQL|\
RIG_FUNC_CSQL|RIG_FUNC_DSQL)
#define ICR8600_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|\
RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_PREAMP|\
RIG_LEVEL_AGC|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH)
#define ICR8600_PARM_ALL (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|\
RIG_PARM_BEEP|RIG_PARM_TIME|RIG_PARM_KEYLIGHT)
#define ICR8600_VFO_ALL (RIG_VFO_VFO|RIG_VFO_MEM)
#define ICR8600_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define ICR8600_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_SLCT|\
RIG_SCAN_PRIO|RIG_SCAN_PRIO|RIG_SCAN_DELTA|RIG_SCAN_STOP)
#define ICR8600_ANTS_HF (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3)
#define ICR8600_ANTS_VHF (RIG_ANT_1)
#define ICR8600_STR_CAL { 2, {\
{ 0, -60 }, \
{ 255, 60 }, \
} }
/*
* channel caps.
*/
#define ICR8600_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
.ant = 1, \
.levels = RIG_LEVEL_ATT|RIG_LEVEL_PREAMP, \
.channel_desc = 1, \
.flags = 1, \
}
int icr8600_set_parm(RIG *rig, setting_t parm, value_t val);
int icr8600_get_parm(RIG *rig, setting_t parm, value_t *val);
static const struct icom_priv_caps icr8600_priv_caps =
{
0x96, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r8600_ts_sc_list, /* list of tuning steps */
.offs_len = 4, /* Repeater offset is 4 bytes */
.serial_USB_echo_check = 1 /* USB CI-V may not echo */
};
const struct rig_caps icr8600_caps =
{
.rig_model = RIG_MODEL_ICR8600,
.model_name = "IC-R8600",
.mfg_name = "Icom",
.version = "0.8",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_RECEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200, // USB can do up to 115000
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 1,
.timeout = 1000,
.retry = 3,
.has_get_func = ICR8600_FUNC_ALL,
.has_set_func = ICR8600_FUNC_ALL,
.has_get_level = ICR8600_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ICR8600_LEVEL_ALL),
.has_get_parm = ICR8600_PARM_ALL,
.has_set_parm = RIG_PARM_SET(ICR8600_PARM_ALL),
.level_gran = { [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } } },
.parm_gran = { [PARM_TIME] = { .min = { .i = 0 }, .max = { .i = 86399} } },
.ctcss_list = common_ctcss_list,
.dcs_list = common_dcs_list,
.preamp = { 20, RIG_DBLST_END, }, /* 20 on HF, 14 on VHF, UHF, same setting */
.attenuator = { 10, 20, 30, RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR8600_VFO_OPS,
.scan_ops = ICR8600_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 100,
.chan_desc_sz = 16,
.chan_list = {
{ 0, 99, RIG_MTYPE_MEM, ICR8600_MEM_CAP },
{ 0, 99, RIG_MTYPE_EDGE, ICR8600_MEM_CAP },
/* to be extended */
RIG_CHAN_END,
},
.rx_range_list1 = {
{ kHz(10), MHz(3000), ICR8600_MODES, -1, -1, ICR8600_VFO_ALL, ICR8600_ANTS_VHF },
{ kHz(10), MHz(30), ICR8600_MODES, -1, -1, ICR8600_VFO_ALL, ICR8600_ANTS_HF },
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{ kHz(10), MHz(3000), ICR8600_MODES, -1, -1, ICR8600_VFO_ALL, ICR8600_ANTS_VHF },
{ kHz(10), MHz(30), ICR8600_MODES, -1, -1, ICR8600_VFO_ALL, ICR8600_ANTS_HF },
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, },
.tuning_steps = {
{ICR8600_MODES, Hz(100)},
{ICR8600_MODES, kHz(1)},
{ICR8600_MODES, kHz(2.5)},
{ICR8600_MODES, kHz(3.125)},
{ICR8600_MODES, kHz(5)},
{ICR8600_MODES, kHz(6.25)},
{ICR8600_MODES, kHz(8.33)},
{ICR8600_MODES, kHz(9)},
{ICR8600_MODES, kHz(10)},
{ICR8600_MODES, kHz(12.5)},
{ICR8600_MODES, kHz(20)},
{ICR8600_MODES, kHz(25)},
{ICR8600_MODES, kHz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(1.9)},
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(6)},
{RIG_MODE_AM | RIG_MODE_AMS, kHz(6)},
{RIG_MODE_AM | RIG_MODE_AMS, kHz(2.4)},
{RIG_MODE_AM | RIG_MODE_AMS, kHz(15)},
{RIG_MODE_FM, kHz(15)},
{RIG_MODE_FM, kHz(6)},
RIG_FLT_END,
},
.str_cal = ICR8600_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr8600_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = icom_rig_open,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_bank = icom_set_bank,
.get_rptr_offs = icom_get_rptr_offs,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_shift = icom_set_rptr_shift,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.decode_event = icom_decode_event,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_parm = icr8600_set_parm,
.get_parm = icr8600_get_parm,
.get_dcd = icom_get_dcd,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_sql = icom_set_dcs_sql,
.get_dcs_sql = icom_get_dcs_sql,
};
int icr8600_set_parm(RIG *rig, setting_t parm, value_t val)
{
unsigned char parmbuf[MAXFRAMELEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (parm)
{
case RIG_PARM_BEEP:
parmbuf[0] = 0x00;
parmbuf[1] = 0x38;
return icom_set_custom_parm(rig, 2, parmbuf, 1, val.i ? 1 : 0);
case RIG_PARM_BACKLIGHT:
parmbuf[0] = 0x01;
parmbuf[1] = 0x15;
return icom_set_custom_parm(rig, 2, parmbuf, 2, (int)(val.f * 255.0f));
case RIG_PARM_KEYLIGHT:
parmbuf[0] = 0x01;
parmbuf[1] = 0x16;
return icom_set_custom_parm(rig, 2, parmbuf, 2, val.f != 0 ? 255 : 0);
case RIG_PARM_TIME:
parmbuf[0] = 0x01;
parmbuf[1] = 0x32;
return icom_set_custom_parm_time(rig, 2, parmbuf, val.i);
default:
return icom_set_parm(rig, parm, val);
}
}
int icr8600_get_parm(RIG *rig, setting_t parm, value_t *val)
{
unsigned char parmbuf[MAXFRAMELEN];
int retval;
int icom_val;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (parm)
{
case RIG_PARM_BEEP:
parmbuf[0] = 0x00;
parmbuf[1] = 0x38;
retval = icom_get_custom_parm(rig, 2, parmbuf, &icom_val);
if (retval != RIG_OK)
{
return retval;
}
val->i = icom_val ? 1 : 0;
break;
case RIG_PARM_BACKLIGHT:
parmbuf[0] = 0x01;
parmbuf[1] = 0x15;
retval = icom_get_custom_parm(rig, 2, parmbuf, &icom_val);
if (retval != RIG_OK)
{
return retval;
}
val->f = (float) icom_val / 255.0f;
break;
case RIG_PARM_KEYLIGHT:
parmbuf[0] = 0x01;
parmbuf[1] = 0x16;
retval = icom_get_custom_parm(rig, 2, parmbuf, &icom_val);
if (retval != RIG_OK)
{
return retval;
}
val->f = icom_val != 0;
break;
case RIG_PARM_TIME:
parmbuf[0] = 0x01;
parmbuf[1] = 0x32;
return icom_get_custom_parm_time(rig, 2, parmbuf, &val->i);
default:
return icom_get_parm(rig, parm, val);
}
return RIG_OK;
}

Wyświetl plik

@ -1,207 +0,0 @@
/*
* Hamlib CI-V backend - IC-R9000 descriptions
* Copyright (c) 2000-2011 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "serial.h"
#include "misc.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#define ICR9000_MODES (RIG_MODE_AM|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_CW|RIG_MODE_WFM)
#define ICR9000_OPS (RIG_OP_FROM_VFO|RIG_OP_MCL)
#define ICR9000_FUNCS (RIG_FUNC_VSC)
#define ICR9000_LEVELS (RIG_LEVEL_ATT|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR)
#define ICR9000_PARMS (RIG_PARM_ANN)
#define ICR9000_SCAN_OPS (RIG_SCAN_MEM) /* TBC */
#define ICR9000_ANTS (RIG_ANT_1|RIG_ANT_2) /* selectable by CI-V ? */
#define ICR9000_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
.levels = RIG_LEVEL_ATT, \
}
/* TODO: S-Meter measurements */
#define ICR9000_STR_CAL UNKNOWN_IC_STR_CAL
static const struct icom_priv_caps icr9000_priv_caps =
{
0x2a, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r9000_ts_sc_list
};
static int icr9000_open(RIG *rig);
/*
* ICR9000A rig capabilities.
*/
const struct rig_caps icr9000_caps =
{
.rig_model = RIG_MODEL_ICR9000,
.model_name = "IC-R9000",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_RECEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 1200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ICR9000_FUNCS,
.has_set_func = ICR9000_FUNCS,
.has_get_level = ICR9000_LEVELS,
.has_set_level = RIG_LEVEL_SET(ICR9000_LEVELS),
.has_get_parm = ICR9000_PARMS,
.has_set_parm = RIG_PARM_SET(ICR9000_PARMS),
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END },
.attenuator = { 10, 20, 30, RIG_DBLST_END },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR9000_OPS,
.scan_ops = ICR9000_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 0, 999, RIG_MTYPE_MEM, ICR9000_MEM_CAP }, /* TBC */
{ 1000, 1009, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP }, /* 2 by 2 */
{ 1010, 1019, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP }, /* 2 by 2 */
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(100), MHz(1999.8), ICR9000_MODES, -1, -1, RIG_VFO_A, ICR9000_ANTS},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{kHz(100), MHz(1999.8), ICR9000_MODES, -1, -1, RIG_VFO_A, ICR9000_ANTS},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, }, /* no TX ranges, this is a receiver */
.tuning_steps = {
{ICR9000_MODES, 10}, /* resolution */
{ICR9000_MODES, 100},
{ICR9000_MODES, kHz(1)},
{ICR9000_MODES, kHz(5)},
{ICR9000_MODES, kHz(9)},
{ICR9000_MODES, kHz(10)},
{ICR9000_MODES, 12500},
{ICR9000_MODES, kHz(20)},
{ICR9000_MODES, kHz(25)},
{ICR9000_MODES, kHz(100)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.4)},
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(15)},
{RIG_MODE_WFM, kHz(150)},
RIG_FLT_END,
},
.str_cal = ICR9000_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr9000_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = icr9000_open,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_level = icom_set_level,
.get_level = icom_get_level,
#ifdef XXREMOVEDXX
.set_parm = icom_set_parm,
.get_parm = icom_get_parm,
#endif
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.get_dcd = icom_get_dcd,
};
/*
* Function definitions below
*/
int icr9000_open(RIG *rig)
{
return icom_scan(rig, RIG_VFO_CURR, RIG_SCAN_STOP, 0);
}

Wyświetl plik

@ -1,220 +0,0 @@
/*
* Hamlib CI-V backend - IC-R9500 descriptions
* Copyright (c) 2000-2011 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "serial.h"
#include "misc.h"
#include "idx_builtin.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#define ICR9500_MODES (RIG_MODE_AM|RIG_MODE_AMS|\
RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR|\
RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_WFM)
#define ICR9500_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define ICR9500_FUNCS (RIG_FUNC_NB|RIG_FUNC_TSQL|RIG_FUNC_NR|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK)
#define ICR9500_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_APF)
#define ICR9500_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
#define ICR9500_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_SLCT|RIG_SCAN_PRIO) /* TBC */
#define ICR9500_HF_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3)
#define ICR9500_VFOS (RIG_VFO_A|RIG_VFO_MEM)
#define ICR9500_MEM_CAP { /* FIXME */ \
.freq = 1, \
.mode = 1, \
.width = 1, \
.levels = RIG_LEVEL_ATT, \
}
/* TODO: S-Meter measurements */
#define ICR9500_STR_CAL UNKNOWN_IC_STR_CAL
static const struct icom_priv_caps icr9500_priv_caps =
{
0x72, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r9500_ts_sc_list
};
/*
* ICR9500A rig capabilities.
*/
const struct rig_caps icr9500_caps =
{
.rig_model = RIG_MODEL_ICR9500,
.model_name = "IC-R9500",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_RECEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 1200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ICR9500_FUNCS,
.has_set_func = ICR9500_FUNCS,
.has_get_level = ICR9500_LEVELS,
.has_set_level = RIG_LEVEL_SET(ICR9500_LEVELS),
.has_get_parm = ICR9500_PARMS,
.has_set_parm = RIG_PARM_SET(ICR9500_PARMS),
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = common_dcs_list,
.preamp = { 10, 20, RIG_DBLST_END }, /* FIXME: TBC */
.attenuator = { 6, 10, 12, 18, 20, 24, 30, RIG_DBLST_END },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICR9500_OPS,
.scan_ops = ICR9500_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 12,
.chan_desc_sz = 0, /* FIXME */
.chan_list = {
{ 0, 999, RIG_MTYPE_MEM, ICR9500_MEM_CAP }, /* TBC */
{ 1000, 1099, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP }, /* Bank-A (Auto) */
{ 1100, 1199, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP }, /* Bank-S (skip) */
{ 1200, 1219, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP }, /* Bank-P (Scan edge), 2 by 2 */
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(5), MHz(30) - 1, ICR9500_MODES, -1, -1, ICR9500_VFOS, ICR9500_HF_ANTS},
{MHz(30), MHz(3335), ICR9500_MODES, -1, -1, ICR9500_VFOS, RIG_ANT_4},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{kHz(5), MHz(30) - 1, ICR9500_MODES, -1, -1, ICR9500_VFOS, ICR9500_HF_ANTS},
{MHz(30), MHz(3335), ICR9500_MODES, -1, -1, ICR9500_VFOS, RIG_ANT_4},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, }, /* no TX ranges, this is a receiver */
.tuning_steps = {
{ICR9500_MODES, 1}, /* resolution */
{ICR9500_MODES, 10},
{ICR9500_MODES, 100},
{ICR9500_MODES, kHz(1)},
{ICR9500_MODES, kHz(2.5)},
{ICR9500_MODES, kHz(5)},
{ICR9500_MODES, kHz(6.25)},
{ICR9500_MODES, kHz(9)},
{ICR9500_MODES, kHz(10)},
{ICR9500_MODES, 12500},
{ICR9500_MODES, kHz(20)},
{ICR9500_MODES, kHz(25)},
{ICR9500_MODES, kHz(100)},
{ICR9500_MODES, MHz(1)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, kHz(2.4)},
{RIG_MODE_CW, Hz(500)},
{RIG_MODE_AM | RIG_MODE_AMS, kHz(6)},
{RIG_MODE_FM, kHz(15)},
{RIG_MODE_WFM, kHz(350)},
RIG_FLT_END,
},
.str_cal = ICR9500_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icr9500_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_sql = icom_set_dcs_sql,
.get_dcs_sql = icom_get_dcs_sql,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_parm = icom_set_parm,
.get_parm = icom_get_parm,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.set_bank = icom_set_bank,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.get_dcd = icom_get_dcd,
};
/*
* Function definitions below
*/

Wyświetl plik

@ -1,152 +0,0 @@
/*
* Hamlib CI-V backend - description of IC-RX7
* Copyright (c) 2011 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "icom.h"
#include "idx_builtin.h"
#define ICRX7_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM)
#define ICRX7_FUNC_ALL (RIG_FUNC_NONE)
#define ICRX7_LEVEL_ALL (RIG_LEVEL_RAWSTR)
#define ICRX7_VFO_ALL (RIG_VFO_A)
#define ICRX7_VFO_OPS (RIG_OP_NONE)
#define ICRX7_SCAN_OPS (RIG_SCAN_NONE)
/*
* FIXME: S-meter measurement
*/
#define ICRX7_STR_CAL UNKNOWN_IC_STR_CAL
static const struct icom_priv_caps icrx7_priv_caps =
{
0x78, /* default address */
0, /* 731 mode */
0, /* no XCHG */
r8500_ts_sc_list /* wrong, but don't have set_ts anyway */
};
const struct rig_caps icrx7_caps =
{
.rig_model = RIG_MODEL_ICRX7,
.model_name = "IC-RX7",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ICRX7_FUNC_ALL,
.has_set_func = ICRX7_FUNC_ALL,
.has_get_level = ICRX7_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ICRX7_LEVEL_ALL),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ICRX7_VFO_OPS,
.scan_ops = ICRX7_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
/* Unfortunately, not accessible through CI-V */
RIG_CHAN_END,
},
.rx_range_list1 = {
{kHz(150), GHz(1.3), ICRX7_MODES, -1, -1, ICRX7_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
.rx_range_list2 = {
{kHz(150), MHz(821.995), ICRX7_MODES, -1, -1, ICRX7_VFO_ALL},
{MHz(851), MHz(866.995), ICRX7_MODES, -1, -1, ICRX7_VFO_ALL},
{MHz(896), GHz(1.3), ICRX7_MODES, -1, -1, ICRX7_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, },
.tuning_steps = {
{ICRX7_MODES, Hz(100)},
RIG_TS_END,
},
.filters = {
{RIG_MODE_AM | RIG_MODE_FM, kHz(15)},
{RIG_MODE_WFM, kHz(150)},
RIG_FLT_END,
},
.str_cal = ICRX7_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& icrx7_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode, /* TODO: do not pass bandwidth data */
.get_mode = icom_get_mode,
.decode_event = icom_decode_event,
.get_level = icom_get_level,
.get_dcd = icom_get_dcd,
};

Wyświetl plik

@ -1,201 +0,0 @@
/*
* Hamlib CI-V backend - description of ID-1 and variations
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "idx_builtin.h"
#include "icom.h"
#define ID1_MODES (RIG_MODE_FM /* |RIG_MODE_DIGVOICE|RIG_MODE_DIGDATA*/ )
#define ID1_FUNC_ALL (RIG_FUNC_MUTE|RIG_FUNC_MON|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|RIG_FUNC_AFC)
#define ID1_LEVEL_ALL (RIG_LEVEL_AF|RIG_LEVEL_SQL|RIG_LEVEL_RFPOWER|RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_RAWSTR)
#define ID1_PARM_ALL (RIG_PARM_BEEP|RIG_PARM_BACKLIGHT /* |RIG_PARM_FAN */)
#define ID1_VFO_ALL (RIG_VFO_A|RIG_VFO_MEM)
#define ID1_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define ID1_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM)
/*
* FIXME: real measurement
*/
#define ID1_STR_CAL UNKNOWN_IC_STR_CAL
const struct ts_sc_list id1_ts_sc_list[] =
{
{ kHz(5), 0x00 },
{ kHz(10), 0x01 },
{ 12500, 0x02 },
{ kHz(20), 0x03 },
{ kHz(25), 0x04 },
{ kHz(50), 0x05 },
{ kHz(100), 0x06 },
{ kHz(6.25), 0x07 },
{ 0, 0 },
};
/*
*/
static const struct icom_priv_caps id1_priv_caps =
{
0x01, /* default address */
0, /* 731 mode */
0, /* no XCHG */
id1_ts_sc_list
};
const struct rig_caps id1_caps =
{
.rig_model = RIG_MODEL_ICID1,
.model_name = "IC ID-1",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 19200,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ID1_FUNC_ALL,
.has_set_func = ID1_FUNC_ALL,
.has_get_level = ID1_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ID1_LEVEL_ALL),
.has_get_parm = ID1_PARM_ALL,
.has_set_parm = ID1_PARM_ALL,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = full_dcs_list,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ID1_VFO_OPS,
.scan_ops = ID1_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 101, RIG_MTYPE_EDGE }, /* two by two */
{ 102, 104, RIG_MTYPE_CALL },
RIG_CHAN_END,
},
.rx_range_list1 = {
{GHz(1.240), GHz(1.3), ID1_MODES, -1, -1, ID1_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{GHz(1.240), GHz(1.3), ID1_MODES, W(1), W(10), ID1_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{GHz(1.240), GHz(1.3), ID1_MODES, -1, -1, ID1_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
{GHz(1.240), GHz(1.3), ID1_MODES, W(1), W(10), ID1_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{ID1_MODES, kHz(5)},
{ID1_MODES, kHz(10)},
{ID1_MODES, 12500},
{ID1_MODES, kHz(20)},
{ID1_MODES, kHz(25)},
{ID1_MODES, kHz(25)},
{ID1_MODES, kHz(100)},
{ID1_MODES, kHz(6.25)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_FM, kHz(12)},
#if 0
{RIG_MODE_DIGVOICE, kHz(6)},
{RIG_MODE_DIGDATA, kHz(140)},
#endif
RIG_FLT_END,
},
.str_cal = ID1_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& id1_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.decode_event = icom_decode_event,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.set_rptr_shift = icom_set_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
};

Wyświetl plik

@ -1,205 +0,0 @@
/*
* Hamlib CI-V backend - description of ID-31 and variations
* Copyright (c) 2015 by Stephane Fillod
* Copyright (c) 2019 by Malcolm Herring
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "idx_builtin.h"
#include "icom.h"
/*
* Specs and protocol details comes from the chapter 11 of ID-31A_E_CD_ENG_1.pdf
*
* NB: while the port labeled "Data" is used for firmware upgrades,
* you have to use the port labeled "SP" for rig control.
*
*/
#define ID31_MODES (RIG_MODE_FM|RIG_MODE_DSTAR)
#define ID31_ALL_RX_MODES (RIG_MODE_AM|ID31_MODES)
#define ID31_VFO_ALL (RIG_VFO_MAIN)
#define ID31_SCAN_OPS RIG_SCAN_NONE
#define ID31_VFO_OPS RIG_OP_NONE
#define ID31_FUNC_ALL ( \
RIG_FUNC_TONE| \
RIG_FUNC_TSQL| \
RIG_FUNC_CSQL| \
RIG_FUNC_DSQL| \
RIG_FUNC_VOX)
#define ID31_LEVEL_ALL (RIG_LEVEL_AF| \
RIG_LEVEL_SQL| \
RIG_LEVEL_RAWSTR| \
RIG_LEVEL_RFPOWER| \
RIG_LEVEL_MICGAIN| \
RIG_LEVEL_VOXGAIN)
#define ID31_PARM_ALL RIG_PARM_NONE
/*
* FIXME: real measurement
*/
#define ID31_STR_CAL UNKNOWN_IC_STR_CAL
/*
*/
static const struct icom_priv_caps id31_priv_caps =
{
0xA0, /* default address */
0, /* 731 mode */
1, /* no XCHG */
};
const struct rig_caps id31_caps =
{
.rig_model = RIG_MODEL_ID31,
.model_name = "ID-31",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_RIG,
.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 = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ID31_FUNC_ALL,
.has_set_func = ID31_FUNC_ALL,
.has_get_level = ID31_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ID31_LEVEL_ALL),
.has_get_parm = ID31_PARM_ALL,
.has_set_parm = ID31_PARM_ALL,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = full_dcs_list,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ID31_VFO_OPS,
.scan_ops = ID31_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
// There's no memory support through CI-V,
// but there is a clone mode apart.
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(400), MHz(479), ID31_ALL_RX_MODES, -1, -1, ID31_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(430), MHz(440), ID31_MODES, W(2.5), W(5), ID31_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{MHz(400), MHz(479), ID31_ALL_RX_MODES, -1, -1, ID31_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
{MHz(440), MHz(450), ID31_MODES, W(2.5), W(5), ID31_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
// Rem: no support for changing tuning step
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_FM, kHz(12)},
{RIG_MODE_FM, kHz(6)},
RIG_FLT_END,
},
.str_cal = ID31_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& id31_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.decode_event = icom_decode_event,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_dcs_code = icom_set_dcs_code,
.get_dcs_code = icom_get_dcs_code,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_sql = icom_set_dcs_sql,
.get_dcs_sql = icom_get_dcs_sql,
};

Wyświetl plik

@ -1,214 +0,0 @@
/*
* Hamlib CI-V backend - description of ID-4100 and variations
* Copyright (c) 2015 by Stephane Fillod
* Copyright (c) 2019 by Malcolm Herring
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "idx_builtin.h"
#include "icom.h"
/*
* Specs and protocol details comes from the chapter 10 of ID-4100A_E_ENG_PU_0.pdf
*
* NB: while the port labeled "Data" is used for firmware upgrades,
* you have to use the port labeled "SP2" for rig control.
*
* TODO:
* - DV mode
* - GPS support
* - Single/dual watch (RIG_LEVEL_BALANCE)
*/
#define ID4100_MODES (RIG_MODE_FM|RIG_MODE_DSTAR)
#define ID4100_ALL_RX_MODES (RIG_MODE_AM|ID4100_MODES)
#define ID4100_VFO_ALL (RIG_VFO_MAIN|RIG_VFO_SUB)
#define ID4100_SCAN_OPS RIG_SCAN_NONE
#define ID4100_VFO_OPS RIG_OP_NONE
#define ID4100_FUNC_ALL ( \
RIG_FUNC_TONE| \
RIG_FUNC_TSQL| \
RIG_FUNC_CSQL| \
RIG_FUNC_DSQL| \
RIG_FUNC_VOX)
#define ID4100_LEVEL_ALL (RIG_LEVEL_AF| \
RIG_LEVEL_SQL| \
RIG_LEVEL_RAWSTR| \
RIG_LEVEL_RFPOWER| \
RIG_LEVEL_MICGAIN| \
RIG_LEVEL_VOXGAIN)
#define ID4100_PARM_ALL RIG_PARM_NONE
/*
* FIXME: real measurement
*/
#define ID4100_STR_CAL UNKNOWN_IC_STR_CAL
/*
*/
static const struct icom_priv_caps id4100_priv_caps =
{
0x9A, /* default address */
0, /* 731 mode */
1, /* no XCHG */
};
const struct rig_caps id4100_caps =
{
.rig_model = RIG_MODEL_ID4100,
.model_name = "ID-4100",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_RIG,
.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 = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ID4100_FUNC_ALL,
.has_set_func = ID4100_FUNC_ALL,
.has_get_level = ID4100_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ID4100_LEVEL_ALL),
.has_get_parm = ID4100_PARM_ALL,
.has_set_parm = ID4100_PARM_ALL,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = full_dcs_list,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ID4100_VFO_OPS,
.scan_ops = ID4100_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
// There's no memory support through CI-V,
// but there is a clone mode apart.
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(118), MHz(174), ID4100_ALL_RX_MODES, -1, -1, ID4100_VFO_ALL},
{MHz(375), MHz(550), ID4100_ALL_RX_MODES, -1, -1, ID4100_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(144), MHz(146), ID4100_MODES, W(5), W(25), ID4100_VFO_ALL},
{MHz(430), MHz(440), ID4100_MODES, W(5), W(25), ID4100_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{MHz(118), MHz(174), ID4100_ALL_RX_MODES, -1, -1, ID4100_VFO_ALL},
{MHz(375), MHz(550), ID4100_ALL_RX_MODES, -1, -1, ID4100_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
{MHz(144), MHz(148), ID4100_MODES, W(5), W(50), ID4100_VFO_ALL},
{MHz(430), MHz(450), ID4100_MODES, W(5), W(50), ID4100_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
// Rem: no support for changing tuning step
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_FM | RIG_MODE_AM, kHz(12)},
{RIG_MODE_FM | RIG_MODE_AM, kHz(6)},
RIG_FLT_END,
},
.str_cal = ID4100_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& id4100_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.decode_event = icom_decode_event,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_dcs_code = icom_set_dcs_code,
.get_dcs_code = icom_get_dcs_code,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_sql = icom_set_dcs_sql,
.get_dcs_sql = icom_get_dcs_sql,
};

Wyświetl plik

@ -1,210 +0,0 @@
/*
* Hamlib CI-V backend - description of ID-51 and variations
* Copyright (c) 2015 by Stephane Fillod
* Copyright (c) 2019 by Malcolm Herring
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "idx_builtin.h"
#include "icom.h"
/*
* Specs and protocol details comes from the chapter 17 of ID-51A_E_PLUS2_CD_0.pdf
* NB: while the port labeled "Data" is used for firmware upgrades,
* you have to use the port labeled "SP" for rig control.
*
*/
#define ID51_MODES (RIG_MODE_FM|RIG_MODE_DSTAR)
#define ID51_ALL_RX_MODES (RIG_MODE_AM|ID51_MODES)
#define ID51_VFO_ALL (RIG_VFO_MAIN|RIG_VFO_SUB)
#define ID51_SCAN_OPS RIG_SCAN_NONE
#define ID51_VFO_OPS RIG_OP_NONE
#define ID51_FUNC_ALL ( \
RIG_FUNC_TONE| \
RIG_FUNC_TSQL| \
RIG_FUNC_CSQL| \
RIG_FUNC_DSQL| \
RIG_FUNC_VOX)
#define ID51_LEVEL_ALL (RIG_LEVEL_AF| \
RIG_LEVEL_SQL| \
RIG_LEVEL_RAWSTR| \
RIG_LEVEL_RFPOWER| \
RIG_LEVEL_MICGAIN| \
RIG_LEVEL_VOXGAIN)
#define ID51_PARM_ALL RIG_PARM_NONE
/*
* FIXME: real measurement
*/
#define ID51_STR_CAL UNKNOWN_IC_STR_CAL
/*
*/
static const struct icom_priv_caps id51_priv_caps =
{
0x86, /* default address */
0, /* 731 mode */
1, /* no XCHG */
};
const struct rig_caps id51_caps =
{
.rig_model = RIG_MODEL_ID51,
.model_name = "ID-51",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ID51_FUNC_ALL,
.has_set_func = ID51_FUNC_ALL,
.has_get_level = ID51_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ID51_LEVEL_ALL),
.has_get_parm = ID51_PARM_ALL,
.has_set_parm = ID51_PARM_ALL,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = full_dcs_list,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ID51_VFO_OPS,
.scan_ops = ID51_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
// There's no memory support through CI-V,
// but there is a clone mode apart.
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(118), MHz(174), ID51_ALL_RX_MODES, -1, -1, ID51_VFO_ALL},
{MHz(375), MHz(550), ID51_ALL_RX_MODES, -1, -1, ID51_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(144), MHz(146), ID51_MODES, W(5), W(25), ID51_VFO_ALL},
{MHz(430), MHz(440), ID51_MODES, W(5), W(25), ID51_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{MHz(118), MHz(174), ID51_ALL_RX_MODES, -1, -1, ID51_VFO_ALL},
{MHz(375), MHz(550), ID51_ALL_RX_MODES, -1, -1, ID51_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
{MHz(144), MHz(148), ID51_MODES, W(5), W(50), ID51_VFO_ALL},
{MHz(430), MHz(450), ID51_MODES, W(5), W(50), ID51_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
// Rem: no support for changing tuning step
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_FM | RIG_MODE_AM, kHz(12)},
{RIG_MODE_FM | RIG_MODE_AM, kHz(6)},
RIG_FLT_END,
},
.str_cal = ID51_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& id51_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.decode_event = icom_decode_event,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_dcs_code = icom_set_dcs_code,
.get_dcs_code = icom_get_dcs_code,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_sql = icom_set_dcs_sql,
.get_dcs_sql = icom_get_dcs_sql,
};

Wyświetl plik

@ -1,214 +0,0 @@
/*
* Hamlib CI-V backend - description of ID-5100 and variations
* Copyright (c) 2015 by Stephane Fillod
* Copyright (c) 2019 by Malcolm Herring
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "hamlib/rig.h"
#include "idx_builtin.h"
#include "icom.h"
/*
* Specs and protocol details comes from the chapter 13 of ID-5100_Full-Inst_Manual.pdf
*
* NB: while the port labeled "Data" is used for firmware upgrades,
* you have to use the port labeled "SP2" for rig control.
*
* TODO:
* - DV mode
* - GPS support
* - Single/dual watch (RIG_LEVEL_BALANCE)
*/
#define ID5100_MODES (RIG_MODE_FM|RIG_MODE_DSTAR)
#define ID5100_ALL_RX_MODES (RIG_MODE_AM|ID5100_MODES)
#define ID5100_VFO_ALL (RIG_VFO_MAIN|RIG_VFO_SUB)
#define ID5100_SCAN_OPS RIG_SCAN_NONE
#define ID5100_VFO_OPS RIG_OP_NONE
#define ID5100_FUNC_ALL ( \
RIG_FUNC_TONE| \
RIG_FUNC_TSQL| \
RIG_FUNC_CSQL| \
RIG_FUNC_DSQL| \
RIG_FUNC_VOX)
#define ID5100_LEVEL_ALL (RIG_LEVEL_AF| \
RIG_LEVEL_SQL| \
RIG_LEVEL_RAWSTR| \
RIG_LEVEL_RFPOWER| \
RIG_LEVEL_MICGAIN| \
RIG_LEVEL_VOXGAIN)
#define ID5100_PARM_ALL RIG_PARM_NONE
/*
* FIXME: real measurement
*/
#define ID5100_STR_CAL UNKNOWN_IC_STR_CAL
/*
*/
static const struct icom_priv_caps id5100_priv_caps =
{
0x8C, /* default address */
0, /* 731 mode */
1, /* no XCHG */
};
const struct rig_caps id5100_caps =
{
.rig_model = RIG_MODEL_ID5100,
.model_name = "ID-5100",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_RIG,
.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 = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = ID5100_FUNC_ALL,
.has_set_func = ID5100_FUNC_ALL,
.has_get_level = ID5100_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(ID5100_LEVEL_ALL),
.has_get_parm = ID5100_PARM_ALL,
.has_set_parm = ID5100_PARM_ALL,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
.dcs_list = full_dcs_list,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = ID5100_VFO_OPS,
.scan_ops = ID5100_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = {
// There's no memory support through CI-V,
// but there is a clone mode apart.
RIG_CHAN_END,
},
.rx_range_list1 = {
{MHz(118), MHz(174), ID5100_ALL_RX_MODES, -1, -1, ID5100_VFO_ALL},
{MHz(375), MHz(550), ID5100_ALL_RX_MODES, -1, -1, ID5100_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = {
{MHz(144), MHz(146), ID5100_MODES, W(5), W(25), ID5100_VFO_ALL},
{MHz(430), MHz(440), ID5100_MODES, W(5), W(25), ID5100_VFO_ALL},
RIG_FRNG_END,
},
.rx_range_list2 = {
{MHz(118), MHz(174), ID5100_ALL_RX_MODES, -1, -1, ID5100_VFO_ALL},
{MHz(375), MHz(550), ID5100_ALL_RX_MODES, -1, -1, ID5100_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = {
{MHz(144), MHz(148), ID5100_MODES, W(5), W(50), ID5100_VFO_ALL},
{MHz(430), MHz(450), ID5100_MODES, W(5), W(50), ID5100_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
// Rem: no support for changing tuning step
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_FM | RIG_MODE_AM, kHz(12)},
{RIG_MODE_FM | RIG_MODE_AM, kHz(6)},
RIG_FLT_END,
},
.str_cal = ID5100_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& id5100_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = NULL,
.rig_close = NULL,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.set_powerstat = icom_set_powerstat,
.get_powerstat = icom_get_powerstat,
.decode_event = icom_decode_event,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_level = icom_set_level,
.get_level = icom_get_level,
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
.get_ctcss_tone = icom_get_ctcss_tone,
.set_dcs_code = icom_set_dcs_code,
.get_dcs_code = icom_get_dcs_code,
.set_ctcss_sql = icom_set_ctcss_sql,
.get_ctcss_sql = icom_get_ctcss_sql,
.set_dcs_sql = icom_set_dcs_sql,
.get_dcs_sql = icom_get_dcs_sql,
};

Wyświetl plik

@ -1,277 +0,0 @@
/*
* Hamlib CI-V backend - description of the TenTenc OMNI VI
* Copyright (c) 2000-2010 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/* Improvements by Martin Ewing, AA6E, 3/2008
* This backend should support either the Ten-Tec Omni VI Plus (564) or the
* Omni VI (563). Tested on an Omni VI.
*/
/* Known problems:
*
* To Do:
* Implement vfo split, FSK mode
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include <misc.h>
#define OMNIVIP_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define OMNIVIP_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
#define OMNIVIP_ALL_RX_MODES (OMNIVIP_OTHER_TX_MODES)
#define OMNIVIP_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
#define OMNIVIP_STR_CAL { 0, { } }
static int omni6_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
static int omni6_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
static int omni6_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
static const struct icom_priv_caps omnivip_priv_caps =
{
0x04, /* default address */
0, /* 731 mode */
0, /* no XCHG */
NULL /* TODO */
};
const struct rig_caps omnivip_caps =
{
.rig_model = RIG_MODEL_OMNIVIP,
.model_name = "Omni VI Plus",
.mfg_name = "Ten-Tec",
.version = "0.2",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG, // Allow program controlled PTT
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 1200,
.serial_rate_max = 19200,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE,
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {},
.parm_gran = {},
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(9980),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = OMNIVIP_VFO_OPS,
.scan_ops = RIG_SCAN_NONE,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = { { 0, 99, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
.rx_range_list1 = {
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, },
/* These limits measured on Omni VI SN 1A10473 */
.rx_range_list2 = {
{kHz(1770), kHz(2330), OMNIVIP_ALL_RX_MODES, -1, -1, OMNIVIP_VFO_ALL},
{kHz(3471), kHz(4030), OMNIVIP_ALL_RX_MODES, -1, -1, OMNIVIP_VFO_ALL},
{kHz(6821), kHz(7338), OMNIVIP_ALL_RX_MODES, -1, -1, OMNIVIP_VFO_ALL},
{kHz(9971), kHz(10530), OMNIVIP_ALL_RX_MODES, -1, -1, OMNIVIP_VFO_ALL},
{kHz(13971), kHz(14530), OMNIVIP_ALL_RX_MODES, -1, -1, OMNIVIP_VFO_ALL},
{kHz(17971), kHz(18530), OMNIVIP_ALL_RX_MODES, -1, -1, OMNIVIP_VFO_ALL},
{kHz(20971), kHz(21530), OMNIVIP_ALL_RX_MODES, -1, -1, OMNIVIP_VFO_ALL},
{kHz(24471), kHz(25030), OMNIVIP_ALL_RX_MODES, -1, -1, OMNIVIP_VFO_ALL},
{kHz(27971), kHz(30030), OMNIVIP_ALL_RX_MODES, -1, -1, OMNIVIP_VFO_ALL},
RIG_FRNG_END,
},
/* Note: There is no AM mode. */
.tx_range_list2 = {
{kHz(1800), MHz(2) - 1, OMNIVIP_OTHER_TX_MODES, 5000, 100000, OMNIVIP_VFO_ALL},
{kHz(3500), MHz(4) - 1, OMNIVIP_OTHER_TX_MODES, 5000, 100000, OMNIVIP_VFO_ALL},
{MHz(7), kHz(7300), OMNIVIP_OTHER_TX_MODES, 5000, 100000, OMNIVIP_VFO_ALL},
{kHz(10100), kHz(10150), OMNIVIP_OTHER_TX_MODES, 5000, 100000, OMNIVIP_VFO_ALL},
{MHz(14), kHz(14350), OMNIVIP_OTHER_TX_MODES, 5000, 100000, OMNIVIP_VFO_ALL},
{kHz(18068), kHz(18168), OMNIVIP_OTHER_TX_MODES, 5000, 100000, OMNIVIP_VFO_ALL},
{MHz(21), kHz(21450), OMNIVIP_OTHER_TX_MODES, 5000, 100000, OMNIVIP_VFO_ALL},
{kHz(24890), kHz(24990), OMNIVIP_OTHER_TX_MODES, 5000, 100000, OMNIVIP_VFO_ALL},
{MHz(28), kHz(29700), OMNIVIP_OTHER_TX_MODES, 5000, 100000, OMNIVIP_VFO_ALL},
RIG_FRNG_END,
},
.tuning_steps = {
{OMNIVIP_ALL_RX_MODES, Hz(10)}, // This radio has 10 Hz steps.
RIG_TS_END,
},
/* mode/filter list, remember: order matters!
* Possible XTAL filters: 2.4, 1.8, 0.5, 0.25 kHz - may not all be
* present. FM filter is 15 kHz.
* We are not supporting the 'FSK' (RTTY) mode at this time.
*/
.filters = {
{RIG_MODE_SSB | RIG_MODE_CW, kHz(2.4)},
{RIG_MODE_FM, kHz(15)},
RIG_FLT_END,
},
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& omnivip_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo, // icom.c has no get_vfo
.set_rit = omni6_set_rit,
.get_rit = omni6_get_rit, // icom.c has no get_rit
.set_xit = omni6_set_rit, // xit=rit for this rig
.get_xit = omni6_get_rit, // (front panel controlled)
.set_ptt = omni6_set_ptt,
.decode_event = icom_decode_event,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
};
/*
* omni6_set_ptt based on icom_set_ptt
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int omni6_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
int retval, sc;
sc = ptt == RIG_PTT_ON ? 0x1 : 0x2;
/*
* Ignore ACK/NAK on this command, because in CW mode, the Omni VI
* does not send an ACK.
*/
retval = icom_transaction(rig, C_OMNI6_XMT, sc, NULL, 0, NULL, NULL);
if (retval != RIG_OK)
{
return retval;
}
return RIG_OK;
}
/*
* These 'rit' commands actually deal with an offset frequency. The operator
* must select rit on/off or xit on/off manually to apply this offset.
* Omni VI's rit uses 9's complement for negative freq, and freqs are in units
* of 10 Hz. on the Omni.
* Note that Omni VI rejects rit > 9980, but takes rit >= -9990. So the
* rit limit should be +/- 9.98 kHz.
*/
int omni6_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
{
unsigned char freqbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
int freq_len, ack_len = sizeof(ackbuf), retval;
shortfreq_t rit10;
rit10 = rit / 10; // 10 Hz resolution for Omni
if (rit10 < 0) { rit10 += 10000L; } // 9's compl.
freq_len = 2;
to_bcd(freqbuf, rit10, 2 * freq_len);
retval = icom_transaction(rig, C_SET_OFFS, -1, freqbuf, freq_len,
ackbuf, &ack_len);
if (retval != RIG_OK)
{
return retval;
}
if (ack_len != 1 || ackbuf[0] != ACK)
{
rig_debug(RIG_DEBUG_ERR, "omni6_set_rit: ack NG (%#.2x), "
"len=%d\n", ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
return RIG_OK;
}
/*
* Note: icom.c does not provide a get_rit method. It would have been
* wrong for the Omni VI, anyway, so we implement it here.
*/
int omni6_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
{
unsigned char buffer[MAXFRAMELEN];
int buffer_len, retval;
shortfreq_t my_rit;
retval = icom_transaction(rig, C_RD_OFFS, -1, NULL, 0,
buffer, & buffer_len);
if (retval != RIG_OK)
{
return retval;
}
if (buffer_len != 3)
{
rig_debug(RIG_DEBUG_ERR, "omni6_get_rit: wrong length response (%d)\n",
buffer_len);
return -RIG_ERJCTED;
}
my_rit = 10 * from_bcd(buffer, 2 * buffer_len);
if (my_rit > 10000L) { my_rit -= 100000L; } // 9's compl for negatives
*rit = my_rit;
return RIG_OK;
}

Wyświetl plik

@ -1,837 +0,0 @@
/*
* Hamlib CI-V backend - OptoScan extensions
* Copyright (c) 2000-2005 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <unistd.h> /* UNIX standard function definitions */
#include <math.h>
#include "hamlib/rig.h"
#include "serial.h"
#include "misc.h"
#include "cal.h"
#include "token.h"
#include "icom.h"
#include "icom_defs.h"
#include "frame.h"
#include "optoscan.h"
const struct confparams opto_ext_parms[] =
{
{ TOK_TAPECNTL, "tapecntl", "Toggle Tape Switch", "Toggles built in tape switch", 0, RIG_CONF_CHECKBUTTON, {} },
{ TOK_5KHZWIN, "5khzwin", "Toggle 5kHz Search Window", "Toggles 5kHz search window", 0, RIG_CONF_CHECKBUTTON, {} },
{ TOK_SPEAKER, "speaker", "Toggle speaker audio", "Toggles speaker audio", 0, RIG_CONF_CHECKBUTTON, {} },
{ TOK_AUDIO, "audio", "Audio present", "Audio present", NULL, RIG_CONF_CHECKBUTTON, {} },
{ TOK_DTMFPEND, "dtmfpend", "DTMF Digit Pending", "DTMF Digit Pending", NULL, RIG_CONF_CHECKBUTTON, {} },
{ TOK_DTMFOVRR, "dtmfovrr", "DTMF Buffer Overflow", "DTMF Buffer Overflow", NULL, RIG_CONF_CHECKBUTTON, {} },
{ TOK_CTCSSACT, "ctcssact", "CTCSS Tone Active", "CTCSS Tone Active", NULL, RIG_CONF_CHECKBUTTON, {} },
{ TOK_DCSACT, "dcsact", "DCS Code Active", "DCS Code Active", NULL, RIG_CONF_CHECKBUTTON, {} },
{ RIG_CONF_END, NULL, }
};
static int optoscan_get_status_block(RIG *rig, struct optostat *status_block);
static int optoscan_send_freq(RIG *rig, pltstate_t *state);
static int optoscan_RTS_toggle(RIG *rig);
static int optoscan_start_timer(RIG *rig, pltstate_t *state);
static int optoscan_wait_timer(RIG *rig, pltstate_t *state);
/*
* optoscan_open
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int optoscan_open(RIG *rig)
{
struct icom_priv_data *priv;
struct rig_state *rs;
pltstate_t *pltstate;
unsigned char ackbuf[16];
int ack_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data *)rs->priv;
pltstate = malloc(sizeof(pltstate_t));
if (!pltstate)
{
return -RIG_ENOMEM;
}
memset(pltstate, 0, sizeof(pltstate_t));
priv->pltstate = pltstate;
/* select REMOTE control */
retval = icom_transaction(rig, C_CTL_MISC, S_OPTO_REMOTE,
NULL, 0, ackbuf, &ack_len);
if (retval != RIG_OK)
{
free(pltstate);
return retval;
}
if (ack_len != 1 || ackbuf[0] != ACK)
{
rig_debug(RIG_DEBUG_ERR, "optoscan_open: ack NG (%#.2x), "
"len=%d\n", ackbuf[0], ack_len);
free(pltstate);
return -RIG_ERJCTED;
}
return RIG_OK;
}
/*
* optoscan_close
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int optoscan_close(RIG *rig)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char ackbuf[16];
int ack_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data *)rs->priv;
/* select LOCAL control */
retval = icom_transaction(rig, C_CTL_MISC, S_OPTO_LOCAL,
NULL, 0, ackbuf, &ack_len);
if (retval != RIG_OK)
{
return retval;
}
if (ack_len != 1 || ackbuf[0] != ACK)
{
rig_debug(RIG_DEBUG_ERR, "optoscan_close: ack NG (%#.2x), "
"len=%d\n", ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
free(priv->pltstate);
return RIG_OK;
}
/*
* optoscan_get_info
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
const char *optoscan_get_info(RIG *rig)
{
unsigned char ackbuf[16];
int ack_len, retval;
static char info[64];
/* select LOCAL control */
retval = icom_transaction(rig, C_CTL_MISC, S_OPTO_RDID,
NULL, 0, ackbuf, &ack_len);
if (retval != RIG_OK)
{
return NULL;
}
if (ack_len != 7)
{
rig_debug(RIG_DEBUG_ERR, "optoscan_get_info: ack NG (%#.2x), "
"len=%d\n", ackbuf[0], ack_len);
return NULL;
}
sprintf(info, "OptoScan%c%c%c, software version %d.%d, "
"interface version %d.%d\n",
ackbuf[2], ackbuf[3], ackbuf[4],
ackbuf[5] >> 4, ackbuf[5] & 0xf,
ackbuf[6] >> 4, ackbuf[6] & 0xf);
return info;
}
/*
* optoscan_get_ctcss_tone
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int optoscan_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
{
unsigned char tonebuf[MAXFRAMELEN];
int tone_len, retval;
retval = icom_transaction(rig, C_CTL_MISC, S_OPTO_RDCTCSS, NULL, 0,
tonebuf, &tone_len);
if (retval != RIG_OK)
{
return retval;
}
if (tone_len != 4)
{
rig_debug(RIG_DEBUG_ERR, "optoscan_get_ctcss_tone: ack NG (%#.2x), "
"len=%d\n", tonebuf[0], tone_len);
return -RIG_ERJCTED;
}
tone_len -= 2;
*tone = from_bcd_be(tonebuf + 2, tone_len * 2);
rig_debug(RIG_DEBUG_ERR, "optoscan_get_ctcss_tone: *tone=%d\n", *tone);
return RIG_OK;
}
/*
* optoscan_get_dcs_code
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int optoscan_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code)
{
unsigned char tonebuf[MAXFRAMELEN];
int tone_len, retval;
retval = icom_transaction(rig, C_CTL_MISC, S_OPTO_RDDCS, NULL, 0,
tonebuf, &tone_len);
if (retval != RIG_OK)
{
return retval;
}
if (tone_len != 4)
{
rig_debug(RIG_DEBUG_ERR, "optoscan_get_dcs_code: ack NG (%#.2x), "
"len=%d\n", tonebuf[0], tone_len);
return -RIG_ERJCTED;
}
tone_len -= 2;
*code = from_bcd_be(tonebuf + 2, tone_len * 2);
rig_debug(RIG_DEBUG_ERR, "optoscan_get_dcs_code: *code=%d\n", *code);
return RIG_OK;
}
int optoscan_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
{
unsigned char dtmfbuf[MAXFRAMELEN], digit;
int len, digitpos;
unsigned char xlate[] = {'0', '1', '2', '3', '4', '5', '6',
'7', '8', '9', 'A', 'B', 'C', 'D',
'*', '#'
};
digitpos = 0;
do
{
int retval = icom_transaction(rig, C_CTL_MISC, S_OPTO_RDDTMF,
NULL, 0, dtmfbuf, &len);
if (retval != RIG_OK)
{
return retval;
}
if (len != 3)
{
rig_debug(RIG_DEBUG_ERR, "optoscan_recv_dtmf: ack NG (%#.2x), len=%d\n",
dtmfbuf[0], len);
return -RIG_ERJCTED;
}
digit = dtmfbuf[2];
if (digit < 16)
{
digits[digitpos] = xlate[digit];
digitpos++;
}
}
while ((digit != 0x99) && (digitpos < *length));
*length = digitpos;
digits[digitpos] = 0;
if (*length > 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: %d digits - %s\n", __func__, *length, digits);
}
else
{
rig_debug(RIG_DEBUG_ERR, "%s: no digits to read.\n", __func__);
}
return RIG_OK;
}
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int optoscan_set_ext_parm(RIG *rig, token_t token, value_t val)
{
unsigned char epbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
int ack_len;
int retval, subcode;
memset(epbuf, 0, MAXFRAMELEN);
memset(ackbuf, 0, MAXFRAMELEN);
switch (token)
{
case TOK_TAPECNTL:
if (val.i == 0)
{
subcode = S_OPTO_TAPE_OFF;
}
else
{
subcode = S_OPTO_TAPE_ON;
}
break;
case TOK_5KHZWIN:
if (val.i == 0)
{
subcode = S_OPTO_5KSCOFF;
}
else
{
subcode = S_OPTO_5KSCON;
}
break;
case TOK_SPEAKER:
if (val.i == 0)
{
subcode = S_OPTO_SPKROFF;
}
else
{
subcode = S_OPTO_SPKRON;
}
break;
default:
return -RIG_EINVAL;
}
retval = icom_transaction(rig, C_CTL_MISC, subcode, epbuf, 0,
ackbuf, &ack_len);
if (retval != RIG_OK)
{
return retval;
}
if (ack_len != 1 || ackbuf[0] != ACK)
{
rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), "
"len=%d\n", __func__, ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
return RIG_OK;
}
/*
* Assumes rig!=NULL, rig->state.priv!=NULL
* and val points to a buffer big enough to hold the conf value.
*/
int optoscan_get_ext_parm(RIG *rig, token_t token, value_t *val)
{
struct optostat status_block;
int retval;
retval = optoscan_get_status_block(rig, &status_block);
if (retval != RIG_OK)
{
return retval;
}
switch (token)
{
case TOK_TAPECNTL:
val->i = status_block.tape_enabled;
break;
case TOK_5KHZWIN:
val->i = status_block.fivekhz_enabled;
break;
case TOK_SPEAKER:
val->i = status_block.speaker_enabled;
break;
case TOK_AUDIO:
val->i = status_block.audio_present;
break;
case TOK_DTMFPEND:
val->i = status_block.DTMF_pending;
break;
case TOK_DTMFOVRR:
val->i = status_block.DTMF_overrun;
break;
case TOK_CTCSSACT:
val->i = status_block.CTCSS_active;
break;
case TOK_DCSACT:
val->i = status_block.DCS_active;
break;
default:
return -RIG_ENIMPL;
}
return RIG_OK;
}
/*
* optoscan_set_level
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int optoscan_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char lvlbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
int ack_len;
int lvl_cn, lvl_sc; /* Command Number, Subcommand */
int icom_val;
int retval;
memset(lvlbuf, 0, MAXFRAMELEN);
/*
* So far, levels of float type are in [0.0..1.0] range
*/
if (RIG_LEVEL_IS_FLOAT(level))
{
icom_val = val.f * 255;
}
else
{
icom_val = val.i;
}
switch (level)
{
case RIG_LEVEL_AF:
lvl_cn = C_CTL_MISC;
if (icom_val == 0)
{
lvl_sc = S_OPTO_SPKROFF;
}
else
{
lvl_sc = S_OPTO_SPKRON;
}
break;
default:
rig_debug(RIG_DEBUG_ERR, "Unsupported set_level %s", rig_strlevel(level));
return -RIG_EINVAL;
}
retval = icom_transaction(rig, lvl_cn, lvl_sc, lvlbuf, 0,
ackbuf, &ack_len);
if (retval != RIG_OK)
{
return retval;
}
if (ack_len != 1 || ackbuf[0] != ACK)
{
rig_debug(RIG_DEBUG_ERR, "optoscan_set_level: ack NG (%#.2x), "
"len=%d\n", ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
return RIG_OK;
}
/*
* optoscan_get_level
* Assumes rig!=NULL, rig->state.priv!=NULL, val!=NULL
*/
int optoscan_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
struct optostat status_block;
int lvl_len = 0;
int icom_val;
int retval;
if (level != RIG_LEVEL_AF)
{
int lvl_cn, lvl_sc; /* Command Number, Subcommand */
unsigned char lvlbuf[MAXFRAMELEN];
int cmdhead;
switch (level)
{
case RIG_LEVEL_RAWSTR:
lvl_cn = C_RD_SQSM;
lvl_sc = S_SML;
break;
default:
rig_debug(RIG_DEBUG_ERR, "Unsupported get_level %s", rig_strlevel(level));
return -RIG_EINVAL;
}
retval = icom_transaction(rig, lvl_cn, lvl_sc, NULL, 0,
lvlbuf, &lvl_len);
if (retval != RIG_OK)
{
return retval;
}
/*
* strbuf should contain Cn,Sc,Data area
*/
cmdhead = (lvl_sc == -1) ? 1 : 2;
lvl_len -= cmdhead;
if (lvlbuf[0] != ACK && lvlbuf[0] != lvl_cn)
{
rig_debug(RIG_DEBUG_ERR, "optoscan_get_level: ack NG (%#.2x), "
"len=%d\n", lvlbuf[0], lvl_len);
return -RIG_ERJCTED;
}
/*
* The result is a 3 digit BCD, but in *big endian* order: 0000..0255
* (from_bcd is little endian)
*/
icom_val = from_bcd_be(lvlbuf + cmdhead, lvl_len * 2);
}
else /* level == RIG_LEVEL_AF */
{
retval = optoscan_get_status_block(rig, &status_block);
if (retval != RIG_OK)
{
return retval;
}
icom_val = 0;
if (status_block.speaker_enabled == 1)
{
icom_val = 255;
}
}
switch (level)
{
case RIG_LEVEL_RAWSTR:
val->i = icom_val;
break;
default:
if (RIG_LEVEL_IS_FLOAT(level))
{
val->f = (float)icom_val / 255;
}
else
{
val->i = icom_val;
}
}
rig_debug(RIG_DEBUG_TRACE, "optoscan_get_level: %d %d %d %f\n", lvl_len,
icom_val, val->i, val->f);
return RIG_OK;
}
/* OS456 Pipeline tuning algorithm:
* Step 2: Send the next frequency and mode to the receiver using the
* TRANSFER NEXT FREQUENCY/MODE command.
*
* Step 3: Change the state of the RTS interface signal to cause the
* next frequency and mode to become the current frequency and
* mode, and the receiver to begin settling.
*
* Step 4: While the receiver is still settling on the current
* frequency and mode, send the next frequency and mode to the
* receiver using the TRANSFER NEXT FREQUENCY/MODE command.
*
* Step 5: Wait for the receiver to finish settling. The total
* settling time, including sending the next frequency and
* mode, is 20 milliseconds (0.02 seconds).
*
* Step 6: Check the squelch status by reading the DCD interface
* signal. If the squelch is open, scanning is stopped.
* Otherwise, scanning continues. Optionally, the status of
* the CTCSS/DCS/DTMF decoder can be checked, and the
* appropriate action taken.
*
* Step 7: Continuously repeat steps 3 through 6 above.
*/
int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
{
pltstate_t *state;
pltune_cb_t cb;
int rc, pin_state;
struct rig_state *rs;
if (scan != RIG_SCAN_PLT)
{
return -RIG_ENAVAIL;
}
rs = &rig->state;
cb = rig->callbacks.pltune;
state = ((struct icom_priv_data *)rs->priv)->pltstate;
if (state == NULL)
{
return -RIG_EINTERNAL;
}
if (state->freq == 0) /* pltstate_t is not initialized - perform setup */
{
/* time for CIV command to be sent. this is subtracted from */
/* rcvr settle time */
state->usleep_time = (1000000 / (rig->state.rigport.parm.serial.rate))
* 13 * 9;
rc = cb(rig, vfo, &(state->next_freq), &(state->next_mode),
&(state->next_width), rig->callbacks.pltune_arg);
if (rc == RIG_SCAN_STOP)
{
return RIG_OK; /* callback halted loop */
}
/* Step 1 is implicit, since hamlib does this when it opens the device */
optoscan_send_freq(rig, state); /*Step 2*/
}
rc = !RIG_SCAN_STOP;
while (rc != RIG_SCAN_STOP)
{
optoscan_RTS_toggle(rig); /*Step 3*/
state->freq = state->next_freq;
state->mode = state->next_mode;
optoscan_start_timer(rig, state);
rc = cb(rig, vfo, &(state->next_freq), &(state->next_mode),
&(state->next_width), rig->callbacks.pltune_arg);
if (rc != RIG_SCAN_STOP)
{
optoscan_send_freq(rig, state); /*Step 4*/
}
optoscan_wait_timer(rig, state); /*Step 5*/
ser_get_car(&rs->rigport, &pin_state);
if (pin_state) /*Step 6*/
{
return RIG_OK; /* we've broken squelch - return(). caller can */
/* get current freq & mode out of state str */
}
}
/* exiting pipeline loop - force state init on next call */
state->freq = 0;
return RIG_OK;
}
/*
* Assumes rig!=NULL, status_block !=NULL
*/
static int optoscan_get_status_block(RIG *rig, struct optostat *status_block)
{
int retval, ack_len, expected_len;
unsigned char ackbuf[MAXFRAMELEN];
memset(status_block, 0, sizeof(struct optostat));
retval = icom_transaction(rig, C_CTL_MISC, S_OPTO_RDSTAT, NULL, 0,
ackbuf, &ack_len);
if (retval != RIG_OK)
{
return retval;
}
switch (rig->caps->rig_model)
{
case RIG_MODEL_OS456:
expected_len = 4;
break;
case RIG_MODEL_OS535:
expected_len = 5;
break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: unknown rig model", __func__);
return -RIG_ERJCTED;
break;
}
if (ack_len != expected_len)
{
rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__,
ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
if (ackbuf[2] & 1) { status_block->remote_control = 1; }
if (ackbuf[2] & 2) { status_block->DTMF_pending = 1; }
if (ackbuf[2] & 4) { status_block->DTMF_overrun = 1; }
if (ackbuf[2] & 16) { status_block->squelch_open = 1; }
if (ackbuf[2] & 32) { status_block->CTCSS_active = 1; }
if (ackbuf[2] & 64) { status_block->DCS_active = 1; }
if (ackbuf[3] & 1) { status_block->tape_enabled = 1; }
if (ackbuf[3] & 2) { status_block->speaker_enabled = 1; }
if (ackbuf[3] & 4) { status_block->fivekhz_enabled = 1; }
if (ackbuf[3] & 16) { status_block->audio_present = 1; }
rig_debug(RIG_DEBUG_VERBOSE, "remote_control = %d\n",
status_block->remote_control);
rig_debug(RIG_DEBUG_VERBOSE, "DTMF_pending = %d\n",
status_block->DTMF_pending);
rig_debug(RIG_DEBUG_VERBOSE, "DTMF_overrun = %d\n",
status_block->DTMF_overrun);
rig_debug(RIG_DEBUG_VERBOSE, "squelch_open = %d\n",
status_block->squelch_open);
rig_debug(RIG_DEBUG_VERBOSE, "CTCSS_active = %d\n",
status_block->CTCSS_active);
rig_debug(RIG_DEBUG_VERBOSE, "DCS_active = %d\n",
status_block->DCS_active);
rig_debug(RIG_DEBUG_VERBOSE, "tape_enabled = %d\n",
status_block->tape_enabled);
rig_debug(RIG_DEBUG_VERBOSE, "speaker_enabled = %d\n",
status_block->speaker_enabled);
rig_debug(RIG_DEBUG_VERBOSE, "fivekhz_enabled = %d\n",
status_block->fivekhz_enabled);
rig_debug(RIG_DEBUG_VERBOSE, "audio_present = %d\n",
status_block->audio_present);
return RIG_OK;
}
static int optoscan_send_freq(RIG *rig, pltstate_t *state)
{
unsigned char buff[OPTO_BUFF_SIZE];
char md, pd;
freq_t freq;
rmode_t mode;
freq = state->next_freq;
mode = state->next_mode;
memset(buff, 0, OPTO_BUFF_SIZE);
to_bcd(buff, freq, 5 * 2); /* to_bcd requires nibble len */
rig2icom_mode(rig, mode, 0, (unsigned char *) &md, (signed char *) &pd);
buff[5] = md;
/* read echo'd chars only...there will be no ACK from this command
*
* Note:
* It may have waited fro pltstate->usleep_time before reading the echo'd
* chars, but the read will be blocking anyway. --SF
* */
return icom_transaction(rig, C_CTL_MISC, S_OPTO_NXT, buff, 6, NULL, NULL);
}
static int optoscan_RTS_toggle(RIG *rig)
{
struct rig_state *rs;
int state = 0;
rs = &rig->state;
ser_get_rts(&rs->rigport, &state);
ser_set_rts(&rs->rigport, !state);
return RIG_OK;
}
static int optoscan_start_timer(RIG *rig, pltstate_t *state)
{
gettimeofday(&(state->timer_start), NULL);
return RIG_OK;
}
static int optoscan_wait_timer(RIG *rig, pltstate_t *state)
{
struct icom_priv_caps *priv_caps;
int usec_diff;
int settle_usec;
priv_caps = (struct icom_priv_caps *)rig->caps->priv;
settle_usec = priv_caps->settle_time * 1000; /*convert settle time (ms) to */
/* settle time (usec) */
gettimeofday(&(state->timer_current), NULL);
usec_diff = (int)labs((state->timer_current.tv_usec) -
(state->timer_start.tv_usec));
if (usec_diff < settle_usec)
{
hl_usleep(settle_usec - usec_diff); /* sleep balance of settle_time */
}
return RIG_OK;
}

Wyświetl plik

@ -1,65 +0,0 @@
/*
* Hamlib CI-V backend - main header
* Copyright (c) 2000-2003 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _OPTOSCAN_H
#define _OPTOSCAN_H 1
#include <hamlib/rig.h>
#include <cal.h>
#include <tones.h>
#define TOK_TAPECNTL TOKEN_BACKEND(1)
#define TOK_5KHZWIN TOKEN_BACKEND(2)
#define TOK_SPEAKER TOKEN_BACKEND(3)
#define TOK_AUDIO TOKEN_BACKEND(4)
#define TOK_DTMFPEND TOKEN_BACKEND(5)
#define TOK_DTMFOVRR TOKEN_BACKEND(6)
#define TOK_CTCSSACT TOKEN_BACKEND(7)
#define TOK_DCSACT TOKEN_BACKEND(8)
#define OPTO_BUFF_SIZE 64
int optoscan_open(RIG *rig);
int optoscan_close(RIG *rig);
const char* optoscan_get_info(RIG *rig);
int optoscan_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone);
int optoscan_get_dcs_code(RIG * rig, vfo_t vfo, tone_t *code);
int optoscan_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length);
int optoscan_set_ext_parm(RIG *rig, token_t token, value_t val);
int optoscan_get_ext_parm(RIG *rig, token_t token, value_t *val);
int optoscan_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int optoscan_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);
struct optostat {
int remote_control;
int DTMF_pending;
int DTMF_overrun;
int squelch_open;
int CTCSS_active;
int DCS_active;
int tape_enabled;
int speaker_enabled;
int fivekhz_enabled;
int audio_present;
};
#endif /* _OPTOSCAN_H */

Wyświetl plik

@ -1,189 +0,0 @@
/*
* Hamlib CI-V backend - description of the OptoScan456
* Copyright (c) 2000-2004 by Stephane Fillod and Michael Smith
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/*
* This backend is currently being maintained by Michael Smith, KE4RJQ.
* Email: james (dot) m (dot) smith (at) earthlink (dot) net
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <hamlib/rig.h>
#include "idx_builtin.h"
#include "icom.h"
#include "tones.h"
#include "token.h"
#include "optoscan.h"
extern struct confparams opto_ext_parms[];
#define OS456_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM)
#define OS456_VFO_ALL (RIG_VFO_A)
#define OS456_LEVELS (RIG_LEVEL_RAWSTR|RIG_LEVEL_AF)
#define OS456_SCAN_OPS (RIG_SCAN_PLT)
/*
* The signal strength data is in the form of two bytes, each consisting
* of two BCD digits. The signal strength is reported in units of absolute
* dBm as measured at the antenna connector. The reported signal strength
* ranges from a maximum signal of 0 dBm to a minimum signal of - 125 dBm.
* A minus sign is implied.
*/
#define OS456_STR_CAL { 2, { \
{ 0, 60 }, \
{ 125, -60 }, \
} } /* TBC */
/*
* The OptoScan is not actually a rig. This is an add-in circuit board
* for the Realistic PRO-2006 and PRO-2005 Scanning VHF-UHF Receivers.
* http://www.optoelectronics.com/tech/pdf/os535/os535_ci5_spec_v10.pdf
*
* TODO: srch_dcs, srch_ctcss, rcv_dtmf, and make icom_probe opto aware
*/
static const struct icom_priv_caps os456_priv_caps =
{
0x80, /* default address */
0, /* 731 mode */
0, /* no XCHG */
NULL,
.settle_time = 20,
};
const struct rig_caps os456_caps =
{
.rig_model = RIG_MODEL_OS456,
.model_name = "OptoScan456",
.mfg_name = "Optoelectronics",
.version = "0.3",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_SCANNER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_SERIAL_CAR,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300,
.serial_rate_max = 38400,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE,
.has_get_level = OS456_LEVELS,
.has_set_level = RIG_LEVEL_AF,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = full_ctcss_list,
.dcs_list = full_dcs_list,
.preamp = { RIG_DBLST_END, },
.attenuator = { RIG_DBLST_END, },
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = RIG_OP_NONE,
.scan_ops = OS456_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_list = { RIG_CHAN_END, },
.rx_range_list1 = {
{ MHz(25), MHz(520), OS456_MODES, -1, -1, OS456_VFO_ALL},
{ MHz(760), MHz(1300), OS456_MODES, -1, -1, OS456_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list1 = { RIG_FRNG_END, }, /* this is a scanner */
.rx_range_list2 = {
{ MHz(25), MHz(520), OS456_MODES, -1, -1, OS456_VFO_ALL},
{ MHz(760), MHz(823.995), OS456_MODES, -1, -1, OS456_VFO_ALL},
{ MHz(849), MHz(868.995), OS456_MODES, -1, -1, OS456_VFO_ALL},
{ MHz(894), MHz(1300), OS456_MODES, -1, -1, OS456_VFO_ALL},
RIG_FRNG_END,
},
.tx_range_list2 = { RIG_FRNG_END, }, /* this is a scanner */
.tuning_steps = {
{OS456_MODES, kHz(5)},
{OS456_MODES, kHz(12.5)},
{OS456_MODES, kHz(50)},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
.filters = {
{RIG_MODE_AM | RIG_MODE_FM | RIG_MODE_WFM, kHz(15)}, /* TBC */
RIG_FLT_END,
},
.str_cal = OS456_STR_CAL,
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
.priv = (void *)& os456_priv_caps,
.rig_init = icom_init,
.rig_cleanup = icom_cleanup,
.rig_open = optoscan_open,
.rig_close = optoscan_close,
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
.set_mode = icom_set_mode,
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
.get_dcd = icom_get_dcd,
.decode_event = icom_decode_event,
.get_info = optoscan_get_info,
.get_ctcss_tone = optoscan_get_ctcss_tone,
.get_dcs_code = optoscan_get_dcs_code,
.recv_dtmf = optoscan_recv_dtmf,
.extparms = opto_ext_parms,
.set_ext_parm = optoscan_set_ext_parm,
.get_ext_parm = optoscan_get_ext_parm,
.set_level = optoscan_set_level,
.get_level = optoscan_get_level,
.scan = optoscan_scan,
};

Some files were not shown because too many files have changed in this diff Show More