2001-12-17 22:40:34 +00:00
|
|
|
/*
|
|
|
|
* Hamlib JRC backend - NRD-545 DSP description
|
2004-05-19 08:57:50 +00:00
|
|
|
* Copyright (c) 2001-2004 by Stephane Fillod
|
2001-12-17 22:40:34 +00:00
|
|
|
*
|
2004-05-19 08:57:50 +00:00
|
|
|
* $Id: nrd545.c,v 1.8 2004-05-19 08:57:50 fillods Exp $
|
2001-12-17 22:40:34 +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
|
|
|
|
|
2003-10-01 19:32:04 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2001-12-17 22:40:34 +00:00
|
|
|
#include <hamlib/rig.h>
|
2003-11-16 17:14:44 +00:00
|
|
|
#include "idx_builtin.h"
|
2001-12-17 22:40:34 +00:00
|
|
|
#include "jrc.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define NRD545_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY)
|
|
|
|
|
|
|
|
#define NRD545_FUNC (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_LOCK|RIG_FUNC_ABM|RIG_FUNC_BC|RIG_FUNC_NR)
|
|
|
|
|
2004-05-19 08:57:50 +00:00
|
|
|
#define NRD545_LEVEL (RIG_LEVEL_SQLSTAT|RIG_LEVEL_RAWSTR|RIG_LEVEL_ATT|RIG_LEVEL_RF|RIG_LEVEL_AF|RIG_LEVEL_AGC|RIG_LEVEL_IF|RIG_LEVEL_NR|RIG_LEVEL_NOTCHF|RIG_LEVEL_SQL|RIG_LEVEL_IF|RIG_LEVEL_CWPITCH)
|
2001-12-17 22:40:34 +00:00
|
|
|
|
2001-12-20 23:03:27 +00:00
|
|
|
/* FIXME: add more from "U" command */
|
2001-12-17 22:40:34 +00:00
|
|
|
#define NRD545_PARM (RIG_PARM_TIME|RIG_PARM_BACKLIGHT|RIG_PARM_BEEP)
|
|
|
|
|
|
|
|
#define NRD545_VFO (RIG_VFO_A)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* FIXME: measure S-meter levels
|
|
|
|
*/
|
|
|
|
#define NRD545_STR_CAL { 2, { \
|
|
|
|
{ 0, -60 }, \
|
|
|
|
{ 255, 60 }, \
|
|
|
|
} }
|
|
|
|
|
2004-05-19 08:57:50 +00:00
|
|
|
/*
|
|
|
|
* channel caps.
|
|
|
|
*/
|
|
|
|
#define NRD545_MEM_CAP { \
|
|
|
|
.freq = 1, \
|
|
|
|
.mode = 1, \
|
|
|
|
.width = 1, \
|
|
|
|
.levels = RIG_LEVEL_ATT|RIG_LEVEL_AGC, \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const struct jrc_priv_caps nrd545_priv_caps = {
|
|
|
|
.max_freq_len = 10,
|
|
|
|
.info_len = 18,
|
|
|
|
.mem_len = 21,
|
|
|
|
.pbs_info_len = 6,
|
|
|
|
.pbs_len = 3,
|
|
|
|
.beep = 100,
|
|
|
|
.beep_len = 3,
|
|
|
|
.cw_pitch = "U14"
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-12-17 22:40:34 +00:00
|
|
|
/*
|
|
|
|
* NRD-545 rig capabilities.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
const struct rig_caps nrd545_caps = {
|
2002-08-16 17:43:02 +00:00
|
|
|
.rig_model = RIG_MODEL_NRD545,
|
|
|
|
.model_name = "NRD-545 DSP",
|
|
|
|
.mfg_name = "JRC",
|
2004-05-19 08:57:50 +00:00
|
|
|
.version = "0.2",
|
2002-08-16 17:43:02 +00:00
|
|
|
.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 = 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,
|
|
|
|
.post_write_delay = 0,
|
|
|
|
.timeout = 200,
|
|
|
|
.retry = 3,
|
|
|
|
|
|
|
|
.has_get_func = NRD545_FUNC,
|
|
|
|
.has_set_func = NRD545_FUNC,
|
|
|
|
.has_get_level = NRD545_LEVEL,
|
|
|
|
.has_set_level = RIG_LEVEL_SET(NRD545_LEVEL),
|
|
|
|
.has_get_parm = RIG_PARM_TIME,
|
|
|
|
.has_set_parm = RIG_PARM_SET(NRD545_PARM),
|
2003-11-16 17:14:44 +00:00
|
|
|
.level_gran = {
|
2003-12-08 08:46:11 +00:00
|
|
|
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
|
2003-11-16 17:14:44 +00:00
|
|
|
},
|
2002-08-16 17:43:02 +00:00
|
|
|
.parm_gran = {},
|
|
|
|
.ctcss_list = NULL,
|
|
|
|
.dcs_list = NULL,
|
|
|
|
.preamp = { RIG_DBLST_END },
|
|
|
|
.attenuator = { 20, RIG_DBLST_END }, /* To be confirmed */
|
|
|
|
.max_rit = Hz(0),
|
|
|
|
.max_xit = Hz(0),
|
|
|
|
.max_ifshift = kHz(2.3),
|
|
|
|
.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*)&nrd545_priv_caps,
|
2002-08-16 17:43:02 +00:00
|
|
|
|
|
|
|
.chan_list = {
|
2004-05-19 08:57:50 +00:00
|
|
|
{ 0, 999, RIG_MTYPE_MEM, NRD545_MEM_CAP },
|
|
|
|
RIG_CHAN_END,
|
|
|
|
},
|
2001-12-17 22:40:34 +00:00
|
|
|
|
2002-08-16 17:43:02 +00:00
|
|
|
.rx_range_list1 = { RIG_FRNG_END, }, /* FIXME: enter region 1 setting */
|
|
|
|
.tx_range_list1 = { RIG_FRNG_END, },
|
|
|
|
.rx_range_list2 = {
|
2001-12-17 22:40:34 +00:00
|
|
|
{kHz(100),MHz(30),NRD545_MODES,-1,-1,NRD545_VFO},
|
|
|
|
RIG_FRNG_END,
|
|
|
|
},
|
2002-08-16 17:43:02 +00:00
|
|
|
.tx_range_list2 = { RIG_FRNG_END, },
|
2001-12-17 22:40:34 +00:00
|
|
|
|
2002-08-16 17:43:02 +00:00
|
|
|
.tuning_steps = {
|
2001-12-17 22:40:34 +00:00
|
|
|
{NRD545_MODES,1},
|
|
|
|
{NRD545_MODES,10},
|
|
|
|
{NRD545_MODES,100},
|
|
|
|
{NRD545_MODES,kHz(1)},
|
|
|
|
{NRD545_MODES,kHz(5)},
|
|
|
|
{NRD545_MODES,kHz(6.25)},
|
|
|
|
{NRD545_MODES,kHz(9)},
|
|
|
|
{NRD545_MODES,kHz(10)},
|
|
|
|
{NRD545_MODES,kHz(12.5)},
|
|
|
|
{NRD545_MODES,kHz(20)},
|
|
|
|
{NRD545_MODES,kHz(25)},
|
|
|
|
{NRD545_MODES,kHz(30)},
|
|
|
|
{NRD545_MODES,kHz(100)},
|
|
|
|
RIG_TS_END,
|
|
|
|
},
|
2002-08-16 17:43:02 +00:00
|
|
|
/* mode/filter list, .remember = order matters! */
|
|
|
|
.filters = {
|
2001-12-17 22:40:34 +00:00
|
|
|
{RIG_MODE_AM|RIG_MODE_FM, kHz(10)},
|
|
|
|
{NRD545_MODES, kHz(2.4)},
|
|
|
|
{NRD545_MODES, kHz(1)},
|
|
|
|
{NRD545_MODES, kHz(4.5)},
|
|
|
|
RIG_FLT_END,
|
|
|
|
},
|
2003-11-16 17:14:44 +00:00
|
|
|
.str_cal = NRD545_STR_CAL,
|
2002-08-16 17:43:02 +00:00
|
|
|
|
|
|
|
.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,
|
2002-08-16 17:43:02 +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,
|
2002-08-16 17:43:02 +00:00
|
|
|
.vfo_op = jrc_vfo_op,
|
|
|
|
.scan = jrc_scan,
|
|
|
|
.set_powerstat = jrc_set_powerstat,
|
|
|
|
.decode_event = jrc_decode_event,
|
2001-12-17 22:40:34 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Function definitions below
|
|
|
|
*/
|
|
|
|
|