2004-02-08 17:05:55 +00:00
|
|
|
/*
|
|
|
|
* Hamlib Kenwood backend - TM-D700 description
|
2010-09-07 21:11:13 +00:00
|
|
|
* Copyright (c) 2000-2010 by Stephane Fillod
|
2004-02-08 17:05:55 +00:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
2010-09-13 21:25:46 +00:00
|
|
|
#include <math.h>
|
2004-02-08 17:05:55 +00:00
|
|
|
|
2010-09-13 21:25:46 +00:00
|
|
|
#include "hamlib/rig.h"
|
2004-02-08 17:05:55 +00:00
|
|
|
#include "kenwood.h"
|
|
|
|
#include "th.h"
|
2010-09-08 08:28:39 +00:00
|
|
|
#include "tones.h"
|
2004-02-08 17:05:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define TMD700_MODES (RIG_MODE_FM|RIG_MODE_AM)
|
|
|
|
#define TMD700_MODES_TX (RIG_MODE_FM)
|
|
|
|
|
|
|
|
/* TBC */
|
|
|
|
#define TMD700_FUNC_ALL (RIG_FUNC_TSQL| \
|
|
|
|
RIG_FUNC_AIP| \
|
|
|
|
RIG_FUNC_MON| \
|
2010-09-13 21:25:46 +00:00
|
|
|
RIG_FUNC_MUTE| \
|
2004-02-08 17:05:55 +00:00
|
|
|
RIG_FUNC_SQL| \
|
|
|
|
RIG_FUNC_TONE| \
|
2010-09-08 08:28:39 +00:00
|
|
|
RIG_FUNC_TBURST| \
|
2004-02-08 17:05:55 +00:00
|
|
|
RIG_FUNC_REV| \
|
|
|
|
RIG_FUNC_LOCK| \
|
|
|
|
RIG_FUNC_ARO)
|
|
|
|
|
|
|
|
#define TMD700_LEVEL_ALL (RIG_LEVEL_STRENGTH| \
|
|
|
|
RIG_LEVEL_SQL| \
|
|
|
|
RIG_LEVEL_AF| \
|
|
|
|
RIG_LEVEL_RF|\
|
|
|
|
RIG_LEVEL_MICGAIN)
|
|
|
|
|
2010-09-08 08:28:39 +00:00
|
|
|
#define TMD700_PARMS (RIG_PARM_BACKLIGHT|\
|
2010-09-13 21:25:46 +00:00
|
|
|
RIG_PARM_BEEP|\
|
2010-09-08 08:28:39 +00:00
|
|
|
RIG_PARM_APO)
|
2004-02-08 17:05:55 +00:00
|
|
|
|
|
|
|
#define TMD700_VFO_OP (RIG_OP_UP|RIG_OP_DOWN)
|
|
|
|
|
2010-09-13 21:25:46 +00:00
|
|
|
#define TMD700_CHANNEL_CAPS \
|
|
|
|
TH_CHANNEL_CAPS,\
|
|
|
|
.flags=1, \
|
|
|
|
.dcs_code=1, \
|
|
|
|
.dcs_sql=1,
|
|
|
|
|
|
|
|
#define TMD700_CHANNEL_CAPS_WO_LO \
|
|
|
|
TH_CHANNEL_CAPS,\
|
|
|
|
.dcs_code=1, \
|
|
|
|
.dcs_sql=1,
|
|
|
|
|
2004-02-08 17:05:55 +00:00
|
|
|
/*
|
|
|
|
* TODO: Band A & B
|
|
|
|
*/
|
|
|
|
#define TMD700_VFO (RIG_VFO_A|RIG_VFO_B)
|
|
|
|
|
2010-09-07 21:11:13 +00:00
|
|
|
static rmode_t tmd700_mode_table[KENWOOD_MODE_TABLE_MAX] = {
|
|
|
|
[0] = RIG_MODE_FM,
|
|
|
|
[1] = RIG_MODE_AM,
|
|
|
|
};
|
|
|
|
|
2009-01-28 23:30:59 +00:00
|
|
|
static struct kenwood_priv_caps tmd700_priv_caps = {
|
2004-02-08 17:05:55 +00:00
|
|
|
.cmdtrm = EOM_TH, /* Command termination character */
|
2010-09-07 21:11:13 +00:00
|
|
|
.mode_table = tmd700_mode_table,
|
2004-02-08 17:05:55 +00:00
|
|
|
};
|
|
|
|
|
2010-09-08 08:28:39 +00:00
|
|
|
|
2004-02-08 17:05:55 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* TM-D700 rig capabilities.
|
|
|
|
*
|
2010-09-07 21:11:13 +00:00
|
|
|
* specs: http://www.geocities.jp/hkwatarin/TM-D700/English/spec.htm
|
|
|
|
* protocol: http://www.qsl.net/k/k7jar//pages/D700Cmds.html
|
2004-02-08 17:05:55 +00:00
|
|
|
*/
|
|
|
|
const struct rig_caps tmd700_caps = {
|
|
|
|
.rig_model = RIG_MODEL_TMD700,
|
|
|
|
.model_name = "TM-D700",
|
|
|
|
.mfg_name = "Kenwood",
|
2005-04-03 20:23:19 +00:00
|
|
|
.version = TH_VER,
|
2004-02-08 17:05:55 +00:00
|
|
|
.copyright = "LGPL",
|
2010-09-07 21:11:13 +00:00
|
|
|
.status = RIG_STATUS_BETA,
|
2004-02-08 17:05:55 +00:00
|
|
|
.rig_type = RIG_TYPE_MOBILE|RIG_FLAG_APRS|RIG_FLAG_TNC,
|
|
|
|
.ptt_type = RIG_PTT_RIG,
|
|
|
|
.dcd_type = RIG_DCD_RIG,
|
|
|
|
.port_type = RIG_PORT_SERIAL,
|
|
|
|
.serial_rate_min = 9600,
|
|
|
|
.serial_rate_max = 57600,
|
|
|
|
.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,
|
2010-09-13 21:25:46 +00:00
|
|
|
.timeout = 1000,
|
2004-02-08 17:05:55 +00:00
|
|
|
.retry = 3,
|
|
|
|
|
|
|
|
.has_get_func = TMD700_FUNC_ALL,
|
|
|
|
.has_set_func = TMD700_FUNC_ALL,
|
|
|
|
.has_get_level = TMD700_LEVEL_ALL,
|
|
|
|
.has_set_level = RIG_LEVEL_SET(TMD700_LEVEL_ALL),
|
|
|
|
.has_get_parm = TMD700_PARMS,
|
|
|
|
.has_set_parm = TMD700_PARMS, /* FIXME: parms */
|
2004-03-21 18:25:54 +00:00
|
|
|
.level_gran = {
|
2010-09-13 21:25:46 +00:00
|
|
|
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 7 } },
|
|
|
|
[LVL_SQL] = { .min = { .i = 0 }, .max = { .i = 0x1f }, .step = { .f = 1./0x1f } },
|
|
|
|
[LVL_RFPOWER] = { .min = { .i = 2 }, .max = { .i = 0 }, .step = { .f = 1./3. } },
|
|
|
|
[LVL_AF] = { .min = { .i = 0 }, .max = { .i = 0x3f }, .step = { .f = 1./0x3f } },
|
2004-03-21 18:25:54 +00:00
|
|
|
},
|
2004-02-08 17:05:55 +00:00
|
|
|
.parm_gran = {},
|
|
|
|
.ctcss_list = kenwood38_ctcss_list,
|
2010-09-08 08:28:39 +00:00
|
|
|
.dcs_list = common_dcs_list,
|
2004-02-08 17:05:55 +00:00
|
|
|
.preamp = { RIG_DBLST_END, },
|
|
|
|
.attenuator = { RIG_DBLST_END, },
|
|
|
|
.max_rit = Hz(0),
|
|
|
|
.max_xit = Hz(0),
|
|
|
|
.max_ifshift = Hz(0),
|
|
|
|
.vfo_ops = TMD700_VFO_OP,
|
2010-09-13 21:25:46 +00:00
|
|
|
.scan_ops = RIG_SCAN_VFO,
|
|
|
|
.targetable_vfo = RIG_TARGETABLE_NONE,
|
2004-02-08 17:05:55 +00:00
|
|
|
.transceive = RIG_TRN_RIG,
|
|
|
|
.bank_qty = 0,
|
2010-09-13 21:25:46 +00:00
|
|
|
.chan_desc_sz = 8,
|
|
|
|
|
|
|
|
.chan_list = {
|
|
|
|
{ 1, 199, RIG_MTYPE_MEM , {TMD700_CHANNEL_CAPS}}, /* normal MEM */
|
|
|
|
{ 200,219, RIG_MTYPE_EDGE , {TMD700_CHANNEL_CAPS}}, /* U/L MEM */
|
|
|
|
{ 221,222, RIG_MTYPE_CALL, {TMD700_CHANNEL_CAPS_WO_LO}}, /* Call 0/1 */
|
|
|
|
RIG_CHAN_END,
|
|
|
|
},
|
2004-02-08 17:05:55 +00:00
|
|
|
/*
|
|
|
|
* TODO: Japan & TM-D700S, and Taiwan models
|
|
|
|
*/
|
|
|
|
.rx_range_list1 = {
|
|
|
|
{MHz(118),MHz(470),TMD700_MODES,-1,-1,RIG_VFO_A},
|
|
|
|
{MHz(136),MHz(174),RIG_MODE_FM,-1,-1,RIG_VFO_B},
|
|
|
|
{MHz(300),MHz(524),RIG_MODE_FM,-1,-1,RIG_VFO_B},
|
|
|
|
{MHz(800),MHz(1300),RIG_MODE_FM,-1,-1,RIG_VFO_B},
|
|
|
|
RIG_FRNG_END,
|
|
|
|
}, /* rx range */
|
|
|
|
.tx_range_list1 = {
|
|
|
|
{MHz(144),MHz(146),TMD700_MODES_TX,W(5),W(50),RIG_VFO_A},
|
|
|
|
{MHz(430),MHz(440),TMD700_MODES_TX,W(5),W(35),RIG_VFO_A},
|
|
|
|
RIG_FRNG_END,
|
|
|
|
}, /* tx range */
|
|
|
|
|
|
|
|
.rx_range_list2 = {
|
|
|
|
{MHz(118),MHz(470),TMD700_MODES,-1,-1,RIG_VFO_A},
|
|
|
|
{MHz(136),MHz(174),RIG_MODE_FM,-1,-1,RIG_VFO_B},
|
|
|
|
{MHz(300),MHz(524),RIG_MODE_FM,-1,-1,RIG_VFO_B},
|
|
|
|
{MHz(800),MHz(1300),RIG_MODE_FM,-1,-1,RIG_VFO_B}, /* TODO: cellular blocked */
|
|
|
|
RIG_FRNG_END,
|
|
|
|
}, /* rx range */
|
|
|
|
.tx_range_list2 = {
|
|
|
|
{MHz(144),MHz(148),TMD700_MODES_TX,W(5),W(50),RIG_VFO_A},
|
|
|
|
{MHz(430),MHz(450),TMD700_MODES_TX,W(5),W(35),RIG_VFO_A},
|
|
|
|
RIG_FRNG_END,
|
|
|
|
}, /* tx range */
|
|
|
|
|
|
|
|
.tuning_steps = {
|
|
|
|
{TMD700_MODES,kHz(5)},
|
|
|
|
{TMD700_MODES,kHz(6.25)},
|
|
|
|
{TMD700_MODES,kHz(10)},
|
|
|
|
{TMD700_MODES,kHz(12.5)},
|
|
|
|
{TMD700_MODES,kHz(15)},
|
|
|
|
{TMD700_MODES,kHz(20)},
|
|
|
|
{TMD700_MODES,kHz(25)},
|
|
|
|
{TMD700_MODES,kHz(30)},
|
|
|
|
{TMD700_MODES,kHz(50)},
|
|
|
|
{TMD700_MODES,kHz(100)},
|
|
|
|
RIG_TS_END,
|
|
|
|
},
|
|
|
|
/* mode/filter list, remember: order matters! */
|
|
|
|
.filters = {
|
|
|
|
{RIG_MODE_FM, kHz(12)},
|
|
|
|
{RIG_MODE_AM, kHz(9)}, /* TBC */
|
|
|
|
RIG_FLT_END,
|
|
|
|
},
|
|
|
|
.priv = (void *)&tmd700_priv_caps,
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
.rig_init = kenwood_init,
|
|
|
|
.rig_cleanup = kenwood_cleanup,
|
2010-09-19 12:32:24 +00:00
|
|
|
.set_freq = th_set_freq,
|
2004-02-08 17:05:55 +00:00
|
|
|
.get_freq = th_get_freq,
|
|
|
|
.set_mode = th_set_mode,
|
|
|
|
.get_mode = th_get_mode,
|
2010-09-13 21:25:46 +00:00
|
|
|
.set_vfo = tm_set_vfo_bc2,
|
2004-02-08 17:05:55 +00:00
|
|
|
.get_vfo = th_get_vfo,
|
2010-09-13 21:25:46 +00:00
|
|
|
.set_split_vfo = th_set_split_vfo,
|
|
|
|
.get_split_vfo = th_get_split_vfo,
|
2004-02-08 17:05:55 +00:00
|
|
|
.set_ctcss_tone = th_set_ctcss_tone,
|
|
|
|
.get_ctcss_tone = th_get_ctcss_tone,
|
2010-09-13 21:25:46 +00:00
|
|
|
.set_ctcss_sql = th_set_ctcss_sql,
|
|
|
|
.get_ctcss_sql = th_get_ctcss_sql,
|
|
|
|
.set_dcs_sql = th_set_dcs_sql,
|
|
|
|
.get_dcs_sql = th_get_dcs_sql,
|
2004-02-08 17:05:55 +00:00
|
|
|
.set_mem = th_set_mem,
|
|
|
|
.get_mem = th_get_mem,
|
2004-03-20 16:48:34 +00:00
|
|
|
.set_channel = th_set_channel,
|
|
|
|
.get_channel = th_get_channel,
|
2004-02-08 17:05:55 +00:00
|
|
|
.set_trn = th_set_trn,
|
|
|
|
.get_trn = th_get_trn,
|
|
|
|
|
2010-09-08 08:28:39 +00:00
|
|
|
.set_func = th_set_func,
|
2004-02-08 17:05:55 +00:00
|
|
|
.get_func = th_get_func,
|
2010-09-08 08:28:39 +00:00
|
|
|
.set_level = th_set_level,
|
2004-02-08 17:05:55 +00:00
|
|
|
.get_level = th_get_level,
|
2010-09-08 08:28:39 +00:00
|
|
|
.set_parm = th_set_parm,
|
2004-02-08 17:05:55 +00:00
|
|
|
.get_parm = th_get_parm,
|
|
|
|
.get_info = th_get_info,
|
2004-09-26 08:35:05 +00:00
|
|
|
.get_dcd = th_get_dcd,
|
2010-09-08 08:28:39 +00:00
|
|
|
.set_ptt = th_set_ptt,
|
|
|
|
.vfo_op = th_vfo_op,
|
2010-09-13 21:25:46 +00:00
|
|
|
.scan = th_scan,
|
2004-02-08 17:05:55 +00:00
|
|
|
|
|
|
|
.decode_event = th_decode_event,
|
|
|
|
};
|
|
|
|
|
2010-09-13 07:46:21 +00:00
|
|
|
|
2004-02-08 17:05:55 +00:00
|
|
|
/* end of file */
|