2003-11-16 16:58:35 +00:00
|
|
|
/*
|
|
|
|
* Hamlib JRC backend - NRD-535 DSP description
|
2004-05-19 08:57:50 +00:00
|
|
|
* Copyright (c) 2001-2004 by Stephane Fillod
|
2003-11-16 16:58:35 +00:00
|
|
|
*
|
2005-04-03 19:57:46 +00:00
|
|
|
* $Id: nrd535.c,v 1.14 2005-04-03 19:57:46 fillods Exp $
|
2003-11-16 16:58:35 +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>
|
|
|
|
|
|
|
|
#include <hamlib/rig.h>
|
|
|
|
#include "idx_builtin.h"
|
|
|
|
#include "jrc.h"
|
|
|
|
|
|
|
|
|
2004-08-08 20:13:19 +00:00
|
|
|
#define NRD535_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_ECSS|RIG_MODE_FAX) /* + FAX */
|
2003-11-16 16:58:35 +00:00
|
|
|
|
2004-08-08 20:13:19 +00:00
|
|
|
#define NRD535_FUNC (RIG_FUNC_FAGC|RIG_FUNC_NB)
|
2003-11-16 16:58:35 +00:00
|
|
|
|
2004-09-14 22:19:10 +00:00
|
|
|
#define NRD535_LEVEL (RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_ATT|RIG_LEVEL_IF|RIG_LEVEL_AGC|RIG_LEVEL_CWPITCH) /*RIG_LEVEL_BWC*/
|
2003-11-16 16:58:35 +00:00
|
|
|
|
|
|
|
/* FIXME: add more from "U" command */
|
2004-05-19 08:57:50 +00:00
|
|
|
#define NRD535_PARM (RIG_PARM_TIME|RIG_PARM_BEEP)
|
2003-11-16 16:58:35 +00:00
|
|
|
|
2004-08-31 03:47:52 +00:00
|
|
|
#define NRD535_VFO (RIG_VFO_VFO|RIG_VFO_MEM)
|
2003-11-16 16:58:35 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* NRD-535, specs from http://mods.dk
|
|
|
|
*
|
|
|
|
* FIXME: measure S-meter levels
|
|
|
|
*/
|
2004-08-08 20:13:19 +00:00
|
|
|
#define NRD535_STR_CAL { 16, { \
|
2003-11-16 16:58:35 +00:00
|
|
|
{ 0, 60 }, \
|
2004-08-08 20:13:19 +00:00
|
|
|
{ 71, 50 }, \
|
|
|
|
{ 75, 40 }, \
|
2003-11-16 16:58:35 +00:00
|
|
|
{ 81, 30 }, \
|
2004-08-08 20:13:19 +00:00
|
|
|
{ 87, 20 }, \
|
2003-11-16 16:58:35 +00:00
|
|
|
{ 93, 10 }, \
|
|
|
|
{ 100, 0 }, \
|
2004-08-08 20:13:19 +00:00
|
|
|
{ 103, -6 }, \
|
|
|
|
{ 107, -12 }, \
|
|
|
|
{ 112, -18 }, \
|
2003-11-16 16:58:35 +00:00
|
|
|
{ 118, -24 }, \
|
2004-08-08 20:13:19 +00:00
|
|
|
{ 124, -30 }, \
|
|
|
|
{ 133, -36 }, \
|
|
|
|
{ 143, -42 }, \
|
|
|
|
{ 152, -48 }, \
|
2003-11-16 16:58:35 +00:00
|
|
|
{ 255, -60 }, \
|
|
|
|
} }
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* channel caps.
|
|
|
|
*/
|
|
|
|
#define NRD535_MEM_CAP { \
|
|
|
|
.freq = 1, \
|
|
|
|
.mode = 1, \
|
|
|
|
.width = 1, \
|
2004-05-19 08:57:50 +00:00
|
|
|
.funcs = RIG_FUNC_FAGC, \
|
2003-11-16 16:58:35 +00:00
|
|
|
.levels = RIG_LEVEL_ATT|RIG_LEVEL_AGC, \
|
2004-08-08 20:13:19 +00:00
|
|
|
}
|
2003-11-16 16:58:35 +00:00
|
|
|
|
2004-05-19 08:57:50 +00:00
|
|
|
static const struct jrc_priv_caps nrd535_priv_caps = {
|
|
|
|
.max_freq_len = 8,
|
|
|
|
.info_len = 14,
|
|
|
|
.mem_len = 17,
|
|
|
|
.pbs_info_len = 7,
|
|
|
|
.pbs_len = 4,
|
|
|
|
.beep = 90,
|
|
|
|
.beep_len = 2,
|
|
|
|
.cw_pitch = "U2"
|
|
|
|
};
|
|
|
|
|
2003-11-16 16:58:35 +00:00
|
|
|
/*
|
|
|
|
* NRD-535 rig capabilities.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
const struct rig_caps nrd535_caps = {
|
|
|
|
.rig_model = RIG_MODEL_NRD535,
|
2004-05-19 08:57:50 +00:00
|
|
|
.model_name = "NRD-535D",
|
2003-11-16 16:58:35 +00:00
|
|
|
.mfg_name = "JRC",
|
2005-04-03 19:57:46 +00:00
|
|
|
.version = BACKEND_VER,
|
2003-11-16 16:58:35 +00:00
|
|
|
.copyright = "LGPL",
|
2004-08-01 21:23:41 +00:00
|
|
|
.status = RIG_STATUS_STABLE,
|
2003-11-16 16:58:35 +00:00
|
|
|
.rig_type = RIG_TYPE_RECEIVER,
|
|
|
|
.ptt_type = RIG_PTT_NONE,
|
2004-09-26 08:35:05 +00:00
|
|
|
.dcd_type = RIG_DCD_RIG,
|
2003-11-16 16:58:35 +00:00
|
|
|
.port_type = RIG_PORT_SERIAL,
|
|
|
|
.serial_rate_min = 4800,
|
|
|
|
.serial_rate_max = 4800,
|
|
|
|
.serial_data_bits = 8,
|
|
|
|
.serial_stop_bits = 1,
|
|
|
|
.serial_parity = RIG_PARITY_NONE,
|
|
|
|
.serial_handshake = RIG_HANDSHAKE_NONE,
|
|
|
|
.write_delay = 0,
|
2004-06-26 20:01:00 +00:00
|
|
|
.post_write_delay = 20,
|
2003-11-16 16:58:35 +00:00
|
|
|
.timeout = 200,
|
|
|
|
.retry = 3,
|
|
|
|
|
|
|
|
.has_get_func = NRD535_FUNC,
|
|
|
|
.has_set_func = NRD535_FUNC,
|
|
|
|
.has_get_level = NRD535_LEVEL,
|
|
|
|
.has_set_level = RIG_LEVEL_SET(NRD535_LEVEL),
|
|
|
|
.has_get_parm = RIG_PARM_TIME,
|
|
|
|
.has_set_parm = RIG_PARM_SET(NRD535_PARM),
|
|
|
|
.level_gran = {
|
2003-12-08 08:46:11 +00:00
|
|
|
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
|
2004-06-04 21:48:05 +00:00
|
|
|
[LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 20 } },
|
|
|
|
[LVL_IF] = { .min = { .i = -2000 }, .max = { .i = 2000 } },
|
|
|
|
[LVL_CWPITCH] = { .min = { .i = -5000 }, .max = { .i = 5000 } },
|
2004-09-14 22:19:10 +00:00
|
|
|
/*[LVL_BWC] = { .min = { .i = 500 }, .max = { .i = 5500 }, .step = { .i = 10} },*/
|
2003-11-16 16:58:35 +00:00
|
|
|
},
|
|
|
|
.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 = kHz(2),
|
|
|
|
.targetable_vfo = 0,
|
|
|
|
.transceive = RIG_TRN_RIG,
|
|
|
|
.vfo_ops = RIG_OP_FROM_VFO,
|
|
|
|
.scan_ops = RIG_SCAN_STOP|RIG_SCAN_SLCT,
|
|
|
|
.bank_qty = 0,
|
|
|
|
.chan_desc_sz = 0,
|
2004-05-19 08:57:50 +00:00
|
|
|
.priv = (void*)&nrd535_priv_caps,
|
2003-11-16 16:58:35 +00:00
|
|
|
|
|
|
|
.chan_list = {
|
|
|
|
{ 0, 199, RIG_MTYPE_MEM, NRD535_MEM_CAP },
|
|
|
|
RIG_CHAN_END,
|
|
|
|
},
|
|
|
|
|
|
|
|
.rx_range_list1 = {
|
2004-11-14 22:33:58 +00:00
|
|
|
{kHz(10),MHz(30),NRD535_MODES,-1,-1,NRD535_VFO},
|
2003-11-16 16:58:35 +00:00
|
|
|
RIG_FRNG_END,
|
|
|
|
},
|
|
|
|
.tx_range_list1 = { RIG_FRNG_END, },
|
|
|
|
.rx_range_list2 = {
|
2004-11-14 22:33:58 +00:00
|
|
|
{kHz(10),MHz(30),NRD535_MODES,-1,-1,NRD535_VFO},
|
2003-11-16 16:58:35 +00:00
|
|
|
RIG_FRNG_END,
|
|
|
|
},
|
|
|
|
.tx_range_list2 = { RIG_FRNG_END, },
|
|
|
|
|
|
|
|
.tuning_steps = {
|
|
|
|
{NRD535_MODES,1},
|
|
|
|
{NRD535_MODES,10},
|
|
|
|
{NRD535_MODES,100},
|
|
|
|
RIG_TS_END,
|
|
|
|
},
|
|
|
|
/* mode/filter list, .remember = order matters! */
|
|
|
|
.filters = {
|
2004-08-12 02:06:10 +00:00
|
|
|
{RIG_MODE_FM, kHz(12)},
|
|
|
|
{RIG_MODE_FM, kHz(6)},
|
|
|
|
{RIG_MODE_AM|RIG_MODE_ECSS, kHz(6)},
|
|
|
|
{RIG_MODE_AM|RIG_MODE_ECSS, kHz(2)},
|
|
|
|
{RIG_MODE_AM|RIG_MODE_ECSS, kHz(12)},
|
|
|
|
{RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FAX, kHz(2)},
|
|
|
|
{RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FAX, kHz(1)},
|
|
|
|
{RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FAX, kHz(6)},
|
|
|
|
{RIG_MODE_CW, kHz(1)},
|
|
|
|
{RIG_MODE_CW, kHz(2)},
|
2003-11-16 16:58:35 +00:00
|
|
|
RIG_FLT_END,
|
|
|
|
},
|
|
|
|
.str_cal = NRD535_STR_CAL,
|
|
|
|
|
|
|
|
.rig_open = jrc_open,
|
|
|
|
.rig_close = jrc_close,
|
|
|
|
.set_freq = jrc_set_freq,
|
|
|
|
.get_freq = jrc_get_freq,
|
|
|
|
.set_mode = jrc_set_mode,
|
2004-05-19 08:57:50 +00:00
|
|
|
.get_mode = jrc_get_mode,
|
2004-08-31 03:47:52 +00:00
|
|
|
.set_vfo = jrc_set_vfo,
|
2003-11-16 16:58:35 +00:00
|
|
|
.set_func = jrc_set_func,
|
|
|
|
.get_func = jrc_get_func,
|
|
|
|
.set_level = jrc_set_level,
|
|
|
|
.get_level = jrc_get_level,
|
|
|
|
.set_parm = jrc_set_parm,
|
|
|
|
.get_parm = jrc_get_parm,
|
|
|
|
.get_dcd = jrc_get_dcd,
|
|
|
|
.set_trn = jrc_set_trn,
|
|
|
|
.reset = jrc_reset,
|
|
|
|
.set_mem = jrc_set_mem,
|
2004-05-19 08:57:50 +00:00
|
|
|
.get_mem = jrc_get_mem,
|
2004-09-05 00:33:56 +00:00
|
|
|
.set_channel = jrc_set_chan,
|
|
|
|
.get_channel = jrc_get_chan,
|
2003-11-16 16:58:35 +00:00
|
|
|
.vfo_op = jrc_vfo_op,
|
|
|
|
.scan = jrc_scan,
|
|
|
|
.set_powerstat = jrc_set_powerstat,
|
2004-06-04 21:48:05 +00:00
|
|
|
.get_powerstat = jrc_get_powerstat,
|
2003-11-16 16:58:35 +00:00
|
|
|
.decode_event = jrc_decode_event,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Function definitions below
|
|
|
|
*/
|
|
|
|
|
|
|
|
|