kopia lustrzana https://github.com/Hamlib/Hamlib
Implemented initial abstraction for spectrum scope data and support for Icom spectrum data output. The abstraction is based on common features of both Icom and Kenwood rigs. Added TRANSCEIVE func and enumeration of supported AGC levels. Work in progress.
rodzic
86d2b4ee6c
commit
b4ba22d369
|
@ -195,6 +195,11 @@ typedef struct s_rig RIG;
|
|||
#define HAMLIB_FLTLSTSIZ 60 /* max mode/filter list size, zero ended */
|
||||
#define HAMLIB_MAXDBLSTSIZ 8 /* max preamp/att levels supported, zero ended */
|
||||
#define HAMLIB_CHANLSTSIZ 16 /* max mem_list size, zero ended */
|
||||
#define HAMLIB_MAX_AGC_LEVELS 8 /* max AGC levels supported */
|
||||
#define HAMLIB_MAX_SPECTRUM_SCOPES 4 /* max number of spectrum scopes supported */
|
||||
#define HAMLIB_MAX_SPECTRUM_MODES 5 /* max number of spectrum modes supported */
|
||||
#define HAMLIB_MAX_SPECTRUM_AVG_MODES 12 /* max number of spectrum averaging modes supported */
|
||||
#define HAMLIB_MAX_SPECTRUM_SPANS 20 /* max number of spectrum modes supported */
|
||||
#define HAMLIB_MAX_CAL_LENGTH 32 /* max calibration plots in cal_table_t */
|
||||
#define HAMLIB_MAX_MODES 63
|
||||
#define HAMLIB_MAX_VFOS 31
|
||||
|
@ -504,6 +509,7 @@ typedef unsigned int vfo_t;
|
|||
#define RIG_TARGETABLE_BANK (1<<9)
|
||||
#define RIG_TARGETABLE_ANT (1<<10)
|
||||
#define RIG_TARGETABLE_ROOFING (1<<11) // roofing filter targetable by VFO
|
||||
#define RIG_TARGETABLE_SPECTRUM (1<<12) // spectrum scope targetable by VFO
|
||||
#define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK)
|
||||
#define RIG_TARGETABLE_ALL 0x7fffffff
|
||||
//! @endcond
|
||||
|
@ -920,13 +926,13 @@ typedef uint64_t rig_level_e;
|
|||
#define RIG_LEVEL_MONITOR_GAIN CONSTANT_64BIT_FLAG(37) /*!< \c MONITOR_GAIN -- Monitor gain (level for monitoring of transmitted audio) arg float [0.0 ... 1.0] */
|
||||
#define RIG_LEVEL_NB CONSTANT_64BIT_FLAG(38) /*!< \c NB -- Noise Blanker level, arg float [0.0 ... 1.0] */
|
||||
#define RIG_LEVEL_RFPOWER_METER_WATTS CONSTANT_64BIT_FLAG(39) /*!< \c RFPOWER_METER_WATTS -- RF power output meter, arg float [0.0 ... MAX] (output power in watts) */
|
||||
#define RIG_LEVEL_40 CONSTANT_64BIT_FLAG(40) /*!< \c Future use */
|
||||
#define RIG_LEVEL_41 CONSTANT_64BIT_FLAG(41) /*!< \c Future use */
|
||||
#define RIG_LEVEL_42 CONSTANT_64BIT_FLAG(42) /*!< \c Future use */
|
||||
#define RIG_LEVEL_43 CONSTANT_64BIT_FLAG(43) /*!< \c Future use */
|
||||
#define RIG_LEVEL_44 CONSTANT_64BIT_FLAG(44) /*!< \c Future use */
|
||||
#define RIG_LEVEL_45 CONSTANT_64BIT_FLAG(45) /*!< \c Future use */
|
||||
#define RIG_LEVEL_46 CONSTANT_64BIT_FLAG(46) /*!< \c Future use */
|
||||
#define RIG_LEVEL_SPECTRUM_MODE CONSTANT_64BIT_FLAG(40) /*!< \c SPECTRUM_MODE -- Spectrum scope mode, arg int (see enum rig_spectrum_mode_e). Supported modes defined in rig caps. */
|
||||
#define RIG_LEVEL_SPECTRUM_SPAN CONSTANT_64BIT_FLAG(41) /*!< \c SPECTRUM_SPAN -- Spectrum scope span in center mode, arg int (Hz). Supported spans defined in rig caps. */
|
||||
#define RIG_LEVEL_SPECTRUM_EDGE_LOW CONSTANT_64BIT_FLAG(42) /*!< \c SPECTRUM_EDGE_LOW -- Spectrum scope low edge in fixed mode, arg int (Hz) */
|
||||
#define RIG_LEVEL_SPECTRUM_EDGE_HIGH CONSTANT_64BIT_FLAG(43) /*!< \c SPECTRUM_EDGE_HIGH -- Spectrum scope high edge in fixed mode, arg int (Hz) */
|
||||
#define RIG_LEVEL_SPECTRUM_SPEED CONSTANT_64BIT_FLAG(44) /*!< \c SPECTRUM_SPEED -- Spectrum scope update speed, arg int (highest is fastest, define rig-specific granularity) */
|
||||
#define RIG_LEVEL_SPECTRUM_REF CONSTANT_64BIT_FLAG(45) /*!< \c SPECTRUM_REF -- Spectrum scope reference display level, arg float (dB, define rig-specific granularity) */
|
||||
#define RIG_LEVEL_SPECTRUM_AVG CONSTANT_64BIT_FLAG(46) /*!< \c SPECTRUM_AVG -- Spectrum scope averaging mode, arg int (see struct rig_spectrum_avg_mode). Supported averaging modes defined in rig caps. */
|
||||
#define RIG_LEVEL_47 CONSTANT_64BIT_FLAG(47) /*!< \c Future use */
|
||||
#define RIG_LEVEL_48 CONSTANT_64BIT_FLAG(48) /*!< \c Future use */
|
||||
#define RIG_LEVEL_49 CONSTANT_64BIT_FLAG(49) /*!< \c Future use */
|
||||
|
@ -946,7 +952,7 @@ typedef uint64_t rig_level_e;
|
|||
#define RIG_LEVEL_63 CONSTANT_64BIT_FLAG(63) /*!< \c Future use */
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
#define RIG_LEVEL_FLOAT_LIST (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_APF|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|RIG_LEVEL_BALANCE|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
|
||||
#define RIG_LEVEL_FLOAT_LIST (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_APF|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|RIG_LEVEL_BALANCE|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_REF)
|
||||
|
||||
#define RIG_LEVEL_READONLY_LIST (RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_STRENGTH|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER)
|
||||
|
||||
|
@ -1012,14 +1018,14 @@ typedef uint64_t setting_t;
|
|||
#define RIG_SETTING_MAX 64
|
||||
|
||||
/**
|
||||
* \brief Tranceive mode
|
||||
* \brief Transceive mode
|
||||
* The rig notifies the host of any event, like freq changed, mode changed, etc.
|
||||
* \def RIG_TRN_OFF
|
||||
* Turn it off
|
||||
* \brief Tranceive mode
|
||||
* \brief Transceive mode
|
||||
* \def RIG_TRN_RIG
|
||||
* RIG_TRN_RIG means the rig acts asynchrousnly
|
||||
* \brief Tranceive mode
|
||||
* RIG_TRN_RIG means the rig acts asynchronously
|
||||
* \brief Transceive mode
|
||||
* \def RIG_TRN_POLL
|
||||
* RIG_TRN_POLL means we have to poll the rig
|
||||
*
|
||||
|
@ -1091,9 +1097,9 @@ typedef uint64_t setting_t;
|
|||
#define RIG_FUNC_DSQL CONSTANT_64BIT_FLAG (39) /*!< \c DSQL -- Digital modes squelch */
|
||||
#define RIG_FUNC_SCEN CONSTANT_64BIT_FLAG (40) /*!< \c SCEN -- scrambler/encryption */
|
||||
#define RIG_FUNC_SLICE CONSTANT_64BIT_FLAG (41) /*!< \c Rig slice selection -- Flex */
|
||||
#define RIG_FUNC_BIT42 CONSTANT_64BIT_FLAG (42) /*!< \c available for future RIG_FUNC items */
|
||||
#define RIG_FUNC_BIT43 CONSTANT_64BIT_FLAG (43) /*!< \c available for future RIG_FUNC items */
|
||||
#define RIG_FUNC_BIT44 CONSTANT_64BIT_FLAG (44) /*!< \c available for future RIG_FUNC items */
|
||||
#define RIG_FUNC_TRANSCEIVE CONSTANT_64BIT_FLAG (42) /*!< \c TRANSCEIVE -- Send radio state changes automatically ON/OFF */
|
||||
#define RIG_FUNC_SPECTRUM CONSTANT_64BIT_FLAG (43) /*!< \c SPECTRUM -- Spectrum scope data output ON/OFF */
|
||||
#define RIG_FUNC_SPECTRUM_HOLD CONSTANT_64BIT_FLAG (44) /*!< \c SPECTRUM_HOLD -- Pause spectrum scope updates ON/OFF */
|
||||
#define RIG_FUNC_BIT45 CONSTANT_64BIT_FLAG (45) /*!< \c available for future RIG_FUNC items */
|
||||
#define RIG_FUNC_BIT46 CONSTANT_64BIT_FLAG (46) /*!< \c available for future RIG_FUNC items */
|
||||
#define RIG_FUNC_BIT47 CONSTANT_64BIT_FLAG (47) /*!< \c available for future RIG_FUNC items */
|
||||
|
@ -1594,6 +1600,66 @@ typedef int (* confval_cb_t)(RIG *,
|
|||
rig_ptr_t);
|
||||
//! @endcond
|
||||
|
||||
/**
|
||||
* \brief Spectrum scope
|
||||
*/
|
||||
struct rig_spectrum_scope
|
||||
{
|
||||
int id;
|
||||
char *name;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Spectrum scope modes
|
||||
*/
|
||||
enum rig_spectrum_mode_e {
|
||||
RIG_SPECTRUM_MODE_NONE = 0,
|
||||
RIG_SPECTRUM_MODE_CENTER, /*!< Spectrum scope centered around the VFO frequency */
|
||||
RIG_SPECTRUM_MODE_FIXED, /*!< Spectrum scope edge frequencies are fixed */
|
||||
RIG_SPECTRUM_MODE_CENTER_SCROLL, /*!< Spectrum scope edge frequencies are fixed, but identical to what the center mode would use. Scrolling is enabled. */
|
||||
RIG_SPECTRUM_MODE_FIXED_SCROLL, /*!< Spectrum scope edge frequencies are fixed with scrolling enabled */
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Spectrum scope averaging modes
|
||||
*/
|
||||
struct rig_spectrum_avg_mode
|
||||
{
|
||||
int id;
|
||||
char *name;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Represents a single line of rig spectrum scope FFT data.
|
||||
*
|
||||
* The data levels specify the range of the spectrum scope FFT data.
|
||||
* The minimum level should represent the lowest numeric value and the lowest signal level in dB.
|
||||
* The maximum level should represent the highest numeric value and the highest signal level in dB.
|
||||
* The data level values are assumed to represent the dB strength scale in a linear way.
|
||||
*
|
||||
* Note that the data level and signal strength ranges may change depending on the settings of the rig.
|
||||
* At least on Kenwood the sub-scope provides different kind of data compared to the main scope.
|
||||
*/
|
||||
struct rig_spectrum_line
|
||||
{
|
||||
int id; /*!< Numeric ID of the spectrum scope data stream identifying the VFO/receiver. First ID is zero. Rigs with multiple scopes usually have identifiers, such as 0 = Main, 1 = Sub. */
|
||||
|
||||
int data_level_min; /*!< The numeric value that represents the minimum signal level. */
|
||||
int data_level_max; /*!< The numeric value that represents the maximum signal level. */
|
||||
double signal_strength_min; /*!< The strength of the minimum signal level in dB. */
|
||||
double signal_strength_max; /*!< The strength of the maximum signal level in dB. */
|
||||
|
||||
enum rig_spectrum_mode_e spectrum_mode; /*!< Spectrum mode. */
|
||||
|
||||
freq_t center_freq; /*!< Center frequency of the spectrum scope in Hz in RIG_SPECTRUM_CENTER mode. */
|
||||
freq_t span_freq; /*!< Span of the spectrum scope in Hz in RIG_SPECTRUM_CENTER mode. */
|
||||
|
||||
freq_t low_edge_freq; /*!< Low edge frequency of the spectrum scope in Hz in RIG_SPECTRUM_FIXED mode. */
|
||||
freq_t high_edge_freq; /*!< High edge frequency of the spectrum scope in Hz in RIG_SPECTRUM_FIXED mode. */
|
||||
|
||||
int spectrum_data_length; /*!< Number of bytes of 8-bit spectrum data in the data buffer. The amount of data may vary if the rig has multiple spectrum scopes, depending on the scope. */
|
||||
unsigned char *spectrum_data; /*!< 8-bit spectrum data covering bandwidth of either the span_freq in center mode or from low edge to high edge in fixed mode. A higher value represents higher signal strength. */
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Rig data structure.
|
||||
|
@ -1665,6 +1731,9 @@ struct rig_caps {
|
|||
shortfreq_t max_xit; /*!< max absolute XIT */
|
||||
shortfreq_t max_ifshift; /*!< max absolute IF-SHIFT */
|
||||
|
||||
int agc_level_count; /*!< Number of supported AGC levels. Zero indicates all modes should be available (for backwards-compatibility). */
|
||||
enum agc_level_e agc_levels[HAMLIB_MAX_AGC_LEVELS]; /*!< Supported AGC levels */
|
||||
|
||||
ann_t announces; /*!< Announces bit field list */
|
||||
|
||||
vfo_op_t vfo_ops; /*!< VFO op bit field list */
|
||||
|
@ -1703,7 +1772,12 @@ struct rig_caps {
|
|||
cal_table_float_t vd_meter_cal; /*!< Voltage meter calibration table */
|
||||
cal_table_float_t id_meter_cal; /*!< Current draw meter calibration table */
|
||||
|
||||
const struct confparams *cfgparams; /*!< Configuration parametres. */
|
||||
struct rig_spectrum_scope spectrum_scopes[HAMLIB_MAX_SPECTRUM_SCOPES]; /*!< Supported spectrum scopes. The array index must match the scope ID. Last entry must have NULL name. */
|
||||
enum rig_spectrum_mode_e spectrum_modes[HAMLIB_MAX_SPECTRUM_MODES]; /*!< Supported spectrum scope modes. Last entry must be RIG_SPECTRUM_MODE_NONE. */
|
||||
freq_t spectrum_spans[HAMLIB_MAX_SPECTRUM_SPANS]; /*!< Supported spectrum scope frequency spans in Hz in center mode. Last entry must be 0. */
|
||||
struct rig_spectrum_avg_mode spectrum_avg_modes[HAMLIB_MAX_SPECTRUM_AVG_MODES]; /*!< Supported spectrum scope averaging modes. Last entry must have NULL name. */
|
||||
|
||||
const struct confparams *cfgparams; /*!< Configuration parameters. */
|
||||
const rig_ptr_t priv; /*!< Private data. */
|
||||
|
||||
/*
|
||||
|
@ -2295,6 +2369,9 @@ typedef int (*pltune_cb_t)(RIG *,
|
|||
rmode_t *,
|
||||
pbwidth_t *,
|
||||
rig_ptr_t);
|
||||
typedef int (*spectrum_cb_t)(RIG *,
|
||||
struct rig_spectrum_line *,
|
||||
rig_ptr_t);
|
||||
|
||||
//! @endcond
|
||||
|
||||
|
@ -2328,6 +2405,8 @@ struct rig_callbacks {
|
|||
rig_ptr_t dcd_arg; /*!< DCD change argument */
|
||||
pltune_cb_t pltune; /*!< Pipeline tuning module freq/mode/width callback */
|
||||
rig_ptr_t pltune_arg; /*!< Pipeline tuning argument */
|
||||
spectrum_cb_t spectrum_event; /*!< Spectrum line reception event */
|
||||
rig_ptr_t spectrum_arg; /*!< Spectrum line reception argument */
|
||||
/* etc.. */
|
||||
};
|
||||
|
||||
|
@ -2893,6 +2972,11 @@ rig_set_pltune_callback HAMLIB_PARAMS((RIG *,
|
|||
pltune_cb_t,
|
||||
rig_ptr_t));
|
||||
|
||||
extern HAMLIB_EXPORT(int)
|
||||
rig_set_spectrum_callback HAMLIB_PARAMS((RIG *,
|
||||
spectrum_cb_t,
|
||||
rig_ptr_t));
|
||||
|
||||
extern HAMLIB_EXPORT(int)
|
||||
rig_set_twiddle HAMLIB_PARAMS((RIG *rig,
|
||||
int seconds));
|
||||
|
@ -3013,11 +3097,13 @@ extern HAMLIB_EXPORT(const char *) rig_strvfo(vfo_t vfo);
|
|||
extern HAMLIB_EXPORT(const char *) rig_strfunc(setting_t);
|
||||
extern HAMLIB_EXPORT(const char *) rig_strlevel(setting_t);
|
||||
extern HAMLIB_EXPORT(const char *) rig_strparm(setting_t);
|
||||
extern HAMLIB_EXPORT(const char *) rig_stragclevel(enum agc_level_e level);
|
||||
extern HAMLIB_EXPORT(const char *) rig_strptrshift(rptr_shift_t);
|
||||
extern HAMLIB_EXPORT(const char *) rig_strvfop(vfo_op_t op);
|
||||
extern HAMLIB_EXPORT(const char *) rig_strscan(scan_t scan);
|
||||
extern HAMLIB_EXPORT(const char *) rig_strstatus(enum rig_status_e status);
|
||||
extern HAMLIB_EXPORT(const char *) rig_strmtype(chan_type_t mtype);
|
||||
extern HAMLIB_EXPORT(const char *) rig_strspectrummode(enum rig_spectrum_mode_e mode);
|
||||
|
||||
extern HAMLIB_EXPORT(rmode_t) rig_parse_mode(const char *s);
|
||||
extern HAMLIB_EXPORT(vfo_t) rig_parse_vfo(const char *s);
|
||||
|
|
|
@ -24,17 +24,15 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h> /* String function definitions */
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "token.h"
|
||||
#include "idx_builtin.h"
|
||||
|
||||
#include "token.h"
|
||||
#include "icom.h"
|
||||
#include "icom_defs.h"
|
||||
#include "frame.h"
|
||||
#include "misc.h"
|
||||
#include "bandplan.h"
|
||||
#include "tones.h"
|
||||
|
||||
|
@ -49,9 +47,9 @@ static int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val);
|
|||
#define IC7300_OTHER_TX_MODES (RIG_MODE_FM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR)
|
||||
#define IC7300_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
|
||||
|
||||
#define IC7300_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_SCOPE|RIG_FUNC_TUNER)
|
||||
#define IC7300_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_SCOPE|RIG_FUNC_TUNER|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD)
|
||||
|
||||
#define IC7300_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
|
||||
#define IC7300_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_MODE|RIG_LEVEL_SPECTRUM_SPAN|RIG_LEVEL_SPECTRUM_SPEED|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_SPECTRUM_AVG|RIG_LEVEL_SPECTRUM_EDGE_LOW|RIG_LEVEL_SPECTRUM_EDGE_HIGH)
|
||||
|
||||
#define IC7300_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
|
||||
#define IC7300_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP)
|
||||
|
@ -136,15 +134,15 @@ static int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val);
|
|||
#define IC705_ALL_TX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR)
|
||||
#define IC705_ALL_RX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM|RIG_MODE_DSTAR)
|
||||
#define IC705_OTHER_TX_MODES (RIG_MODE_FM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR)
|
||||
#define IC705_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
|
||||
#define IC705_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_MODE|RIG_LEVEL_SPECTRUM_SPAN|RIG_LEVEL_SPECTRUM_SPEED|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_SPECTRUM_AVG|RIG_LEVEL_SPECTRUM_EDGE_LOW|RIG_LEVEL_SPECTRUM_EDGE_HIGH)
|
||||
|
||||
/*
|
||||
* IC9700 items that differ from IC7300
|
||||
*/
|
||||
#define IC9700_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM|RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
|
||||
#define IC9700_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP|RIG_PARM_SCREENSAVER)
|
||||
#define IC9700_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_SCOPE|RIG_FUNC_SATMODE|RIG_FUNC_AFC)
|
||||
#define IC9700_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
|
||||
#define IC9700_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_SCOPE|RIG_FUNC_SATMODE|RIG_FUNC_AFC|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD)
|
||||
#define IC9700_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_MODE|RIG_LEVEL_SPECTRUM_SPAN|RIG_LEVEL_SPECTRUM_SPEED|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_SPECTRUM_AVG|RIG_LEVEL_SPECTRUM_EDGE_LOW|RIG_LEVEL_SPECTRUM_EDGE_HIGH)
|
||||
#define IC9700_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
|
||||
#define IC9700_SCAN_OPS (RIG_SCAN_STOP|RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_SLCT)
|
||||
#define IC9700_ALL_TX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR|RIG_MODE_DD)
|
||||
|
@ -220,6 +218,8 @@ struct cmdparams ic7300_extcmds[] =
|
|||
{ {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 },
|
||||
{ {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x59}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x71}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x02}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_PARM_NONE} }
|
||||
};
|
||||
|
||||
|
@ -230,6 +230,8 @@ struct cmdparams ic9700_extcmds[] =
|
|||
{ {.s = RIG_PARM_SCREENSAVER}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x80}, CMD_DAT_TIM, 2 },
|
||||
{ {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x27}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x92}, CMD_DAT_INT, 1 },
|
||||
{ {0} }
|
||||
};
|
||||
|
||||
|
@ -240,9 +242,26 @@ struct cmdparams ic705_extcmds[] =
|
|||
{ {.s = RIG_PARM_SCREENSAVER}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x38}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x66}, CMD_DAT_TIM, 2 },
|
||||
{ {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x31}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x78}, CMD_DAT_INT, 1 },
|
||||
{ {0} }
|
||||
};
|
||||
|
||||
int ic7300_ext_tokens[] =
|
||||
{
|
||||
TOK_SCOPE_STX, TOK_SCOPE_CFQ, TOK_SCOPE_EDG, TOK_SCOPE_VBW, TOK_BACKEND_NONE,
|
||||
};
|
||||
|
||||
int ic9700_ext_tokens[] =
|
||||
{
|
||||
TOK_SCOPE_MSS, TOK_SCOPE_SDS, TOK_SCOPE_STX, TOK_SCOPE_CFQ, TOK_SCOPE_EDG, TOK_SCOPE_VBW, TOK_SCOPE_MKP, TOK_BACKEND_NONE,
|
||||
};
|
||||
|
||||
int ic705_ext_tokens[] =
|
||||
{
|
||||
TOK_SCOPE_STX, TOK_SCOPE_CFQ, TOK_SCOPE_EDG, TOK_SCOPE_VBW, TOK_BACKEND_NONE,
|
||||
};
|
||||
|
||||
/*
|
||||
* IC-7300 rig capabilities.
|
||||
*/
|
||||
|
@ -259,6 +278,86 @@ static const struct icom_priv_caps IC7300_priv_caps =
|
|||
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
|
||||
{ .level = -1, .icom_level = 0 },
|
||||
},
|
||||
.spectrum_scope_caps = {
|
||||
.spectrum_line_length = 475,
|
||||
.single_frame_data_length = 50,
|
||||
.data_level_min = 0,
|
||||
.data_level_max = 160,
|
||||
.signal_strength_min = -80,
|
||||
.signal_strength_max = 0,
|
||||
},
|
||||
.spectrum_edge_frequency_ranges = {
|
||||
{
|
||||
.range_id = 1,
|
||||
.low_freq = 30000,
|
||||
.high_freq = 1600000,
|
||||
},
|
||||
{
|
||||
.range_id = 2,
|
||||
.low_freq = 1600000,
|
||||
.high_freq = 2000000,
|
||||
},
|
||||
{
|
||||
.range_id = 3,
|
||||
.low_freq = 2000000,
|
||||
.high_freq = 6000000,
|
||||
},
|
||||
{
|
||||
.range_id = 4,
|
||||
.low_freq = 6000000,
|
||||
.high_freq = 8000000,
|
||||
},
|
||||
{
|
||||
.range_id = 5,
|
||||
.low_freq = 8000000,
|
||||
.high_freq = 11000000,
|
||||
},
|
||||
{
|
||||
.range_id = 6,
|
||||
.low_freq = 11000000,
|
||||
.high_freq = 15000000,
|
||||
},
|
||||
{
|
||||
.range_id = 7,
|
||||
.low_freq = 15000000,
|
||||
.high_freq = 20000000,
|
||||
},
|
||||
{
|
||||
.range_id = 8,
|
||||
.low_freq = 20000000,
|
||||
.high_freq = 22000000,
|
||||
},
|
||||
{
|
||||
.range_id = 9,
|
||||
.low_freq = 22000000,
|
||||
.high_freq = 26000000,
|
||||
},
|
||||
{
|
||||
.range_id = 10,
|
||||
.low_freq = 26000000,
|
||||
.high_freq = 30000000,
|
||||
},
|
||||
{
|
||||
.range_id = 11,
|
||||
.low_freq = 30000000,
|
||||
.high_freq = 45000000,
|
||||
},
|
||||
{
|
||||
.range_id = 12,
|
||||
.low_freq = 45000000,
|
||||
.high_freq = 60000000,
|
||||
},
|
||||
{
|
||||
.range_id = 13,
|
||||
.low_freq = 60000000,
|
||||
.high_freq = 74800000,
|
||||
},
|
||||
{
|
||||
.range_id = 0,
|
||||
.low_freq = 0,
|
||||
.high_freq = 0,
|
||||
},
|
||||
},
|
||||
.extcmds = ic7300_extcmds, /* Custom op parameters */
|
||||
};
|
||||
|
||||
|
@ -276,6 +375,36 @@ static const struct icom_priv_caps IC9700_priv_caps =
|
|||
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
|
||||
{ .level = -1, .icom_level = 0 },
|
||||
},
|
||||
.spectrum_scope_caps = {
|
||||
.spectrum_line_length = 475,
|
||||
.single_frame_data_length = 50,
|
||||
.data_level_min = 0,
|
||||
.data_level_max = 160,
|
||||
.signal_strength_min = -80, // TODO: signal strength to be confirmed
|
||||
.signal_strength_max = 0,
|
||||
},
|
||||
.spectrum_edge_frequency_ranges = {
|
||||
{
|
||||
.range_id = 1,
|
||||
.low_freq = 144000000,
|
||||
.high_freq = 148000000,
|
||||
},
|
||||
{
|
||||
.range_id = 2,
|
||||
.low_freq = 430000000,
|
||||
.high_freq = 450000000,
|
||||
},
|
||||
{
|
||||
.range_id = 3,
|
||||
.low_freq = 1240000000,
|
||||
.high_freq = 1300000000,
|
||||
},
|
||||
{
|
||||
.range_id = 0,
|
||||
.low_freq = 0,
|
||||
.high_freq = 0,
|
||||
},
|
||||
},
|
||||
.extcmds = ic9700_extcmds, /* Custom op parameters */
|
||||
};
|
||||
|
||||
|
@ -293,6 +422,111 @@ static const struct icom_priv_caps IC705_priv_caps =
|
|||
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
|
||||
{ .level = -1, .icom_level = 0 },
|
||||
},
|
||||
.spectrum_scope_caps = {
|
||||
.spectrum_line_length = 475,
|
||||
.single_frame_data_length = 50,
|
||||
.data_level_min = 0,
|
||||
.data_level_max = 160,
|
||||
.signal_strength_min = -80, // TODO: signal strength to be confirmed
|
||||
.signal_strength_max = 0,
|
||||
},
|
||||
.spectrum_edge_frequency_ranges = {
|
||||
{
|
||||
.range_id = 1,
|
||||
.low_freq = 30000,
|
||||
.high_freq = 1600000,
|
||||
},
|
||||
{
|
||||
.range_id = 2,
|
||||
.low_freq = 1600000,
|
||||
.high_freq = 2000000,
|
||||
},
|
||||
{
|
||||
.range_id = 3,
|
||||
.low_freq = 2000000,
|
||||
.high_freq = 6000000,
|
||||
},
|
||||
{
|
||||
.range_id = 4,
|
||||
.low_freq = 6000000,
|
||||
.high_freq = 8000000,
|
||||
},
|
||||
{
|
||||
.range_id = 5,
|
||||
.low_freq = 8000000,
|
||||
.high_freq = 11000000,
|
||||
},
|
||||
{
|
||||
.range_id = 6,
|
||||
.low_freq = 11000000,
|
||||
.high_freq = 15000000,
|
||||
},
|
||||
{
|
||||
.range_id = 7,
|
||||
.low_freq = 15000000,
|
||||
.high_freq = 20000000,
|
||||
},
|
||||
{
|
||||
.range_id = 8,
|
||||
.low_freq = 20000000,
|
||||
.high_freq = 22000000,
|
||||
},
|
||||
{
|
||||
.range_id = 9,
|
||||
.low_freq = 22000000,
|
||||
.high_freq = 26000000,
|
||||
},
|
||||
{
|
||||
.range_id = 10,
|
||||
.low_freq = 26000000,
|
||||
.high_freq = 30000000,
|
||||
},
|
||||
{
|
||||
.range_id = 11,
|
||||
.low_freq = 30000000,
|
||||
.high_freq = 45000000,
|
||||
},
|
||||
{
|
||||
.range_id = 12,
|
||||
.low_freq = 45000000,
|
||||
.high_freq = 60000000,
|
||||
},
|
||||
{
|
||||
.range_id = 13,
|
||||
.low_freq = 60000000,
|
||||
.high_freq = 74800000,
|
||||
},
|
||||
{
|
||||
.range_id = 13,
|
||||
.low_freq = 60000000,
|
||||
.high_freq = 74800000,
|
||||
},
|
||||
{
|
||||
.range_id = 14,
|
||||
.low_freq = 74800000,
|
||||
.high_freq = 108000000,
|
||||
},
|
||||
{
|
||||
.range_id = 15,
|
||||
.low_freq = 108000000,
|
||||
.high_freq = 137000000,
|
||||
},
|
||||
{
|
||||
.range_id = 16,
|
||||
.low_freq = 137000000,
|
||||
.high_freq = 200000000,
|
||||
},
|
||||
{
|
||||
.range_id = 17,
|
||||
.low_freq = 400000000,
|
||||
.high_freq = 470000000,
|
||||
},
|
||||
{
|
||||
.range_id = 0,
|
||||
.low_freq = 0,
|
||||
.high_freq = 0,
|
||||
},
|
||||
},
|
||||
.extcmds = ic705_extcmds, /* Custom parameters */
|
||||
};
|
||||
|
||||
|
@ -330,9 +564,13 @@ const struct rig_caps ic7300_caps =
|
|||
[LVL_VOXDELAY] = {.min = {.i = 0}, .max = {.i = 20}, .step = {.i = 1}},
|
||||
[LVL_KEYSPD] = {.min = {.i = 6}, .max = {.i = 48}, .step = {.i = 1}},
|
||||
[LVL_CWPITCH] = {.min = {.i = 300}, .max = {.i = 900}, .step = {.i = 1}},
|
||||
[LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
|
||||
[LVL_SPECTRUM_REF] = {.min = {.f = -20.0f}, .max = {.f = 20.0f}, .step = {.f = 0.5f}},
|
||||
[LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
|
||||
},
|
||||
.parm_gran = {},
|
||||
.extlevels = NULL,
|
||||
.ext_tokens = ic7300_ext_tokens,
|
||||
.extlevels = icom_ext_levels,
|
||||
.ctcss_list = full_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
.preamp = { 1, 2, RIG_DBLST_END, },
|
||||
|
@ -340,6 +578,8 @@ const struct rig_caps ic7300_caps =
|
|||
.max_rit = Hz(9999),
|
||||
.max_xit = Hz(9999),
|
||||
.max_ifshift = Hz(0),
|
||||
.agc_level_count = 3,
|
||||
.agc_levels = { RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW },
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
.vfo_ops = IC7300_VFO_OPS,
|
||||
.scan_ops = IC7300_SCAN_OPS,
|
||||
|
@ -405,6 +645,53 @@ const struct rig_caps ic7300_caps =
|
|||
.vd_meter_cal = IC7300_VD_METER_CAL,
|
||||
.id_meter_cal = IC7300_ID_METER_CAL,
|
||||
|
||||
.spectrum_scopes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "Main",
|
||||
},
|
||||
{
|
||||
.id = -1,
|
||||
.name = NULL,
|
||||
},
|
||||
},
|
||||
.spectrum_modes = {
|
||||
RIG_SPECTRUM_MODE_CENTER,
|
||||
RIG_SPECTRUM_MODE_FIXED,
|
||||
RIG_SPECTRUM_MODE_CENTER_SCROLL,
|
||||
RIG_SPECTRUM_MODE_FIXED_SCROLL,
|
||||
RIG_SPECTRUM_MODE_NONE,
|
||||
},
|
||||
.spectrum_spans = {
|
||||
5000,
|
||||
10000,
|
||||
20000,
|
||||
50000,
|
||||
100000,
|
||||
200000,
|
||||
500000,
|
||||
1000000,
|
||||
0,
|
||||
},
|
||||
.spectrum_avg_modes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "OFF",
|
||||
},
|
||||
{
|
||||
.id = 1,
|
||||
.name = "2",
|
||||
},
|
||||
{
|
||||
.id = 2,
|
||||
.name = "3",
|
||||
},
|
||||
{
|
||||
.id = 3,
|
||||
.name = "4",
|
||||
},
|
||||
},
|
||||
|
||||
.cfgparams = icom_cfg_params,
|
||||
.set_conf = icom_set_conf,
|
||||
.get_conf = icom_get_conf,
|
||||
|
@ -502,9 +789,13 @@ const struct rig_caps ic9700_caps =
|
|||
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
|
||||
[LVL_KEYSPD] = {.min = {.i = 6}, .max = {.i = 48}, .step = {.i = 1}},
|
||||
[LVL_CWPITCH] = {.min = {.i = 300}, .max = {.i = 900}, .step = {.i = 1}},
|
||||
[LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
|
||||
[LVL_SPECTRUM_REF] = {.min = {.f = -20.0f}, .max = {.f = 20.0f}, .step = {.f = 0.5f}},
|
||||
[LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
|
||||
},
|
||||
.parm_gran = {},
|
||||
.extlevels = NULL,
|
||||
.ext_tokens = ic9700_ext_tokens,
|
||||
.extlevels = icom_ext_levels,
|
||||
.ctcss_list = full_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
.preamp = { 1, 2, 3, RIG_DBLST_END, },
|
||||
|
@ -512,7 +803,9 @@ const struct rig_caps ic9700_caps =
|
|||
.max_rit = Hz(9999),
|
||||
.max_xit = Hz(9999),
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
.agc_level_count = 3,
|
||||
.agc_levels = { RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW },
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_SPECTRUM,
|
||||
.vfo_ops = IC9700_VFO_OPS,
|
||||
.scan_ops = IC9700_SCAN_OPS,
|
||||
.transceive = RIG_TRN_RIG,
|
||||
|
@ -655,6 +948,57 @@ const struct rig_caps ic9700_caps =
|
|||
.vd_meter_cal = IC9700_VD_METER_CAL,
|
||||
.id_meter_cal = IC9700_ID_METER_CAL,
|
||||
|
||||
.spectrum_scopes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "Main",
|
||||
},
|
||||
{
|
||||
.id = 1,
|
||||
.name = "Sub",
|
||||
},
|
||||
{
|
||||
.id = -1,
|
||||
.name = NULL,
|
||||
},
|
||||
},
|
||||
.spectrum_modes = {
|
||||
RIG_SPECTRUM_MODE_CENTER,
|
||||
RIG_SPECTRUM_MODE_FIXED,
|
||||
RIG_SPECTRUM_MODE_CENTER_SCROLL,
|
||||
RIG_SPECTRUM_MODE_FIXED_SCROLL,
|
||||
RIG_SPECTRUM_MODE_NONE,
|
||||
},
|
||||
.spectrum_spans = {
|
||||
5000,
|
||||
10000,
|
||||
20000,
|
||||
50000,
|
||||
100000,
|
||||
200000,
|
||||
500000,
|
||||
1000000,
|
||||
0,
|
||||
},
|
||||
.spectrum_avg_modes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "OFF",
|
||||
},
|
||||
{
|
||||
.id = 1,
|
||||
.name = "2",
|
||||
},
|
||||
{
|
||||
.id = 2,
|
||||
.name = "3",
|
||||
},
|
||||
{
|
||||
.id = 3,
|
||||
.name = "4",
|
||||
},
|
||||
},
|
||||
|
||||
.cfgparams = icom_cfg_params,
|
||||
.set_conf = icom_set_conf,
|
||||
.get_conf = icom_get_conf,
|
||||
|
@ -749,9 +1093,13 @@ const struct rig_caps ic705_caps =
|
|||
[LVL_VOXDELAY] = {.min = {.i = 0}, .max = {.i = 20}, .step = {.i = 1}},
|
||||
[LVL_KEYSPD] = {.min = {.i = 6}, .max = {.i = 48}, .step = {.i = 1}},
|
||||
[LVL_CWPITCH] = {.min = {.i = 300}, .max = {.i = 900}, .step = {.i = 1}},
|
||||
[LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
|
||||
[LVL_SPECTRUM_REF] = {.min = {.f = -20.0f}, .max = {.f = 20.0f}, .step = {.f = 0.5f}},
|
||||
[LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
|
||||
},
|
||||
.parm_gran = {},
|
||||
.extlevels = NULL,
|
||||
.ext_tokens = ic705_ext_tokens,
|
||||
.extlevels = icom_ext_levels,
|
||||
.ctcss_list = full_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
.preamp = { 1, 2, RIG_DBLST_END, },
|
||||
|
@ -759,6 +1107,8 @@ const struct rig_caps ic705_caps =
|
|||
.max_rit = Hz(9999),
|
||||
.max_xit = Hz(9999),
|
||||
.max_ifshift = Hz(0),
|
||||
.agc_level_count = 3,
|
||||
.agc_levels = { RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW },
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
.vfo_ops = IC7300_VFO_OPS,
|
||||
.scan_ops = IC7300_SCAN_OPS,
|
||||
|
@ -857,6 +1207,53 @@ const struct rig_caps ic705_caps =
|
|||
.vd_meter_cal = IC7300_VD_METER_CAL,
|
||||
.id_meter_cal = IC7300_ID_METER_CAL,
|
||||
|
||||
.spectrum_scopes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "Main",
|
||||
},
|
||||
{
|
||||
.id = -1,
|
||||
.name = NULL,
|
||||
},
|
||||
},
|
||||
.spectrum_modes = {
|
||||
RIG_SPECTRUM_MODE_CENTER,
|
||||
RIG_SPECTRUM_MODE_FIXED,
|
||||
RIG_SPECTRUM_MODE_CENTER_SCROLL,
|
||||
RIG_SPECTRUM_MODE_FIXED_SCROLL,
|
||||
RIG_SPECTRUM_MODE_NONE,
|
||||
},
|
||||
.spectrum_spans = {
|
||||
5000,
|
||||
10000,
|
||||
20000,
|
||||
50000,
|
||||
100000,
|
||||
200000,
|
||||
500000,
|
||||
1000000,
|
||||
0,
|
||||
},
|
||||
.spectrum_avg_modes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "OFF",
|
||||
},
|
||||
{
|
||||
.id = 1,
|
||||
.name = "2",
|
||||
},
|
||||
{
|
||||
.id = 2,
|
||||
.name = "3",
|
||||
},
|
||||
{
|
||||
.id = 3,
|
||||
.name = "4",
|
||||
},
|
||||
},
|
||||
|
||||
.cfgparams = icom_cfg_params,
|
||||
.set_conf = icom_set_conf,
|
||||
.get_conf = icom_get_conf,
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h> /* String function definitions */
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
|
@ -32,8 +31,6 @@
|
|||
|
||||
#include "icom.h"
|
||||
#include "icom_defs.h"
|
||||
#include "frame.h"
|
||||
#include "misc.h"
|
||||
#include "bandplan.h"
|
||||
|
||||
#define IC7600_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTAM|RIG_MODE_PKTFM)
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h> /* String function definitions */
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
|
@ -33,8 +32,6 @@
|
|||
|
||||
#include "icom.h"
|
||||
#include "icom_defs.h"
|
||||
#include "frame.h"
|
||||
#include "misc.h"
|
||||
#include "bandplan.h"
|
||||
|
||||
#define IC7610_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTAM|RIG_MODE_PKTFM)
|
||||
|
@ -42,12 +39,12 @@
|
|||
#define IC7610_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM)
|
||||
#define IC7610_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
|
||||
|
||||
#define IC7610_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF|RIG_FUNC_DUAL_WATCH)
|
||||
#define IC7610_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF|RIG_FUNC_DUAL_WATCH|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD)
|
||||
|
||||
#define IC7610_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
|
||||
#define IC7610_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_MODE|RIG_LEVEL_SPECTRUM_SPAN|RIG_LEVEL_SPECTRUM_SPEED|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_SPECTRUM_AVG|RIG_LEVEL_SPECTRUM_EDGE_LOW|RIG_LEVEL_SPECTRUM_EDGE_HIGH)
|
||||
|
||||
#define IC7610_VFOS (RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM)
|
||||
#define IC7610_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
|
||||
#define IC7610_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP)
|
||||
|
||||
#define IC7610_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
|
||||
#define IC7610_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_PROG|RIG_SCAN_DELTA|RIG_SCAN_PRIO)
|
||||
|
@ -134,13 +131,20 @@
|
|||
|
||||
struct cmdparams ic7610_extcmds[] =
|
||||
{
|
||||
{ {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x24}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x41}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x59}, CMD_DAT_TIM, 2 },
|
||||
{ {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x02, 0x92}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x12}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x70}, CMD_DAT_INT, 1 },
|
||||
{ { 0 } }
|
||||
};
|
||||
|
||||
int ic7610_ext_tokens[] =
|
||||
{
|
||||
TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE
|
||||
TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL,
|
||||
TOK_SCOPE_MSS, TOK_SCOPE_SDS, TOK_SCOPE_STX, TOK_SCOPE_CFQ, TOK_SCOPE_EDG, TOK_SCOPE_VBW, TOK_SCOPE_RBW, TOK_SCOPE_MKP,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -161,6 +165,81 @@ static const struct icom_priv_caps ic7610_priv_caps =
|
|||
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
|
||||
{ .level = -1, .icom_level = 0 },
|
||||
},
|
||||
.spectrum_scope_caps = {
|
||||
.spectrum_line_length = 689,
|
||||
.single_frame_data_length = 50,
|
||||
.data_level_min = 0,
|
||||
.data_level_max = 200,
|
||||
.signal_strength_min = -100,
|
||||
.signal_strength_max = 0,
|
||||
},
|
||||
.spectrum_edge_frequency_ranges = {
|
||||
{
|
||||
.range_id = 1,
|
||||
.low_freq = 30000,
|
||||
.high_freq = 1600000,
|
||||
},
|
||||
{
|
||||
.range_id = 2,
|
||||
.low_freq = 1600000,
|
||||
.high_freq = 2000000,
|
||||
},
|
||||
{
|
||||
.range_id = 3,
|
||||
.low_freq = 2000000,
|
||||
.high_freq = 6000000,
|
||||
},
|
||||
{
|
||||
.range_id = 4,
|
||||
.low_freq = 6000000,
|
||||
.high_freq = 8000000,
|
||||
},
|
||||
{
|
||||
.range_id = 5,
|
||||
.low_freq = 8000000,
|
||||
.high_freq = 11000000,
|
||||
},
|
||||
{
|
||||
.range_id = 6,
|
||||
.low_freq = 11000000,
|
||||
.high_freq = 15000000,
|
||||
},
|
||||
{
|
||||
.range_id = 7,
|
||||
.low_freq = 15000000,
|
||||
.high_freq = 20000000,
|
||||
},
|
||||
{
|
||||
.range_id = 8,
|
||||
.low_freq = 20000000,
|
||||
.high_freq = 22000000,
|
||||
},
|
||||
{
|
||||
.range_id = 9,
|
||||
.low_freq = 22000000,
|
||||
.high_freq = 26000000,
|
||||
},
|
||||
{
|
||||
.range_id = 10,
|
||||
.low_freq = 26000000,
|
||||
.high_freq = 30000000,
|
||||
},
|
||||
{
|
||||
.range_id = 11,
|
||||
.low_freq = 30000000,
|
||||
.high_freq = 45000000,
|
||||
},
|
||||
{
|
||||
.range_id = 12,
|
||||
.low_freq = 45000000,
|
||||
.high_freq = 60000000,
|
||||
},
|
||||
{
|
||||
.range_id = 0,
|
||||
.low_freq = 0,
|
||||
.high_freq = 0,
|
||||
},
|
||||
},
|
||||
.extcmds = ic7610_extcmds,
|
||||
};
|
||||
|
||||
|
@ -198,9 +277,13 @@ const struct rig_caps ic7610_caps =
|
|||
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
|
||||
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
|
||||
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
|
||||
[LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
|
||||
[LVL_SPECTRUM_REF] = {.min = {.f = -30.0f}, .max = {.f = 10.0f}, .step = {.f = 0.5f}},
|
||||
[LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
|
||||
},
|
||||
.parm_gran = {},
|
||||
.ext_tokens = ic7610_ext_tokens,
|
||||
.extlevels = icom_ext_levels,
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
.preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */
|
||||
|
@ -208,7 +291,9 @@ const struct rig_caps ic7610_caps =
|
|||
.max_rit = Hz(9999),
|
||||
.max_xit = Hz(9999),
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
.agc_level_count = 3,
|
||||
.agc_levels = { RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW },
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_SPECTRUM,
|
||||
.vfo_ops = IC7610_VFO_OPS,
|
||||
.scan_ops = IC7610_SCAN_OPS,
|
||||
.transceive = RIG_TRN_RIG,
|
||||
|
@ -286,6 +371,57 @@ const struct rig_caps ic7610_caps =
|
|||
.vd_meter_cal = IC7610_VD_METER_CAL,
|
||||
.id_meter_cal = IC7610_ID_METER_CAL,
|
||||
|
||||
.spectrum_scopes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "Main",
|
||||
},
|
||||
{
|
||||
.id = 1,
|
||||
.name = "Sub",
|
||||
},
|
||||
{
|
||||
.id = -1,
|
||||
.name = NULL,
|
||||
},
|
||||
},
|
||||
.spectrum_modes = {
|
||||
RIG_SPECTRUM_MODE_CENTER,
|
||||
RIG_SPECTRUM_MODE_FIXED,
|
||||
RIG_SPECTRUM_MODE_CENTER_SCROLL,
|
||||
RIG_SPECTRUM_MODE_FIXED_SCROLL,
|
||||
RIG_SPECTRUM_MODE_NONE,
|
||||
},
|
||||
.spectrum_spans = {
|
||||
5000,
|
||||
10000,
|
||||
20000,
|
||||
50000,
|
||||
100000,
|
||||
200000,
|
||||
500000,
|
||||
1000000,
|
||||
0,
|
||||
},
|
||||
.spectrum_avg_modes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "OFF",
|
||||
},
|
||||
{
|
||||
.id = 1,
|
||||
.name = "2",
|
||||
},
|
||||
{
|
||||
.id = 2,
|
||||
.name = "3",
|
||||
},
|
||||
{
|
||||
.id = 3,
|
||||
.name = "4",
|
||||
},
|
||||
},
|
||||
|
||||
.cfgparams = icom_cfg_params,
|
||||
.set_conf = icom_set_conf,
|
||||
.get_conf = icom_get_conf,
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h> /* String function definitions */
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
|
@ -33,8 +32,6 @@
|
|||
|
||||
#include "icom.h"
|
||||
#include "icom_defs.h"
|
||||
#include "frame.h"
|
||||
#include "misc.h"
|
||||
#include "bandplan.h"
|
||||
|
||||
#define IC785x_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTAM|RIG_MODE_PKTFM)
|
||||
|
@ -42,12 +39,12 @@
|
|||
#define IC785x_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM)
|
||||
#define IC785x_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
|
||||
|
||||
#define IC785x_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF|RIG_FUNC_DUAL_WATCH)
|
||||
#define IC785x_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF|RIG_FUNC_DUAL_WATCH|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD)
|
||||
|
||||
#define IC785x_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_APF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
|
||||
#define IC785x_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_APF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_MODE|RIG_LEVEL_SPECTRUM_SPAN|RIG_LEVEL_SPECTRUM_SPEED|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_SPECTRUM_AVG|RIG_LEVEL_SPECTRUM_EDGE_LOW|RIG_LEVEL_SPECTRUM_EDGE_HIGH)
|
||||
|
||||
#define IC785x_VFOS (RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM)
|
||||
#define IC785x_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
|
||||
#define IC785x_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP)
|
||||
|
||||
#define IC785x_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
|
||||
#define IC785x_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_PROG|RIG_SCAN_DELTA|RIG_SCAN_PRIO)
|
||||
|
@ -126,14 +123,21 @@ int ic785x_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
|||
|
||||
struct cmdparams ic785x_extcmds[] =
|
||||
{
|
||||
{ {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x04}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x76}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x96}, CMD_DAT_TIM, 2 },
|
||||
{ {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x09}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x55}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x87}, CMD_DAT_INT, 1 },
|
||||
{ { 0 } }
|
||||
};
|
||||
|
||||
|
||||
int ic785x_ext_tokens[] =
|
||||
{
|
||||
TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE
|
||||
TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL,
|
||||
TOK_SCOPE_MSS, TOK_SCOPE_SDS, TOK_SCOPE_STX, TOK_SCOPE_CFQ, TOK_SCOPE_EDG, TOK_SCOPE_VBW, TOK_SCOPE_MKP,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -155,6 +159,81 @@ static struct icom_priv_caps ic785x_priv_caps =
|
|||
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
|
||||
{ .level = -1, .icom_level = 0 },
|
||||
},
|
||||
.spectrum_scope_caps = {
|
||||
.spectrum_line_length = 689,
|
||||
.single_frame_data_length = 50,
|
||||
.data_level_min = 0,
|
||||
.data_level_max = 200,
|
||||
.signal_strength_min = -100,
|
||||
.signal_strength_max = 0,
|
||||
},
|
||||
.spectrum_edge_frequency_ranges = {
|
||||
{
|
||||
.range_id = 1,
|
||||
.low_freq = 30000,
|
||||
.high_freq = 1600000,
|
||||
},
|
||||
{
|
||||
.range_id = 2,
|
||||
.low_freq = 1600000,
|
||||
.high_freq = 2000000,
|
||||
},
|
||||
{
|
||||
.range_id = 3,
|
||||
.low_freq = 2000000,
|
||||
.high_freq = 6000000,
|
||||
},
|
||||
{
|
||||
.range_id = 4,
|
||||
.low_freq = 6000000,
|
||||
.high_freq = 8000000,
|
||||
},
|
||||
{
|
||||
.range_id = 5,
|
||||
.low_freq = 8000000,
|
||||
.high_freq = 11000000,
|
||||
},
|
||||
{
|
||||
.range_id = 6,
|
||||
.low_freq = 11000000,
|
||||
.high_freq = 15000000,
|
||||
},
|
||||
{
|
||||
.range_id = 7,
|
||||
.low_freq = 15000000,
|
||||
.high_freq = 20000000,
|
||||
},
|
||||
{
|
||||
.range_id = 8,
|
||||
.low_freq = 20000000,
|
||||
.high_freq = 22000000,
|
||||
},
|
||||
{
|
||||
.range_id = 9,
|
||||
.low_freq = 22000000,
|
||||
.high_freq = 26000000,
|
||||
},
|
||||
{
|
||||
.range_id = 10,
|
||||
.low_freq = 26000000,
|
||||
.high_freq = 30000000,
|
||||
},
|
||||
{
|
||||
.range_id = 11,
|
||||
.low_freq = 30000000,
|
||||
.high_freq = 45000000,
|
||||
},
|
||||
{
|
||||
.range_id = 12,
|
||||
.low_freq = 45000000,
|
||||
.high_freq = 60000000,
|
||||
},
|
||||
{
|
||||
.range_id = 0,
|
||||
.low_freq = 0,
|
||||
.high_freq = 0,
|
||||
},
|
||||
},
|
||||
.extcmds = ic785x_extcmds,
|
||||
};
|
||||
|
||||
|
@ -192,9 +271,13 @@ const struct rig_caps ic785x_caps =
|
|||
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
|
||||
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
|
||||
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
|
||||
[LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
|
||||
[LVL_SPECTRUM_REF] = {.min = {.f = -20.0f}, .max = {.f = 20.0f}, .step = {.f = 0.5f}},
|
||||
[LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
|
||||
},
|
||||
.parm_gran = {},
|
||||
.ext_tokens = ic785x_ext_tokens,
|
||||
.extlevels = icom_ext_levels,
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
.preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */
|
||||
|
@ -202,7 +285,9 @@ const struct rig_caps ic785x_caps =
|
|||
.max_rit = Hz(9999),
|
||||
.max_xit = Hz(9999),
|
||||
.max_ifshift = Hz(0),
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
.agc_level_count = 3,
|
||||
.agc_levels = { RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW },
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_SPECTRUM,
|
||||
.vfo_ops = IC785x_VFO_OPS,
|
||||
.scan_ops = IC785x_SCAN_OPS,
|
||||
.transceive = RIG_TRN_RIG,
|
||||
|
@ -280,6 +365,57 @@ const struct rig_caps ic785x_caps =
|
|||
.vd_meter_cal = IC785x_VD_METER_CAL,
|
||||
.id_meter_cal = IC785x_ID_METER_CAL,
|
||||
|
||||
.spectrum_scopes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "Main",
|
||||
},
|
||||
{
|
||||
.id = 1,
|
||||
.name = "Sub",
|
||||
},
|
||||
{
|
||||
.id = -1,
|
||||
.name = NULL,
|
||||
},
|
||||
},
|
||||
.spectrum_modes = {
|
||||
RIG_SPECTRUM_MODE_CENTER,
|
||||
RIG_SPECTRUM_MODE_FIXED,
|
||||
RIG_SPECTRUM_MODE_CENTER_SCROLL,
|
||||
RIG_SPECTRUM_MODE_FIXED_SCROLL,
|
||||
RIG_SPECTRUM_MODE_NONE,
|
||||
},
|
||||
.spectrum_spans = {
|
||||
5000,
|
||||
10000,
|
||||
20000,
|
||||
50000,
|
||||
100000,
|
||||
200000,
|
||||
500000,
|
||||
1000000,
|
||||
0,
|
||||
},
|
||||
.spectrum_avg_modes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "OFF",
|
||||
},
|
||||
{
|
||||
.id = 1,
|
||||
.name = "2",
|
||||
},
|
||||
{
|
||||
.id = 2,
|
||||
.name = "3",
|
||||
},
|
||||
{
|
||||
.id = 3,
|
||||
.name = "4",
|
||||
},
|
||||
},
|
||||
|
||||
.cfgparams = icom_cfg_params,
|
||||
.set_conf = icom_set_conf,
|
||||
.get_conf = icom_get_conf,
|
||||
|
|
830
rigs/icom/icom.c
830
rigs/icom/icom.c
Plik diff jest za duży
Load Diff
148
rigs/icom/icom.h
148
rigs/icom/icom.h
|
@ -30,7 +30,12 @@
|
|||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND_VER "20210507"
|
||||
#define BACKEND_VER "20210525"
|
||||
|
||||
#define ICOM_IS_SECONDARY_VFO(vfo) ((vfo) & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B))
|
||||
#define ICOM_GET_VFO_NUMBER(vfo) (ICOM_IS_SECONDARY_VFO(vfo) ? 0x01 : 0x00)
|
||||
|
||||
#define ICOM_MAX_SPECTRUM_FREQ_RANGES 20
|
||||
|
||||
/*
|
||||
* defines used by comp_cal_str in rig.c
|
||||
|
@ -74,7 +79,6 @@
|
|||
*/
|
||||
#define UNKNOWN_IC_STR_CAL { 2, {{ 0, -60}, { 255, 60}} }
|
||||
|
||||
|
||||
struct ts_sc_list
|
||||
{
|
||||
shortfreq_t ts; /* tuning step */
|
||||
|
@ -97,12 +101,15 @@ typedef struct rig_pltstate
|
|||
int usleep_time; /* dependent on radio module & serial data rate */
|
||||
} pltstate_t;
|
||||
|
||||
/**
|
||||
* \brief Mappings between Hamlib and Icom AGC levels
|
||||
*/
|
||||
struct icom_agc_level
|
||||
{
|
||||
enum agc_level_e
|
||||
level; /* Hamlib AGC level from agc_level_e enum, the last entry should have level -1 */
|
||||
level; /*!< Hamlib AGC level from agc_level_e enum, the last entry should have level -1 */
|
||||
unsigned char
|
||||
icom_level; /* Icom AGC level for C_CTL_FUNC (0x16), S_FUNC_AGC (0x12) command */
|
||||
icom_level; /*!< Icom AGC level for C_CTL_FUNC (0x16), S_FUNC_AGC (0x12) command */
|
||||
};
|
||||
|
||||
typedef enum
|
||||
|
@ -114,27 +121,74 @@ typedef enum
|
|||
CMD_PARAM_TYPE_FUNC,
|
||||
} cmd_param_t;
|
||||
|
||||
struct cmdparams /* Lookup table item for levels & parms */
|
||||
/**
|
||||
* \brief Lookup table item for Icom levels & parms
|
||||
*/
|
||||
struct cmdparams
|
||||
{
|
||||
union
|
||||
{
|
||||
setting_t s; /* Level or parm */
|
||||
token_t t; /* TOKEN_BACKEND */
|
||||
setting_t s; /*!< Level or parm */
|
||||
token_t t; /*!< TOKEN_BACKEND */
|
||||
} id;
|
||||
cmd_param_t cmdparamtype; /* CMD_PARAM_TYPE_LEVEL or CMD_PARAM_TYPE_PARM */
|
||||
int command; /* CI-V command */
|
||||
int subcmd; /* CI-V Subcommand */
|
||||
int submod; /* Subcommand modifier */
|
||||
int sublen; /* Number of bytes for subcommand extension */
|
||||
unsigned char subext[4]; /* Subcommand extension bytes */
|
||||
int dattyp; /* Data type conversion */
|
||||
int datlen; /* Number of data bytes in frame */
|
||||
cmd_param_t cmdparamtype; /*!< CMD_PARAM_TYPE_LEVEL or CMD_PARAM_TYPE_PARM */
|
||||
int command; /*!< CI-V command */
|
||||
int subcmd; /*!< CI-V Subcommand */
|
||||
int submod; /*!< Subcommand modifier */
|
||||
int sublen; /*!< Number of bytes for subcommand extension */
|
||||
unsigned char subext[4]; /*!< Subcommand extension bytes */
|
||||
int dattyp; /*!< Data type conversion */
|
||||
int datlen; /*!< Number of data bytes in frame */
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Icom-specific spectrum scope capabilities, if supported by the rig.
|
||||
*/
|
||||
struct icom_spectrum_scope_caps
|
||||
{
|
||||
int spectrum_line_length; /*!< Number of bytes in a complete spectrum scope line */
|
||||
int single_frame_data_length; /*!< Number of bytes of specrtum data in a single CI-V frame when the data split to multiple frames */
|
||||
int data_level_min; /*!< */
|
||||
int data_level_max;
|
||||
double signal_strength_min;
|
||||
double signal_strength_max;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Icom spectrum scope edge frequencies, if supported by the rig.
|
||||
*
|
||||
* Last entry should have zeros in all fields.
|
||||
*/
|
||||
struct icom_spectrum_edge_frequency_range
|
||||
{
|
||||
int range_id; /*!< ID of the range, as specified in the Icom CI-V manuals. First range ID is 1. */
|
||||
freq_t low_freq; /*!< The low edge frequency if the range in Hz */
|
||||
freq_t high_freq; /*!< The high edge frequency if the range in Hz */
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Cached Icom spectrum scope data.
|
||||
*
|
||||
* This data is used to store data for current line of spectrum data as it is being received from the rig.
|
||||
* Caching the data is necessary for handling spectrum scope data split in multiple CI-V frames.
|
||||
*/
|
||||
struct icom_spectrum_scope_cache
|
||||
{
|
||||
int id; /*!< Numeric ID of the spectrum scope data stream identifying the VFO/receiver. First ID is zero. Icom rigs with multiple scopes have IDs: 0 = Main, 1 = Sub. */
|
||||
int spectrum_metadata_valid; /*!< Boolean value to track validity of the cached data for spectrum scope. */
|
||||
enum rig_spectrum_mode_e spectrum_mode; /*!< The spectrum mode of the current spectrum scope line being received. */
|
||||
freq_t spectrum_center_freq; /*!< The center frequency of the current spectrum scope line being received */
|
||||
freq_t spectrum_span_freq; /*!< The frequency span of the current spectrum scope line being received */
|
||||
freq_t spectrum_low_edge_freq; /*!< The low edge frequency of the current spectrum scope line being received */
|
||||
freq_t spectrum_high_edge_freq; /*!< The high edge frequency of the current spectrum scope line being received */
|
||||
int spectrum_data_length; /*!< Number of bytes of 8-bit spectrum data in the data buffer. The amount of data may vary if the rig has multiple spectrum scopes, depending on the scope. */
|
||||
unsigned char *spectrum_data; /*!< Dynamically allocated buffer for raw spectrum data */
|
||||
};
|
||||
|
||||
struct icom_priv_caps
|
||||
{
|
||||
unsigned char re_civ_addr; /* the remote dlft equipment's CI-V address*/
|
||||
int civ_731_mode; /* Off: freqs on 10 digits, On: freqs on 8 digits plus passband setting */
|
||||
unsigned char re_civ_addr; /*!< The remote equipment's default CI-V address */
|
||||
int civ_731_mode; /*!< Off: freqs on 10 digits, On: freqs on 8 digits plus passband setting */
|
||||
// According to the CI-V+ manual the IC-781, IC-R9000, and IC-R7000 can select pas$
|
||||
// The other rigs listed apparently cannot and may need the civ_731_mode=1 which are
|
||||
// 1-706
|
||||
|
@ -155,56 +209,58 @@ struct icom_priv_caps
|
|||
// 16-703
|
||||
// 17-7800
|
||||
|
||||
|
||||
int no_xchg; /* Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */
|
||||
int no_xchg; /*!< Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */
|
||||
const struct ts_sc_list *ts_sc_list;
|
||||
// the 4 elements above are mandatory
|
||||
// everything below here is optional in the backends
|
||||
int settle_time; /*!< Receiver settle time, in ms */
|
||||
int (*r2i_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
|
||||
unsigned char *md, signed char *pd); /*< backend specific code
|
||||
unsigned char *md, signed char *pd); /*!< backend specific code
|
||||
to convert bandwidth and
|
||||
mode to cmd tokens */
|
||||
void (*i2r_mode)(RIG *rig, unsigned char md, int pd,
|
||||
rmode_t *mode, pbwidth_t *width); /*< backend specific code
|
||||
rmode_t *mode, pbwidth_t *width); /*!< backend specific code
|
||||
to convert response
|
||||
tokens to bandwidth and
|
||||
mode */
|
||||
int antack_len; /* Length of 0x12 cmd may be 3 or 4 bytes as of 2020-01-22 e.g. 7851 */
|
||||
int ant_count; /* number of antennas */
|
||||
int antack_len; /*!< Length of 0x12 cmd may be 3 or 4 bytes as of 2020-01-22 e.g. 7851 */
|
||||
int ant_count; /*!< Number of antennas */
|
||||
int serial_full_duplex; /*!< Whether RXD&TXD are not tied together */
|
||||
int offs_len; /* Number of bytes in offset frequency field. 0 defaults to 3 */
|
||||
int serial_USB_echo_check; /* Flag to test USB echo state */
|
||||
int agc_levels_present; /* Flag to indicate that agc_levels array is populated */
|
||||
int offs_len; /*!< Number of bytes in offset frequency field. 0 defaults to 3 */
|
||||
int serial_USB_echo_check; /*!< Flag to test USB echo state */
|
||||
int agc_levels_present; /*!< Flag to indicate that agc_levels array is populated */
|
||||
struct icom_agc_level agc_levels[RIG_AGC_LAST +
|
||||
1]; /* Icom rig-specific AGC levels, the last entry should have level -1 */
|
||||
struct cmdparams *extcmds; /* Pointer to extended operations array */
|
||||
1]; /*!< Icom rig-specific AGC levels, the last entry should have level -1 */
|
||||
struct icom_spectrum_scope_caps spectrum_scope_caps; /*!< Icom spectrum scope capabilities, if supported by the rig. Main/Sub scopes in Icom rigs have the same caps. */
|
||||
struct icom_spectrum_edge_frequency_range spectrum_edge_frequency_ranges[ICOM_MAX_SPECTRUM_FREQ_RANGES]; /*!< Icom spectrum scope edge frequencies, if supported by the rig. Last entry should have zeros in all fields. */
|
||||
struct cmdparams *extcmds; /*!< Pointer to extended operations array */
|
||||
};
|
||||
|
||||
|
||||
struct icom_priv_data
|
||||
{
|
||||
unsigned char re_civ_addr; /* the remote equipment's CI-V address*/
|
||||
int civ_731_mode; /* Off: freqs on 10 digits, On: freqs on 8 digits */
|
||||
int no_xchg; /* Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */
|
||||
int no_1a_03_cmd; /* rig doesn't tell IF widths */
|
||||
int split_on; /* record split state */
|
||||
pltstate_t *pltstate; /* only on optoscan */
|
||||
int serial_USB_echo_off; /* USB is not set to echo */
|
||||
unsigned char re_civ_addr; /*!< The remote equipment's CI-V address */
|
||||
int civ_731_mode; /*!< Off: freqs on 10 digits, On: freqs on 8 digits */
|
||||
int no_xchg; /*!< Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */
|
||||
int no_1a_03_cmd; /*!< Rig doesn't tell IF widths */
|
||||
int split_on; /*!< Record split state */
|
||||
pltstate_t *pltstate; /*!< Only on optoscan */
|
||||
int serial_USB_echo_off; /*!< USB is not set to echo */
|
||||
/* we track vfos internally for use with different functions like split */
|
||||
/* this allows queries using CURR_VFO and Main/Sub to behave */
|
||||
vfo_t rx_vfo;
|
||||
vfo_t tx_vfo;
|
||||
freq_t curr_freq; // our current freq depending on which vfo is selected
|
||||
freq_t main_freq; // track last setting of main -- not being used yet
|
||||
freq_t sub_freq; // track last setting of sub -- not being used yet
|
||||
freq_t vfoa_freq; // track last setting of vfoa -- used to return last freq when ptt is asserted
|
||||
freq_t vfob_freq; // track last setting of vfob -- used to return last freq when ptt is asserted
|
||||
int x25cmdfails; // This will get set if the 0x25 command fails so we try just once
|
||||
int x1cx03cmdfails; // This will get set if the 0x1c 0x03 command fails so we try just once
|
||||
int poweron; // to prevent powering on more than once
|
||||
unsigned char filter; // Current filter selected
|
||||
unsigned char datamode; // Current datamode
|
||||
freq_t curr_freq; /*!< Our current freq depending on which vfo is selected */
|
||||
freq_t main_freq; /*!< Track last setting of main -- not being used yet */
|
||||
freq_t sub_freq; /*!< Track last setting of sub -- not being used yet */
|
||||
freq_t vfoa_freq; /*!< Track last setting of vfoa -- used to return last freq when ptt is asserted */
|
||||
freq_t vfob_freq; /*!< Track last setting of vfob -- used to return last freq when ptt is asserted */
|
||||
int x25cmdfails; /*!< This will get set if the 0x25 command fails so we try just once */
|
||||
int x1cx03cmdfails; /*!< This will get set if the 0x1c 0x03 command fails so we try just once */
|
||||
int poweron; /*!< To prevent powering on more than once */
|
||||
unsigned char filter; /*!< Current filter selected */
|
||||
unsigned char datamode; /*!< Current datamode */
|
||||
int spectrum_scope_count; /*!< Number of spectrum scopes, calculated from caps */
|
||||
struct icom_spectrum_scope_cache spectrum_scope_cache[HAMLIB_MAX_SPECTRUM_SCOPES]; /*!< Cached Icom spectrum scope data used during reception of the data. The array index must match the scope ID. */
|
||||
};
|
||||
|
||||
extern const struct ts_sc_list r8500_ts_sc_list[];
|
||||
|
|
|
@ -477,16 +477,20 @@
|
|||
#define S_SCP_STS 0x10 /* On/Off status */
|
||||
#define S_SCP_DOP 0x11 /* Data O/P Control */
|
||||
#define S_SCP_MSS 0x12 /* Main/Sub setting */
|
||||
#define S_SCP_MOD 0x14 /* Centre/Fixed mode */
|
||||
#define S_SCP_SDS 0x13 /* Single/Dual scope setting */
|
||||
#define S_SCP_MOD 0x14 /* Center/Fixed mode */
|
||||
#define S_SCP_SPN 0x15 /* Span setting */
|
||||
#define S_SCP_EDG 0x16 /* Edge setting */
|
||||
#define S_SCP_HLD 0x17 /* Hold On/Off */
|
||||
#define S_SCP_ATT 0x18 /* Attenuator */
|
||||
#define S_SCP_REF 0x19 /* Reference level */
|
||||
#define S_SCP_SWP 0x1a /* Sweep speed */
|
||||
#define S_SCP_STX 0x1b /* Scope during Tx */
|
||||
#define S_SCP_TYP 0x1c /* Display type */
|
||||
#define S_SCP_VBW 0x1d /* VBW setting */
|
||||
#define S_SCP_CFQ 0x1c /* Center frequency type */
|
||||
#define S_SCP_VBW 0x1d /* Video Band Width (VBW) setting */
|
||||
#define S_SCP_FEF 0x1e /* Fixed edge freqs */
|
||||
#define S_SCP_RBW 0x1f /* Resolution Band Width (RBW) setting */
|
||||
#define S_SCP_MKP 0x20 /* Marker position setting */
|
||||
|
||||
/*
|
||||
* C_CTL_MISC OptoScan extension
|
||||
|
@ -550,20 +554,15 @@
|
|||
#define TOK_DSTAR_TX_MESS TOKEN_BACKEND(128)
|
||||
#define TOK_DSTAR_TX_DATA TOKEN_BACKEND(129)
|
||||
#define TOK_DSTAR_CODE TOKEN_BACKEND(130)
|
||||
#define TOK_SCOPE_DAT TOKEN_BACKEND(131)
|
||||
#define TOK_SCOPE_STS TOKEN_BACKEND(132)
|
||||
#define TOK_SCOPE_DOP TOKEN_BACKEND(133)
|
||||
#define TOK_SCOPE_MSS TOKEN_BACKEND(134)
|
||||
#define TOK_SCOPE_MOD TOKEN_BACKEND(135)
|
||||
#define TOK_SCOPE_SPN TOKEN_BACKEND(136)
|
||||
#define TOK_SCOPE_EDG TOKEN_BACKEND(137)
|
||||
#define TOK_SCOPE_HLD TOKEN_BACKEND(138)
|
||||
#define TOK_SCOPE_REF TOKEN_BACKEND(139)
|
||||
#define TOK_SCOPE_SWP TOKEN_BACKEND(140)
|
||||
#define TOK_SCOPE_STX TOKEN_BACKEND(141)
|
||||
#define TOK_SCOPE_TYP TOKEN_BACKEND(142)
|
||||
#define TOK_SCOPE_VBW TOKEN_BACKEND(143)
|
||||
#define TOK_SCOPE_FEF TOKEN_BACKEND(144)
|
||||
#define TOK_SCOPE_MSS TOKEN_BACKEND(140)
|
||||
#define TOK_SCOPE_SDS TOKEN_BACKEND(141)
|
||||
#define TOK_SCOPE_EDG TOKEN_BACKEND(142)
|
||||
#define TOK_SCOPE_STX TOKEN_BACKEND(143)
|
||||
#define TOK_SCOPE_CFQ TOKEN_BACKEND(144)
|
||||
#define TOK_SCOPE_VBW TOKEN_BACKEND(145)
|
||||
#define TOK_SCOPE_FEF TOKEN_BACKEND(146)
|
||||
#define TOK_SCOPE_RBW TOKEN_BACKEND(147)
|
||||
#define TOK_SCOPE_MKP TOKEN_BACKEND(148)
|
||||
|
||||
/*
|
||||
* icom_ext_parm table subcommand modifiers
|
||||
|
@ -587,4 +586,20 @@
|
|||
#define CMD_DAT_BUF 0x06 /* literal byte buffer type */
|
||||
#define CMD_DAT_TIM 0x07 /* Time type HHMM<>seconds */
|
||||
|
||||
/*
|
||||
* Icom spectrum scope definitions
|
||||
*/
|
||||
|
||||
#define SCOPE_MODE_CENTER 0x00
|
||||
#define SCOPE_MODE_FIXED 0x01
|
||||
#define SCOPE_MODE_SCROLL_C 0x02
|
||||
#define SCOPE_MODE_SCROLL_F 0x03
|
||||
|
||||
#define SCOPE_SPEED_FAST 0x00
|
||||
#define SCOPE_SPEED_MID 0x01
|
||||
#define SCOPE_SPEED_SLOW 0x02
|
||||
|
||||
#define SCOPE_IN_RANGE 0x00
|
||||
#define SCOPE_OUT_OF_RANGE 0x01
|
||||
|
||||
#endif /* _ICOM_DEFS_H */
|
||||
|
|
|
@ -25,17 +25,12 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
#include "misc.h"
|
||||
#include "idx_builtin.h"
|
||||
#include "token.h"
|
||||
|
||||
#include "icom.h"
|
||||
#include "icom_defs.h"
|
||||
#include "frame.h"
|
||||
|
||||
#define ICR8600_MODES (RIG_MODE_LSB|RIG_MODE_USB|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_RTTY|\
|
||||
RIG_MODE_FM|RIG_MODE_WFM|RIG_MODE_CWR|RIG_MODE_RTTYR|RIG_MODE_SAM|RIG_MODE_SAL|\
|
||||
|
@ -44,11 +39,13 @@
|
|||
|
||||
#define ICR8600_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MN|RIG_FUNC_AFC|\
|
||||
RIG_FUNC_NR|RIG_FUNC_AIP|RIG_FUNC_LOCK|RIG_FUNC_VSC|RIG_FUNC_RESUME|RIG_FUNC_TSQL|\
|
||||
RIG_FUNC_CSQL|RIG_FUNC_DSQL)
|
||||
RIG_FUNC_CSQL|RIG_FUNC_DSQL|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD)
|
||||
|
||||
#define ICR8600_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|\
|
||||
RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_PREAMP|\
|
||||
RIG_LEVEL_AGC|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH)
|
||||
RIG_LEVEL_AGC|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_SPECTRUM_MODE|RIG_LEVEL_SPECTRUM_SPAN|\
|
||||
RIG_LEVEL_SPECTRUM_SPEED|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_SPECTRUM_AVG|\
|
||||
RIG_LEVEL_SPECTRUM_EDGE_LOW|RIG_LEVEL_SPECTRUM_EDGE_HIGH)
|
||||
|
||||
#define ICR8600_PARM_ALL (RIG_PARM_BACKLIGHT|RIG_PARM_BEEP|RIG_PARM_TIME|RIG_PARM_KEYLIGHT)
|
||||
|
||||
|
@ -73,19 +70,19 @@ struct cmdparams icr8600_extcmds[] =
|
|||
{ {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x15}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_KEYLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x16}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x32}, CMD_DAT_TIM, 2 },
|
||||
{ {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x92}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x40}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_PARM_NONE} }
|
||||
};
|
||||
|
||||
int icr8600_tokens[] = { TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE, TOK_DSTAR_STATUS,
|
||||
TOK_DSTAR_GPS_DATA, TOK_DSTAR_GPS_MESS, TOK_DSTAR_CODE, TOK_DSTAR_TX_DATA,
|
||||
TOK_SCOPE_DAT, TOK_SCOPE_STS, TOK_SCOPE_DOP, TOK_SCOPE_MSS, TOK_SCOPE_MOD, TOK_SCOPE_SPN,
|
||||
TOK_SCOPE_HLD, TOK_SCOPE_REF, TOK_SCOPE_SWP, TOK_SCOPE_TYP, TOK_SCOPE_VBW, TOK_SCOPE_FEF,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
int icr8600_tokens[] =
|
||||
{
|
||||
TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE, TOK_DSTAR_STATUS,
|
||||
TOK_DSTAR_GPS_DATA, TOK_DSTAR_GPS_MESS, TOK_DSTAR_CODE, TOK_DSTAR_TX_DATA,
|
||||
TOK_SCOPE_CFQ, TOK_SCOPE_VBW,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
/*
|
||||
* channel caps.
|
||||
*/
|
||||
#define ICR8600_MEM_CAP { \
|
||||
.freq = 1, \
|
||||
.mode = 1, \
|
||||
|
@ -106,6 +103,28 @@ static struct icom_priv_caps icr8600_priv_caps =
|
|||
.ant_count = 3,
|
||||
.offs_len = 4, /* Repeater offset is 4 bytes */
|
||||
.serial_USB_echo_check = 1, /* USB CI-V may not echo */
|
||||
.agc_levels_present = 1,
|
||||
.agc_levels = {
|
||||
{ .level = RIG_AGC_FAST, .icom_level = 1 },
|
||||
{ .level = RIG_AGC_MEDIUM, .icom_level = 2 },
|
||||
{ .level = RIG_AGC_SLOW, .icom_level = 3 },
|
||||
{ .level = -1, .icom_level = 0 },
|
||||
},
|
||||
.spectrum_scope_caps = {
|
||||
.spectrum_line_length = 475,
|
||||
.single_frame_data_length = 50,
|
||||
.data_level_min = 0,
|
||||
.data_level_max = 160,
|
||||
.signal_strength_min = -100, // TODO: signal strength to be confirmed
|
||||
.signal_strength_max = 0,
|
||||
},
|
||||
.spectrum_edge_frequency_ranges = {
|
||||
{
|
||||
.range_id = 1,
|
||||
.low_freq = 0,
|
||||
.high_freq = 3000000000,
|
||||
},
|
||||
},
|
||||
.extcmds = icr8600_extcmds /* Custom ext_cmd parameters */
|
||||
};
|
||||
|
||||
|
@ -138,7 +157,12 @@ const struct rig_caps icr8600_caps =
|
|||
.has_get_parm = ICR8600_PARM_ALL,
|
||||
.has_set_parm = RIG_PARM_SET(ICR8600_PARM_ALL),
|
||||
// cppcheck-suppress *
|
||||
.level_gran = { [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } } },
|
||||
.level_gran = {
|
||||
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
|
||||
[LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
|
||||
[LVL_SPECTRUM_REF] = {.min = {.f = -20.0f}, .max = {.f = 20.0f}, .step = {.f = 0.5f}},
|
||||
[LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
|
||||
},
|
||||
.parm_gran = { [PARM_TIME] = { .min = { .i = 0 }, .max = { .i = 86399} } },
|
||||
.ext_tokens = icr8600_tokens,
|
||||
.extlevels = icom_ext_levels,
|
||||
|
@ -151,6 +175,8 @@ const struct rig_caps icr8600_caps =
|
|||
.max_rit = Hz(0),
|
||||
.max_xit = Hz(0),
|
||||
.max_ifshift = Hz(0),
|
||||
.agc_level_count = 3,
|
||||
.agc_levels = { RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW },
|
||||
.targetable_vfo = 0,
|
||||
.vfo_ops = ICR8600_VFO_OPS,
|
||||
.scan_ops = ICR8600_SCAN_OPS,
|
||||
|
@ -213,6 +239,53 @@ const struct rig_caps icr8600_caps =
|
|||
|
||||
.str_cal = ICR8600_STR_CAL,
|
||||
|
||||
.spectrum_scopes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "Main",
|
||||
},
|
||||
{
|
||||
.id = -1,
|
||||
.name = NULL,
|
||||
},
|
||||
},
|
||||
.spectrum_modes = {
|
||||
RIG_SPECTRUM_MODE_CENTER,
|
||||
RIG_SPECTRUM_MODE_FIXED,
|
||||
RIG_SPECTRUM_MODE_NONE,
|
||||
},
|
||||
.spectrum_spans = {
|
||||
5000,
|
||||
10000,
|
||||
20000,
|
||||
50000,
|
||||
100000,
|
||||
200000,
|
||||
500000,
|
||||
1000000,
|
||||
2000000,
|
||||
5000000,
|
||||
0,
|
||||
},
|
||||
.spectrum_avg_modes = {
|
||||
{
|
||||
.id = 0,
|
||||
.name = "OFF",
|
||||
},
|
||||
{
|
||||
.id = 1,
|
||||
.name = "2",
|
||||
},
|
||||
{
|
||||
.id = 2,
|
||||
.name = "3",
|
||||
},
|
||||
{
|
||||
.id = 3,
|
||||
.name = "4",
|
||||
},
|
||||
},
|
||||
|
||||
.cfgparams = icom_cfg_params,
|
||||
|
||||
.set_conf = icom_set_conf,
|
||||
|
@ -250,6 +323,8 @@ const struct rig_caps icr8600_caps =
|
|||
.get_ext_parm = icom_get_ext_parm,
|
||||
.set_ext_func = icom_set_ext_func,
|
||||
.get_ext_func = icom_get_ext_func,
|
||||
.set_ext_level = icom_set_ext_level,
|
||||
.get_ext_level = icom_get_ext_level,
|
||||
.get_dcd = icom_get_dcd,
|
||||
.set_mem = icom_set_mem,
|
||||
.vfo_op = icom_vfo_op,
|
||||
|
|
30
src/event.c
30
src/event.c
|
@ -691,6 +691,36 @@ int HAMLIB_API rig_set_pltune_callback(RIG *rig, pltune_cb_t cb, rig_ptr_t arg)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief set the callback for spectrum line reception events
|
||||
* \param rig The rig handle
|
||||
* \param cb The callback to install
|
||||
* \param arg A Pointer to some private data to pass later on to the callback
|
||||
*
|
||||
* Install a callback for spectrum line reception events, to be called when in transceive mode.
|
||||
*
|
||||
* \return RIG_OK if the operation has been successful, otherwise
|
||||
* a negative value if an error occurred (in which case, cause is
|
||||
* set appropriately).
|
||||
*
|
||||
* \sa rig_set_trn()
|
||||
*/
|
||||
int HAMLIB_API rig_set_spectrum_callback(RIG *rig, spectrum_cb_t cb, rig_ptr_t arg)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
if (CHECK_RIG_ARG(rig))
|
||||
{
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->callbacks.spectrum_event = cb;
|
||||
rig->callbacks.spectrum_arg = arg;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief control the transceive mode
|
||||
* \param rig The rig handle
|
||||
|
|
|
@ -154,13 +154,14 @@
|
|||
|
||||
#define LVL_BRIGHT setting2idx_builtin(RIG_LEVEL_BRIGHT)
|
||||
|
||||
#define LVL_40 setting2idx_builtin(RIG_LEVEL_40)
|
||||
#define LVL_41 setting2idx_builtin(RIG_LEVEL_41)
|
||||
#define LVL_42 setting2idx_builtin(RIG_LEVEL_42)
|
||||
#define LVL_43 setting2idx_builtin(RIG_LEVEL_43)
|
||||
#define LVL_44 setting2idx_builtin(RIG_LEVEL_44)
|
||||
#define LVL_45 setting2idx_builtin(RIG_LEVEL_45)
|
||||
#define LVL_46 setting2idx_builtin(RIG_LEVEL_46)
|
||||
#define LVL_SPECTRUM_MODE setting2idx_builtin(RIG_LEVEL_SPECTRUM_MODE)
|
||||
#define LVL_SPECTRUM_SPAN setting2idx_builtin(RIG_LEVEL_SPECTRUM_SPAN)
|
||||
#define LVL_SPECTRUM_EDGE_LOW setting2idx_builtin(RIG_LEVEL_SPECTRUM_EDGE_LOW)
|
||||
#define LVL_SPECTRUM_EDGE_HIGH setting2idx_builtin(RIG_LEVEL_SPECTRUM_EDGE_HIGH)
|
||||
#define LVL_SPECTRUM_SPEED setting2idx_builtin(RIG_LEVEL_SPECTRUM_SPEED)
|
||||
#define LVL_SPECTRUM_REF setting2idx_builtin(RIG_LEVEL_SPECTRUM_REF)
|
||||
#define LVL_SPECTRUM_AVG setting2idx_builtin(RIG_LEVEL_SPECTRUM_AVG)
|
||||
|
||||
#define LVL_47 setting2idx_builtin(RIG_LEVEL_47)
|
||||
#define LVL_48 setting2idx_builtin(RIG_LEVEL_48)
|
||||
#define LVL_49 setting2idx_builtin(RIG_LEVEL_49)
|
||||
|
|
88
src/misc.c
88
src/misc.c
|
@ -679,6 +679,9 @@ static struct
|
|||
{ RIG_FUNC_DIVERSITY, "DIVERSITY"},
|
||||
{ RIG_FUNC_CSQL, "CSQL" },
|
||||
{ RIG_FUNC_SCEN, "SCEN" },
|
||||
{ RIG_FUNC_TRANSCEIVE, "TRANSCEIVE" },
|
||||
{ RIG_FUNC_SPECTRUM, "SPECTRUM" },
|
||||
{ RIG_FUNC_SPECTRUM_HOLD, "SPECTRUM_HOLD" },
|
||||
{ RIG_FUNC_NONE, "" },
|
||||
};
|
||||
|
||||
|
@ -858,6 +861,13 @@ static struct
|
|||
{ RIG_LEVEL_MONITOR_GAIN, "MONITOR_GAIN" },
|
||||
{ RIG_LEVEL_NB, "NB" },
|
||||
{ RIG_LEVEL_RFPOWER_METER_WATTS, "RFPOWER_METER_WATTS" },
|
||||
{ RIG_LEVEL_SPECTRUM_MODE, "SPECTRUM_MODE" },
|
||||
{ RIG_LEVEL_SPECTRUM_SPAN, "SPECTRUM_SPAN" },
|
||||
{ RIG_LEVEL_SPECTRUM_EDGE_LOW, "SPECTRUM_EDGE_LOW" },
|
||||
{ RIG_LEVEL_SPECTRUM_EDGE_HIGH, "SPECTRUM_EDGE_HIGH" },
|
||||
{ RIG_LEVEL_SPECTRUM_SPEED, "SPECTRUM_SPEED" },
|
||||
{ RIG_LEVEL_SPECTRUM_REF, "SPECTRUM_REF" },
|
||||
{ RIG_LEVEL_SPECTRUM_AVG, "SPECTRUM_AVG" },
|
||||
{ RIG_LEVEL_NONE, "" },
|
||||
};
|
||||
|
||||
|
@ -1199,6 +1209,47 @@ const char *HAMLIB_API rot_strparm(setting_t parm)
|
|||
return "";
|
||||
}
|
||||
|
||||
static struct
|
||||
{
|
||||
enum agc_level_e level;
|
||||
const char *str;
|
||||
} rig_agc_level_str[] =
|
||||
{
|
||||
{ RIG_AGC_OFF, "OFF" },
|
||||
{ RIG_AGC_SUPERFAST, "SUPERFAST" },
|
||||
{ RIG_AGC_FAST, "FAST" },
|
||||
{ RIG_AGC_SLOW, "SLOW" },
|
||||
{ RIG_AGC_USER, "USER" },
|
||||
{ RIG_AGC_MEDIUM, "MEDIUM" },
|
||||
{ RIG_AGC_AUTO, "AUTO" },
|
||||
{ -1, "" },
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Convert enum RIG_AGC_... to alpha string
|
||||
* \param mode RIG_AGC_...
|
||||
* \return alpha string
|
||||
*/
|
||||
const char *HAMLIB_API rig_stragclevel(enum agc_level_e level)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (level < 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
for (i = 0; rig_agc_level_str[i].str[0] != '\0'; i++)
|
||||
{
|
||||
if (level == rig_agc_level_str[i].level)
|
||||
{
|
||||
return rig_agc_level_str[i].str;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
static struct
|
||||
{
|
||||
|
@ -1469,6 +1520,43 @@ const char *HAMLIB_API rig_strmtype(chan_type_t mtype)
|
|||
return "";
|
||||
}
|
||||
|
||||
static struct
|
||||
{
|
||||
enum rig_spectrum_mode_e mode;
|
||||
const char *str;
|
||||
} rig_spectrum_mode_str[] =
|
||||
{
|
||||
{ RIG_SPECTRUM_MODE_CENTER, "CENTER" },
|
||||
{ RIG_SPECTRUM_MODE_FIXED, "FIXED" },
|
||||
{ RIG_SPECTRUM_MODE_CENTER_SCROLL, "CENTER_SCROLL" },
|
||||
{ RIG_SPECTRUM_MODE_FIXED_SCROLL, "FIXED_SCROLL" },
|
||||
{ RIG_SPECTRUM_MODE_NONE, "" },
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Convert enum RIG_SPECTRUM_MODE_... to alpha string
|
||||
* \param mode RIG_SPECTRUM_MODE_...
|
||||
* \return alpha string
|
||||
*/
|
||||
const char *HAMLIB_API rig_strspectrummode(enum rig_spectrum_mode_e mode)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (mode == RIG_SPECTRUM_MODE_NONE)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
for (i = 0; rig_spectrum_mode_str[i].str[0] != '\0'; i++)
|
||||
{
|
||||
if (mode == rig_spectrum_mode_str[i].mode)
|
||||
{
|
||||
return rig_spectrum_mode_str[i].str;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
static long timediff(const struct timeval *tv1, const struct timeval *tv2)
|
||||
{
|
||||
|
|
|
@ -727,6 +727,74 @@ int rot_sprintf_status(char *str, int nlen, rot_status_t status)
|
|||
return len;
|
||||
}
|
||||
|
||||
int rig_sprintf_spectrum_modes(char *str, int nlen, const enum rig_spectrum_mode_e *modes)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
*str = '\0';
|
||||
|
||||
for (i = 0; i < HAMLIB_MAX_SPECTRUM_MODES; i++)
|
||||
{
|
||||
const char *sm;
|
||||
|
||||
if (modes[i] == RIG_SPECTRUM_MODE_NONE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
sm = rig_strspectrummode(modes[i]);
|
||||
|
||||
if (!sm || !sm[0])
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
len += snprintf(str + len, nlen - len, "%d=%s ", modes[i], sm);
|
||||
}
|
||||
|
||||
check_buffer_overflow(str, len, nlen);
|
||||
return len;
|
||||
}
|
||||
|
||||
int rig_sprintf_spectrum_spans(char *str, int nlen, const freq_t *spans)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
*str = '\0';
|
||||
|
||||
for (i = 0; i < HAMLIB_MAX_SPECTRUM_SPANS; i++)
|
||||
{
|
||||
if (spans[i] == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
len += snprintf(str + len, nlen - len, "%.0f ", spans[i]);
|
||||
}
|
||||
|
||||
check_buffer_overflow(str, len, nlen);
|
||||
return len;
|
||||
}
|
||||
|
||||
int rig_sprintf_spectrum_avg_modes(char *str, int nlen, const struct rig_spectrum_avg_mode *avg_modes)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
*str = '\0';
|
||||
|
||||
for (i = 0; i < HAMLIB_MAX_SPECTRUM_MODES; i++)
|
||||
{
|
||||
if (avg_modes[i].name == NULL || avg_modes[i].id < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
len += snprintf(str + len, nlen - len, "%d=\"%s\" ", avg_modes[i].id, avg_modes[i].name);
|
||||
}
|
||||
|
||||
check_buffer_overflow(str, len, nlen);
|
||||
return len;
|
||||
}
|
||||
|
||||
char *get_rig_conf_type(enum rig_conf_e type)
|
||||
{
|
||||
|
|
|
@ -47,6 +47,9 @@ extern HAMLIB_EXPORT( int ) rot_sprintf_parm_gran(char *str, int len, setting_t
|
|||
extern HAMLIB_EXPORT( int ) rig_sprintf_vfop(char *str, int len, vfo_op_t op);
|
||||
extern HAMLIB_EXPORT( int ) rig_sprintf_scan(char *str, int len, scan_t rscan);
|
||||
extern HAMLIB_EXPORT( int ) rot_sprintf_status(char *str, int len, rot_status_t status);
|
||||
extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_modes(char *str, int nlen, const enum rig_spectrum_mode_e *modes);
|
||||
extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_spans(char *str, int nlen, const freq_t *spans);
|
||||
extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_avg_modes(char *str, int nlen, const struct rig_spectrum_avg_mode *avg_modes);
|
||||
extern HAMLIB_EXPORT( char ) *get_rig_conf_type(enum rig_conf_e type);
|
||||
extern HAMLIB_EXPORT( int ) print_ext_param(const struct confparams *cfp, rig_ptr_t ptr);
|
||||
|
||||
|
|
|
@ -293,6 +293,24 @@ int dumpcaps(RIG *rig, FILE *fout)
|
|||
|
||||
fprintf(fout, "\n");
|
||||
|
||||
fprintf(fout, "AGC levels:");
|
||||
|
||||
for (i = 0; i < HAMLIB_MAX_AGC_LEVELS && i < caps->agc_level_count; i++)
|
||||
{
|
||||
fprintf(fout, " %d=%s", caps->agc_levels[i], rig_stragclevel(caps->agc_levels[i]));
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
// Fall back to printing out all levels for backwards-compatibility
|
||||
for (i = RIG_AGC_OFF; i <= RIG_AGC_LAST; i++)
|
||||
{
|
||||
fprintf(fout, " %d=%s", i, rig_stragclevel(i));
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fout, "\n");
|
||||
|
||||
fprintf(fout, "CTCSS:");
|
||||
|
||||
for (i = 0; caps->ctcss_list && i < 60 && caps->ctcss_list[i] != 0; i++)
|
||||
|
@ -680,6 +698,29 @@ int dumpcaps(RIG *rig, FILE *fout)
|
|||
|
||||
fprintf(fout, "\n");
|
||||
|
||||
fprintf(fout, "Spectrum scopes:");
|
||||
|
||||
for (i = 0; i < HAMLIB_MAX_SPECTRUM_SCOPES && caps->spectrum_scopes[i].name != NULL; i++)
|
||||
{
|
||||
fprintf(fout, " %d=\"%s\"", caps->spectrum_scopes[i].id, caps->spectrum_scopes[i].name);
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
fprintf(fout, " None");
|
||||
}
|
||||
|
||||
fprintf(fout, "\n");
|
||||
|
||||
rig_sprintf_spectrum_modes(prntbuf, sizeof(prntbuf), caps->spectrum_modes);
|
||||
fprintf(fout, "Spectrum modes: %s\n", prntbuf);
|
||||
|
||||
rig_sprintf_spectrum_spans(prntbuf, sizeof(prntbuf), caps->spectrum_spans);
|
||||
fprintf(fout, "Spectrum spans: %s\n", prntbuf);
|
||||
|
||||
rig_sprintf_spectrum_avg_modes(prntbuf, sizeof(prntbuf), caps->spectrum_avg_modes);
|
||||
fprintf(fout, "Spectrum averaging modes: %s\n", prntbuf);
|
||||
|
||||
fprintf(fout, "Has priv data:\t%c\n", caps->priv != NULL ? 'Y' : 'N');
|
||||
/*
|
||||
* Status is either 'Y'es, 'E'mulated, 'N'o
|
||||
|
|
|
@ -4058,6 +4058,77 @@ static int mydcd_event(RIG *rig, vfo_t vfo, dcd_t dcd, rig_ptr_t arg)
|
|||
}
|
||||
|
||||
|
||||
static int print_spectrum_line(char *str, size_t length, struct rig_spectrum_line *line)
|
||||
{
|
||||
int data_level_max = line->data_level_max / 2;
|
||||
int aggregate_count = line->spectrum_data_length / 120;
|
||||
int aggregate_value = 0;
|
||||
int i, c;
|
||||
int charlen = strlen("█");
|
||||
|
||||
str[0] = '\0';
|
||||
|
||||
for (i = 0, c = 0; i < line->spectrum_data_length; i++)
|
||||
{
|
||||
int current = line->spectrum_data[i];
|
||||
aggregate_value = current > aggregate_value ? current : aggregate_value;
|
||||
|
||||
if (i > 0 && i % aggregate_count == 0)
|
||||
{
|
||||
if (c + charlen >= length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
int level = aggregate_value * 10 / data_level_max;
|
||||
if (level >= 8) {
|
||||
strcpy(str + c, "█");
|
||||
c += charlen;
|
||||
}
|
||||
else if (level >= 6)
|
||||
{
|
||||
strcpy(str + c, "▓");
|
||||
c += charlen;
|
||||
}
|
||||
else if (level >= 4)
|
||||
{
|
||||
strcpy(str + c, "▒");
|
||||
c += charlen;
|
||||
}
|
||||
else if (level >= 2)
|
||||
{
|
||||
strcpy(str + c, "░");
|
||||
c += charlen;
|
||||
}
|
||||
else if (level >= 0)
|
||||
{
|
||||
strcpy(str + c, " ");
|
||||
c += 1;
|
||||
}
|
||||
|
||||
aggregate_value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
static int myspectrum_event(RIG *rig, struct rig_spectrum_line *line, rig_ptr_t arg)
|
||||
{
|
||||
ENTERFUNC;
|
||||
|
||||
if (rig_need_debug(RIG_DEBUG_TRACE))
|
||||
{
|
||||
char spectrum_debug[line->spectrum_data_length * 4];
|
||||
print_spectrum_line(spectrum_debug, sizeof(spectrum_debug), line);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ASCII Spectrum Scope: %s\n", __func__, spectrum_debug);
|
||||
}
|
||||
|
||||
RETURNFUNC(0);
|
||||
}
|
||||
|
||||
|
||||
/* 'A' */
|
||||
declare_proto_rig(set_trn)
|
||||
{
|
||||
|
@ -4095,6 +4166,7 @@ declare_proto_rig(set_trn)
|
|||
rig_set_vfo_callback(rig, myvfo_event, NULL);
|
||||
rig_set_ptt_callback(rig, myptt_event, NULL);
|
||||
rig_set_dcd_callback(rig, mydcd_event, NULL);
|
||||
rig_set_spectrum_callback(rig, myspectrum_event, NULL);
|
||||
}
|
||||
|
||||
RETURNFUNC(rig_set_trn(rig, trn));
|
||||
|
|
Ładowanie…
Reference in New Issue