2000-09-16 01:43:48 +00:00
|
|
|
/*
|
2001-07-13 19:08:15 +00:00
|
|
|
* Hamlib CI-V backend - main header
|
2004-05-18 06:55:06 +00:00
|
|
|
* Copyright (c) 2000-2004 by Stephane Fillod
|
2000-09-16 01:43:48 +00:00
|
|
|
*
|
2004-09-26 08:35:05 +00:00
|
|
|
* $Id: icom.h,v 1.70 2004-09-26 08:35:03 fillods Exp $
|
2000-09-16 01:43:48 +00:00
|
|
|
*
|
2001-07-13 19:08:15 +00:00
|
|
|
* This library is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
2000-09-16 01:43:48 +00:00
|
|
|
*
|
2001-07-13 19:08:15 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Library General Public License for more details.
|
2000-09-16 01:43:48 +00:00
|
|
|
*
|
2001-07-13 19:08:15 +00:00
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2000-09-16 01:43:48 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ICOM_H
|
|
|
|
#define _ICOM_H 1
|
|
|
|
|
2000-12-05 22:01:03 +00:00
|
|
|
#include <hamlib/rig.h>
|
2001-03-04 13:03:41 +00:00
|
|
|
#include <cal.h>
|
2001-12-19 03:35:27 +00:00
|
|
|
#include <tones.h>
|
2000-12-05 22:01:03 +00:00
|
|
|
|
2004-08-16 20:57:37 +00:00
|
|
|
#ifdef HAVE_SYS_TIME_H
|
|
|
|
#include <sys/time.h>
|
|
|
|
#endif
|
|
|
|
|
2004-09-25 14:33:17 +00:00
|
|
|
#define BACKEND_VER "0.3"
|
|
|
|
|
2001-01-28 22:06:11 +00:00
|
|
|
/*
|
2002-02-28 10:59:46 +00:00
|
|
|
* defines used by comp_cal_str in rig.c
|
2001-01-28 22:06:11 +00:00
|
|
|
* STR_CAL_LENGTH is the lenght of the S Meter calibration table
|
|
|
|
* STR_CAL_S0 is the value in dB of the lowest value (not even in table)
|
|
|
|
*/
|
|
|
|
#define STR_CAL_LENGTH 16
|
|
|
|
#define STR_CAL_S0 -54
|
|
|
|
|
2000-09-16 01:43:48 +00:00
|
|
|
|
2002-12-26 14:32:03 +00:00
|
|
|
/*
|
|
|
|
* minimal channel caps.
|
|
|
|
* If your rig has better/lesser, don't modify this define but clone it,
|
|
|
|
* so you don't change other rigs.
|
|
|
|
*/
|
|
|
|
#define IC_MIN_MEM_CAP { \
|
|
|
|
.freq = 1, \
|
|
|
|
.mode = 1, \
|
|
|
|
.width = 1, \
|
|
|
|
}
|
|
|
|
|
2002-11-04 22:26:49 +00:00
|
|
|
/*
|
|
|
|
* common channel caps.
|
|
|
|
* If your rig has better/lesser, don't modify this define but clone it,
|
|
|
|
* so you don't change other rigs.
|
|
|
|
*/
|
|
|
|
#define IC_MEM_CAP { \
|
|
|
|
.freq = 1, \
|
|
|
|
.mode = 1, \
|
|
|
|
.width = 1, \
|
2003-12-04 23:22:52 +00:00
|
|
|
.tx_freq = 1, \
|
|
|
|
.tx_mode = 1, \
|
|
|
|
.tx_width = 1, \
|
2002-11-04 22:26:49 +00:00
|
|
|
.rptr_offs = 1, \
|
|
|
|
}
|
|
|
|
|
2004-09-26 08:35:05 +00:00
|
|
|
/*
|
|
|
|
* S-Meter data for uncalibrated rigs
|
|
|
|
*/
|
|
|
|
#define UNKNOWN_IC_STR_CAL { 2, {{ 0, -60}, { 255, 60}} }
|
|
|
|
|
|
|
|
|
2000-10-10 21:58:31 +00:00
|
|
|
struct ts_sc_list {
|
2000-12-05 22:01:03 +00:00
|
|
|
shortfreq_t ts; /* tuning step */
|
2000-10-10 21:58:31 +00:00
|
|
|
unsigned char sc; /* sub command */
|
|
|
|
};
|
|
|
|
|
2003-08-17 22:39:07 +00:00
|
|
|
/**
|
|
|
|
* \brief Pipelined tuning state data structure.
|
|
|
|
*/
|
|
|
|
typedef struct rig_pltstate {
|
|
|
|
freq_t freq;
|
|
|
|
freq_t next_freq;
|
|
|
|
rmode_t mode;
|
|
|
|
rmode_t next_mode;
|
|
|
|
pbwidth_t width;
|
|
|
|
pbwidth_t next_width;
|
|
|
|
struct timeval timer_start;
|
|
|
|
struct timeval timer_current;
|
|
|
|
int usleep_time; /* dependent on radio module & serial data rate */
|
|
|
|
} pltstate_t;
|
|
|
|
|
2001-03-04 13:03:41 +00:00
|
|
|
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 */
|
|
|
|
const struct ts_sc_list *ts_sc_list;
|
2003-08-17 22:39:07 +00:00
|
|
|
int settle_time; /*!< Receiver settle time, in ms */
|
2001-03-04 13:03:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-09-16 01:43:48 +00:00
|
|
|
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 */
|
2003-08-17 22:39:07 +00:00
|
|
|
pltstate_t *pltstate; /* only on optoscan */
|
2000-09-16 01:43:48 +00:00
|
|
|
};
|
|
|
|
|
2001-03-04 13:03:41 +00:00
|
|
|
extern const struct ts_sc_list r8500_ts_sc_list[];
|
|
|
|
extern const struct ts_sc_list ic737_ts_sc_list[];
|
|
|
|
extern const struct ts_sc_list r75_ts_sc_list[];
|
|
|
|
extern const struct ts_sc_list r7100_ts_sc_list[];
|
2002-01-27 14:51:07 +00:00
|
|
|
extern const struct ts_sc_list r9000_ts_sc_list[];
|
2001-03-04 13:03:41 +00:00
|
|
|
extern const struct ts_sc_list ic756_ts_sc_list[];
|
2002-01-27 14:51:07 +00:00
|
|
|
extern const struct ts_sc_list ic756pro_ts_sc_list[];
|
2001-03-04 13:03:41 +00:00
|
|
|
extern const struct ts_sc_list ic706_ts_sc_list[];
|
2002-02-28 10:59:46 +00:00
|
|
|
extern const struct ts_sc_list ic910_ts_sc_list[];
|
2002-03-05 23:31:31 +00:00
|
|
|
extern const struct ts_sc_list ic718_ts_sc_list[];
|
2001-03-01 00:28:08 +00:00
|
|
|
|
2000-09-16 01:43:48 +00:00
|
|
|
int icom_init(RIG *rig);
|
|
|
|
int icom_cleanup(RIG *rig);
|
2000-12-05 22:01:03 +00:00
|
|
|
int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
|
|
|
int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
2002-08-19 22:17:11 +00:00
|
|
|
int icom_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
2000-12-05 22:01:03 +00:00
|
|
|
int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
|
|
|
int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
2000-10-08 21:39:58 +00:00
|
|
|
int icom_set_vfo(RIG *rig, vfo_t vfo);
|
2000-12-05 22:01:03 +00:00
|
|
|
int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
|
|
|
|
int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
|
|
|
|
int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs);
|
|
|
|
int icom_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs);
|
2001-06-27 17:32:47 +00:00
|
|
|
int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
|
|
|
|
int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq);
|
|
|
|
int icom_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width);
|
|
|
|
int icom_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width);
|
2003-04-06 18:40:36 +00:00
|
|
|
int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
|
|
|
int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
2003-12-04 23:22:52 +00:00
|
|
|
int icom_mem_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
2000-12-05 22:01:03 +00:00
|
|
|
int icom_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts);
|
|
|
|
int icom_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts);
|
|
|
|
int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
|
|
|
int icom_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
2001-02-14 23:55:54 +00:00
|
|
|
int icom_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
|
2001-07-01 11:46:17 +00:00
|
|
|
int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone);
|
|
|
|
int icom_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone);
|
|
|
|
int icom_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone);
|
|
|
|
int icom_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone);
|
2000-12-05 22:01:03 +00:00
|
|
|
int icom_set_bank(RIG *rig, vfo_t vfo, int bank);
|
|
|
|
int icom_set_mem(RIG *rig, vfo_t vfo, int ch);
|
2001-06-03 19:54:05 +00:00
|
|
|
int icom_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
2001-06-26 20:55:29 +00:00
|
|
|
int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);
|
2000-12-05 22:01:03 +00:00
|
|
|
int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
|
|
|
|
int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
2001-01-28 22:06:11 +00:00
|
|
|
int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
2001-03-01 21:22:03 +00:00
|
|
|
int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
2004-08-21 23:53:39 +00:00
|
|
|
int icom_set_parm(RIG *rig, setting_t parm, value_t val);
|
|
|
|
int icom_get_parm(RIG *rig, setting_t parm, value_t *val);
|
2001-07-21 13:00:03 +00:00
|
|
|
int icom_set_conf(RIG *rig, token_t token, const char *val);
|
|
|
|
int icom_get_conf(RIG *rig, token_t token, char *val);
|
2001-03-02 18:39:42 +00:00
|
|
|
int icom_set_powerstat(RIG *rig, powerstat_t status);
|
|
|
|
int icom_get_powerstat(RIG *rig, powerstat_t *status);
|
2003-11-16 17:28:29 +00:00
|
|
|
int icom_set_ant(RIG * rig, vfo_t vfo, ant_t ant);
|
|
|
|
int icom_get_ant(RIG * rig, vfo_t vfo, ant_t *ant);
|
2000-10-08 21:39:58 +00:00
|
|
|
int icom_decode_event(RIG *rig);
|
|
|
|
|
2001-07-21 13:00:03 +00:00
|
|
|
extern const struct confparams icom_cfg_params[];
|
|
|
|
|
2003-11-05 20:40:27 +00:00
|
|
|
extern const struct rig_caps ic703_caps;
|
2000-10-08 21:39:58 +00:00
|
|
|
extern const struct rig_caps ic706_caps;
|
|
|
|
extern const struct rig_caps ic706mkii_caps;
|
|
|
|
extern const struct rig_caps ic706mkiig_caps;
|
2004-02-02 22:15:17 +00:00
|
|
|
extern const struct rig_caps ic707_caps;
|
2002-03-05 23:31:31 +00:00
|
|
|
extern const struct rig_caps ic718_caps;
|
2002-12-23 14:20:42 +00:00
|
|
|
extern const struct rig_caps ic725_caps;
|
2003-11-10 16:01:21 +00:00
|
|
|
extern const struct rig_caps ic726_caps;
|
2004-02-02 22:15:17 +00:00
|
|
|
extern const struct rig_caps ic728_caps;
|
2001-09-17 05:45:06 +00:00
|
|
|
extern const struct rig_caps ic735_caps;
|
2003-02-19 23:56:56 +00:00
|
|
|
extern const struct rig_caps ic736_caps;
|
2002-11-16 14:05:53 +00:00
|
|
|
extern const struct rig_caps ic737_caps;
|
2003-10-24 22:59:18 +00:00
|
|
|
extern const struct rig_caps ic746_caps;
|
|
|
|
extern const struct rig_caps ic746pro_caps;
|
2001-09-18 00:37:39 +00:00
|
|
|
extern const struct rig_caps ic756_caps;
|
|
|
|
extern const struct rig_caps ic756pro_caps;
|
2002-07-09 20:43:37 +00:00
|
|
|
extern const struct rig_caps ic756pro2_caps;
|
2004-09-25 14:33:17 +00:00
|
|
|
extern const struct rig_caps ic756pro3_caps;
|
2004-05-18 06:55:06 +00:00
|
|
|
extern const struct rig_caps ic751_caps;
|
2004-03-07 15:49:45 +00:00
|
|
|
extern const struct rig_caps ic761_caps;
|
2003-11-10 16:01:21 +00:00
|
|
|
extern const struct rig_caps ic765_caps;
|
2001-09-17 05:45:06 +00:00
|
|
|
extern const struct rig_caps ic775_caps;
|
2004-09-25 14:33:17 +00:00
|
|
|
extern const struct rig_caps ic78_caps;
|
|
|
|
extern const struct rig_caps ic7800_caps;
|
2003-11-10 16:01:21 +00:00
|
|
|
extern const struct rig_caps ic781_caps;
|
2001-12-20 23:07:15 +00:00
|
|
|
extern const struct rig_caps ic821h_caps;
|
2002-02-28 10:59:46 +00:00
|
|
|
extern const struct rig_caps ic910_caps;
|
2002-03-04 20:23:22 +00:00
|
|
|
extern const struct rig_caps ic970_caps;
|
2003-11-16 17:28:29 +00:00
|
|
|
extern const struct rig_caps icr10_caps;
|
2004-09-25 14:33:17 +00:00
|
|
|
extern const struct rig_caps icr20_caps;
|
2003-11-16 17:28:29 +00:00
|
|
|
extern const struct rig_caps icr71_caps;
|
|
|
|
extern const struct rig_caps icr72_caps;
|
|
|
|
extern const struct rig_caps icr75_caps;
|
2002-02-27 23:17:17 +00:00
|
|
|
extern const struct rig_caps icr7000_caps;
|
2003-11-16 17:28:29 +00:00
|
|
|
extern const struct rig_caps icr7100_caps;
|
2001-01-28 22:06:11 +00:00
|
|
|
extern const struct rig_caps icr8500_caps;
|
2003-11-16 17:28:29 +00:00
|
|
|
extern const struct rig_caps icr9000_caps;
|
|
|
|
extern const struct rig_caps ic271_caps;
|
2001-11-28 22:04:56 +00:00
|
|
|
extern const struct rig_caps ic275_caps;
|
2003-11-10 16:01:21 +00:00
|
|
|
extern const struct rig_caps ic471_caps;
|
2001-11-28 22:04:56 +00:00
|
|
|
extern const struct rig_caps ic475_caps;
|
2000-10-08 21:39:58 +00:00
|
|
|
|
2002-05-30 17:38:07 +00:00
|
|
|
extern const struct rig_caps omnivip_caps;
|
|
|
|
|
2003-05-19 06:57:44 +00:00
|
|
|
extern const struct rig_caps os456_caps;
|
|
|
|
extern const struct rig_caps os535_caps;
|
2000-09-16 01:43:48 +00:00
|
|
|
|
2003-11-16 17:28:29 +00:00
|
|
|
extern const struct rig_caps id1_caps;
|
2000-09-16 01:43:48 +00:00
|
|
|
|
2003-11-16 17:28:29 +00:00
|
|
|
#endif /* _ICOM_H */
|