- implemented RIG_FUNC_AFC

- fixed some PCR1000 filter list, added set/get_powerstat
- wire up RIG_LEVEL_CWPITCH and RIG_FUNC_VSC
- moved some prototypes to pcr.c


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2717 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.10
Stéphane Fillod, F8CFE 2009-08-04 15:21:14 +00:00
rodzic 030f88d635
commit 842e769948
4 zmienionych plików z 69 dodań i 26 usunięć

Wyświetl plik

@ -101,6 +101,26 @@ struct pcr_country pcr_countries[] = {
{ 0x0F, "FCC Generic 2" },
};
static int pcr_set_volume(RIG *rig, float level);
static int pcr_set_squelch(RIG *rig, float level);
static int pcr_set_if_shift(RIG *rig, int level);
static int pcr_set_agc(RIG *rig, int status); // J45xx
static int pcr_set_afc(RIG *rig, int status); // LD820xx
static int pcr_set_nb(RIG *rig, int status); // J46xx
static int pcr_set_attenuator(RIG *rig, int status); // J47xx
static int pcr_set_anl(RIG *rig, int status); // J4Dxx
static int pcr_set_bfo_shift(RIG *rig, int level); // J4Axx
static int pcr_set_vsc(RIG *rig, int level); // J50xx
static int pcr_set_dsp(RIG *rig, int level); // J80xx
static int pcr_set_dsp_state(RIG *rig, int level); // J8100=off J8101=on
static int pcr_set_dsp_noise_reducer(RIG *rig, int level); // J82xx
static int pcr_set_dsp_auto_notch(RIG *rig, int level); // J83xx
static int pcr_check_ok(RIG * rig);
#define PCR_COUNTRIES (sizeof(pcr_countries) / sizeof(struct pcr_country))
static int
@ -811,6 +831,9 @@ pcr_set_level(RIG * rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_IF:
return pcr_set_if_shift(rig, val.i);
case RIG_LEVEL_CWPITCH: /* BFO */
return pcr_set_bfo_shift(rig, val.i);
case RIG_LEVEL_AGC:
/* this is implemented as a level even though it is a binary function
* as far as PCR is concerned. There is no AGC on/off for a "set func",
@ -952,6 +975,14 @@ pcr_set_func(RIG * rig, vfo_t vfo, setting_t func, int status)
break;
case RIG_FUNC_AFC: /* Tracking Filter */
if (status == 0)
return pcr_set_afc(rig, 0);
else
return pcr_set_afc(rig, 1);
break;
case RIG_FUNC_TSQL:
if (priv->last_mode != MD_FM)
return -RIG_ERJCTED;
@ -961,6 +992,14 @@ pcr_set_func(RIG * rig, vfo_t vfo, setting_t func, int status)
else
return pcr_set_ctcss_sql(rig, vfo, priv->last_ctcss_sql);
case RIG_FUNC_VSC: /* Voice Scan Control */
if (status == 0)
return pcr_set_vsc(rig, 0);
else
return pcr_set_vsc(rig, 1);
break;
default:
rig_debug(RIG_DEBUG_VERBOSE, "%s: default\n", __func__);
return -RIG_EINVAL;
@ -1149,6 +1188,23 @@ pcr_set_agc(RIG * rig, int status)
return err;
}
/*
* pcr_set_afc(RIG *rig, int level);
* Assumes rig!=NULL, rig->state.priv!=NULL
*
* Sets the Tracking Filter on or off based on the status argument.
* 00 = on, 01 (non zero) is off
*
* Format is LD820xx - where xx is 00 to ff in hex
*
*/
int
pcr_set_afc(RIG * rig, int status)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: status = %d\n", __func__, status);
return pcr_set_level_cmd(rig, "LD820", status ? 0 : 1);
}
/*
* pcr_set_nb(RIG *rig, int level);
* Assumes rig!=NULL, rig->state.priv!=NULL
@ -1212,14 +1268,14 @@ pcr_set_attenuator(RIG * rig, int status)
* > 80 Plus shift (in 10 Hz steps)
* 80 Centre
*
* Format is J4Axx - where xx is 00 to FF in hex, and specifies 255 squelch levels
* Format is J4Axx - where xx is 00 to FF in hex, and specifies 255 levels
* XXX command undocumented?
*/
int
pcr_set_bfo_shift(RIG * rig, int level)
{
rig_debug(RIG_DEBUG_TRACE, "%s: level is %d\n", __func__, level);
return pcr_set_level_cmd(rig, "J4A", level);
return pcr_set_level_cmd(rig, "J4A", 0x80 + level/10);
}
/*

Wyświetl plik

@ -85,30 +85,12 @@ int pcr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
int pcr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int pcr_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val);
int pcr_set_comm_rate(RIG *rig, int baud_rate);
static int pcr_set_volume(RIG *rig, float level);
static int pcr_set_squelch(RIG *rig, float level);
int pcr_set_if_shift(RIG *rig, int level);
int pcr_set_agc(RIG *rig, int status); // J45xx
int pcr_set_nb(RIG *rig, int status); // J46xx
int pcr_set_attenuator(RIG *rig, int status); // J47xx
int pcr_set_anl(RIG *rig, int status); // J4Dxx
int pcr_set_bf0(RIG *rig, int level); // J4Axx
int pcr_set_vsc(RIG *rig, int level); // J50xx
int pcr_set_dsp(RIG *rig, int level); // J80xx
int pcr_set_dsp_state(RIG *rig, int level); // J8100=off J8101=on
int pcr_set_dsp_noise_reducer(RIG *rig, int level); // J82xx
int pcr_set_dsp_auto_notch(RIG *rig, int level); // J83xx
int pcr_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone);
int pcr_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone);
int pcr_set_trn(RIG * rig, int trn);
int pcr_decode_event(RIG *rig);
int pcr_set_powerstat(RIG * rig, powerstat_t status);
int pcr_get_powerstat(RIG * rig, powerstat_t *status);
static int pcr_check_ok(RIG * rig);
/* ------------------------------------------------------------------ */

Wyświetl plik

@ -1,6 +1,6 @@
/*
* Hamlib PCR backend - PCR-1000 description
* Copyright (c) 2001-2003 by Stephane Fillod and Darren Hatcher
* Copyright (c) 2001-2009 by Stephane Fillod and Darren Hatcher
*
* $Id: pcr1000.c,v 1.11 2009-01-27 19:05:59 fillods Exp $
*
@ -33,7 +33,8 @@
#define PCR1000_MODES ( RIG_MODE_AM | RIG_MODE_FM | RIG_MODE_WFM | RIG_MODE_CW | RIG_MODE_SSB )
#define PCR1000_FUNC ( RIG_FUNC_NB | RIG_FUNC_TSQL | RIG_FUNC_NB | RIG_FUNC_ANF | RIG_FUNC_NR )
#define PCR1000_FUNC ( RIG_FUNC_NB | RIG_FUNC_TSQL | RIG_FUNC_NB | \
RIG_FUNC_ANF | RIG_FUNC_NR | RIG_FUNC_AFC )
#define PCR1000_LEVEL ( \
RIG_LEVEL_ATT | RIG_LEVEL_AF | RIG_LEVEL_SQL | RIG_LEVEL_IF | \
@ -116,12 +117,12 @@ const struct rig_caps pcr1000_caps = {
},
/* mode/filter list, remember: order matters! */
.filters = {
{ RIG_MODE_FM | RIG_MODE_AM, kHz(15) },
{ RIG_MODE_FM | RIG_MODE_AM, kHz(6) },
{ RIG_MODE_CW | RIG_MODE_USB | RIG_MODE_LSB | RIG_MODE_AM,
kHz(2.8)},
{ RIG_MODE_FM | RIG_MODE_AM, kHz(6) },
{ RIG_MODE_FM | RIG_MODE_AM, kHz(15) },
{ RIG_MODE_WFM | RIG_MODE_FM | RIG_MODE_AM, kHz(50) },
{ RIG_MODE_WFM, kHz(230) },
{ RIG_MODE_WFM | RIG_MODE_FM | RIG_MODE_AM, kHz(50) },
RIG_FLT_END,
},
@ -153,4 +154,7 @@ const struct rig_caps pcr1000_caps = {
.set_trn = pcr_set_trn,
.decode_event = pcr_decode_event,
.set_powerstat = pcr_set_powerstat,
.get_powerstat = pcr_get_powerstat,
};

Wyświetl plik

@ -35,7 +35,8 @@
#define PCR1500_MODES_NAR ( RIG_MODE_CW | RIG_MODE_SSB )
#define PCR1500_MODES ( PCR1500_MODES_NAR | PCR1500_MODES_WIDE )
#define PCR1500_FUNC ( RIG_FUNC_NB | RIG_FUNC_TSQL | RIG_FUNC_NB | RIG_FUNC_ANF | RIG_FUNC_NR )
#define PCR1500_FUNC ( RIG_FUNC_NB | RIG_FUNC_TSQL | RIG_FUNC_NB | \
RIG_FUNC_ANF | RIG_FUNC_NR | RIG_FUNC_AFC )
#define PCR1500_LEVEL ( \
RIG_LEVEL_ATT | RIG_LEVEL_AF | RIG_LEVEL_SQL | RIG_LEVEL_IF | \