Add extension parameter handling for K2/K3 RIT/XIT

Implemented kenwood_cfg_params structure to allow RIT/XIT tokens to be
available to all Kenwood backend rigs (Fine Step and Voice announce are
also defined).  K2/K3 rigs can only set/get RIT/XIT.

Updated README.k2/k3 for RIT/XIT functions and prior updates.

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@3031 7ae35d74-ebe9-4afe-98af-79ac388436b8
This commit is contained in:
Nate Bargmann, N0NB 2011-02-01 00:48:45 +00:00
parent 992b0842e4
commit 15615ec467
8 changed files with 63 additions and 14 deletions

View File

@ -20,4 +20,15 @@ it also checks for K2 or K3 extensions and sets a pair of private variables
that may be used later for advanced functions. This way the backend should be
able to reliably test for either a K2 or K3 (needs more testing with the K2).
This function also probes the K2 for the RTTY option and then installed filters
and bandwidths. This information is stored in a structure and used later. The
probe adds about 10 seconds to the rig_open.
kenwood_get/set_ext_parms()
===========================
These functions are used to get and set RIT/XIT on and off. The special token
names of 'rit' and 'xit' are used with the P/p commands of rigctl[d] for the
'parm'. Set/returned value is 0 or 1 for off or on.

View File

@ -91,3 +91,20 @@ rigctl) will set the bandwidth to 2350 Hz (rounded down by the K3).
The k3_get_mode function will query and return the actual bandwidth in use in
Hertz.
k3_get_ext_level()
==================
This function is used to query the K3 for the IF center frequency. Use the 'l'
command with the token name 'ifctr' for 'Level' to read in rigctl[d]. Value
returned is 8210000.0 + queried value from rig (see K3 Programmers Reference,
FI command). Returned type is a floating point value.
kenwood_get/set_ext_parms()
===========================
These functions are used to get and set RIT/XIT on and off. The special token
names of 'rit' and 'xit' are used with the P/p commands of rigctl[d] for the
'parm'. Set/returned value is 0 or 1 for off or on.

View File

@ -23,7 +23,6 @@
#include <string.h>
#include <stdlib.h>
#include "token.h"
#include "elecraft.h"
#include "kenwood.h"

View File

@ -21,8 +21,7 @@
#ifndef _ELECRAFT_H
#define _ELECRAFT_H 1
#include "token.h"
#include "hamlib/rig.h"
/* The Elecraft Programmer's Reference details the extension level that
* a K2 or K3 may have in effect which modify certain commands.
@ -57,12 +56,4 @@ enum k3_data_submodes_e {
int elecraft_open(RIG *rig);
/* Tokens for Extra Levels and Parameters common to multiple rigs.
* Use token # >= 1 or <= 100. Defined here so they will be available in
* Elecraft name space.
*/
/* Place common tokens here */
#endif /* _ELECRAFT_H */

View File

@ -209,6 +209,8 @@ const struct rig_caps k2_caps = {
.get_dcd = kenwood_get_dcd,
.set_func = kenwood_set_func,
.get_func = kenwood_get_func,
.set_ext_parm = kenwood_set_ext_parm,
.get_ext_parm = kenwood_get_ext_parm,
.set_level = kenwood_set_level,
.get_level = kenwood_get_level,
.vfo_op = kenwood_vfo_op,

View File

@ -52,7 +52,7 @@
/* Private tokens used for ext_lvl and ext_parm functions in K3 backend.
* Extra parameters and levels which are rig specific should be coded in
* the individual rig files and token #s > 100.
* the individual rig files and token #s >= 101.
*/
#define TOK_IF_FREQ TOKEN_BACKEND(101) /* K3 FI command */
@ -61,7 +61,7 @@
* See enum rig_conf_e and struct confparams in rig.h
*/
static const struct confparams k3_ext_levels[] = {
{ TOK_IF_FREQ, "IFCTR", "IF center frequency", "IF center freq",
{ TOK_IF_FREQ, "ifctr", "IF center frequency", "IF center freq",
NULL, RIG_CONF_NUMERIC, { .n = { 0, 9990, 10 } }
},
{ RIG_CONF_END, NULL, }
@ -124,6 +124,7 @@ const struct rig_caps k3_caps = {
.level_gran = {}, /* FIXME: granularity */
.parm_gran = {},
.extlevels = k3_ext_levels,
.extparms = kenwood_cfg_params,
.preamp = { 14, RIG_DBLST_END, },
.attenuator = { 10, RIG_DBLST_END, },
.max_rit = Hz(9990),
@ -210,6 +211,8 @@ const struct rig_caps k3_caps = {
.get_dcd = kenwood_get_dcd,
.set_func = kenwood_set_func,
.get_func = kenwood_get_func,
.set_ext_parm = kenwood_set_ext_parm,
.get_ext_parm = kenwood_get_ext_parm,
.set_level = kenwood_set_level,
.get_level = kenwood_get_level,
.get_ext_level = k3_get_ext_level,
@ -416,7 +419,6 @@ int k3_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
char buf[KENWOOD_MAX_BUF_LEN];
int err;
struct kenwood_priv_data *priv = (struct kenwood_priv_data *)rig->state.priv;
const struct confparams *cfp;
cfp = rig_ext_lookup_tok(rig, token);

View File

@ -131,6 +131,24 @@ const tone_t kenwood38_ctcss_list[] = {
0,
};
/* Token definitions for .cfgparams in rig_caps
*
* See enum rig_conf_e and struct confparams in rig.h
*/
const struct confparams kenwood_cfg_params[] = {
{ TOK_FINE, "fine", "Fine", "Fine step mode",
NULL, RIG_CONF_CHECKBUTTON, { } },
{ TOK_VOICE, "voice", "Voice", "Voice recall",
NULL, RIG_CONF_BUTTON, { } },
{ TOK_XIT, "xit", "XIT", "XIT",
NULL, RIG_CONF_CHECKBUTTON, { } },
{ TOK_RIT, "rit", "RIT", "RIT",
NULL, RIG_CONF_CHECKBUTTON, { } },
{ RIG_CONF_END, NULL, }
};
/**
* kenwood_transaction
* Assumes rig!=NULL rig->state!=NULL rig->caps!=NULL

View File

@ -32,11 +32,20 @@
#define KENWOOD_MODE_TABLE_MAX 10
#define KENWOOD_MAX_BUF_LEN 50 /* max answer len, arbitrary */
/* Tokens for Parameters common to multiple rigs.
* Use token # >= 1 or <= 100. Defined here so they will be
* available in Kenwood name space.
*/
#define TOK_VOICE TOKEN_BACKEND(1)
#define TOK_FINE TOKEN_BACKEND(2)
#define TOK_XIT TOKEN_BACKEND(3)
#define TOK_RIT TOKEN_BACKEND(4)
/* Token structure assigned to .cfgparams in rig_caps */
extern const struct confparams kenwood_cfg_params[];
/*
* modes in use by the "MD" command
*/