astyle icom.c icom.h

pull/137/head
Michael Black 2019-10-29 22:29:06 -05:00
rodzic 8bab7d6e46
commit 84ae165145
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6599353EC683404D
2 zmienionych plików z 3854 dodań i 2788 usunięć

Plik diff jest za duży Load Diff

Wyświetl plik

@ -48,10 +48,10 @@
* If your rig has better/lesser, don't modify this define but clone it, * If your rig has better/lesser, don't modify this define but clone it,
* so you don't change other rigs. * so you don't change other rigs.
*/ */
#define IC_MIN_MEM_CAP { \ #define IC_MIN_MEM_CAP { \
.freq = 1, \ .freq = 1, \
.mode = 1, \ .mode = 1, \
.width = 1, \ .width = 1, \
} }
/* /*
@ -59,14 +59,14 @@
* If your rig has better/lesser, don't modify this define but clone it, * If your rig has better/lesser, don't modify this define but clone it,
* so you don't change other rigs. * so you don't change other rigs.
*/ */
#define IC_MEM_CAP { \ #define IC_MEM_CAP { \
.freq = 1, \ .freq = 1, \
.mode = 1, \ .mode = 1, \
.width = 1, \ .width = 1, \
.tx_freq = 1, \ .tx_freq = 1, \
.tx_mode = 1, \ .tx_mode = 1, \
.tx_width = 1, \ .tx_width = 1, \
.rptr_offs = 1, \ .rptr_offs = 1, \
} }
/* /*
@ -75,62 +75,70 @@
#define UNKNOWN_IC_STR_CAL { 2, {{ 0, -60}, { 255, 60}} } #define UNKNOWN_IC_STR_CAL { 2, {{ 0, -60}, { 255, 60}} }
struct ts_sc_list { struct ts_sc_list
shortfreq_t ts; /* tuning step */ {
unsigned char sc; /* sub command */ shortfreq_t ts; /* tuning step */
unsigned char sc; /* sub command */
}; };
/** /**
* \brief Pipelined tuning state data structure. * \brief Pipelined tuning state data structure.
*/ */
typedef struct rig_pltstate { typedef struct rig_pltstate
freq_t freq; {
freq_t next_freq; freq_t freq;
rmode_t mode; freq_t next_freq;
rmode_t next_mode; rmode_t mode;
pbwidth_t width; rmode_t next_mode;
pbwidth_t next_width; pbwidth_t width;
struct timeval timer_start; pbwidth_t next_width;
struct timeval timer_current; struct timeval timer_start;
int usleep_time; /* dependent on radio module & serial data rate */ struct timeval timer_current;
int usleep_time; /* dependent on radio module & serial data rate */
} pltstate_t; } pltstate_t;
struct icom_agc_level { struct icom_agc_level
enum agc_level_e 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 */ enum agc_level_e
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 */
}; };
struct icom_priv_caps { 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 */ unsigned char re_civ_addr; /* the remote dlft equipment's CI-V address*/
int no_xchg; /* Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */ int civ_731_mode; /* Off: freqs on 10 digits, On: freqs on 8 digits */
const struct ts_sc_list *ts_sc_list; int no_xchg; /* Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */
int settle_time; /*!< Receiver settle time, in ms */ const struct ts_sc_list *ts_sc_list;
int (*r2i_mode)(RIG *rig, rmode_t mode, pbwidth_t width, int settle_time; /*!< Receiver settle time, in ms */
unsigned char *md, signed char *pd); /*< backend specific code int (*r2i_mode)(RIG *rig, rmode_t mode, pbwidth_t width,
to convert bandwidth and unsigned char *md, signed char *pd); /*< backend specific code
mode to cmd tokens */ to convert bandwidth and
void (*i2r_mode)(RIG *rig, unsigned char md, int pd, mode to cmd tokens */
rmode_t *mode, pbwidth_t *width); /*< backend specific code void (*i2r_mode)(RIG *rig, unsigned char md, int pd,
to convert response rmode_t *mode, pbwidth_t *width); /*< backend specific code
tokens to bandwidth and to convert response
mode */ tokens to bandwidth and
int serial_full_duplex; /*!< Whether RXD&TXD are not tied together */ mode */
int offs_len; /* Number of bytes in offset frequency field. 0 defaults to 3 */ int serial_full_duplex; /*!< Whether RXD&TXD are not tied together */
int serial_USB_echo_check; /* Flag to test USB echo state */ int offs_len; /* Number of bytes in offset frequency field. 0 defaults to 3 */
int agc_levels_present; /* Flag to indicate that agc_levels array is populated */ int serial_USB_echo_check; /* Flag to test USB echo state */
struct icom_agc_level agc_levels[RIG_AGC_LAST + 1]; /* Icom rig-specific AGC levels, the last entry should have level -1 */ 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 icom_priv_data { 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 */ unsigned char re_civ_addr; /* the remote equipment's CI-V address*/
int no_xchg; /* Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */ int civ_731_mode; /* Off: freqs on 10 digits, On: freqs on 8 digits */
int no_1a_03_cmd; /* rig doesn't tell IF widths */ int no_xchg; /* Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */
int split_on; /* record split state */ int no_1a_03_cmd; /* rig doesn't tell IF widths */
pltstate_t *pltstate; /* only on optoscan */ int split_on; /* record split state */
int serial_USB_echo_off; /* USB is not set to echo */ pltstate_t *pltstate; /* only on optoscan */
int serial_USB_echo_off; /* USB is not set to echo */
}; };
extern const struct ts_sc_list r8500_ts_sc_list[]; extern const struct ts_sc_list r8500_ts_sc_list[];
@ -151,7 +159,8 @@ extern const struct ts_sc_list ic910_ts_sc_list[];
extern const struct ts_sc_list ic718_ts_sc_list[]; extern const struct ts_sc_list ic718_ts_sc_list[];
extern const struct ts_sc_list x108g_ts_sc_list[]; extern const struct ts_sc_list x108g_ts_sc_list[];
extern const pbwidth_t rtty_fil[]; /* rtty filter passband width; available on 746pro and 756pro rigs */ extern const pbwidth_t
rtty_fil[]; /* rtty filter passband width; available on 746pro and 756pro rigs */
pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode); pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode);
@ -166,7 +175,8 @@ int icom_set_rit_new(RIG *rig, vfo_t vfo, shortfreq_t ts);
int icom_set_xit_new(RIG *rig, vfo_t vfo, shortfreq_t ts); int icom_set_xit_new(RIG *rig, vfo_t vfo, shortfreq_t ts);
int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); int icom_get_mode_with_data(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); int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int icom_get_vfo(RIG *rig, vfo_t *vfo); int icom_get_vfo(RIG *rig, vfo_t *vfo);
int icom_set_vfo(RIG *rig, vfo_t vfo); int icom_set_vfo(RIG *rig, vfo_t vfo);
@ -176,10 +186,14 @@ 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); int icom_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs);
int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq); 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_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_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
int icom_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width); pbwidth_t tx_width);
int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq, rmode_t tx_mode, pbwidth_t tx_width); int icom_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
int icom_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *tx_freq, rmode_t *tx_mode, pbwidth_t *tx_width); pbwidth_t *tx_width);
int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq,
rmode_t tx_mode, pbwidth_t tx_width);
int icom_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *tx_freq,
rmode_t *tx_mode, pbwidth_t *tx_width);
int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo); 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); int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
int icom_mem_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo); int icom_mem_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
@ -210,25 +224,34 @@ int icom_set_conf(RIG *rig, token_t token, const char *val);
int icom_get_conf(RIG *rig, token_t token, char *val); int icom_get_conf(RIG *rig, token_t token, char *val);
int icom_set_powerstat(RIG *rig, powerstat_t status); int icom_set_powerstat(RIG *rig, powerstat_t status);
int icom_get_powerstat(RIG *rig, powerstat_t *status); int icom_get_powerstat(RIG *rig, powerstat_t *status);
int icom_set_ant(RIG * rig, vfo_t vfo, ant_t ant); int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant);
int icom_get_ant(RIG * rig, vfo_t vfo, ant_t *ant); int icom_get_ant(RIG *rig, vfo_t vfo, ant_t *ant);
int icom_decode_event(RIG *rig); int icom_decode_event(RIG *rig);
int icom_power2mW(RIG * rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode); int icom_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
int icom_mW2power(RIG * rig, float *power, unsigned int mwpower, freq_t freq, rmode_t mode); rmode_t mode);
int icom_send_morse (RIG * rig, vfo_t vfo, const char *msg); int icom_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq,
rmode_t mode);
int icom_send_morse(RIG *rig, vfo_t vfo, const char *msg);
/* Exposed routines */ /* Exposed routines */
int icom_get_split_vfos(const RIG *rig, vfo_t *rx_vfo, vfo_t *tx_vfo); int icom_get_split_vfos(const RIG *rig, vfo_t *rx_vfo, vfo_t *tx_vfo);
int icom_set_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen, unsigned char *subcmdbuf, int val_bytes, int val); int icom_set_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen,
int icom_get_raw_buf(RIG *rig, int cmd, int subcmd, int subcmdbuflen, unsigned char *subcmdbuf, int *reslen, unsigned char *res); unsigned char *subcmdbuf, int val_bytes, int val);
int icom_get_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen, unsigned char *subcmdbuf, int *val); int icom_get_raw_buf(RIG *rig, int cmd, int subcmd, int subcmdbuflen,
unsigned char *subcmdbuf, int *reslen, unsigned char *res);
int icom_get_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen,
unsigned char *subcmdbuf, int *val);
int icom_set_level_raw(RIG *rig, setting_t level, int cmd, int subcmd, int icom_set_level_raw(RIG *rig, setting_t level, int cmd, int subcmd,
int subcmdbuflen, unsigned char *subcmdbuf, int val_bytes, value_t val); int subcmdbuflen, unsigned char *subcmdbuf, int val_bytes, value_t val);
int icom_get_level_raw(RIG *rig, setting_t level, int cmd, int subcmd, int icom_get_level_raw(RIG *rig, setting_t level, int cmd, int subcmd,
int subcmdbuflen, unsigned char *subcmdbuf, value_t *val); int subcmdbuflen, unsigned char *subcmdbuf, value_t *val);
int icom_set_custom_parm(RIG *rig, int parmbuflen, unsigned char *parmbuf, int val_bytes, int value); int icom_set_custom_parm(RIG *rig, int parmbuflen, unsigned char *parmbuf,
int icom_get_custom_parm(RIG *rig, int parmbuflen, unsigned char *parmbuf, int *value); int val_bytes, int value);
int icom_set_custom_parm_time(RIG *rig, int parmbuflen, unsigned char *parmbuf, int seconds); int icom_get_custom_parm(RIG *rig, int parmbuflen, unsigned char *parmbuf,
int icom_get_custom_parm_time(RIG *rig, int parmbuflen, unsigned char *parmbuf, int *seconds); int *value);
int icom_set_custom_parm_time(RIG *rig, int parmbuflen, unsigned char *parmbuf,
int seconds);
int icom_get_custom_parm_time(RIG *rig, int parmbuflen, unsigned char *parmbuf,
int *seconds);
extern const struct confparams icom_cfg_params[]; extern const struct confparams icom_cfg_params[];