2001-10-18 20:42:25 +00:00
|
|
|
/*
|
|
|
|
* Hamlib Kenwood backend - TH-D7 description
|
2010-09-07 21:11:13 +00:00
|
|
|
* Copyright (c) 2000-2010 by Stephane Fillod
|
2001-10-18 20:42:25 +00:00
|
|
|
*
|
|
|
|
*
|
2011-08-21 02:20:21 +00:00
|
|
|
* 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.
|
2001-10-18 20:42:25 +00:00
|
|
|
*
|
2011-08-21 02:20:21 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2001-10-18 20:42:25 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2011-08-21 02:20:21 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2001-10-18 20:42:25 +00:00
|
|
|
*
|
2011-08-21 02:20:21 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2001-10-18 20:42:25 +00:00
|
|
|
* License along with this library; if not, write to the Free Software
|
2011-08-21 02:20:21 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-10-18 20:42:25 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-02-04 13:41:36 +00:00
|
|
|
#include <hamlib/config.h>
|
2001-10-18 20:42:25 +00:00
|
|
|
|
2003-10-01 19:32:04 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2001-10-18 20:42:25 +00:00
|
|
|
#include <hamlib/rig.h>
|
|
|
|
#include "kenwood.h"
|
2001-11-09 15:45:38 +00:00
|
|
|
#include "th.h"
|
2001-10-18 20:42:25 +00:00
|
|
|
|
2002-01-02 23:41:44 +00:00
|
|
|
#if 1
|
2019-11-30 16:19:08 +00:00
|
|
|
#define RIG_ASSERT(x) if (!(x)) { rig_debug(RIG_DEBUG_ERR, "Assertion failed on line %i\n",__LINE__); abort(); }
|
2002-01-02 23:41:44 +00:00
|
|
|
#else
|
|
|
|
#define RIG_ASSERT(x)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
#define THD7_MODES (RIG_MODE_FM|RIG_MODE_AM)
|
2001-10-18 20:42:25 +00:00
|
|
|
#define THD7_MODES_TX (RIG_MODE_FM)
|
|
|
|
|
2002-01-07 17:46:28 +00:00
|
|
|
#define THD7_FUNC_ALL (RIG_FUNC_TSQL| \
|
|
|
|
RIG_FUNC_AIP| \
|
|
|
|
RIG_FUNC_MON| \
|
|
|
|
RIG_FUNC_SQL| \
|
|
|
|
RIG_FUNC_TONE| \
|
|
|
|
RIG_FUNC_REV| \
|
|
|
|
RIG_FUNC_LOCK| \
|
2003-03-24 23:08:28 +00:00
|
|
|
RIG_FUNC_ARO)
|
2002-01-07 17:46:28 +00:00
|
|
|
|
|
|
|
#define THD7_LEVEL_ALL (RIG_LEVEL_STRENGTH| \
|
|
|
|
RIG_LEVEL_SQL| \
|
|
|
|
RIG_LEVEL_AF| \
|
|
|
|
RIG_LEVEL_RF|\
|
|
|
|
RIG_LEVEL_MICGAIN)
|
2001-10-18 20:42:25 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
#define THD7_PARMS (RIG_PARM_BACKLIGHT)
|
2003-03-24 23:08:28 +00:00
|
|
|
|
2001-10-18 20:42:25 +00:00
|
|
|
#define THD7_VFO_OP (RIG_OP_UP|RIG_OP_DOWN)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* TODO: Band A & B
|
|
|
|
*/
|
2002-01-07 17:46:28 +00:00
|
|
|
#define THD7_VFO (RIG_VFO_A|RIG_VFO_B)
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
static rmode_t td7_mode_table[KENWOOD_MODE_TABLE_MAX] =
|
|
|
|
{
|
2010-09-07 21:11:13 +00:00
|
|
|
[0] = RIG_MODE_FM,
|
|
|
|
[1] = RIG_MODE_AM,
|
|
|
|
};
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
static struct kenwood_priv_caps thd7_priv_caps =
|
|
|
|
{
|
2002-08-16 17:43:02 +00:00
|
|
|
.cmdtrm = EOM_TH, /* Command termination character */
|
2010-09-07 21:11:13 +00:00
|
|
|
.mode_table = td7_mode_table,
|
2002-01-07 17:46:28 +00:00
|
|
|
};
|
|
|
|
|
2001-10-18 20:42:25 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* th-d7a rig capabilities.
|
2010-09-13 21:27:21 +00:00
|
|
|
*
|
|
|
|
* http://www.qsl.net/ta1dx/kenwood/thd7kom.htm
|
2001-10-18 20:42:25 +00:00
|
|
|
*/
|
2019-11-30 16:19:08 +00:00
|
|
|
const struct rig_caps thd7a_caps =
|
|
|
|
{
|
2020-03-05 14:44:18 +00:00
|
|
|
RIG_MODEL(RIG_MODEL_THD7A),
|
2019-11-30 16:19:08 +00:00
|
|
|
.model_name = "TH-D7A",
|
|
|
|
.mfg_name = "Kenwood",
|
2022-11-17 16:16:28 +00:00
|
|
|
.version = TH_VER ".1",
|
2019-11-30 16:19:08 +00:00
|
|
|
.copyright = "LGPL",
|
2021-09-15 13:57:34 +00:00
|
|
|
.status = RIG_STATUS_STABLE,
|
2019-11-30 16:19:08 +00:00
|
|
|
.rig_type = RIG_TYPE_HANDHELD | RIG_FLAG_APRS | RIG_FLAG_TNC | RIG_FLAG_DXCLUSTER,
|
|
|
|
.ptt_type = RIG_PTT_RIG,
|
|
|
|
.dcd_type = RIG_DCD_RIG,
|
|
|
|
.port_type = RIG_PORT_SERIAL,
|
|
|
|
.serial_rate_min = 9600,
|
|
|
|
.serial_rate_max = 9600,
|
|
|
|
.serial_data_bits = 8,
|
|
|
|
.serial_stop_bits = 1,
|
|
|
|
.serial_parity = RIG_PARITY_NONE,
|
|
|
|
.serial_handshake = RIG_HANDSHAKE_NONE,
|
|
|
|
.write_delay = 0,
|
|
|
|
.post_write_delay = 0,
|
2022-11-17 16:16:28 +00:00
|
|
|
.timeout = 500,
|
2019-11-30 16:19:08 +00:00
|
|
|
.retry = 3,
|
|
|
|
|
|
|
|
.has_get_func = THD7_FUNC_ALL,
|
|
|
|
.has_set_func = THD7_FUNC_ALL,
|
|
|
|
.has_get_level = THD7_LEVEL_ALL,
|
|
|
|
.has_set_level = RIG_LEVEL_SET(THD7_LEVEL_ALL),
|
|
|
|
.has_get_parm = THD7_PARMS,
|
|
|
|
.has_set_parm = THD7_PARMS, /* FIXME: parms */
|
2022-11-13 12:53:55 +00:00
|
|
|
.level_gran =
|
|
|
|
{
|
|
|
|
#include "level_gran_kenwood.h"
|
2019-11-30 16:19:08 +00:00
|
|
|
},
|
|
|
|
.parm_gran = {},
|
|
|
|
.ctcss_list = kenwood38_ctcss_list,
|
|
|
|
.dcs_list = NULL,
|
|
|
|
.preamp = { RIG_DBLST_END, },
|
|
|
|
.attenuator = { RIG_DBLST_END, },
|
|
|
|
.max_rit = Hz(0),
|
|
|
|
.max_xit = Hz(0),
|
|
|
|
.max_ifshift = Hz(0),
|
|
|
|
.vfo_ops = THD7_VFO_OP,
|
|
|
|
.targetable_vfo = RIG_TARGETABLE_FREQ,
|
|
|
|
.transceive = RIG_TRN_RIG,
|
|
|
|
.bank_qty = 0,
|
|
|
|
.chan_desc_sz = 6,
|
|
|
|
|
|
|
|
.chan_list = {
|
|
|
|
{ 1, 199, RIG_MTYPE_MEM, {TH_CHANNEL_CAPS}}, /* normal MEM */
|
|
|
|
{ 200, 219, RIG_MTYPE_EDGE, {TH_CHANNEL_CAPS}}, /* U/L MEM */
|
|
|
|
{ 221, 222, RIG_MTYPE_CALL, {TH_CHANNEL_CAPS}}, /* Call 0/1 */
|
|
|
|
RIG_CHAN_END,
|
|
|
|
},
|
|
|
|
|
|
|
|
.rx_range_list1 = { RIG_FRNG_END, }, /* FIXME: enter region 1 setting */
|
|
|
|
.tx_range_list1 = { RIG_FRNG_END, },
|
|
|
|
.rx_range_list2 = {
|
|
|
|
{MHz(144), MHz(148), THD7_MODES, -1, -1, THD7_VFO},
|
|
|
|
{MHz(430), MHz(440), THD7_MODES, -1, -1, THD7_VFO},
|
|
|
|
RIG_FRNG_END,
|
|
|
|
}, /* rx range */
|
|
|
|
.tx_range_list2 = {
|
|
|
|
{MHz(144), MHz(148), THD7_MODES_TX, W(5.5), W(5.5), THD7_VFO},
|
|
|
|
{MHz(430), MHz(440), THD7_MODES_TX, W(5.5), W(5.5), THD7_VFO},
|
|
|
|
RIG_FRNG_END,
|
|
|
|
}, /* tx range */
|
|
|
|
.tuning_steps = {
|
|
|
|
{THD7_MODES, kHz(5)},
|
|
|
|
{THD7_MODES, kHz(6.25)},
|
|
|
|
{THD7_MODES, kHz(10)},
|
|
|
|
{THD7_MODES, kHz(12.5)},
|
|
|
|
{THD7_MODES, kHz(15)},
|
|
|
|
{THD7_MODES, kHz(20)},
|
|
|
|
{THD7_MODES, kHz(25)},
|
|
|
|
{THD7_MODES, kHz(30)},
|
|
|
|
{THD7_MODES, kHz(50)},
|
|
|
|
{THD7_MODES, kHz(100)},
|
|
|
|
RIG_TS_END,
|
|
|
|
},
|
|
|
|
/* mode/filter list, remember: order matters! */
|
|
|
|
.filters = {
|
|
|
|
{RIG_MODE_FM, kHz(14)},
|
|
|
|
{RIG_MODE_AM, kHz(9)},
|
|
|
|
RIG_FLT_END,
|
|
|
|
},
|
|
|
|
.priv = (void *)& thd7_priv_caps,
|
|
|
|
|
|
|
|
.rig_init = kenwood_init,
|
2020-04-13 13:10:07 +00:00
|
|
|
.rig_open = kenwood_open,
|
2020-04-14 13:38:11 +00:00
|
|
|
.rig_close = kenwood_close,
|
2019-11-30 16:19:08 +00:00
|
|
|
.rig_cleanup = kenwood_cleanup,
|
|
|
|
.set_freq = th_set_freq,
|
|
|
|
.get_freq = th_get_freq,
|
|
|
|
.set_mode = th_set_mode,
|
|
|
|
.get_mode = th_get_mode,
|
|
|
|
.set_vfo = th_set_vfo,
|
|
|
|
.get_vfo = th_get_vfo,
|
|
|
|
.set_ctcss_tone = th_set_ctcss_tone,
|
|
|
|
.get_ctcss_tone = th_get_ctcss_tone,
|
|
|
|
.set_ctcss_sql = th_set_ctcss_sql,
|
|
|
|
.get_ctcss_sql = th_get_ctcss_sql,
|
|
|
|
.set_mem = th_set_mem,
|
|
|
|
.get_mem = th_get_mem,
|
|
|
|
.set_channel = th_set_channel,
|
|
|
|
.get_channel = th_get_channel,
|
|
|
|
.set_trn = th_set_trn,
|
|
|
|
.get_trn = th_get_trn,
|
|
|
|
|
|
|
|
.get_func = th_get_func,
|
|
|
|
.get_level = th_get_level,
|
|
|
|
.get_parm = th_get_parm,
|
|
|
|
.get_info = th_get_info,
|
|
|
|
|
2020-07-04 12:00:31 +00:00
|
|
|
.get_dcd = th_get_dcd,
|
2019-11-30 16:19:08 +00:00
|
|
|
|
|
|
|
.decode_event = th_decode_event,
|
2022-02-11 17:34:26 +00:00
|
|
|
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
|
2001-10-18 20:42:25 +00:00
|
|
|
};
|
|
|
|
|
2002-01-02 23:41:44 +00:00
|
|
|
|
2002-01-07 17:46:28 +00:00
|
|
|
/* end of file */
|
2002-01-02 23:41:44 +00:00
|
|
|
|