pull/71/head
Malcolm Herring 2018-12-21 07:07:41 +00:00
rodzic 4e8ba3d6f3
commit 31cc85bf57
9 zmienionych plików z 203 dodań i 3 usunięć

Wyświetl plik

@ -4,7 +4,7 @@ ICOMSRC = ic706.c icr8500.c ic735.c ic775.c ic756.c \
os535.c os456.c omni.c delta2.c ic92d.c \
ic736.c ic738.c ic7410.c ic746.c ic703.c ic726.c ic271.c \
ic765.c ic781.c ic471.c icr9000.c icr9500.c \
icr10.c icr20.c icr6.c icr71.c icr72.c icr75.c icrx7.c icr8600.c \
icr10.c icr20.c icr30.c icr6.c icr71.c icr72.c icr75.c icrx7.c icr8600.c \
id1.c id5100.c perseus.c ic2730.c \
ic707.c ic728.c ic751.c ic761.c \
ic78.c ic7800.c ic785x.c \

Wyświetl plik

@ -326,6 +326,7 @@ int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
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;
@ -335,6 +336,12 @@ int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
case RIG_MODE_RTTYR: icmode = S_RTTYR; break;
case RIG_MODE_FM: icmode = S_FM; 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;
default:
rig_debug(RIG_DEBUG_ERR,"icom: Unsupported Hamlib mode %d\n",mode);
return -RIG_EINVAL;

Wyświetl plik

@ -379,6 +379,7 @@ static const struct icom_addr icom_addr_list[] = {
{ RIG_MODEL_PERSEUS, 0xE1 },
{ RIG_MODEL_X108G, 0x70 },
{ RIG_MODEL_ICR8600, 0x96 },
{ RIG_MODEL_ICR30, 0x9c },
{ RIG_MODEL_NONE, 0 },
};
@ -742,7 +743,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
unsigned char icmode;
signed char icmode_ext;
int ack_len=sizeof(ackbuf), retval, err;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
@ -3930,6 +3931,7 @@ DECLARE_INITRIG_BACKEND(icom)
rig_register(&icr6_caps);
rig_register(&icr10_caps);
rig_register(&icr20_caps);
rig_register(&icr30_caps);
rig_register(&icr71_caps);
rig_register(&icr72_caps);
rig_register(&icr75_caps);

Wyświetl plik

@ -282,5 +282,6 @@ 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

@ -106,6 +106,7 @@
#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 */
@ -115,6 +116,14 @@
#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_R7000_SSB 0x05 /* Set to SSB on R-7000 */

172
icom/icr30.c 100644
Wyświetl plik

@ -0,0 +1,172 @@
/*
* 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"
#define ICR30_MODES (RIG_MODE_LSB|RIG_MODE_USB|RIG_MODE_AM|RIG_MODE_AMN|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 ICR30_FUNC_ALL (RIG_FUNC_TSQL|RIG_FUNC_VSC)
#define ICR30_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_AF|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH)
#define ICR30_VFO_ALL (RIG_VFO_A)
#define ICR30_VFO_OPS (RIG_OP_NONE)
#define ICR30_SCAN_OPS (RIG_SCAN_NONE)
#define ICR30_STR_CAL { 2, \
{ \
{ 0, -60 }, /* S0 */ \
{ 255, 60 } /* +60 */ \
} }
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 */
};
const struct rig_caps icr30_caps = {
.rig_model = RIG_MODEL_ICR30,
.model_name = "IC-R30",
.mfg_name = "Icom",
.version = BACKEND_VER,
.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 = 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 = 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(5000)},
{ICR30_MODES,Hz(6250)},
{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)},
/* Air band only */
{ICR30_MODES,Hz(8330)},
/* AM broadcast band only */
{ICR30_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 = 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 = 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_code = icom_set_dcs_code,
.get_dcs_code = icom_get_dcs_code,
};

Wyświetl plik

@ -875,6 +875,7 @@ typedef enum {
RIG_MODE_NXDNVN = (1 << 26), /*!< \c NXDN-VN -- VHF,UHF digital mode IC-R8600 */
RIG_MODE_NXDN_N = (1 << 27), /*!< \c NXDN-N -- VHF,UHF digital mode IC-R8600 */
RIG_MODE_DCR = (1 << 28), /*!< \c DCR -- VHF,UHF digital mode IC-R8600 */
RIG_MODE_AMN = (1 << 29), /*!< \c AM-N -- Narrow band AM mode IC-R30 */
RIG_MODE_TESTS_MAX /*!< \c MUST ALWAYS BE LAST, Max Count for dumpcaps.c */
} rmode_t;

Wyświetl plik

@ -231,7 +231,8 @@
#define RIG_MODEL_ICR6 RIG_MAKE_MODEL(RIG_ICOM, 77)
#define RIG_MODEL_IC7610 RIG_MAKE_MODEL(RIG_ICOM, 78)
#define RIG_MODEL_ICR8600 RIG_MAKE_MODEL(RIG_ICOM, 79)
/* next one is 80 */
#define RIG_MODEL_ICR30 RIG_MAKE_MODEL(RIG_ICOM, 80)
/* next one is 81 */
/*

Wyświetl plik

@ -334,6 +334,13 @@ static struct
{ RIG_MODE_SAL, "SAL" },
{ RIG_MODE_SAH, "SAH" },
{ RIG_MODE_DSB, "DSB"},
{ RIG_MODE_AMN, "AM-N"},
{ RIG_MODE_P25, "P25"},
{ RIG_MODE_DSTAR, "D-STAR"},
{ RIG_MODE_DPMR, "dPMR"},
{ RIG_MODE_NXDNVN, "NXDN-VN"},
{ RIG_MODE_NXDN_N, "NXDN-N"},
{ RIG_MODE_DCR, "DCR"},
{ RIG_MODE_NONE, "" },
};