kopia lustrzana https://github.com/Hamlib/Hamlib
Yeasu rigs: move native command to C file, move function declration to C
file. There is no point in having it in the header file if data that is used only in the C file. Export ft857_[sg]et_vfo via the ft857 header and use the header in ft897.pull/787/head
rodzic
a0672e4f7e
commit
0ebf99742e
|
@ -36,6 +36,39 @@
|
|||
#include "yaesu.h"
|
||||
#include "frg100.h"
|
||||
|
||||
enum frg100_native_cmd_e {
|
||||
FRG100_NATIVE_RECALL_MEM = 0, /* 0x02, p1=ch */
|
||||
FRG100_NATIVE_VFO_TO_MEM, /* 0x03, p1=ch, p2=0 */
|
||||
FRG100_NATIVE_MEM_HIDE, /* 0x03, p1=ch, p2=1 */
|
||||
FRG100_NATIVE_VFO_A, /* 0x05 */
|
||||
FRG100_NATIVE_FREQ_SET, /* 0x0a, p1:4=freq */
|
||||
FRG100_NATIVE_MODE_SET_LSB, /* 0x0c, p1=0x00 */
|
||||
FRG100_NATIVE_MODE_SET_USB, /* 0x0c, p1=0x01 */
|
||||
FRG100_NATIVE_MODE_SET_CW_W, /* 0x0c, p1=0x02 */
|
||||
FRG100_NATIVE_MODE_SET_CW_N, /* 0x0c, p1=0x03 */
|
||||
FRG100_NATIVE_MODE_SET_AM, /* 0x0c, p1=0x04 */
|
||||
FRG100_NATIVE_MODE_SET_RTTY_LSB_W, /* 0x0c, p1=0x08 */
|
||||
FRG100_NATIVE_MODE_SET_RTTY_USB_W, /* 0x0c, p1=0x09 */
|
||||
FRG100_NATIVE_MODE_SET_H3E, /* 0x0c, p1=0x0d */
|
||||
FRG100_NATIVE_MODE_SET_RTTY_LSB_N, /* 0x0c, p1=0x0e */
|
||||
FRG100_NATIVE_MODE_SET_RTTY_USB_N, /* 0x0c, p1=0x0f */
|
||||
FRG100_NATIVE_PTT_OFF, /* 0x0f, p1=0 */
|
||||
FRG100_NATIVE_PTT_ON, /* 0x0f, p1=1 */
|
||||
FRG100_NATIVE_UPDATE_MEM_CHNL, /* 0x10, p1=1 */
|
||||
FRG100_NATIVE_UPDATE_OP_DATA, /* 0x10, p1=2 */
|
||||
FRG100_NATIVE_UPDATE_VFO_DATA, /* 0x10, p1=3 */
|
||||
FRG100_NATIVE_TX_POWER_LOW, /* 0x18 */
|
||||
FRG100_NATIVE_TX_POWER_MID, /* 0x28 */
|
||||
FRG100_NATIVE_TX_POWER_HI, /* 0x48 */
|
||||
FRG100_NATIVE_CPY_RX_TO_TX, /* 0x85 */
|
||||
FRG100_NATIVE_TX_FREQ_SET, /* 0x8a, p1:4=freq */
|
||||
FRG100_NATIVE_OP_FREQ_STEP_UP, /* 0x8e, p1=0 */
|
||||
FRG100_NATIVE_OP_FREQ_STEP_DOWN, /* 0x8e, p1=1 */
|
||||
FRG100_NATIVE_READ_METER, /* 0xf7 */
|
||||
FRG100_NATIVE_READ_FLAGS, /* 0xfa */
|
||||
FRG100_NATIVE_SIZE
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define FRG100_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_AM|RIG_MODE_FM)
|
||||
|
|
|
@ -33,36 +33,3 @@
|
|||
#define FRG100_CMD_RETCODE_OK 0x00
|
||||
#define FRG100_CMD_RETCODE_ERROR 0xF0
|
||||
|
||||
typedef enum frg100_native_cmd_e {
|
||||
FRG100_NATIVE_RECALL_MEM = 0, /* 0x02, p1=ch */
|
||||
FRG100_NATIVE_VFO_TO_MEM, /* 0x03, p1=ch, p2=0 */
|
||||
FRG100_NATIVE_MEM_HIDE, /* 0x03, p1=ch, p2=1 */
|
||||
FRG100_NATIVE_VFO_A, /* 0x05 */
|
||||
FRG100_NATIVE_FREQ_SET, /* 0x0a, p1:4=freq */
|
||||
FRG100_NATIVE_MODE_SET_LSB, /* 0x0c, p1=0x00 */
|
||||
FRG100_NATIVE_MODE_SET_USB, /* 0x0c, p1=0x01 */
|
||||
FRG100_NATIVE_MODE_SET_CW_W, /* 0x0c, p1=0x02 */
|
||||
FRG100_NATIVE_MODE_SET_CW_N, /* 0x0c, p1=0x03 */
|
||||
FRG100_NATIVE_MODE_SET_AM, /* 0x0c, p1=0x04 */
|
||||
FRG100_NATIVE_MODE_SET_RTTY_LSB_W, /* 0x0c, p1=0x08 */
|
||||
FRG100_NATIVE_MODE_SET_RTTY_USB_W, /* 0x0c, p1=0x09 */
|
||||
FRG100_NATIVE_MODE_SET_H3E, /* 0x0c, p1=0x0d */
|
||||
FRG100_NATIVE_MODE_SET_RTTY_LSB_N, /* 0x0c, p1=0x0e */
|
||||
FRG100_NATIVE_MODE_SET_RTTY_USB_N, /* 0x0c, p1=0x0f */
|
||||
FRG100_NATIVE_PTT_OFF, /* 0x0f, p1=0 */
|
||||
FRG100_NATIVE_PTT_ON, /* 0x0f, p1=1 */
|
||||
FRG100_NATIVE_UPDATE_MEM_CHNL, /* 0x10, p1=1 */
|
||||
FRG100_NATIVE_UPDATE_OP_DATA, /* 0x10, p1=2 */
|
||||
FRG100_NATIVE_UPDATE_VFO_DATA, /* 0x10, p1=3 */
|
||||
FRG100_NATIVE_TX_POWER_LOW, /* 0x18 */
|
||||
FRG100_NATIVE_TX_POWER_MID, /* 0x28 */
|
||||
FRG100_NATIVE_TX_POWER_HI, /* 0x48 */
|
||||
FRG100_NATIVE_CPY_RX_TO_TX, /* 0x85 */
|
||||
FRG100_NATIVE_TX_FREQ_SET, /* 0x8a, p1:4=freq */
|
||||
FRG100_NATIVE_OP_FREQ_STEP_UP, /* 0x8e, p1=0 */
|
||||
FRG100_NATIVE_OP_FREQ_STEP_DOWN, /* 0x8e, p1=1 */
|
||||
FRG100_NATIVE_READ_METER, /* 0xf7 */
|
||||
FRG100_NATIVE_READ_FLAGS, /* 0xfa */
|
||||
FRG100_NATIVE_SIZE
|
||||
} frg100_native_cmd_t;
|
||||
|
||||
|
|
|
@ -41,6 +41,140 @@
|
|||
#include "misc.h"
|
||||
#include "bandplan.h"
|
||||
|
||||
enum ft100_native_cmd_e {
|
||||
|
||||
FT100_NATIVE_CAT_LOCK_ON = 0,
|
||||
FT100_NATIVE_CAT_LOCK_OFF,
|
||||
FT100_NATIVE_CAT_PTT_ON,
|
||||
FT100_NATIVE_CAT_PTT_OFF,
|
||||
FT100_NATIVE_CAT_SET_FREQ,
|
||||
FT100_NATIVE_CAT_SET_MODE_LSB,
|
||||
FT100_NATIVE_CAT_SET_MODE_USB,
|
||||
FT100_NATIVE_CAT_SET_MODE_CW,
|
||||
FT100_NATIVE_CAT_SET_MODE_CWR,
|
||||
FT100_NATIVE_CAT_SET_MODE_AM,
|
||||
FT100_NATIVE_CAT_SET_MODE_FM,
|
||||
FT100_NATIVE_CAT_SET_MODE_DIG,
|
||||
FT100_NATIVE_CAT_SET_MODE_WFM,
|
||||
FT100_NATIVE_CAT_CLAR_ON,
|
||||
FT100_NATIVE_CAT_CLAR_OFF,
|
||||
FT100_NATIVE_CAT_SET_CLAR_FREQ,
|
||||
FT100_NATIVE_CAT_SET_VFOAB,
|
||||
FT100_NATIVE_CAT_SET_VFOA,
|
||||
FT100_NATIVE_CAT_SET_VFOB,
|
||||
FT100_NATIVE_CAT_SPLIT_ON,
|
||||
FT100_NATIVE_CAT_SPLIT_OFF,
|
||||
FT100_NATIVE_CAT_SET_RPT_SHIFT_MINUS,
|
||||
FT100_NATIVE_CAT_SET_RPT_SHIFT_PLUS,
|
||||
FT100_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX,
|
||||
FT100_NATIVE_CAT_SET_RPT_OFFSET,
|
||||
/* fix me */
|
||||
FT100_NATIVE_CAT_SET_DCS_ON,
|
||||
FT100_NATIVE_CAT_SET_CTCSS_ENC_ON,
|
||||
FT100_NATIVE_CAT_SET_CTCSS_ENC_DEC_ON,
|
||||
FT100_NATIVE_CAT_SET_CTCSS_DCS_OFF,
|
||||
/* em xif */
|
||||
FT100_NATIVE_CAT_SET_CTCSS_FREQ,
|
||||
FT100_NATIVE_CAT_SET_DCS_CODE,
|
||||
FT100_NATIVE_CAT_GET_RX_STATUS,
|
||||
FT100_NATIVE_CAT_GET_TX_STATUS,
|
||||
FT100_NATIVE_CAT_GET_FREQ_MODE_STATUS,
|
||||
FT100_NATIVE_CAT_PWR_WAKE,
|
||||
FT100_NATIVE_CAT_PWR_ON,
|
||||
FT100_NATIVE_CAT_PWR_OFF,
|
||||
FT100_NATIVE_CAT_READ_STATUS,
|
||||
FT100_NATIVE_CAT_READ_METERS,
|
||||
FT100_NATIVE_CAT_READ_FLAGS,
|
||||
FT100_NATIVE_SIZE /* end marker */
|
||||
};
|
||||
|
||||
/*
|
||||
* we are able to get way more info
|
||||
* than we can set
|
||||
*
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned char band_no;
|
||||
unsigned char freq[4];
|
||||
unsigned char mode;
|
||||
unsigned char ctcss;
|
||||
unsigned char dcs;
|
||||
unsigned char flag1;
|
||||
unsigned char flag2;
|
||||
unsigned char clarifier[2];
|
||||
unsigned char not_used;
|
||||
unsigned char step1;
|
||||
unsigned char step2;
|
||||
unsigned char filter;
|
||||
|
||||
unsigned char stuffing[16];
|
||||
}
|
||||
FT100_STATUS_INFO;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char mic_switch_1;
|
||||
unsigned char tx_fwd_power;
|
||||
unsigned char tx_rev_power;
|
||||
unsigned char s_meter;
|
||||
unsigned char mic_level;
|
||||
unsigned char squelch_level;
|
||||
unsigned char mic_switch_2;
|
||||
unsigned char final_temp;
|
||||
unsigned char alc_level;
|
||||
}
|
||||
FT100_METER_INFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char byte[8];
|
||||
}
|
||||
FT100_FLAG_INFO;
|
||||
|
||||
|
||||
static int ft100_init(RIG *rig);
|
||||
static int ft100_open(RIG *rig);
|
||||
static int ft100_cleanup(RIG *rig);
|
||||
static int ft100_close(RIG *rig);
|
||||
|
||||
static int ft100_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft100_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft100_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft100_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int ft100_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
|
||||
static int ft100_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft100_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
static int ft100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
#if 0
|
||||
static int ft100_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
|
||||
|
||||
static int ft100_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
static int ft100_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
|
||||
static int ft100_set_parm(RIG *rig, setting_t parm, value_t val);
|
||||
static int ft100_get_parm(RIG *rig, setting_t parm, value_t *val);
|
||||
#endif
|
||||
|
||||
static int ft100_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft100_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft100_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t shift);
|
||||
static int ft100_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *shift);
|
||||
|
||||
static int ft100_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft100_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code);
|
||||
|
||||
static int ft100_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft100_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone);
|
||||
|
||||
//static int ft100_get_info(RIG *rig, FT100_STATUS_INFO *ft100_status, FT100_METER_INFO *ft100_meter, FT100_FLAG_INFO *ft100_flags);
|
||||
|
||||
struct ft100_priv_data
|
||||
{
|
||||
/* TODO: make use of cached data */
|
||||
|
|
|
@ -31,141 +31,4 @@
|
|||
#define FT100_POST_WRITE_DELAY 100 /* max is 200ms */
|
||||
#define FT100_DEFAULT_READ_TIMEOUT 2000
|
||||
|
||||
enum ft100_native_cmd_e {
|
||||
|
||||
FT100_NATIVE_CAT_LOCK_ON = 0,
|
||||
FT100_NATIVE_CAT_LOCK_OFF,
|
||||
FT100_NATIVE_CAT_PTT_ON,
|
||||
FT100_NATIVE_CAT_PTT_OFF,
|
||||
FT100_NATIVE_CAT_SET_FREQ,
|
||||
FT100_NATIVE_CAT_SET_MODE_LSB,
|
||||
FT100_NATIVE_CAT_SET_MODE_USB,
|
||||
FT100_NATIVE_CAT_SET_MODE_CW,
|
||||
FT100_NATIVE_CAT_SET_MODE_CWR,
|
||||
FT100_NATIVE_CAT_SET_MODE_AM,
|
||||
FT100_NATIVE_CAT_SET_MODE_FM,
|
||||
FT100_NATIVE_CAT_SET_MODE_DIG,
|
||||
FT100_NATIVE_CAT_SET_MODE_WFM,
|
||||
FT100_NATIVE_CAT_CLAR_ON,
|
||||
FT100_NATIVE_CAT_CLAR_OFF,
|
||||
FT100_NATIVE_CAT_SET_CLAR_FREQ,
|
||||
FT100_NATIVE_CAT_SET_VFOAB,
|
||||
FT100_NATIVE_CAT_SET_VFOA,
|
||||
FT100_NATIVE_CAT_SET_VFOB,
|
||||
FT100_NATIVE_CAT_SPLIT_ON,
|
||||
FT100_NATIVE_CAT_SPLIT_OFF,
|
||||
FT100_NATIVE_CAT_SET_RPT_SHIFT_MINUS,
|
||||
FT100_NATIVE_CAT_SET_RPT_SHIFT_PLUS,
|
||||
FT100_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX,
|
||||
FT100_NATIVE_CAT_SET_RPT_OFFSET,
|
||||
/* fix me */
|
||||
FT100_NATIVE_CAT_SET_DCS_ON,
|
||||
FT100_NATIVE_CAT_SET_CTCSS_ENC_ON,
|
||||
FT100_NATIVE_CAT_SET_CTCSS_ENC_DEC_ON,
|
||||
FT100_NATIVE_CAT_SET_CTCSS_DCS_OFF,
|
||||
/* em xif */
|
||||
FT100_NATIVE_CAT_SET_CTCSS_FREQ,
|
||||
FT100_NATIVE_CAT_SET_DCS_CODE,
|
||||
FT100_NATIVE_CAT_GET_RX_STATUS,
|
||||
FT100_NATIVE_CAT_GET_TX_STATUS,
|
||||
FT100_NATIVE_CAT_GET_FREQ_MODE_STATUS,
|
||||
FT100_NATIVE_CAT_PWR_WAKE,
|
||||
FT100_NATIVE_CAT_PWR_ON,
|
||||
FT100_NATIVE_CAT_PWR_OFF,
|
||||
FT100_NATIVE_CAT_READ_STATUS,
|
||||
FT100_NATIVE_CAT_READ_METERS,
|
||||
FT100_NATIVE_CAT_READ_FLAGS,
|
||||
FT100_NATIVE_SIZE /* end marker */
|
||||
};
|
||||
|
||||
|
||||
typedef enum ft100_native_cmd_e ft100_native_cmd_t;
|
||||
|
||||
/*
|
||||
* we are able to get way more info
|
||||
* than we can set
|
||||
*
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned char band_no;
|
||||
unsigned char freq[4];
|
||||
unsigned char mode;
|
||||
unsigned char ctcss;
|
||||
unsigned char dcs;
|
||||
unsigned char flag1;
|
||||
unsigned char flag2;
|
||||
unsigned char clarifier[2];
|
||||
unsigned char not_used;
|
||||
unsigned char step1;
|
||||
unsigned char step2;
|
||||
unsigned char filter;
|
||||
|
||||
unsigned char stuffing[16];
|
||||
}
|
||||
FT100_STATUS_INFO;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char mic_switch_1;
|
||||
unsigned char tx_fwd_power;
|
||||
unsigned char tx_rev_power;
|
||||
unsigned char s_meter;
|
||||
unsigned char mic_level;
|
||||
unsigned char squelch_level;
|
||||
unsigned char mic_switch_2;
|
||||
unsigned char final_temp;
|
||||
unsigned char alc_level;
|
||||
}
|
||||
FT100_METER_INFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char byte[8];
|
||||
}
|
||||
FT100_FLAG_INFO;
|
||||
|
||||
|
||||
static int ft100_init(RIG *rig);
|
||||
static int ft100_open(RIG *rig);
|
||||
static int ft100_cleanup(RIG *rig);
|
||||
static int ft100_close(RIG *rig);
|
||||
|
||||
static int ft100_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft100_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft100_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft100_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int ft100_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
|
||||
static int ft100_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft100_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
static int ft100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
#if 0
|
||||
static int ft100_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
|
||||
|
||||
static int ft100_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
static int ft100_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
|
||||
static int ft100_set_parm(RIG *rig, setting_t parm, value_t val);
|
||||
static int ft100_get_parm(RIG *rig, setting_t parm, value_t *val);
|
||||
#endif
|
||||
|
||||
static int ft100_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft100_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft100_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t shift);
|
||||
static int ft100_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *shift);
|
||||
|
||||
static int ft100_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft100_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code);
|
||||
|
||||
static int ft100_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft100_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone);
|
||||
|
||||
//static int ft100_get_info(RIG *rig, FT100_STATUS_INFO *ft100_status, FT100_METER_INFO *ft100_meter, FT100_FLAG_INFO *ft100_flags);
|
||||
|
||||
#endif /* _FT100_H */
|
||||
|
|
|
@ -43,6 +43,112 @@
|
|||
#include "yaesu.h"
|
||||
#include "ft1000d.h"
|
||||
|
||||
// FT1000D native commands
|
||||
enum FT1000D_native_cmd_e {
|
||||
FT1000D_NATIVE_SPLIT_OFF = 0,
|
||||
FT1000D_NATIVE_SPLIT_ON,
|
||||
FT1000D_NATIVE_RECALL_MEM,
|
||||
FT1000D_NATIVE_VFO_TO_MEM,
|
||||
FT1000D_NATIVE_LOCK_OFF,
|
||||
FT1000D_NATIVE_LOCK_ON,
|
||||
FT1000D_NATIVE_VFO_A,
|
||||
FT1000D_NATIVE_VFO_B,
|
||||
FT1000D_NATIVE_MEM_TO_VFO,
|
||||
FT1000D_NATIVE_VFO_STEP_UP,
|
||||
FT1000D_NATIVE_VFO_STEP_UP_FAST,
|
||||
FT1000D_NATIVE_VFO_STEP_DOWN,
|
||||
FT1000D_NATIVE_VFO_STEP_DOWN_FAST,
|
||||
FT1000D_NATIVE_RX_CLARIFIER_OFF,
|
||||
FT1000D_NATIVE_RX_CLARIFIER_ON,
|
||||
FT1000D_NATIVE_TX_CLARIFIER_OFF,
|
||||
FT1000D_NATIVE_TX_CLARIFIER_ON,
|
||||
FT1000D_NATIVE_CLEAR_CLARIFIER_OFFSET,
|
||||
FT1000D_NATIVE_CLARIFIER_OPS,
|
||||
FT1000D_NATIVE_FREQ_SET,
|
||||
FT1000D_NATIVE_MODE_SET_LSB,
|
||||
FT1000D_NATIVE_MODE_SET_USB,
|
||||
FT1000D_NATIVE_MODE_SET_CW_W,
|
||||
FT1000D_NATIVE_MODE_SET_CW_N,
|
||||
FT1000D_NATIVE_MODE_SET_AM_W,
|
||||
FT1000D_NATIVE_MODE_SET_AM_N,
|
||||
FT1000D_NATIVE_MODE_SET_FM,
|
||||
FT1000D_NATIVE_MODE_SET_RTTY_LSB,
|
||||
FT1000D_NATIVE_MODE_SET_RTTY_USB,
|
||||
FT1000D_NATIVE_MODE_SET_PKT_LSB,
|
||||
FT1000D_NATIVE_MODE_SET_PKT_FM,
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_LSB, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_USB, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_CW_W, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_CW_N, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_AM_W, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_AM_N, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_FM, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_RTTY_LSB, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_RTTY_USB, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_PKT_LSB, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_PKT_FM, /* Added December 2016 */
|
||||
FT1000D_NATIVE_PACING,
|
||||
FT1000D_NATIVE_PTT_OFF,
|
||||
FT1000D_NATIVE_PTT_ON,
|
||||
FT1000D_NATIVE_UPDATE_ALL_DATA,
|
||||
FT1000D_NATIVE_UPDATE_MEM_CHNL,
|
||||
FT1000D_NATIVE_UPDATE_OP_DATA,
|
||||
FT1000D_NATIVE_UPDATE_VFO_DATA,
|
||||
FT1000D_NATIVE_UPDATE_MEM_CHNL_DATA,
|
||||
FT1000D_NATIVE_TUNER_OFF,
|
||||
FT1000D_NATIVE_TUNER_ON,
|
||||
FT1000D_NATIVE_TUNER_START,
|
||||
FT1000D_NATIVE_RPTR_SHIFT_NONE,
|
||||
FT1000D_NATIVE_RPTR_SHIFT_MINUS,
|
||||
FT1000D_NATIVE_RPTR_SHIFT_PLUS,
|
||||
FT1000D_NATIVE_VFO_TO_VFO,
|
||||
FT1000D_NATIVE_SET_SUB_VFO_FREQ,
|
||||
FT1000D_NATIVE_BANDWIDTH,
|
||||
FT1000D_NATIVE_OP_FREQ_STEP_UP,
|
||||
FT1000D_NATIVE_OP_FREQ_STEP_DOWN,
|
||||
FT1000D_NATIVE_READ_METER,
|
||||
FT1000D_NATIVE_DIM_LEVEL,
|
||||
FT1000D_NATIVE_RPTR_OFFSET,
|
||||
FT1000D_NATIVE_READ_FLAGS,
|
||||
FT1000D_NATIVE_SIZE
|
||||
};
|
||||
|
||||
static int ft1000d_init(RIG *rig);
|
||||
static int ft1000d_cleanup(RIG *rig);
|
||||
static int ft1000d_open(RIG *rig);
|
||||
static int ft1000d_close(RIG *rig);
|
||||
static int ft1000d_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft1000d_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
static int ft1000d_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft1000d_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
static int ft1000d_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int ft1000d_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
static int ft1000d_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft1000d_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
static int ft1000d_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
|
||||
static int ft1000d_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
|
||||
static int ft1000d_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs);
|
||||
static int ft1000d_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq); /* Added December 2016 */
|
||||
static int ft1000d_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq); /* Added December 2016 */
|
||||
static int ft1000d_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft1000d_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
static int ft1000d_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width); /* Added December 2016 */
|
||||
static int ft1000d_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width); /* Added December 2016 */
|
||||
static int ft1000d_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft1000d_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
static int ft1000d_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
static int ft1000d_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
static int ft1000d_set_parm(RIG *rig, setting_t parm, value_t val);
|
||||
static int ft1000d_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit);
|
||||
static int ft1000d_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit);
|
||||
static int ft1000d_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *value);
|
||||
static int ft1000d_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
static int ft1000d_set_mem(RIG *rig, vfo_t vfo, int ch);
|
||||
static int ft1000d_get_mem(RIG *rig, vfo_t vfo, int *ch);
|
||||
static int ft1000d_set_channel (RIG *rig, vfo_t vfo, const channel_t *chan);
|
||||
static int ft1000d_get_channel (RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
|
||||
|
||||
|
||||
|
||||
|
||||
/* Private helper function prototypes */
|
||||
|
@ -304,7 +410,7 @@ const struct rig_caps ft1000d_caps =
|
|||
/*
|
||||
* rig_init
|
||||
*/
|
||||
int ft1000d_init(RIG *rig)
|
||||
static int ft1000d_init(RIG *rig)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
|
||||
|
@ -344,7 +450,7 @@ int ft1000d_init(RIG *rig)
|
|||
/*
|
||||
* rig_cleanup
|
||||
*/
|
||||
int ft1000d_cleanup(RIG *rig)
|
||||
static int ft1000d_cleanup(RIG *rig)
|
||||
{
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
@ -368,7 +474,7 @@ int ft1000d_cleanup(RIG *rig)
|
|||
/*
|
||||
* rig_open
|
||||
*/
|
||||
int ft1000d_open(RIG *rig)
|
||||
static int ft1000d_open(RIG *rig)
|
||||
{
|
||||
struct rig_state *rig_s;
|
||||
struct ft1000d_priv_data *priv;
|
||||
|
@ -414,7 +520,7 @@ int ft1000d_open(RIG *rig)
|
|||
/*
|
||||
* rig_close
|
||||
*/
|
||||
int ft1000d_close(RIG *rig)
|
||||
static int ft1000d_close(RIG *rig)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -444,7 +550,7 @@ int ft1000d_close(RIG *rig)
|
|||
* In all other cases the passed vfo is selected if it differs
|
||||
* from the currently selected VFO.
|
||||
*/
|
||||
int ft1000d_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
static int ft1000d_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
|
@ -515,7 +621,7 @@ int ft1000d_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
* In all other cases the passed vfo is selected if it differs
|
||||
* from the currently selected VFO.
|
||||
*/
|
||||
int ft1000d_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
static int ft1000d_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
unsigned char *p;
|
||||
|
@ -608,7 +714,7 @@ int ft1000d_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
* In all other cases the passed vfo is selected if it differs
|
||||
* from the currently selected VFO.
|
||||
*/
|
||||
int ft1000d_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
static int ft1000d_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
|
@ -686,7 +792,7 @@ int ft1000d_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
|||
* Comments: The passed value for the vfo is ignored since the PTT status
|
||||
* is independent from the VFO selection.
|
||||
*/
|
||||
int ft1000d_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
||||
static int ft1000d_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
|
@ -737,7 +843,7 @@ int ft1000d_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
|||
* from the currently selected VFO.
|
||||
* Repeater shift can only be set when in FM mode.
|
||||
*/
|
||||
int ft1000d_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
|
||||
static int ft1000d_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
unsigned char ci;
|
||||
|
@ -866,7 +972,7 @@ int ft1000d_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
|
|||
* from the currently selected VFO.
|
||||
* Repeater shift can only be obtained when in FM mode.
|
||||
*/
|
||||
int ft1000d_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
|
||||
static int ft1000d_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
ft1000d_op_data_t *p;
|
||||
|
@ -960,7 +1066,7 @@ int ft1000d_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
|
|||
* Comments: The passed value for the vfo is ignored since the
|
||||
* repeater frequency offset is independent from the VFO selection.
|
||||
*/
|
||||
int ft1000d_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
|
||||
static int ft1000d_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
|
||||
{
|
||||
unsigned char bcd[(int) FT1000D_BCD_RPTR_OFFSET / 2];
|
||||
int err;
|
||||
|
@ -1019,7 +1125,7 @@ int ft1000d_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
|
|||
* the correct TX VFO is selected by the rig in split mode.
|
||||
* An error is returned if vfo and tx_vfo are the same.
|
||||
*/
|
||||
int ft1000d_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
||||
static int ft1000d_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
unsigned char ci;
|
||||
|
@ -1120,7 +1226,7 @@ int ft1000d_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
* Comments: The passed value for the vfo is ignored in order to
|
||||
* preserve the current split vfo system settings.
|
||||
*/
|
||||
int ft1000d_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
||||
static int ft1000d_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
|
@ -1221,7 +1327,7 @@ int ft1000d_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
|||
* rit = 0 && xit enabled -> disable rit
|
||||
* rit = 0 && xit disabled -> disable rit and set frequency = 0
|
||||
*/
|
||||
int ft1000d_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
static int ft1000d_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
|
@ -1333,7 +1439,7 @@ int ft1000d_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
|||
* In all other cases the passed vfo is selected if it differs
|
||||
* from the currently selected VFO.
|
||||
*/
|
||||
int ft1000d_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
|
||||
static int ft1000d_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
unsigned char ci;
|
||||
|
@ -1428,7 +1534,7 @@ int ft1000d_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
|
|||
* xit = 0 && rit enabled -> disable xit
|
||||
* xit = 0 && rit disabled -> disable xit and set frequency = 0
|
||||
*/
|
||||
int ft1000d_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
|
||||
static int ft1000d_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
|
@ -1538,7 +1644,7 @@ int ft1000d_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
|
|||
* In all other cases the passed vfo is selected if it differs
|
||||
* from the currently selected VFO.
|
||||
*/
|
||||
int ft1000d_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
|
||||
static int ft1000d_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
unsigned char ci;
|
||||
|
@ -1625,7 +1731,7 @@ int ft1000d_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
|
|||
* Comments: The passed value for the vfo is ignored since the
|
||||
* the status of rig functions are vfo independent.
|
||||
*/
|
||||
int ft1000d_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
static int ft1000d_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
{
|
||||
unsigned char ci;
|
||||
int err;
|
||||
|
@ -1699,7 +1805,7 @@ int ft1000d_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
* Comments: The passed value for the vfo is ignored since the
|
||||
* the status of rig function are vfo independent.
|
||||
*/
|
||||
int ft1000d_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
||||
static int ft1000d_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
|
@ -1759,7 +1865,7 @@ int ft1000d_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
*
|
||||
* Comments:
|
||||
*/
|
||||
int ft1000d_set_parm(RIG *rig, setting_t parm, value_t val)
|
||||
static int ft1000d_set_parm(RIG *rig, setting_t parm, value_t val)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -1820,7 +1926,7 @@ int ft1000d_set_parm(RIG *rig, setting_t parm, value_t val)
|
|||
* In all other cases the passed vfo is selected if it differs
|
||||
* from the currently selected VFO.
|
||||
*/
|
||||
int ft1000d_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
static int ft1000d_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
unsigned char bw;
|
||||
|
@ -1974,7 +2080,7 @@ int ft1000d_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
* In all other cases the passed vfo is selected if it differs
|
||||
* from the currently selected VFO.
|
||||
*/
|
||||
int ft1000d_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
static int ft1000d_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
unsigned char *p;
|
||||
|
@ -2158,7 +2264,7 @@ int ft1000d_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
* In all other cases the passed vfo is selected if it differs
|
||||
* from the currently selected VFO.
|
||||
*/
|
||||
int ft1000d_set_vfo(RIG *rig, vfo_t vfo)
|
||||
static int ft1000d_set_vfo(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
unsigned char ci;
|
||||
|
@ -2251,7 +2357,7 @@ int ft1000d_set_vfo(RIG *rig, vfo_t vfo)
|
|||
* The result is stored in the priv->current_vfo data structure
|
||||
* for later retrieval.
|
||||
*/
|
||||
int ft1000d_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
static int ft1000d_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
|
@ -2333,7 +2439,7 @@ int ft1000d_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
* In all other cases the passed vfo is selected if it differs
|
||||
* from the currently selected VFO.
|
||||
*/
|
||||
int ft1000d_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *value)
|
||||
static int ft1000d_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *value)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
struct rig_state *rig_s;
|
||||
|
@ -2435,7 +2541,7 @@ int ft1000d_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *value)
|
|||
* In all other cases the passed vfo is selected if it differs
|
||||
* from the currently selected VFO.
|
||||
*/
|
||||
int ft1000d_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
|
||||
static int ft1000d_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
unsigned char ci;
|
||||
|
@ -2558,7 +2664,7 @@ int ft1000d_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
|
|||
* Comments: The passed value for the vfo is ignored since the
|
||||
* the channel selection is vfo independent.
|
||||
*/
|
||||
int ft1000d_set_mem(RIG *rig, vfo_t vfo, int ch)
|
||||
static int ft1000d_set_mem(RIG *rig, vfo_t vfo, int ch)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
|
@ -2610,7 +2716,7 @@ int ft1000d_set_mem(RIG *rig, vfo_t vfo, int ch)
|
|||
* Comments: The passed value for the vfo is ignored since
|
||||
* the channel selection is vfo independent.
|
||||
*/
|
||||
int ft1000d_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
||||
static int ft1000d_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
|
@ -2666,7 +2772,7 @@ int ft1000d_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
|||
* -------------------------------------------------------------------------
|
||||
* Returns RIG_OK on success or an error code on failure
|
||||
*/
|
||||
int ft1000d_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
||||
static int ft1000d_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -2698,7 +2804,7 @@ int ft1000d_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
|||
* Status for split operation, active rig functions and tuning steps
|
||||
* are only relevant for currVFO
|
||||
*/
|
||||
int ft1000d_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
||||
static int ft1000d_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
ft1000d_op_data_t *p;
|
||||
|
@ -3179,7 +3285,7 @@ int ft1000d_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
|||
* Returns: RIG_OK if all called functions are successful,
|
||||
* otherwise returns error from called functiion
|
||||
*/
|
||||
int ft1000d_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
|
||||
static int ft1000d_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
|
||||
{
|
||||
struct rig_state *rig_s;
|
||||
struct ft1000d_priv_data *priv;
|
||||
|
@ -3302,7 +3408,7 @@ int ft1000d_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
|
|||
* Returns: RIG_OK if all called functions are successful,
|
||||
* otherwise returns error from called functiion
|
||||
*/
|
||||
int ft1000d_send_static_cmd(RIG *rig, unsigned char ci)
|
||||
static int ft1000d_send_static_cmd(RIG *rig, unsigned char ci)
|
||||
{
|
||||
struct rig_state *rig_s;
|
||||
struct ft1000d_priv_data *priv;
|
||||
|
@ -3351,7 +3457,7 @@ int ft1000d_send_static_cmd(RIG *rig, unsigned char ci)
|
|||
* Returns: RIG_OK if all called functions are successful,
|
||||
* otherwise returns error from called functiion
|
||||
*/
|
||||
int ft1000d_send_dynamic_cmd(RIG *rig, unsigned char ci,
|
||||
static int ft1000d_send_dynamic_cmd(RIG *rig, unsigned char ci,
|
||||
unsigned char p1, unsigned char p2,
|
||||
unsigned char p3, unsigned char p4)
|
||||
{
|
||||
|
@ -3414,7 +3520,7 @@ int ft1000d_send_dynamic_cmd(RIG *rig, unsigned char ci,
|
|||
* Returns: RIG_OK if all called functions are successful,
|
||||
* otherwise returns error from called functiion
|
||||
*/
|
||||
int ft1000d_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
||||
static int ft1000d_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
||||
{
|
||||
struct rig_state *rig_s;
|
||||
struct ft1000d_priv_data *priv;
|
||||
|
@ -3475,7 +3581,7 @@ int ft1000d_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
* Returns: RIG_OK if all called functions are successful,
|
||||
* otherwise returns error from called functiion
|
||||
*/
|
||||
int ft1000d_send_rit_freq(RIG *rig, unsigned char ci, shortfreq_t rit)
|
||||
static int ft1000d_send_rit_freq(RIG *rig, unsigned char ci, shortfreq_t rit)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
struct rig_state *rig_s;
|
||||
|
@ -3554,7 +3660,7 @@ int ft1000d_send_rit_freq(RIG *rig, unsigned char ci, shortfreq_t rit)
|
|||
*/
|
||||
|
||||
|
||||
int ft1000d_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||
static int ft1000d_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||
{
|
||||
|
||||
int err;
|
||||
|
@ -3618,7 +3724,7 @@ int ft1000d_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000d_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||
static int ft1000d_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
|
@ -3680,7 +3786,7 @@ int ft1000d_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000d_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
static int ft1000d_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
pbwidth_t tx_width)
|
||||
{
|
||||
int err;
|
||||
|
@ -3813,7 +3919,7 @@ int ft1000d_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000d_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||
static int ft1000d_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||
pbwidth_t *tx_width)
|
||||
{
|
||||
struct ft1000d_priv_data *priv;
|
||||
|
|
|
@ -89,114 +89,6 @@
|
|||
|
||||
#define FT1000D_DEFAULT_READ_TIMEOUT FT1000D_ALL_DATA_LENGTH * ( 5 + (FT1000D_PACING_INTERVAL * FT1000D_PACING_DEFAULT_VALUE))
|
||||
|
||||
// FT1000D native commands
|
||||
typedef enum FT1000D_native_cmd_e {
|
||||
FT1000D_NATIVE_SPLIT_OFF = 0,
|
||||
FT1000D_NATIVE_SPLIT_ON,
|
||||
FT1000D_NATIVE_RECALL_MEM,
|
||||
FT1000D_NATIVE_VFO_TO_MEM,
|
||||
FT1000D_NATIVE_LOCK_OFF,
|
||||
FT1000D_NATIVE_LOCK_ON,
|
||||
FT1000D_NATIVE_VFO_A,
|
||||
FT1000D_NATIVE_VFO_B,
|
||||
FT1000D_NATIVE_MEM_TO_VFO,
|
||||
FT1000D_NATIVE_VFO_STEP_UP,
|
||||
FT1000D_NATIVE_VFO_STEP_UP_FAST,
|
||||
FT1000D_NATIVE_VFO_STEP_DOWN,
|
||||
FT1000D_NATIVE_VFO_STEP_DOWN_FAST,
|
||||
FT1000D_NATIVE_RX_CLARIFIER_OFF,
|
||||
FT1000D_NATIVE_RX_CLARIFIER_ON,
|
||||
FT1000D_NATIVE_TX_CLARIFIER_OFF,
|
||||
FT1000D_NATIVE_TX_CLARIFIER_ON,
|
||||
FT1000D_NATIVE_CLEAR_CLARIFIER_OFFSET,
|
||||
FT1000D_NATIVE_CLARIFIER_OPS,
|
||||
FT1000D_NATIVE_FREQ_SET,
|
||||
FT1000D_NATIVE_MODE_SET_LSB,
|
||||
FT1000D_NATIVE_MODE_SET_USB,
|
||||
FT1000D_NATIVE_MODE_SET_CW_W,
|
||||
FT1000D_NATIVE_MODE_SET_CW_N,
|
||||
FT1000D_NATIVE_MODE_SET_AM_W,
|
||||
FT1000D_NATIVE_MODE_SET_AM_N,
|
||||
FT1000D_NATIVE_MODE_SET_FM,
|
||||
FT1000D_NATIVE_MODE_SET_RTTY_LSB,
|
||||
FT1000D_NATIVE_MODE_SET_RTTY_USB,
|
||||
FT1000D_NATIVE_MODE_SET_PKT_LSB,
|
||||
FT1000D_NATIVE_MODE_SET_PKT_FM,
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_LSB, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_USB, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_CW_W, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_CW_N, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_AM_W, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_AM_N, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_FM, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_RTTY_LSB, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_RTTY_USB, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_PKT_LSB, /* Added December 2016 */
|
||||
FT1000D_NATIVE_MODE_SUB_VFOB_SET_PKT_FM, /* Added December 2016 */
|
||||
FT1000D_NATIVE_PACING,
|
||||
FT1000D_NATIVE_PTT_OFF,
|
||||
FT1000D_NATIVE_PTT_ON,
|
||||
FT1000D_NATIVE_UPDATE_ALL_DATA,
|
||||
FT1000D_NATIVE_UPDATE_MEM_CHNL,
|
||||
FT1000D_NATIVE_UPDATE_OP_DATA,
|
||||
FT1000D_NATIVE_UPDATE_VFO_DATA,
|
||||
FT1000D_NATIVE_UPDATE_MEM_CHNL_DATA,
|
||||
FT1000D_NATIVE_TUNER_OFF,
|
||||
FT1000D_NATIVE_TUNER_ON,
|
||||
FT1000D_NATIVE_TUNER_START,
|
||||
FT1000D_NATIVE_RPTR_SHIFT_NONE,
|
||||
FT1000D_NATIVE_RPTR_SHIFT_MINUS,
|
||||
FT1000D_NATIVE_RPTR_SHIFT_PLUS,
|
||||
FT1000D_NATIVE_VFO_TO_VFO,
|
||||
FT1000D_NATIVE_SET_SUB_VFO_FREQ,
|
||||
FT1000D_NATIVE_BANDWIDTH,
|
||||
FT1000D_NATIVE_OP_FREQ_STEP_UP,
|
||||
FT1000D_NATIVE_OP_FREQ_STEP_DOWN,
|
||||
FT1000D_NATIVE_READ_METER,
|
||||
FT1000D_NATIVE_DIM_LEVEL,
|
||||
FT1000D_NATIVE_RPTR_OFFSET,
|
||||
FT1000D_NATIVE_READ_FLAGS,
|
||||
FT1000D_NATIVE_SIZE
|
||||
} FT1000D_native_cmd_t;
|
||||
|
||||
|
||||
/* HAMLIB API implementation */
|
||||
int ft1000d_init(RIG *rig);
|
||||
int ft1000d_cleanup(RIG *rig);
|
||||
int ft1000d_open(RIG *rig);
|
||||
int ft1000d_close(RIG *rig);
|
||||
int ft1000d_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
int ft1000d_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
int ft1000d_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
int ft1000d_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
int ft1000d_set_vfo(RIG *rig, vfo_t vfo);
|
||||
int ft1000d_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
int ft1000d_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
int ft1000d_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
int ft1000d_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
|
||||
int ft1000d_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
|
||||
int ft1000d_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs);
|
||||
int ft1000d_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq); /* Added December 2016 */
|
||||
int ft1000d_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq); /* Added December 2016 */
|
||||
int ft1000d_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
int ft1000d_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
int ft1000d_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width); /* Added December 2016 */
|
||||
int ft1000d_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width); /* Added December 2016 */
|
||||
int ft1000d_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
int ft1000d_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
int ft1000d_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
int ft1000d_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
int ft1000d_set_parm(RIG *rig, setting_t parm, value_t val);
|
||||
int ft1000d_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit);
|
||||
int ft1000d_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit);
|
||||
int ft1000d_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *value);
|
||||
int ft1000d_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
int ft1000d_set_mem(RIG *rig, vfo_t vfo, int ch);
|
||||
int ft1000d_get_mem(RIG *rig, vfo_t vfo, int *ch);
|
||||
int ft1000d_set_channel (RIG *rig, vfo_t vfo, const channel_t *chan);
|
||||
int ft1000d_get_channel (RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
|
||||
|
||||
|
||||
/*
|
||||
* The definitions below are copied from the kFT1000D
|
||||
* project and are hereby made available to the
|
||||
|
|
|
@ -48,6 +48,94 @@
|
|||
#include "yaesu.h"
|
||||
#include "ft1000mp.h"
|
||||
|
||||
/*
|
||||
* Native FT1000MP functions. More to come :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft1000mp_native_cmd_e
|
||||
{
|
||||
FT1000MP_NATIVE_SPLIT_OFF = 0,
|
||||
FT1000MP_NATIVE_SPLIT_ON,
|
||||
FT1000MP_NATIVE_RECALL_MEM,
|
||||
FT1000MP_NATIVE_VFO_TO_MEM,
|
||||
FT1000MP_NATIVE_VFO_A,
|
||||
FT1000MP_NATIVE_VFO_B,
|
||||
FT1000MP_NATIVE_M_TO_VFO,
|
||||
FT1000MP_NATIVE_RIT_ON,
|
||||
FT1000MP_NATIVE_RIT_OFF,
|
||||
FT1000MP_NATIVE_XIT_ON,
|
||||
FT1000MP_NATIVE_XIT_OFF,
|
||||
FT1000MP_NATIVE_RXIT_SET,
|
||||
FT1000MP_NATIVE_FREQA_SET,
|
||||
FT1000MP_NATIVE_FREQB_SET,
|
||||
FT1000MP_NATIVE_MODE_SET_LSB,
|
||||
FT1000MP_NATIVE_MODE_SET_USB,
|
||||
FT1000MP_NATIVE_MODE_SET_CW,
|
||||
FT1000MP_NATIVE_MODE_SET_CWR,
|
||||
FT1000MP_NATIVE_MODE_SET_AM,
|
||||
FT1000MP_NATIVE_MODE_SET_AMS,
|
||||
FT1000MP_NATIVE_MODE_SET_FM,
|
||||
FT1000MP_NATIVE_MODE_SET_FMW,
|
||||
FT1000MP_NATIVE_MODE_SET_RTTY_LSB,
|
||||
FT1000MP_NATIVE_MODE_SET_RTTY_USB,
|
||||
FT1000MP_NATIVE_MODE_SET_DATA_LSB,
|
||||
FT1000MP_NATIVE_MODE_SET_DATA_FM,
|
||||
FT1000MP_NATIVE_MODE_SET_LSB_B,
|
||||
FT1000MP_NATIVE_MODE_SET_USB_B,
|
||||
FT1000MP_NATIVE_MODE_SET_CW_B,
|
||||
FT1000MP_NATIVE_MODE_SET_CWR_B,
|
||||
FT1000MP_NATIVE_MODE_SET_AM_B,
|
||||
FT1000MP_NATIVE_MODE_SET_AMS_B,
|
||||
FT1000MP_NATIVE_MODE_SET_FM_B,
|
||||
FT1000MP_NATIVE_MODE_SET_FMW_B,
|
||||
FT1000MP_NATIVE_MODE_SET_RTTY_LSB_B,
|
||||
FT1000MP_NATIVE_MODE_SET_RTTY_USB_B,
|
||||
FT1000MP_NATIVE_MODE_SET_DATA_LSB_B,
|
||||
FT1000MP_NATIVE_MODE_SET_DATA_FM_B,
|
||||
FT1000MP_NATIVE_PACING,
|
||||
FT1000MP_NATIVE_PTT_OFF,
|
||||
FT1000MP_NATIVE_PTT_ON,
|
||||
FT1000MP_NATIVE_VFO_UPDATE,
|
||||
FT1000MP_NATIVE_CURR_VFO_UPDATE,
|
||||
FT1000MP_NATIVE_UPDATE,
|
||||
FT1000MP_NATIVE_AB,
|
||||
FT1000MP_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*
|
||||
*/
|
||||
|
||||
static int ft1000mp_init(RIG *rig);
|
||||
static int ft1000mp_cleanup(RIG *rig);
|
||||
static int ft1000mp_open(RIG *rig);
|
||||
//static int ft1000mp_close(RIG *rig);
|
||||
static int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
static int ft1000mp_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
|
||||
static int ft1000mp_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq);
|
||||
static int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
static int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
||||
pbwidth_t width); /* select mode */
|
||||
static int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
|
||||
pbwidth_t *width); /* get mode */
|
||||
static int ft1000mp_set_vfo(RIG *rig, vfo_t vfo); /* select vfo */
|
||||
static int ft1000mp_get_vfo(RIG *rig, vfo_t *vfo); /* get vfo */
|
||||
static int ft1000mp_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft1000mp_set_xit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft1000mp_set_rxit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft1000mp_get_rxit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
static int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
static int ft1000mp_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
static int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
|
||||
|
||||
/*
|
||||
* Differences between FT1000MP:
|
||||
* The FT1000MP MARK-V Field appears to be identical to FT1000MP,
|
||||
|
@ -626,7 +714,7 @@ const struct rig_caps ft1000mpmkvfld_caps =
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000mp_init(RIG *rig)
|
||||
static int ft1000mp_init(RIG *rig)
|
||||
{
|
||||
struct ft1000mp_priv_data *priv;
|
||||
|
||||
|
@ -663,7 +751,7 @@ int ft1000mp_init(RIG *rig)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000mp_cleanup(RIG *rig)
|
||||
static int ft1000mp_cleanup(RIG *rig)
|
||||
{
|
||||
ENTERFUNC;
|
||||
|
||||
|
@ -683,7 +771,7 @@ int ft1000mp_cleanup(RIG *rig)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000mp_open(RIG *rig)
|
||||
static int ft1000mp_open(RIG *rig)
|
||||
{
|
||||
struct rig_state *rig_s;
|
||||
struct ft1000mp_priv_data *p;
|
||||
|
@ -719,7 +807,7 @@ int ft1000mp_open(RIG *rig)
|
|||
|
||||
|
||||
|
||||
int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
static int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
struct rig_state *rig_s;
|
||||
struct ft1000mp_priv_data *p;
|
||||
|
@ -779,7 +867,7 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
int ft1000mp_get_vfo_data(RIG *rig, vfo_t vfo)
|
||||
static int ft1000mp_get_vfo_data(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
int cmd_index, len, retval;
|
||||
|
||||
|
@ -809,7 +897,7 @@ int ft1000mp_get_vfo_data(RIG *rig, vfo_t vfo)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
static int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
struct ft1000mp_priv_data *priv;
|
||||
unsigned char *p;
|
||||
|
@ -862,7 +950,7 @@ int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
static int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
unsigned char cmd_index = 0; /* index of sequence to send */
|
||||
|
||||
|
@ -984,7 +1072,7 @@ int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
static int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
struct ft1000mp_priv_data *priv;
|
||||
unsigned char mymode; /* ft1000mp mode */
|
||||
|
@ -1080,7 +1168,7 @@ int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000mp_set_vfo(RIG *rig, vfo_t vfo)
|
||||
static int ft1000mp_set_vfo(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
//unsigned char cmd_index = 0; /* index of sequence to send */
|
||||
|
||||
|
@ -1145,7 +1233,7 @@ int ft1000mp_set_vfo(RIG *rig, vfo_t vfo)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000mp_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
static int ft1000mp_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
{
|
||||
struct ft1000mp_priv_data *p;
|
||||
int retval;
|
||||
|
@ -1196,7 +1284,7 @@ int ft1000mp_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
static int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
{
|
||||
struct ft1000mp_priv_data *priv;
|
||||
struct rig_state *rs;
|
||||
|
@ -1246,7 +1334,7 @@ int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
||||
static int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
||||
{
|
||||
int retval;
|
||||
struct ft1000mp_priv_data *priv;
|
||||
|
@ -1321,7 +1409,7 @@ int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
/*
|
||||
* set_rit only support vfo = RIG_VFO_CURR
|
||||
*/
|
||||
int ft1000mp_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
static int ft1000mp_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
{
|
||||
ENTERFUNC;
|
||||
|
||||
|
@ -1333,13 +1421,13 @@ int ft1000mp_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
|||
RETURNFUNC(ft1000mp_set_rxit(rig, vfo, rit));
|
||||
}
|
||||
|
||||
int ft1000mp_set_xit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
static int ft1000mp_set_xit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
{
|
||||
ENTERFUNC;
|
||||
RETURNFUNC(ft1000mp_set_rxit(rig, vfo, rit));
|
||||
}
|
||||
|
||||
int ft1000mp_set_rxit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
static int ft1000mp_set_rxit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
{
|
||||
struct rig_state *rs;
|
||||
struct ft1000mp_priv_data *priv;
|
||||
|
@ -1388,7 +1476,7 @@ int ft1000mp_set_rxit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000mp_get_rxit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
|
||||
static int ft1000mp_get_rxit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
|
||||
{
|
||||
struct ft1000mp_priv_data *priv;
|
||||
unsigned char *p;
|
||||
|
@ -1434,7 +1522,7 @@ int ft1000mp_get_rxit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
|
|||
}
|
||||
|
||||
|
||||
int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
static int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
struct ft1000mp_priv_data *priv;
|
||||
struct rig_state *rs;
|
||||
|
@ -1536,7 +1624,7 @@ int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
int ft1000mp_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
static int ft1000mp_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
{
|
||||
unsigned char cmd_index; /* index of sequence to send */
|
||||
|
||||
|
@ -1627,7 +1715,7 @@ static int ft1000mp_send_priv_cmd(RIG *rig, unsigned char ci)
|
|||
|
||||
}
|
||||
|
||||
int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
||||
static int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
||||
{
|
||||
// FT1000 transmits on A and receives on B
|
||||
|
||||
|
@ -1670,7 +1758,7 @@ int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
||||
static int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
||||
{
|
||||
struct ft1000mp_priv_data *p;
|
||||
int retval;
|
||||
|
@ -1702,7 +1790,7 @@ int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
|||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
int ft1000mp_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||
static int ft1000mp_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||
{
|
||||
ENTERFUNC;
|
||||
int retval = rig_set_split_vfo(rig, vfo, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
@ -1712,7 +1800,7 @@ int ft1000mp_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
|||
RETURNFUNC(ft1000mp_set_freq(rig, RIG_VFO_B, tx_freq));
|
||||
}
|
||||
|
||||
int ft1000mp_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||
static int ft1000mp_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||
{
|
||||
ENTERFUNC;
|
||||
RETURNFUNC(ft1000mp_get_freq(rig, RIG_VFO_B, tx_freq));
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#ifndef _FT1000MP_H
|
||||
#define _FT1000MP_H 1
|
||||
|
||||
//#include "rig.h"
|
||||
|
||||
#define FT1000MP_STATUS_FLAGS_LENGTH 5 /* 0xfa return size */
|
||||
#define FT1000MP_STATUS_UPDATE_LENGTH 16 /* 0x10 U = 02 return size */
|
||||
|
||||
|
@ -63,66 +61,6 @@
|
|||
|
||||
|
||||
|
||||
/*
|
||||
* Native FT1000MP functions. More to come :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft1000mp_native_cmd_e
|
||||
{
|
||||
FT1000MP_NATIVE_SPLIT_OFF = 0,
|
||||
FT1000MP_NATIVE_SPLIT_ON,
|
||||
FT1000MP_NATIVE_RECALL_MEM,
|
||||
FT1000MP_NATIVE_VFO_TO_MEM,
|
||||
FT1000MP_NATIVE_VFO_A,
|
||||
FT1000MP_NATIVE_VFO_B,
|
||||
FT1000MP_NATIVE_M_TO_VFO,
|
||||
FT1000MP_NATIVE_RIT_ON,
|
||||
FT1000MP_NATIVE_RIT_OFF,
|
||||
FT1000MP_NATIVE_XIT_ON,
|
||||
FT1000MP_NATIVE_XIT_OFF,
|
||||
FT1000MP_NATIVE_RXIT_SET,
|
||||
FT1000MP_NATIVE_FREQA_SET,
|
||||
FT1000MP_NATIVE_FREQB_SET,
|
||||
FT1000MP_NATIVE_MODE_SET_LSB,
|
||||
FT1000MP_NATIVE_MODE_SET_USB,
|
||||
FT1000MP_NATIVE_MODE_SET_CW,
|
||||
FT1000MP_NATIVE_MODE_SET_CWR,
|
||||
FT1000MP_NATIVE_MODE_SET_AM,
|
||||
FT1000MP_NATIVE_MODE_SET_AMS,
|
||||
FT1000MP_NATIVE_MODE_SET_FM,
|
||||
FT1000MP_NATIVE_MODE_SET_FMW,
|
||||
FT1000MP_NATIVE_MODE_SET_RTTY_LSB,
|
||||
FT1000MP_NATIVE_MODE_SET_RTTY_USB,
|
||||
FT1000MP_NATIVE_MODE_SET_DATA_LSB,
|
||||
FT1000MP_NATIVE_MODE_SET_DATA_FM,
|
||||
FT1000MP_NATIVE_MODE_SET_LSB_B,
|
||||
FT1000MP_NATIVE_MODE_SET_USB_B,
|
||||
FT1000MP_NATIVE_MODE_SET_CW_B,
|
||||
FT1000MP_NATIVE_MODE_SET_CWR_B,
|
||||
FT1000MP_NATIVE_MODE_SET_AM_B,
|
||||
FT1000MP_NATIVE_MODE_SET_AMS_B,
|
||||
FT1000MP_NATIVE_MODE_SET_FM_B,
|
||||
FT1000MP_NATIVE_MODE_SET_FMW_B,
|
||||
FT1000MP_NATIVE_MODE_SET_RTTY_LSB_B,
|
||||
FT1000MP_NATIVE_MODE_SET_RTTY_USB_B,
|
||||
FT1000MP_NATIVE_MODE_SET_DATA_LSB_B,
|
||||
FT1000MP_NATIVE_MODE_SET_DATA_FM_B,
|
||||
FT1000MP_NATIVE_PACING,
|
||||
FT1000MP_NATIVE_PTT_OFF,
|
||||
FT1000MP_NATIVE_PTT_ON,
|
||||
FT1000MP_NATIVE_VFO_UPDATE,
|
||||
FT1000MP_NATIVE_CURR_VFO_UPDATE,
|
||||
FT1000MP_NATIVE_UPDATE,
|
||||
FT1000MP_NATIVE_AB,
|
||||
FT1000MP_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
|
||||
};
|
||||
|
||||
typedef enum ft1000mp_native_cmd_e ft1000mp_native_cmd_t;
|
||||
|
||||
|
||||
/*
|
||||
* Internal MODES - when setting modes via cmd_mode_set()
|
||||
*
|
||||
|
@ -211,42 +149,4 @@ typedef enum ft1000mp_native_cmd_e ft1000mp_native_cmd_t;
|
|||
#define IF_MODE_MASK 0x80
|
||||
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*
|
||||
*/
|
||||
|
||||
int ft1000mp_init(RIG *rig);
|
||||
int ft1000mp_cleanup(RIG *rig);
|
||||
int ft1000mp_open(RIG *rig);
|
||||
int ft1000mp_close(RIG *rig);
|
||||
|
||||
int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
int ft1000mp_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
|
||||
int ft1000mp_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq);
|
||||
int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
||||
pbwidth_t width); /* select mode */
|
||||
int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
|
||||
pbwidth_t *width); /* get mode */
|
||||
|
||||
int ft1000mp_set_vfo(RIG *rig, vfo_t vfo); /* select vfo */
|
||||
int ft1000mp_get_vfo(RIG *rig, vfo_t *vfo); /* get vfo */
|
||||
|
||||
int ft1000mp_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
int ft1000mp_set_xit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
int ft1000mp_set_rxit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
int ft1000mp_get_rxit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
|
||||
int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
int ft1000mp_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
|
||||
int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
|
||||
|
||||
#endif /* _FT1000MP_H */
|
||||
|
|
|
@ -41,6 +41,98 @@
|
|||
#include "misc.h"
|
||||
#include "bandplan.h"
|
||||
|
||||
enum ft600_native_cmd_e {
|
||||
|
||||
FT600_NATIVE_CAT_LOCK_ON = 0,
|
||||
FT600_NATIVE_CAT_LOCK_OFF,
|
||||
FT600_NATIVE_CAT_PTT_ON,
|
||||
FT600_NATIVE_CAT_PTT_OFF,
|
||||
FT600_NATIVE_CAT_SET_FREQ,
|
||||
FT600_NATIVE_CAT_SET_MODE_LSB,
|
||||
FT600_NATIVE_CAT_SET_MODE_USB,
|
||||
FT600_NATIVE_CAT_SET_MODE_DIG,
|
||||
FT600_NATIVE_CAT_SET_MODE_CW,
|
||||
FT600_NATIVE_CAT_SET_MODE_AM,
|
||||
FT600_NATIVE_CAT_CLAR_ON,
|
||||
FT600_NATIVE_CAT_CLAR_OFF,
|
||||
FT600_NATIVE_CAT_SET_CLAR_FREQ,
|
||||
FT600_NATIVE_CAT_SET_VFOAB,
|
||||
FT600_NATIVE_CAT_SET_VFOA,
|
||||
FT600_NATIVE_CAT_SET_VFOB,
|
||||
FT600_NATIVE_CAT_SPLIT_ON,
|
||||
FT600_NATIVE_CAT_SPLIT_OFF,
|
||||
FT600_NATIVE_CAT_SET_RPT_SHIFT_MINUS,
|
||||
FT600_NATIVE_CAT_SET_RPT_SHIFT_PLUS,
|
||||
FT600_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX,
|
||||
FT600_NATIVE_CAT_SET_RPT_OFFSET,
|
||||
/* fix me */
|
||||
FT600_NATIVE_CAT_SET_DCS_ON,
|
||||
FT600_NATIVE_CAT_SET_CTCSS_ENC_ON,
|
||||
FT600_NATIVE_CAT_SET_CTCSS_ENC_DEC_ON,
|
||||
FT600_NATIVE_CAT_SET_CTCSS_DCS_OFF,
|
||||
/* em xif */
|
||||
FT600_NATIVE_CAT_SET_CTCSS_FREQ,
|
||||
FT600_NATIVE_CAT_SET_DCS_CODE,
|
||||
FT600_NATIVE_CAT_GET_RX_STATUS,
|
||||
FT600_NATIVE_CAT_GET_TX_STATUS,
|
||||
FT600_NATIVE_CAT_GET_FREQ_MODE_STATUS,
|
||||
FT600_NATIVE_CAT_PWR_WAKE,
|
||||
FT600_NATIVE_CAT_PWR_ON,
|
||||
FT600_NATIVE_CAT_PWR_OFF,
|
||||
FT600_NATIVE_CAT_READ_STATUS,
|
||||
FT600_NATIVE_CAT_READ_METERS,
|
||||
FT600_NATIVE_CAT_READ_FLAGS
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* we are able to get way more info
|
||||
* than we can set
|
||||
*
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned char band_no;
|
||||
unsigned char freq[16];
|
||||
unsigned char mode;
|
||||
unsigned char ctcss;
|
||||
unsigned char dcs;
|
||||
unsigned char flag1;
|
||||
unsigned char flag2;
|
||||
unsigned char clarifier[2];
|
||||
unsigned char not_used;
|
||||
unsigned char step1;
|
||||
unsigned char step2;
|
||||
unsigned char filter;
|
||||
|
||||
unsigned char stuffing[16];
|
||||
}
|
||||
FT600_STATUS_INFO;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char byte[8];
|
||||
}
|
||||
FT600_FLAG_INFO;
|
||||
|
||||
|
||||
static int ft600_init(RIG *rig);
|
||||
static int ft600_open(RIG *rig);
|
||||
static int ft600_cleanup(RIG *rig);
|
||||
static int ft600_close(RIG *rig);
|
||||
|
||||
static int ft600_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft600_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft600_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft600_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft600_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
|
||||
static int ft600_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft600_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
|
||||
struct ft600_priv_data
|
||||
{
|
||||
FT600_STATUS_INFO status;
|
||||
|
@ -249,7 +341,7 @@ const struct rig_caps ft600_caps =
|
|||
.get_parm = NULL,
|
||||
};
|
||||
|
||||
int ft600_init(RIG *rig)
|
||||
static int ft600_init(RIG *rig)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -261,7 +353,7 @@ int ft600_init(RIG *rig)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int ft600_cleanup(RIG *rig)
|
||||
static int ft600_cleanup(RIG *rig)
|
||||
{
|
||||
if (!rig)
|
||||
{
|
||||
|
@ -280,7 +372,7 @@ int ft600_cleanup(RIG *rig)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int ft600_open(RIG *rig)
|
||||
static int ft600_open(RIG *rig)
|
||||
{
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
|
||||
|
@ -288,7 +380,7 @@ int ft600_open(RIG *rig)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int ft600_close(RIG *rig)
|
||||
static int ft600_close(RIG *rig)
|
||||
{
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s:called\n", __func__);
|
||||
|
@ -348,7 +440,7 @@ static int ft600_read_status(RIG *rig)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int ft600_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
static int ft600_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
|
||||
struct ft600_priv_data *priv;
|
||||
|
@ -384,7 +476,7 @@ int ft600_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int ft600_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
static int ft600_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
struct rig_state *rig_s;
|
||||
unsigned char p_cmd[YAESU_CMD_LENGTH];
|
||||
|
@ -406,7 +498,7 @@ int ft600_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
return write_block(&rig_s->rigport, (char *) p_cmd, YAESU_CMD_LENGTH);
|
||||
}
|
||||
|
||||
int ft600_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
static int ft600_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
|
||||
struct ft600_priv_data *priv = (struct ft600_priv_data *)rig->state.priv;
|
||||
|
@ -433,7 +525,7 @@ int ft600_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int ft600_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
static int ft600_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
{
|
||||
|
||||
unsigned char cmd_index;
|
||||
|
@ -457,7 +549,7 @@ int ft600_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
|||
return ft600_send_priv_cmd(rig, cmd_index);
|
||||
}
|
||||
|
||||
int ft600_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
static int ft600_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
|
||||
struct ft600_priv_data *priv = (struct ft600_priv_data *)rig->state.priv;
|
||||
|
@ -512,7 +604,7 @@ int ft600_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int ft600_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
static int ft600_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
unsigned char cmd_index; /* index of sequence to send */
|
||||
int ret;
|
||||
|
@ -584,7 +676,7 @@ int ft600_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int ft600_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
static int ft600_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
{
|
||||
|
||||
|
||||
|
|
|
@ -33,99 +33,4 @@
|
|||
#define FT600_WRITE_DELAY 5
|
||||
#define FT600_POST_WRITE_DELAY 200
|
||||
#define FT600_DEFAULT_READ_TIMEOUT 2000
|
||||
|
||||
enum ft600_native_cmd_e {
|
||||
|
||||
FT600_NATIVE_CAT_LOCK_ON = 0,
|
||||
FT600_NATIVE_CAT_LOCK_OFF,
|
||||
FT600_NATIVE_CAT_PTT_ON,
|
||||
FT600_NATIVE_CAT_PTT_OFF,
|
||||
FT600_NATIVE_CAT_SET_FREQ,
|
||||
FT600_NATIVE_CAT_SET_MODE_LSB,
|
||||
FT600_NATIVE_CAT_SET_MODE_USB,
|
||||
FT600_NATIVE_CAT_SET_MODE_DIG,
|
||||
FT600_NATIVE_CAT_SET_MODE_CW,
|
||||
FT600_NATIVE_CAT_SET_MODE_AM,
|
||||
FT600_NATIVE_CAT_CLAR_ON,
|
||||
FT600_NATIVE_CAT_CLAR_OFF,
|
||||
FT600_NATIVE_CAT_SET_CLAR_FREQ,
|
||||
FT600_NATIVE_CAT_SET_VFOAB,
|
||||
FT600_NATIVE_CAT_SET_VFOA,
|
||||
FT600_NATIVE_CAT_SET_VFOB,
|
||||
FT600_NATIVE_CAT_SPLIT_ON,
|
||||
FT600_NATIVE_CAT_SPLIT_OFF,
|
||||
FT600_NATIVE_CAT_SET_RPT_SHIFT_MINUS,
|
||||
FT600_NATIVE_CAT_SET_RPT_SHIFT_PLUS,
|
||||
FT600_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX,
|
||||
FT600_NATIVE_CAT_SET_RPT_OFFSET,
|
||||
/* fix me */
|
||||
FT600_NATIVE_CAT_SET_DCS_ON,
|
||||
FT600_NATIVE_CAT_SET_CTCSS_ENC_ON,
|
||||
FT600_NATIVE_CAT_SET_CTCSS_ENC_DEC_ON,
|
||||
FT600_NATIVE_CAT_SET_CTCSS_DCS_OFF,
|
||||
/* em xif */
|
||||
FT600_NATIVE_CAT_SET_CTCSS_FREQ,
|
||||
FT600_NATIVE_CAT_SET_DCS_CODE,
|
||||
FT600_NATIVE_CAT_GET_RX_STATUS,
|
||||
FT600_NATIVE_CAT_GET_TX_STATUS,
|
||||
FT600_NATIVE_CAT_GET_FREQ_MODE_STATUS,
|
||||
FT600_NATIVE_CAT_PWR_WAKE,
|
||||
FT600_NATIVE_CAT_PWR_ON,
|
||||
FT600_NATIVE_CAT_PWR_OFF,
|
||||
FT600_NATIVE_CAT_READ_STATUS,
|
||||
FT600_NATIVE_CAT_READ_METERS,
|
||||
FT600_NATIVE_CAT_READ_FLAGS
|
||||
};
|
||||
|
||||
|
||||
typedef enum ft600_native_cmd_e ft600_native_cmd_t;
|
||||
|
||||
/*
|
||||
* we are able to get way more info
|
||||
* than we can set
|
||||
*
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned char band_no;
|
||||
unsigned char freq[16];
|
||||
unsigned char mode;
|
||||
unsigned char ctcss;
|
||||
unsigned char dcs;
|
||||
unsigned char flag1;
|
||||
unsigned char flag2;
|
||||
unsigned char clarifier[2];
|
||||
unsigned char not_used;
|
||||
unsigned char step1;
|
||||
unsigned char step2;
|
||||
unsigned char filter;
|
||||
|
||||
unsigned char stuffing[16];
|
||||
}
|
||||
FT600_STATUS_INFO;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char byte[8];
|
||||
}
|
||||
FT600_FLAG_INFO;
|
||||
|
||||
|
||||
static int ft600_init(RIG *rig);
|
||||
static int ft600_open(RIG *rig);
|
||||
static int ft600_cleanup(RIG *rig);
|
||||
static int ft600_close(RIG *rig);
|
||||
|
||||
static int ft600_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft600_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft600_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft600_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft600_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
|
||||
static int ft600_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft600_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
|
||||
#endif /* _FT600_H */
|
||||
|
|
|
@ -47,6 +47,142 @@
|
|||
#include "yaesu.h"
|
||||
#include "ft747.h"
|
||||
|
||||
/*
|
||||
* Native FT747 functions. This is what I have to work with :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft747_native_cmd_e {
|
||||
FT_747_NATIVE_SPLIT_OFF = 0,
|
||||
FT_747_NATIVE_SPLIT_ON,
|
||||
FT_747_NATIVE_RECALL_MEM,
|
||||
FT_747_NATIVE_VFO_TO_MEM,
|
||||
FT_747_NATIVE_DLOCK_OFF,
|
||||
FT_747_NATIVE_DLOCK_ON,
|
||||
FT_747_NATIVE_VFO_A,
|
||||
FT_747_NATIVE_VFO_B,
|
||||
FT_747_NATIVE_M_TO_VFO,
|
||||
FT_747_NATIVE_UP_500K,
|
||||
FT_747_NATIVE_DOWN_500K,
|
||||
FT_747_NATIVE_CLARIFY_OFF,
|
||||
FT_747_NATIVE_CLARIFY_ON,
|
||||
FT_747_NATIVE_FREQ_SET,
|
||||
FT_747_NATIVE_MODE_SET_LSB,
|
||||
FT_747_NATIVE_MODE_SET_USB,
|
||||
FT_747_NATIVE_MODE_SET_CWW,
|
||||
FT_747_NATIVE_MODE_SET_CWN,
|
||||
FT_747_NATIVE_MODE_SET_AMW,
|
||||
FT_747_NATIVE_MODE_SET_AMN,
|
||||
FT_747_NATIVE_MODE_SET_FMW,
|
||||
FT_747_NATIVE_MODE_SET_FMN,
|
||||
FT_747_NATIVE_PACING,
|
||||
FT_747_NATIVE_PTT_OFF,
|
||||
FT_747_NATIVE_PTT_ON,
|
||||
FT_747_NATIVE_UPDATE,
|
||||
FT_747_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
|
||||
};
|
||||
|
||||
typedef enum ft747_native_cmd_e ft747_native_cmd_t;
|
||||
|
||||
|
||||
|
||||
/* Internal MODES - when setting modes via cmd_mode_set() */
|
||||
|
||||
#define MODE_SET_LSB 0x00
|
||||
#define MODE_SET_USB 0x01
|
||||
#define MODE_SET_CWW 0x02
|
||||
#define MODE_SET_CWN 0x03
|
||||
#define MODE_SET_AMW 0x04
|
||||
#define MODE_SET_AMN 0x05
|
||||
#define MODE_SET_FMW 0x06
|
||||
#define MODE_SET_FMN 0x07
|
||||
|
||||
|
||||
/*
|
||||
* Mode Bitmap. Bits 5 and 6 unused
|
||||
* When READING modes
|
||||
*/
|
||||
|
||||
#define MODE_FM 0x01
|
||||
#define MODE_AM 0x02
|
||||
#define MODE_CW 0x04
|
||||
#define MODE_FMN 0x81
|
||||
#define MODE_AMN 0x82
|
||||
#define MODE_CWN 0x84
|
||||
#define MODE_USB 0x08
|
||||
#define MODE_LSB 0x10
|
||||
#define MODE_NAR 0x80
|
||||
|
||||
/* All relevant bits */
|
||||
#define MODE_MASK 0x9f
|
||||
|
||||
|
||||
/*
|
||||
* Status Flag Masks when reading
|
||||
*/
|
||||
|
||||
#define SF_DLOCK 0x01
|
||||
#define SF_SPLIT 0x02
|
||||
#define SF_CLAR 0x04
|
||||
#define SF_VFOAB 0x08
|
||||
#define SF_VFOMR 0x10
|
||||
#define SF_RXTX 0x20
|
||||
#define SF_RESV 0x40
|
||||
#define SF_PRI 0x80
|
||||
|
||||
|
||||
/*
|
||||
* Local VFO CMD's, according to spec
|
||||
*/
|
||||
|
||||
#define FT747_VFO_A 0x00
|
||||
#define FT747_VFO_B 0x01
|
||||
|
||||
|
||||
/*
|
||||
* Some useful offsets in the status update map (offset)
|
||||
*
|
||||
* Manual appears to be full of mistakes regarding offsets etc.. -- FS
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT747_SUMO_DISPLAYED_MEM 0x17
|
||||
#define FT747_SUMO_DISPLAYED_MODE 0x18
|
||||
#define FT747_SUMO_DISPLAYED_STATUS 0x00
|
||||
#define FT747_SUMO_DISPLAYED_FREQ 0x01
|
||||
#define FT747_SUMO_VFO_A_FREQ 0x09
|
||||
#define FT747_SUMO_VFO_B_FREQ 0x11
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*/
|
||||
|
||||
static int ft747_init(RIG *rig);
|
||||
static int ft747_cleanup(RIG *rig);
|
||||
static int ft747_open(RIG *rig);
|
||||
static int ft747_close(RIG *rig);
|
||||
|
||||
static int ft747_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft747_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft747_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */
|
||||
static int ft747_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */
|
||||
|
||||
static int ft747_set_vfo(RIG *rig, vfo_t vfo); /* select vfo */
|
||||
static int ft747_get_vfo(RIG *rig, vfo_t *vfo); /* get vfo */
|
||||
|
||||
static int ft747_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
|
||||
static int ft747_set_split(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft747_get_split(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft747_set_mem(RIG *rig, vfo_t vfo, int ch);
|
||||
static int ft747_get_mem(RIG *rig, vfo_t vfo, int *ch);
|
||||
|
||||
|
||||
/* Private helper function prototypes */
|
||||
|
||||
|
|
|
@ -61,142 +61,6 @@
|
|||
|
||||
|
||||
|
||||
/*
|
||||
* Native FT747 functions. This is what I have to work with :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft747_native_cmd_e {
|
||||
FT_747_NATIVE_SPLIT_OFF = 0,
|
||||
FT_747_NATIVE_SPLIT_ON,
|
||||
FT_747_NATIVE_RECALL_MEM,
|
||||
FT_747_NATIVE_VFO_TO_MEM,
|
||||
FT_747_NATIVE_DLOCK_OFF,
|
||||
FT_747_NATIVE_DLOCK_ON,
|
||||
FT_747_NATIVE_VFO_A,
|
||||
FT_747_NATIVE_VFO_B,
|
||||
FT_747_NATIVE_M_TO_VFO,
|
||||
FT_747_NATIVE_UP_500K,
|
||||
FT_747_NATIVE_DOWN_500K,
|
||||
FT_747_NATIVE_CLARIFY_OFF,
|
||||
FT_747_NATIVE_CLARIFY_ON,
|
||||
FT_747_NATIVE_FREQ_SET,
|
||||
FT_747_NATIVE_MODE_SET_LSB,
|
||||
FT_747_NATIVE_MODE_SET_USB,
|
||||
FT_747_NATIVE_MODE_SET_CWW,
|
||||
FT_747_NATIVE_MODE_SET_CWN,
|
||||
FT_747_NATIVE_MODE_SET_AMW,
|
||||
FT_747_NATIVE_MODE_SET_AMN,
|
||||
FT_747_NATIVE_MODE_SET_FMW,
|
||||
FT_747_NATIVE_MODE_SET_FMN,
|
||||
FT_747_NATIVE_PACING,
|
||||
FT_747_NATIVE_PTT_OFF,
|
||||
FT_747_NATIVE_PTT_ON,
|
||||
FT_747_NATIVE_UPDATE,
|
||||
FT_747_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
|
||||
};
|
||||
|
||||
typedef enum ft747_native_cmd_e ft747_native_cmd_t;
|
||||
|
||||
|
||||
|
||||
/* Internal MODES - when setting modes via cmd_mode_set() */
|
||||
|
||||
#define MODE_SET_LSB 0x00
|
||||
#define MODE_SET_USB 0x01
|
||||
#define MODE_SET_CWW 0x02
|
||||
#define MODE_SET_CWN 0x03
|
||||
#define MODE_SET_AMW 0x04
|
||||
#define MODE_SET_AMN 0x05
|
||||
#define MODE_SET_FMW 0x06
|
||||
#define MODE_SET_FMN 0x07
|
||||
|
||||
|
||||
/*
|
||||
* Mode Bitmap. Bits 5 and 6 unused
|
||||
* When READING modes
|
||||
*/
|
||||
|
||||
#define MODE_FM 0x01
|
||||
#define MODE_AM 0x02
|
||||
#define MODE_CW 0x04
|
||||
#define MODE_FMN 0x81
|
||||
#define MODE_AMN 0x82
|
||||
#define MODE_CWN 0x84
|
||||
#define MODE_USB 0x08
|
||||
#define MODE_LSB 0x10
|
||||
#define MODE_NAR 0x80
|
||||
|
||||
/* All relevant bits */
|
||||
#define MODE_MASK 0x9f
|
||||
|
||||
|
||||
/*
|
||||
* Status Flag Masks when reading
|
||||
*/
|
||||
|
||||
#define SF_DLOCK 0x01
|
||||
#define SF_SPLIT 0x02
|
||||
#define SF_CLAR 0x04
|
||||
#define SF_VFOAB 0x08
|
||||
#define SF_VFOMR 0x10
|
||||
#define SF_RXTX 0x20
|
||||
#define SF_RESV 0x40
|
||||
#define SF_PRI 0x80
|
||||
|
||||
|
||||
/*
|
||||
* Local VFO CMD's, according to spec
|
||||
*/
|
||||
|
||||
#define FT747_VFO_A 0x00
|
||||
#define FT747_VFO_B 0x01
|
||||
|
||||
|
||||
/*
|
||||
* Some useful offsets in the status update map (offset)
|
||||
*
|
||||
* Manual appears to be full of mistakes regarding offsets etc.. -- FS
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT747_SUMO_DISPLAYED_MEM 0x17
|
||||
#define FT747_SUMO_DISPLAYED_MODE 0x18
|
||||
#define FT747_SUMO_DISPLAYED_STATUS 0x00
|
||||
#define FT747_SUMO_DISPLAYED_FREQ 0x01
|
||||
#define FT747_SUMO_VFO_A_FREQ 0x09
|
||||
#define FT747_SUMO_VFO_B_FREQ 0x11
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*/
|
||||
|
||||
static int ft747_init(RIG *rig);
|
||||
static int ft747_cleanup(RIG *rig);
|
||||
static int ft747_open(RIG *rig);
|
||||
static int ft747_close(RIG *rig);
|
||||
|
||||
static int ft747_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft747_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft747_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */
|
||||
static int ft747_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */
|
||||
|
||||
static int ft747_set_vfo(RIG *rig, vfo_t vfo); /* select vfo */
|
||||
static int ft747_get_vfo(RIG *rig, vfo_t *vfo); /* get vfo */
|
||||
|
||||
static int ft747_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
|
||||
static int ft747_set_split(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft747_get_split(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft747_set_mem(RIG *rig, vfo_t vfo, int ch);
|
||||
static int ft747_get_mem(RIG *rig, vfo_t vfo, int *ch);
|
||||
|
||||
/*
|
||||
* The time the status block is cached (in millisec).
|
||||
* This optimises the common case of doing eg. rig_get_freq() and
|
||||
|
|
|
@ -51,6 +51,28 @@
|
|||
|
||||
#define FT757GX_VFOS (RIG_VFO_A|RIG_VFO_B)
|
||||
|
||||
/* Backend function prototypes. These map to frontend functions. */
|
||||
static int ft757_init(RIG *rig);
|
||||
static int ft757_cleanup(RIG *rig);
|
||||
static int ft757_open(RIG *rig);
|
||||
|
||||
static int ft757gx_get_conf(RIG *rig, token_t token, char *val);
|
||||
static int ft757gx_set_conf(RIG *rig, token_t token, const char *val);
|
||||
|
||||
static int ft757_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
static int ft757gx_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft757_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */
|
||||
static int ft757_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */
|
||||
|
||||
static int ft757_set_vfo(RIG *rig, vfo_t vfo); /* select vfo */
|
||||
static int ft757_get_vfo(RIG *rig, vfo_t *vfo); /* get vfo */
|
||||
|
||||
static int ft757_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
static int ft757_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
|
||||
|
||||
/* Private helper function prototypes */
|
||||
static int ft757_get_update_data(RIG *rig);
|
||||
static int mode2rig(RIG *rig, rmode_t mode, pbwidth_t width);
|
||||
|
@ -324,7 +346,7 @@ const struct rig_caps ft757gx2_caps =
|
|||
*
|
||||
*/
|
||||
|
||||
int ft757_init(RIG *rig)
|
||||
static int ft757_init(RIG *rig)
|
||||
{
|
||||
struct ft757_priv_data *priv;
|
||||
|
||||
|
@ -364,7 +386,7 @@ int ft757_init(RIG *rig)
|
|||
* the serial port is closed by the frontend
|
||||
*/
|
||||
|
||||
int ft757_cleanup(RIG *rig)
|
||||
static int ft757_cleanup(RIG *rig)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called.\n", __func__);
|
||||
|
||||
|
@ -383,7 +405,7 @@ int ft757_cleanup(RIG *rig)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft757_open(RIG *rig)
|
||||
static int ft757_open(RIG *rig)
|
||||
{
|
||||
struct ft757_priv_data *priv = (struct ft757_priv_data *)rig->state.priv;
|
||||
|
||||
|
@ -416,7 +438,7 @@ int ft757_open(RIG *rig)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft757_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
static int ft757_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
struct ft757_priv_data *priv = (struct ft757_priv_data *)rig->state.priv;
|
||||
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x0a};
|
||||
|
@ -431,7 +453,7 @@ int ft757_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
}
|
||||
|
||||
|
||||
int ft757_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
static int ft757_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x0c};
|
||||
|
||||
|
@ -457,7 +479,7 @@ int ft757_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
}
|
||||
|
||||
|
||||
int ft757gx_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
static int ft757gx_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
struct ft757_priv_data *priv = (struct ft757_priv_data *)rig->state.priv;
|
||||
|
||||
|
@ -474,7 +496,7 @@ int ft757gx_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
* Return Freq
|
||||
*/
|
||||
|
||||
int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
struct ft757_priv_data *priv = (struct ft757_priv_data *)rig->state.priv;
|
||||
int retval;
|
||||
|
@ -513,7 +535,7 @@ int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
}
|
||||
|
||||
|
||||
int ft757_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
static int ft757_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
struct ft757_priv_data *priv = (struct ft757_priv_data *)rig->state.priv;
|
||||
int retval;
|
||||
|
@ -555,7 +577,7 @@ int ft757_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft757_set_vfo(RIG *rig, vfo_t vfo)
|
||||
static int ft757_set_vfo(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x05};
|
||||
struct ft757_priv_data *priv = (struct ft757_priv_data *)rig->state.priv;
|
||||
|
@ -585,7 +607,7 @@ int ft757_set_vfo(RIG *rig, vfo_t vfo)
|
|||
}
|
||||
|
||||
|
||||
int ft757_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
static int ft757_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
{
|
||||
struct ft757_priv_data *priv = (struct ft757_priv_data *)rig->state.priv;
|
||||
int retval;
|
||||
|
@ -616,7 +638,7 @@ int ft757_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
}
|
||||
|
||||
|
||||
int ft757_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
||||
static int ft757_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
||||
{
|
||||
struct ft757_priv_data *priv = (struct ft757_priv_data *)rig->state.priv;
|
||||
int retval;
|
||||
|
@ -635,7 +657,7 @@ int ft757_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
|||
}
|
||||
|
||||
|
||||
int ft757_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
static int ft757_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x01, 0x10};
|
||||
int retval;
|
||||
|
@ -686,7 +708,7 @@ int ft757_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
* need to use this when doing ft757_get_* stuff
|
||||
*/
|
||||
|
||||
int ft757_get_update_data(RIG *rig)
|
||||
static int ft757_get_update_data(RIG *rig)
|
||||
{
|
||||
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x10};
|
||||
struct ft757_priv_data *priv = (struct ft757_priv_data *)rig->state.priv;
|
||||
|
@ -742,7 +764,7 @@ int ft757_get_update_data(RIG *rig)
|
|||
}
|
||||
|
||||
|
||||
int mode2rig(RIG *rig, rmode_t mode, pbwidth_t width)
|
||||
static int mode2rig(RIG *rig, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
int md;
|
||||
|
||||
|
@ -796,7 +818,7 @@ int mode2rig(RIG *rig, rmode_t mode, pbwidth_t width)
|
|||
}
|
||||
|
||||
|
||||
int rig2mode(RIG *rig, int md, rmode_t *mode, pbwidth_t *width)
|
||||
static int rig2mode(RIG *rig, int md, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called.\n", __func__);
|
||||
|
||||
|
@ -850,7 +872,7 @@ int rig2mode(RIG *rig, int md, rmode_t *mode, pbwidth_t *width)
|
|||
/*
|
||||
* Assumes rig!=NULL, rig->state.priv!=NULL
|
||||
*/
|
||||
int ft757gx_get_conf(RIG *rig, token_t token, char *val)
|
||||
static int ft757gx_get_conf(RIG *rig, token_t token, char *val)
|
||||
{
|
||||
struct ft757_priv_data *priv;
|
||||
struct rig_state *rs;
|
||||
|
@ -878,7 +900,7 @@ int ft757gx_get_conf(RIG *rig, token_t token, char *val)
|
|||
/*
|
||||
* Assumes rig!=NULL, rig->state.priv!=NULL
|
||||
*/
|
||||
int ft757gx_set_conf(RIG *rig, token_t token, const char *val)
|
||||
static int ft757gx_set_conf(RIG *rig, token_t token, const char *val)
|
||||
{
|
||||
struct ft757_priv_data *priv;
|
||||
struct rig_state *rs;
|
||||
|
|
|
@ -88,27 +88,4 @@
|
|||
*/
|
||||
#define FT757GX_ALL_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM)
|
||||
|
||||
|
||||
/* Backend function prototypes. These map to frontend functions. */
|
||||
static int ft757_init(RIG *rig);
|
||||
static int ft757_cleanup(RIG *rig);
|
||||
static int ft757_open(RIG *rig);
|
||||
|
||||
static int ft757gx_get_conf(RIG *rig, token_t token, char *val);
|
||||
static int ft757gx_set_conf(RIG *rig, token_t token, const char *val);
|
||||
|
||||
static int ft757_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
static int ft757gx_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft757_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */
|
||||
static int ft757_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */
|
||||
|
||||
static int ft757_set_vfo(RIG *rig, vfo_t vfo); /* select vfo */
|
||||
static int ft757_get_vfo(RIG *rig, vfo_t *vfo); /* get vfo */
|
||||
|
||||
static int ft757_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
static int ft757_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
|
||||
|
||||
#endif /* _FT757GX_H */
|
||||
|
|
|
@ -40,6 +40,38 @@
|
|||
#include "yaesu.h"
|
||||
#include "ft840.h"
|
||||
|
||||
/*
|
||||
* Native FT840 functions. More to come :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft840_native_cmd_e {
|
||||
FT840_NATIVE_SPLIT_OFF = 0,
|
||||
FT840_NATIVE_SPLIT_ON,
|
||||
FT840_NATIVE_RECALL_MEM,
|
||||
FT840_NATIVE_VFO_TO_MEM,
|
||||
FT840_NATIVE_VFO_A,
|
||||
FT840_NATIVE_VFO_B,
|
||||
FT840_NATIVE_MEM_TO_VFO,
|
||||
FT840_NATIVE_CLARIFIER_OPS,
|
||||
FT840_NATIVE_FREQ_SET,
|
||||
FT840_NATIVE_MODE_SET,
|
||||
FT840_NATIVE_PACING,
|
||||
FT840_NATIVE_PTT_OFF,
|
||||
FT840_NATIVE_PTT_ON,
|
||||
FT840_NATIVE_MEM_CHNL,
|
||||
FT840_NATIVE_OP_DATA,
|
||||
FT840_NATIVE_VFO_DATA,
|
||||
FT840_NATIVE_MEM_CHNL_DATA,
|
||||
FT840_NATIVE_TUNER_OFF,
|
||||
FT840_NATIVE_TUNER_ON,
|
||||
FT840_NATIVE_TUNER_START,
|
||||
FT840_NATIVE_READ_METER,
|
||||
FT840_NATIVE_READ_FLAGS,
|
||||
FT840_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
};
|
||||
|
||||
/*
|
||||
*
|
||||
* The FT-840 backend is cloned after the FT-890 backend.
|
||||
|
|
|
@ -106,41 +106,6 @@
|
|||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Native FT840 functions. More to come :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft840_native_cmd_e {
|
||||
FT840_NATIVE_SPLIT_OFF = 0,
|
||||
FT840_NATIVE_SPLIT_ON,
|
||||
FT840_NATIVE_RECALL_MEM,
|
||||
FT840_NATIVE_VFO_TO_MEM,
|
||||
FT840_NATIVE_VFO_A,
|
||||
FT840_NATIVE_VFO_B,
|
||||
FT840_NATIVE_MEM_TO_VFO,
|
||||
FT840_NATIVE_CLARIFIER_OPS,
|
||||
FT840_NATIVE_FREQ_SET,
|
||||
FT840_NATIVE_MODE_SET,
|
||||
FT840_NATIVE_PACING,
|
||||
FT840_NATIVE_PTT_OFF,
|
||||
FT840_NATIVE_PTT_ON,
|
||||
FT840_NATIVE_MEM_CHNL,
|
||||
FT840_NATIVE_OP_DATA,
|
||||
FT840_NATIVE_VFO_DATA,
|
||||
FT840_NATIVE_MEM_CHNL_DATA,
|
||||
FT840_NATIVE_TUNER_OFF,
|
||||
FT840_NATIVE_TUNER_ON,
|
||||
FT840_NATIVE_TUNER_START,
|
||||
FT840_NATIVE_READ_METER,
|
||||
FT840_NATIVE_READ_FLAGS,
|
||||
FT840_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
};
|
||||
|
||||
typedef enum ft840_native_cmd_e ft840_native_cmd_t;
|
||||
|
||||
|
||||
/*
|
||||
* Internal MODES - when setting modes via FT840_NATIVE_MODE_SET
|
||||
*
|
||||
|
|
|
@ -60,6 +60,146 @@
|
|||
#include "bandplan.h"
|
||||
#include "tones.h"
|
||||
|
||||
/*
|
||||
* Native FT847 functions. This is what I have to work with :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft847_native_cmd_e {
|
||||
|
||||
/* Set commands to the rig */
|
||||
|
||||
FT_847_NATIVE_CAT_ON = 0,
|
||||
FT_847_NATIVE_CAT_OFF,
|
||||
|
||||
FT_847_NATIVE_CAT_PTT_ON,
|
||||
FT_847_NATIVE_CAT_PTT_OFF,
|
||||
|
||||
FT_847_NATIVE_CAT_SAT_MODE_ON,
|
||||
FT_847_NATIVE_CAT_SAT_MODE_OFF,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_FREQ_MAIN,
|
||||
FT_847_NATIVE_CAT_SET_FREQ_SAT_RX_VFO,
|
||||
FT_847_NATIVE_CAT_SET_FREQ_SAT_TX_VFO,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_LSB, /* MAIN VFO */
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_USB,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_CW,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_CWR,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_AM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_FM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_CWN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_CWRN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_AMN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_FMN,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_LSB, /* SAT RX VFO */
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_USB,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_CW,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_CWR,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_AM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_FM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_CWN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_CWRN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_AMN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_FMN,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_LSB, /* SAT TX VFO */
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_USB,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_CW,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_CWR,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_AM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_FM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_CWN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_CWRN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_AMN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_FMN,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_DCS_ON_MAIN, /* MAIN CTCSS/DCS */
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_DEC_ON_MAIN,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_ON_MAIN,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_DCS_OFF_MAIN,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_DCS_ON_SAT_RX, /* SAT RX CTCSS/DCS */
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_DEC_ON_SAT_RX,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_ON_SAT_RX,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_DCS_OFF_SAT_RX,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_DCS_ON_SAT_TX, /* SAT TX CTCSS/DCS */
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_DEC_ON_SAT_TX,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_ON_SAT_TX,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_DCS_OFF_SAT_TX,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_FREQ_MAIN, /* CTCSS Freq */
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_FREQ_SAT_RX,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_FREQ_SAT_TX,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_DCS_CODE_MAIN, /* DCS code */
|
||||
FT_847_NATIVE_CAT_SET_DCS_CODE_SAT_RX,
|
||||
FT_847_NATIVE_CAT_SET_DCS_CODE_SAT_TX,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_RPT_SHIFT_MINUS, /* RPT SHIFT */
|
||||
FT_847_NATIVE_CAT_SET_RPT_SHIFT_PLUS,
|
||||
FT_847_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_RPT_OFFSET, /* RPT Offset frequency */
|
||||
|
||||
/* Get info from the rig */
|
||||
|
||||
FT_847_NATIVE_CAT_GET_RX_STATUS,
|
||||
FT_847_NATIVE_CAT_GET_TX_STATUS,
|
||||
|
||||
FT_847_NATIVE_CAT_GET_FREQ_MODE_STATUS_MAIN,
|
||||
FT_847_NATIVE_CAT_GET_FREQ_MODE_STATUS_SAT_RX,
|
||||
FT_847_NATIVE_CAT_GET_FREQ_MODE_STATUS_SAT_TX,
|
||||
|
||||
FT_847_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
|
||||
};
|
||||
|
||||
typedef enum ft847_native_cmd_e ft847_native_cmd_t;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*/
|
||||
|
||||
static int ft847_init(RIG *rig);
|
||||
static int ft847_open(RIG *rig);
|
||||
|
||||
static int ft847_cleanup(RIG *rig);
|
||||
static int ft847_close(RIG *rig);
|
||||
|
||||
static int ft847_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft847_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft847_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */
|
||||
static int ft847_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */
|
||||
|
||||
static int ft847_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft847_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft847_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft847_get_split_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft847_set_split_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft847_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft847_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft847_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
static int ft847_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
|
||||
|
||||
static int ft847_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t * val);
|
||||
|
||||
static int ft847_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
static int ft847_set_ctcss_tone (RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft847_set_ctcss_sql (RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft847_set_dcs_sql (RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft847_set_rptr_shift (RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
|
||||
static int ft847_set_rptr_offs (RIG *rig, vfo_t vfo, shortfreq_t rptr_offs);
|
||||
|
||||
/*
|
||||
* ft847 instance - private data
|
||||
*
|
||||
|
@ -542,7 +682,7 @@ const struct rig_caps ft847uni_caps =
|
|||
* serial port is already open (rig->state->fd)
|
||||
*/
|
||||
|
||||
int ft847_init(RIG *rig)
|
||||
static int ft847_init(RIG *rig)
|
||||
{
|
||||
struct ft847_priv_data *priv;
|
||||
|
||||
|
@ -584,7 +724,7 @@ int ft847_init(RIG *rig)
|
|||
* the serial port is closed by the frontend
|
||||
*/
|
||||
|
||||
int ft847_cleanup(RIG *rig)
|
||||
static int ft847_cleanup(RIG *rig)
|
||||
{
|
||||
if (!rig)
|
||||
{
|
||||
|
@ -609,7 +749,7 @@ int ft847_cleanup(RIG *rig)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft847_open(RIG *rig)
|
||||
static int ft847_open(RIG *rig)
|
||||
{
|
||||
|
||||
/* Good time to set CAT ON */
|
||||
|
@ -624,7 +764,7 @@ int ft847_open(RIG *rig)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft847_close(RIG *rig)
|
||||
static int ft847_close(RIG *rig)
|
||||
{
|
||||
|
||||
/* Good time to set CAT OFF */
|
||||
|
@ -715,7 +855,7 @@ static int opcode_vfo(RIG *rig, unsigned char *cmd, int cmd_index, vfo_t vfo)
|
|||
*/
|
||||
|
||||
|
||||
int ft847_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
static int ft847_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
struct rig_state *rig_s;
|
||||
unsigned char p_cmd[YAESU_CMD_LENGTH]; /* sequence to send */
|
||||
|
@ -892,7 +1032,7 @@ static int get_freq_and_mode(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode,
|
|||
* runs. The Operating Manual does not show the codes for polling the radio.
|
||||
* Note that you cannot query the sub-VFO, nor can you swap VFOs via software.
|
||||
*/
|
||||
int ft847_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
static int ft847_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
rmode_t mode;
|
||||
pbwidth_t width;
|
||||
|
@ -903,7 +1043,7 @@ int ft847_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
|
||||
|
||||
|
||||
int ft847_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
static int ft847_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
unsigned char cmd_index; /* index of sequence to send */
|
||||
struct rig_state *rs = &rig->state;
|
||||
|
@ -1018,7 +1158,7 @@ int ft847_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return write_block(&rs->rigport, (char *)p_cmd, YAESU_CMD_LENGTH);
|
||||
}
|
||||
|
||||
int ft847_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
static int ft847_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
freq_t freq;
|
||||
|
||||
|
@ -1029,7 +1169,7 @@ int ft847_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
/*
|
||||
* Not exactly Split mode, this will set *SAT* Mode
|
||||
*/
|
||||
int ft847_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
||||
static int ft847_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
||||
{
|
||||
struct ft847_priv_data *priv = (struct ft847_priv_data *)rig->state.priv;
|
||||
unsigned char cmd_index; /* index of sequence to send */
|
||||
|
@ -1061,7 +1201,7 @@ int ft847_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int ft847_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
||||
static int ft847_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
||||
{
|
||||
struct ft847_priv_data *priv = (struct ft847_priv_data *)rig->state.priv;
|
||||
|
||||
|
@ -1073,7 +1213,7 @@ int ft847_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int ft847_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
static int ft847_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
int retval = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
|
@ -1082,17 +1222,17 @@ int ft847_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
return ft847_set_freq(rig, RIG_VFO_TX, freq);
|
||||
}
|
||||
|
||||
int ft847_get_split_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
static int ft847_get_split_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
return ft847_get_freq(rig, RIG_VFO_TX, freq);
|
||||
}
|
||||
|
||||
int ft847_set_split_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
static int ft847_set_split_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
return ft847_set_mode(rig, RIG_VFO_TX, mode, width);
|
||||
}
|
||||
|
||||
int ft847_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
static int ft847_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
return ft847_get_mode(rig, RIG_VFO_TX, mode, width);
|
||||
}
|
||||
|
@ -1103,7 +1243,7 @@ int ft847_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
*/
|
||||
|
||||
|
||||
int ft847_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
static int ft847_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
{
|
||||
unsigned char cmd_index; /* index of sequence to send */
|
||||
|
||||
|
@ -1191,7 +1331,7 @@ static int ft847_get_status(RIG *rig, int status_ci)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int ft847_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
||||
static int ft847_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
||||
{
|
||||
|
||||
struct ft847_priv_data *p = (struct ft847_priv_data *) rig->state.priv;
|
||||
|
@ -1225,7 +1365,7 @@ int ft847_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
|||
}
|
||||
|
||||
|
||||
int ft847_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
||||
static int ft847_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
||||
{
|
||||
|
||||
struct ft847_priv_data *p = (struct ft847_priv_data *) rig->state.priv;
|
||||
|
@ -1358,7 +1498,7 @@ static int ft847_get_alc_level(RIG *rig, value_t *val)
|
|||
* and PO/ALC in transmit mode. There is no way
|
||||
* to determine whether it's PO or ALC, unfortunately.
|
||||
*/
|
||||
int ft847_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
static int ft847_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
if (rig->caps->rig_model == RIG_MODEL_FT847UNI)
|
||||
{
|
||||
|
@ -1384,7 +1524,7 @@ int ft847_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
}
|
||||
|
||||
int ft847_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
static int ft847_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
{
|
||||
unsigned char p_cmd[YAESU_CMD_LENGTH]; /* sequence to send */
|
||||
int ret;
|
||||
|
@ -1422,7 +1562,7 @@ int ft847_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
}
|
||||
|
||||
|
||||
int ft847_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
|
||||
static int ft847_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
|
||||
{
|
||||
unsigned char p_cmd[YAESU_CMD_LENGTH]; /* sequence to send */
|
||||
int i, ret;
|
||||
|
@ -1466,13 +1606,13 @@ int ft847_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
|
|||
return write_block(&rig->state.rigport, (char *)p_cmd, YAESU_CMD_LENGTH);
|
||||
}
|
||||
|
||||
int ft847_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
|
||||
static int ft847_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
|
||||
{
|
||||
/* same opcode as tone */
|
||||
return ft847_set_ctcss_tone(rig, vfo, tone);
|
||||
}
|
||||
|
||||
int ft847_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
|
||||
static int ft847_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
|
||||
{
|
||||
unsigned char p_cmd[YAESU_CMD_LENGTH]; /* sequence to send */
|
||||
int ret;
|
||||
|
@ -1493,7 +1633,7 @@ int ft847_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
|
|||
|
||||
}
|
||||
|
||||
int ft847_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
|
||||
static int ft847_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
|
||||
{
|
||||
unsigned char cmd_index; /* index of sequence to send */
|
||||
|
||||
|
@ -1518,7 +1658,7 @@ int ft847_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
|
|||
return ft847_send_priv_cmd(rig, cmd_index);
|
||||
}
|
||||
|
||||
int ft847_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
|
||||
static int ft847_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
|
||||
{
|
||||
unsigned char p_cmd[YAESU_CMD_LENGTH]; /* sequence to send */
|
||||
|
||||
|
|
|
@ -41,145 +41,4 @@
|
|||
#define FT847_DEFAULT_READ_TIMEOUT 2000
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Native FT847 functions. This is what I have to work with :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft847_native_cmd_e {
|
||||
|
||||
/* Set commands to the rig */
|
||||
|
||||
FT_847_NATIVE_CAT_ON = 0,
|
||||
FT_847_NATIVE_CAT_OFF,
|
||||
|
||||
FT_847_NATIVE_CAT_PTT_ON,
|
||||
FT_847_NATIVE_CAT_PTT_OFF,
|
||||
|
||||
FT_847_NATIVE_CAT_SAT_MODE_ON,
|
||||
FT_847_NATIVE_CAT_SAT_MODE_OFF,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_FREQ_MAIN,
|
||||
FT_847_NATIVE_CAT_SET_FREQ_SAT_RX_VFO,
|
||||
FT_847_NATIVE_CAT_SET_FREQ_SAT_TX_VFO,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_LSB, /* MAIN VFO */
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_USB,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_CW,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_CWR,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_AM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_FM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_CWN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_CWRN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_AMN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_MAIN_FMN,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_LSB, /* SAT RX VFO */
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_USB,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_CW,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_CWR,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_AM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_FM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_CWN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_CWRN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_AMN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_RX_FMN,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_LSB, /* SAT TX VFO */
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_USB,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_CW,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_CWR,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_AM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_FM,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_CWN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_CWRN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_AMN,
|
||||
FT_847_NATIVE_CAT_SET_MODE_SAT_TX_FMN,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_DCS_ON_MAIN, /* MAIN CTCSS/DCS */
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_DEC_ON_MAIN,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_ON_MAIN,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_DCS_OFF_MAIN,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_DCS_ON_SAT_RX, /* SAT RX CTCSS/DCS */
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_DEC_ON_SAT_RX,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_ON_SAT_RX,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_DCS_OFF_SAT_RX,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_DCS_ON_SAT_TX, /* SAT TX CTCSS/DCS */
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_DEC_ON_SAT_TX,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_ENC_ON_SAT_TX,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_DCS_OFF_SAT_TX,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_FREQ_MAIN, /* CTCSS Freq */
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_FREQ_SAT_RX,
|
||||
FT_847_NATIVE_CAT_SET_CTCSS_FREQ_SAT_TX,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_DCS_CODE_MAIN, /* DCS code */
|
||||
FT_847_NATIVE_CAT_SET_DCS_CODE_SAT_RX,
|
||||
FT_847_NATIVE_CAT_SET_DCS_CODE_SAT_TX,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_RPT_SHIFT_MINUS, /* RPT SHIFT */
|
||||
FT_847_NATIVE_CAT_SET_RPT_SHIFT_PLUS,
|
||||
FT_847_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX,
|
||||
|
||||
FT_847_NATIVE_CAT_SET_RPT_OFFSET, /* RPT Offset frequency */
|
||||
|
||||
/* Get info from the rig */
|
||||
|
||||
FT_847_NATIVE_CAT_GET_RX_STATUS,
|
||||
FT_847_NATIVE_CAT_GET_TX_STATUS,
|
||||
|
||||
FT_847_NATIVE_CAT_GET_FREQ_MODE_STATUS_MAIN,
|
||||
FT_847_NATIVE_CAT_GET_FREQ_MODE_STATUS_SAT_RX,
|
||||
FT_847_NATIVE_CAT_GET_FREQ_MODE_STATUS_SAT_TX,
|
||||
|
||||
FT_847_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
|
||||
};
|
||||
|
||||
typedef enum ft847_native_cmd_e ft847_native_cmd_t;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*/
|
||||
|
||||
static int ft847_init(RIG *rig);
|
||||
static int ft847_open(RIG *rig);
|
||||
|
||||
static int ft847_cleanup(RIG *rig);
|
||||
static int ft847_close(RIG *rig);
|
||||
|
||||
static int ft847_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft847_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft847_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */
|
||||
static int ft847_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */
|
||||
|
||||
static int ft847_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft847_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft847_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft847_get_split_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft847_set_split_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft847_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft847_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft847_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
static int ft847_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
|
||||
|
||||
static int ft847_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t * val);
|
||||
|
||||
static int ft847_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
static int ft847_set_ctcss_tone (RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft847_set_ctcss_sql (RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft847_set_dcs_sql (RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft847_set_rptr_shift (RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
|
||||
static int ft847_set_rptr_offs (RIG *rig, vfo_t vfo, shortfreq_t rptr_offs);
|
||||
|
||||
#endif /* _FT847_H */
|
||||
|
|
|
@ -74,6 +74,83 @@
|
|||
#include "tones.h"
|
||||
#include "bandplan.h"
|
||||
|
||||
enum ft857_native_cmd_e {
|
||||
FT857_NATIVE_CAT_LOCK_ON = 0,
|
||||
FT857_NATIVE_CAT_LOCK_OFF,
|
||||
FT857_NATIVE_CAT_PTT_ON,
|
||||
FT857_NATIVE_CAT_PTT_OFF,
|
||||
FT857_NATIVE_CAT_SET_FREQ,
|
||||
FT857_NATIVE_CAT_SET_MODE_LSB,
|
||||
FT857_NATIVE_CAT_SET_MODE_USB,
|
||||
FT857_NATIVE_CAT_SET_MODE_CW,
|
||||
FT857_NATIVE_CAT_SET_MODE_CWR,
|
||||
FT857_NATIVE_CAT_SET_MODE_AM,
|
||||
FT857_NATIVE_CAT_SET_MODE_FM,
|
||||
FT857_NATIVE_CAT_SET_MODE_FM_N,
|
||||
FT857_NATIVE_CAT_SET_MODE_DIG,
|
||||
FT857_NATIVE_CAT_SET_MODE_PKT,
|
||||
FT857_NATIVE_CAT_CLAR_ON,
|
||||
FT857_NATIVE_CAT_CLAR_OFF,
|
||||
FT857_NATIVE_CAT_SET_CLAR_FREQ,
|
||||
FT857_NATIVE_CAT_SET_VFOAB,
|
||||
FT857_NATIVE_CAT_SPLIT_ON,
|
||||
FT857_NATIVE_CAT_SPLIT_OFF,
|
||||
FT857_NATIVE_CAT_SET_RPT_SHIFT_MINUS,
|
||||
FT857_NATIVE_CAT_SET_RPT_SHIFT_PLUS,
|
||||
FT857_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX,
|
||||
FT857_NATIVE_CAT_SET_RPT_OFFSET,
|
||||
FT857_NATIVE_CAT_SET_DCS_ON,
|
||||
FT857_NATIVE_CAT_SET_DCS_DEC_ON,
|
||||
FT857_NATIVE_CAT_SET_DCS_ENC_ON,
|
||||
FT857_NATIVE_CAT_SET_CTCSS_ON,
|
||||
FT857_NATIVE_CAT_SET_CTCSS_DEC_ON,
|
||||
FT857_NATIVE_CAT_SET_CTCSS_ENC_ON,
|
||||
FT857_NATIVE_CAT_SET_CTCSS_DCS_OFF,
|
||||
FT857_NATIVE_CAT_SET_CTCSS_FREQ,
|
||||
FT857_NATIVE_CAT_SET_DCS_CODE,
|
||||
FT857_NATIVE_CAT_GET_RX_STATUS,
|
||||
FT857_NATIVE_CAT_GET_TX_STATUS,
|
||||
FT857_NATIVE_CAT_GET_FREQ_MODE_STATUS,
|
||||
FT857_NATIVE_CAT_PWR_WAKE,
|
||||
FT857_NATIVE_CAT_PWR_ON,
|
||||
FT857_NATIVE_CAT_PWR_OFF,
|
||||
FT857_NATIVE_CAT_EEPROM_READ,
|
||||
FT857_NATIVE_SIZE /* end marker */
|
||||
};
|
||||
|
||||
static int ft857_init(RIG *rig);
|
||||
static int ft857_open(RIG *rig);
|
||||
static int ft857_cleanup(RIG *rig);
|
||||
static int ft857_close(RIG *rig);
|
||||
static int ft857_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft857_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
static int ft857_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft857_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
static int ft857_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq, rmode_t mode, pbwidth_t width);
|
||||
static int ft857_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width);
|
||||
static int ft857_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft857_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
// static int ft857_set_vfo(RIG *rig, vfo_t vfo);
|
||||
// static int ft857_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
static int ft857_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft857_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
// static int ft857_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
|
||||
static int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
static int ft857_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
// static int ft857_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
// static int ft857_set_parm(RIG *rig, setting_t parm, value_t val);
|
||||
// static int ft857_get_parm(RIG *rig, setting_t parm, value_t *val);
|
||||
static int ft857_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft857_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft857_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft857_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft857_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
|
||||
static int ft857_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs);
|
||||
static int ft857_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft857_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
|
||||
static int ft857_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
// static int ft857_set_powerstat(RIG *rig, powerstat_t status);
|
||||
|
||||
struct ft857_priv_data
|
||||
{
|
||||
yaesu_cmd_set_t pcs[FT857_NATIVE_SIZE]; /* TODO: why? */
|
||||
|
|
|
@ -69,88 +69,7 @@
|
|||
*/
|
||||
#define FT857_CACHE_TIMEOUT 50
|
||||
|
||||
|
||||
enum ft857_native_cmd_e {
|
||||
FT857_NATIVE_CAT_LOCK_ON = 0,
|
||||
FT857_NATIVE_CAT_LOCK_OFF,
|
||||
FT857_NATIVE_CAT_PTT_ON,
|
||||
FT857_NATIVE_CAT_PTT_OFF,
|
||||
FT857_NATIVE_CAT_SET_FREQ,
|
||||
FT857_NATIVE_CAT_SET_MODE_LSB,
|
||||
FT857_NATIVE_CAT_SET_MODE_USB,
|
||||
FT857_NATIVE_CAT_SET_MODE_CW,
|
||||
FT857_NATIVE_CAT_SET_MODE_CWR,
|
||||
FT857_NATIVE_CAT_SET_MODE_AM,
|
||||
FT857_NATIVE_CAT_SET_MODE_FM,
|
||||
FT857_NATIVE_CAT_SET_MODE_FM_N,
|
||||
FT857_NATIVE_CAT_SET_MODE_DIG,
|
||||
FT857_NATIVE_CAT_SET_MODE_PKT,
|
||||
FT857_NATIVE_CAT_CLAR_ON,
|
||||
FT857_NATIVE_CAT_CLAR_OFF,
|
||||
FT857_NATIVE_CAT_SET_CLAR_FREQ,
|
||||
FT857_NATIVE_CAT_SET_VFOAB,
|
||||
FT857_NATIVE_CAT_SPLIT_ON,
|
||||
FT857_NATIVE_CAT_SPLIT_OFF,
|
||||
FT857_NATIVE_CAT_SET_RPT_SHIFT_MINUS,
|
||||
FT857_NATIVE_CAT_SET_RPT_SHIFT_PLUS,
|
||||
FT857_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX,
|
||||
FT857_NATIVE_CAT_SET_RPT_OFFSET,
|
||||
FT857_NATIVE_CAT_SET_DCS_ON,
|
||||
FT857_NATIVE_CAT_SET_DCS_DEC_ON,
|
||||
FT857_NATIVE_CAT_SET_DCS_ENC_ON,
|
||||
FT857_NATIVE_CAT_SET_CTCSS_ON,
|
||||
FT857_NATIVE_CAT_SET_CTCSS_DEC_ON,
|
||||
FT857_NATIVE_CAT_SET_CTCSS_ENC_ON,
|
||||
FT857_NATIVE_CAT_SET_CTCSS_DCS_OFF,
|
||||
FT857_NATIVE_CAT_SET_CTCSS_FREQ,
|
||||
FT857_NATIVE_CAT_SET_DCS_CODE,
|
||||
FT857_NATIVE_CAT_GET_RX_STATUS,
|
||||
FT857_NATIVE_CAT_GET_TX_STATUS,
|
||||
FT857_NATIVE_CAT_GET_FREQ_MODE_STATUS,
|
||||
FT857_NATIVE_CAT_PWR_WAKE,
|
||||
FT857_NATIVE_CAT_PWR_ON,
|
||||
FT857_NATIVE_CAT_PWR_OFF,
|
||||
FT857_NATIVE_CAT_EEPROM_READ,
|
||||
FT857_NATIVE_SIZE /* end marker */
|
||||
};
|
||||
|
||||
|
||||
typedef enum ft857_native_cmd_e ft857_native_cmd_t;
|
||||
|
||||
|
||||
static int ft857_init(RIG *rig);
|
||||
static int ft857_open(RIG *rig);
|
||||
static int ft857_cleanup(RIG *rig);
|
||||
static int ft857_close(RIG *rig);
|
||||
int ft857_set_vfo(RIG *rig, vfo_t vfo);
|
||||
int ft857_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
static int ft857_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft857_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
static int ft857_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft857_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
static int ft857_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq, rmode_t mode, pbwidth_t width);
|
||||
static int ft857_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width);
|
||||
static int ft857_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft857_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
// static int ft857_set_vfo(RIG *rig, vfo_t vfo);
|
||||
// static int ft857_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
static int ft857_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft857_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
// static int ft857_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
|
||||
static int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
static int ft857_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
// static int ft857_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
// static int ft857_set_parm(RIG *rig, setting_t parm, value_t val);
|
||||
// static int ft857_get_parm(RIG *rig, setting_t parm, value_t *val);
|
||||
static int ft857_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft857_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft857_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft857_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft857_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
|
||||
static int ft857_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs);
|
||||
static int ft857_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft857_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
|
||||
static int ft857_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
// static int ft857_set_powerstat(RIG *rig, powerstat_t status);
|
||||
|
||||
#endif /* _FT857_H */
|
||||
|
|
|
@ -70,6 +70,250 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Native FT890 functions. More to come :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft890_native_cmd_e {
|
||||
FT890_NATIVE_SPLIT_OFF = 0,
|
||||
FT890_NATIVE_SPLIT_ON,
|
||||
FT890_NATIVE_RECALL_MEM,
|
||||
FT890_NATIVE_VFO_TO_MEM,
|
||||
FT890_NATIVE_VFO_A,
|
||||
FT890_NATIVE_VFO_B,
|
||||
FT890_NATIVE_MEM_TO_VFO,
|
||||
FT890_NATIVE_CLARIFIER_OPS,
|
||||
FT890_NATIVE_FREQ_SET,
|
||||
FT890_NATIVE_MODE_SET,
|
||||
FT890_NATIVE_PACING,
|
||||
FT890_NATIVE_PTT_OFF,
|
||||
FT890_NATIVE_PTT_ON,
|
||||
FT890_NATIVE_MEM_CHNL,
|
||||
FT890_NATIVE_OP_DATA,
|
||||
FT890_NATIVE_VFO_DATA,
|
||||
FT890_NATIVE_MEM_CHNL_DATA,
|
||||
FT890_NATIVE_TUNER_OFF,
|
||||
FT890_NATIVE_TUNER_ON,
|
||||
FT890_NATIVE_TUNER_START,
|
||||
FT890_NATIVE_READ_METER,
|
||||
FT890_NATIVE_READ_FLAGS,
|
||||
FT890_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
};
|
||||
|
||||
typedef enum ft890_native_cmd_e ft890_native_cmd_t;
|
||||
|
||||
|
||||
/*
|
||||
* Internal MODES - when setting modes via FT890_NATIVE_MODE_SET
|
||||
*
|
||||
*/
|
||||
|
||||
#define MODE_SET_LSB 0x00
|
||||
#define MODE_SET_USB 0x01
|
||||
#define MODE_SET_CW_W 0x02
|
||||
#define MODE_SET_CW_N 0x03
|
||||
#define MODE_SET_AM_W 0x04
|
||||
#define MODE_SET_AM_N 0x05
|
||||
#define MODE_SET_FM 0x06
|
||||
|
||||
|
||||
/*
|
||||
* Internal Clarifier parms - when setting clarifier via
|
||||
* FT890_NATIVE_CLARIFIER_OPS
|
||||
*
|
||||
* The manual seems to be incorrect with regard to P1 and P2 values
|
||||
* P1 = 0x00 clarifier off
|
||||
* P1 = 0x01 clarifier on
|
||||
* P1 = 0xff clarifier set
|
||||
* P2 = 0x00 clarifier up
|
||||
* P2 = 0xff clarifier down
|
||||
*/
|
||||
|
||||
/* P1 values */
|
||||
#define CLAR_RX_OFF 0x00
|
||||
#define CLAR_RX_ON 0x01
|
||||
#define CLAR_SET_FREQ 0xff
|
||||
|
||||
/* P2 values */
|
||||
#define CLAR_OFFSET_PLUS 0x00
|
||||
#define CLAR_OFFSET_MINUS 0xff
|
||||
|
||||
|
||||
/*
|
||||
* Some useful offsets in the status update flags (offset)
|
||||
* SUMO--Status Update Memory Offset?
|
||||
*
|
||||
* SF_ bit tests are now grouped with flag bytes for ease of reference
|
||||
*
|
||||
* FIXME: complete flags and bits
|
||||
*
|
||||
* CAT command 0xFA requests the FT-890 to return its status flags.
|
||||
* These flags consist of 3 bytes (plus 2 filler bytes) and are documented
|
||||
* in the FT-890 manual on page 33.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT890_SUMO_DISPLAYED_STATUS_0 0x00 /* Status flag byte 0 */
|
||||
#define SF_GC (1<<1) /* General Coverage Reception selected */
|
||||
#define SF_SPLIT (1<<2) /* Split active */
|
||||
#define SF_MCK (1<<3) /* memory Checking in progress */
|
||||
#define SF_MT (1<<4) /* Memory Tuning in progress */
|
||||
#define SF_MR (1<<5) /* Memory Mode selected */
|
||||
#define SF_A (0<<6) /* bit 6 clear, VFO A */
|
||||
#define SF_B (1<<6) /* bit 6 set, VFO B */
|
||||
#define SF_VFO (1<<7) /* bit 7 set, VFO A or B active */
|
||||
|
||||
#define SF_VFOA (SF_VFO|SF_A) /* bit 7 set, bit 6 clear, VFO A */
|
||||
#define SF_VFOB (SF_VFO|SF_B) /* bit 7 set, bit 6 set, VFO B */
|
||||
#define SF_VFO_MASK (SF_VFOB) /* bits 6 and 7 */
|
||||
#define SF_MEM_MASK (SF_MCK|SF_MT|SF_MR) /* bits 3, 4 and 5 */
|
||||
|
||||
|
||||
#define FT890_SUMO_DISPLAYED_STATUS_1 0x01 /* Status flag byte 1 */
|
||||
|
||||
|
||||
#define FT890_SUMO_DISPLAYED_STATUS_2 0x02 /* Status flag byte 1 */
|
||||
#define SF_PTT_OFF (0<<7) /* bit 7 set, PTT open */
|
||||
#define SF_PTT_ON (1<<7) /* bit 7 set, PTT closed */
|
||||
#define SF_PTT_MASK (SF_PTT_ON)
|
||||
|
||||
|
||||
/*
|
||||
* Offsets for VFO record retrieved via 0x10 P1 = 02, 03, 04
|
||||
*
|
||||
* The FT-890 returns frequency and mode data via three separate commands.
|
||||
* CAT command 0x10, P1 = 02 returns the current main and sub displays' data (19 bytes)
|
||||
* CAT command 0x10, P1 = 03 returns VFO A & B data (18 bytes)
|
||||
* CAT command 0x10, P1 = 04, P4 = 0x01-0x20 returns memory channel data (19 bytes)
|
||||
* In all cases the format is (from the FT-890 manual page 32):
|
||||
*
|
||||
* Offset Value
|
||||
* 0x00 Band Selection (BPF selection: 0x00 - 0x30 (bit 7 =1 on a blanked memory))
|
||||
* 0x01 Operating Frequency (Hex value of display--Not BCD!)
|
||||
* 0x04 Clarifier Offset (signed value between -999d (0xfc19) and +999d (0x03e7))
|
||||
* 0x06 Mode Data
|
||||
* 0x07 CTCSS tone code (0x00 - 0x20)
|
||||
* 0x08 Flags (Operating flags -- manual page 33)
|
||||
*
|
||||
* Memory Channel data has the same layout and offsets as the operating
|
||||
* data record.
|
||||
* When either of the 19 byte records is read (P1 = 02, 04), the offset is
|
||||
* +1 as the leading byte is the memory channel number.
|
||||
* The VFO data command (P1 = 03) returns 18 bytes and the VFO B data has
|
||||
* the same layout, but the offset starts at 0x09 and continues through 0x12
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT890_SUMO_MEM_CHANNEL 0x00 /* Memory Channel from 0xfa, P1 = 1 */
|
||||
#define FT890_SUMO_DISPLAYED_FREQ 0x02 /* Current main display, can be VFO A, Memory data, Memory tune (3 bytes) */
|
||||
#define FT890_SUMO_DISPLAYED_CLAR 0x05 /* RIT offset -- current display */
|
||||
#define FT890_SUMO_DISPLAYED_MODE 0x07 /* Current main display mode */
|
||||
#define FT890_SUMO_DISPLAYED_FLAG 0x09
|
||||
|
||||
#define FT890_SUMO_VFO_A_FREQ 0x01 /* VFO A frequency, not necessarily currently displayed! */
|
||||
#define FT890_SUMO_VFO_A_CLAR 0x04 /* RIT offset -- VFO A */
|
||||
#define FT890_SUMO_VFO_A_MODE 0x06 /* VFO A mode, not necessarily currently displayed! */
|
||||
#define FT890_SUMO_VFO_A_FLAG 0x08
|
||||
|
||||
#define FT890_SUMO_VFO_B_FREQ 0x0a /* Current sub display && VFO B */
|
||||
#define FT890_SUMO_VFO_B_CLAR 0x0d /* RIT offset -- VFO B */
|
||||
#define FT890_SUMO_VFO_B_MODE 0x0f /* Current sub display && VFO B */
|
||||
#define FT890_SUMO_VFO_B_FLAG 0x11
|
||||
|
||||
|
||||
/*
|
||||
* Read meter offset
|
||||
*
|
||||
* FT-890 returns the level of the S meter when in RX and ALC or PO or SWR
|
||||
* when in TX. The level is replicated in the first four bytes sent by the
|
||||
* rig with the final byte being a constant 0xf7
|
||||
*
|
||||
* The manual states that the returned value will range between 0x00 and 0xff
|
||||
* while "in practice the highest value returned will be around 0xf0". The
|
||||
* manual is silent when this value is returned as my rig returns 0x00 for
|
||||
* S0, 0x44 for S9 and 0x9D for S9 +60.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT890_SUMO_METER 0x00 /* Meter level */
|
||||
|
||||
|
||||
/*
|
||||
* Narrow filter selection flag from offset 0x08 or 0x11
|
||||
* in VFO/Memory Record
|
||||
*
|
||||
* used when READING modes from FT-890
|
||||
*
|
||||
*/
|
||||
|
||||
#define FLAG_AM_N (1<<6)
|
||||
#define FLAG_CW_N (1<<7)
|
||||
#define FLAG_MASK (FLAG_AM_N|FLAG_CW_N)
|
||||
|
||||
|
||||
/*
|
||||
* Mode Bitmap from offset 0x06 or 0x0f in VFO/Memory Record.
|
||||
*
|
||||
* used when READING modes from FT-890
|
||||
*
|
||||
*/
|
||||
|
||||
#define MODE_LSB 0x00
|
||||
#define MODE_USB 0x01
|
||||
#define MODE_CW 0x02
|
||||
#define MODE_AM 0x03
|
||||
#define MODE_FM 0x04
|
||||
|
||||
/* All relevant bits */
|
||||
#define MODE_MASK (MODE_LSB|MODE_USB|MODE_CW|MODE_AM|MODE_FM)
|
||||
|
||||
|
||||
/*
|
||||
* Command string parameter offsets
|
||||
*/
|
||||
|
||||
#define P1 3
|
||||
#define P2 2
|
||||
#define P3 1
|
||||
#define P4 0
|
||||
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*
|
||||
*/
|
||||
|
||||
static int ft890_init(RIG *rig);
|
||||
static int ft890_cleanup(RIG *rig);
|
||||
static int ft890_open(RIG *rig);
|
||||
static int ft890_close(RIG *rig);
|
||||
|
||||
static int ft890_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft890_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft890_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft890_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft890_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int ft890_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
|
||||
static int ft890_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft890_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
|
||||
static int ft890_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft890_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft890_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft890_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
|
||||
static int ft890_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
|
||||
static int ft890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
|
||||
static int ft890_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
|
||||
|
||||
/* Private helper function prototypes */
|
||||
|
||||
|
|
|
@ -106,248 +106,4 @@
|
|||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Native FT890 functions. More to come :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft890_native_cmd_e {
|
||||
FT890_NATIVE_SPLIT_OFF = 0,
|
||||
FT890_NATIVE_SPLIT_ON,
|
||||
FT890_NATIVE_RECALL_MEM,
|
||||
FT890_NATIVE_VFO_TO_MEM,
|
||||
FT890_NATIVE_VFO_A,
|
||||
FT890_NATIVE_VFO_B,
|
||||
FT890_NATIVE_MEM_TO_VFO,
|
||||
FT890_NATIVE_CLARIFIER_OPS,
|
||||
FT890_NATIVE_FREQ_SET,
|
||||
FT890_NATIVE_MODE_SET,
|
||||
FT890_NATIVE_PACING,
|
||||
FT890_NATIVE_PTT_OFF,
|
||||
FT890_NATIVE_PTT_ON,
|
||||
FT890_NATIVE_MEM_CHNL,
|
||||
FT890_NATIVE_OP_DATA,
|
||||
FT890_NATIVE_VFO_DATA,
|
||||
FT890_NATIVE_MEM_CHNL_DATA,
|
||||
FT890_NATIVE_TUNER_OFF,
|
||||
FT890_NATIVE_TUNER_ON,
|
||||
FT890_NATIVE_TUNER_START,
|
||||
FT890_NATIVE_READ_METER,
|
||||
FT890_NATIVE_READ_FLAGS,
|
||||
FT890_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
};
|
||||
|
||||
typedef enum ft890_native_cmd_e ft890_native_cmd_t;
|
||||
|
||||
|
||||
/*
|
||||
* Internal MODES - when setting modes via FT890_NATIVE_MODE_SET
|
||||
*
|
||||
*/
|
||||
|
||||
#define MODE_SET_LSB 0x00
|
||||
#define MODE_SET_USB 0x01
|
||||
#define MODE_SET_CW_W 0x02
|
||||
#define MODE_SET_CW_N 0x03
|
||||
#define MODE_SET_AM_W 0x04
|
||||
#define MODE_SET_AM_N 0x05
|
||||
#define MODE_SET_FM 0x06
|
||||
|
||||
|
||||
/*
|
||||
* Internal Clarifier parms - when setting clarifier via
|
||||
* FT890_NATIVE_CLARIFIER_OPS
|
||||
*
|
||||
* The manual seems to be incorrect with regard to P1 and P2 values
|
||||
* P1 = 0x00 clarifier off
|
||||
* P1 = 0x01 clarifier on
|
||||
* P1 = 0xff clarifier set
|
||||
* P2 = 0x00 clarifier up
|
||||
* P2 = 0xff clarifier down
|
||||
*/
|
||||
|
||||
/* P1 values */
|
||||
#define CLAR_RX_OFF 0x00
|
||||
#define CLAR_RX_ON 0x01
|
||||
#define CLAR_SET_FREQ 0xff
|
||||
|
||||
/* P2 values */
|
||||
#define CLAR_OFFSET_PLUS 0x00
|
||||
#define CLAR_OFFSET_MINUS 0xff
|
||||
|
||||
|
||||
/*
|
||||
* Some useful offsets in the status update flags (offset)
|
||||
* SUMO--Status Update Memory Offset?
|
||||
*
|
||||
* SF_ bit tests are now grouped with flag bytes for ease of reference
|
||||
*
|
||||
* FIXME: complete flags and bits
|
||||
*
|
||||
* CAT command 0xFA requests the FT-890 to return its status flags.
|
||||
* These flags consist of 3 bytes (plus 2 filler bytes) and are documented
|
||||
* in the FT-890 manual on page 33.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT890_SUMO_DISPLAYED_STATUS_0 0x00 /* Status flag byte 0 */
|
||||
#define SF_GC (1<<1) /* General Coverage Reception selected */
|
||||
#define SF_SPLIT (1<<2) /* Split active */
|
||||
#define SF_MCK (1<<3) /* memory Checking in progress */
|
||||
#define SF_MT (1<<4) /* Memory Tuning in progress */
|
||||
#define SF_MR (1<<5) /* Memory Mode selected */
|
||||
#define SF_A (0<<6) /* bit 6 clear, VFO A */
|
||||
#define SF_B (1<<6) /* bit 6 set, VFO B */
|
||||
#define SF_VFO (1<<7) /* bit 7 set, VFO A or B active */
|
||||
|
||||
#define SF_VFOA (SF_VFO|SF_A) /* bit 7 set, bit 6 clear, VFO A */
|
||||
#define SF_VFOB (SF_VFO|SF_B) /* bit 7 set, bit 6 set, VFO B */
|
||||
#define SF_VFO_MASK (SF_VFOB) /* bits 6 and 7 */
|
||||
#define SF_MEM_MASK (SF_MCK|SF_MT|SF_MR) /* bits 3, 4 and 5 */
|
||||
|
||||
|
||||
#define FT890_SUMO_DISPLAYED_STATUS_1 0x01 /* Status flag byte 1 */
|
||||
|
||||
|
||||
#define FT890_SUMO_DISPLAYED_STATUS_2 0x02 /* Status flag byte 1 */
|
||||
#define SF_PTT_OFF (0<<7) /* bit 7 set, PTT open */
|
||||
#define SF_PTT_ON (1<<7) /* bit 7 set, PTT closed */
|
||||
#define SF_PTT_MASK (SF_PTT_ON)
|
||||
|
||||
|
||||
/*
|
||||
* Offsets for VFO record retrieved via 0x10 P1 = 02, 03, 04
|
||||
*
|
||||
* The FT-890 returns frequency and mode data via three separate commands.
|
||||
* CAT command 0x10, P1 = 02 returns the current main and sub displays' data (19 bytes)
|
||||
* CAT command 0x10, P1 = 03 returns VFO A & B data (18 bytes)
|
||||
* CAT command 0x10, P1 = 04, P4 = 0x01-0x20 returns memory channel data (19 bytes)
|
||||
* In all cases the format is (from the FT-890 manual page 32):
|
||||
*
|
||||
* Offset Value
|
||||
* 0x00 Band Selection (BPF selection: 0x00 - 0x30 (bit 7 =1 on a blanked memory))
|
||||
* 0x01 Operating Frequency (Hex value of display--Not BCD!)
|
||||
* 0x04 Clarifier Offset (signed value between -999d (0xfc19) and +999d (0x03e7))
|
||||
* 0x06 Mode Data
|
||||
* 0x07 CTCSS tone code (0x00 - 0x20)
|
||||
* 0x08 Flags (Operating flags -- manual page 33)
|
||||
*
|
||||
* Memory Channel data has the same layout and offsets as the operating
|
||||
* data record.
|
||||
* When either of the 19 byte records is read (P1 = 02, 04), the offset is
|
||||
* +1 as the leading byte is the memory channel number.
|
||||
* The VFO data command (P1 = 03) returns 18 bytes and the VFO B data has
|
||||
* the same layout, but the offset starts at 0x09 and continues through 0x12
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT890_SUMO_MEM_CHANNEL 0x00 /* Memory Channel from 0xfa, P1 = 1 */
|
||||
#define FT890_SUMO_DISPLAYED_FREQ 0x02 /* Current main display, can be VFO A, Memory data, Memory tune (3 bytes) */
|
||||
#define FT890_SUMO_DISPLAYED_CLAR 0x05 /* RIT offset -- current display */
|
||||
#define FT890_SUMO_DISPLAYED_MODE 0x07 /* Current main display mode */
|
||||
#define FT890_SUMO_DISPLAYED_FLAG 0x09
|
||||
|
||||
#define FT890_SUMO_VFO_A_FREQ 0x01 /* VFO A frequency, not necessarily currently displayed! */
|
||||
#define FT890_SUMO_VFO_A_CLAR 0x04 /* RIT offset -- VFO A */
|
||||
#define FT890_SUMO_VFO_A_MODE 0x06 /* VFO A mode, not necessarily currently displayed! */
|
||||
#define FT890_SUMO_VFO_A_FLAG 0x08
|
||||
|
||||
#define FT890_SUMO_VFO_B_FREQ 0x0a /* Current sub display && VFO B */
|
||||
#define FT890_SUMO_VFO_B_CLAR 0x0d /* RIT offset -- VFO B */
|
||||
#define FT890_SUMO_VFO_B_MODE 0x0f /* Current sub display && VFO B */
|
||||
#define FT890_SUMO_VFO_B_FLAG 0x11
|
||||
|
||||
|
||||
/*
|
||||
* Read meter offset
|
||||
*
|
||||
* FT-890 returns the level of the S meter when in RX and ALC or PO or SWR
|
||||
* when in TX. The level is replicated in the first four bytes sent by the
|
||||
* rig with the final byte being a constant 0xf7
|
||||
*
|
||||
* The manual states that the returned value will range between 0x00 and 0xff
|
||||
* while "in practice the highest value returned will be around 0xf0". The
|
||||
* manual is silent when this value is returned as my rig returns 0x00 for
|
||||
* S0, 0x44 for S9 and 0x9D for S9 +60.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT890_SUMO_METER 0x00 /* Meter level */
|
||||
|
||||
|
||||
/*
|
||||
* Narrow filter selection flag from offset 0x08 or 0x11
|
||||
* in VFO/Memory Record
|
||||
*
|
||||
* used when READING modes from FT-890
|
||||
*
|
||||
*/
|
||||
|
||||
#define FLAG_AM_N (1<<6)
|
||||
#define FLAG_CW_N (1<<7)
|
||||
#define FLAG_MASK (FLAG_AM_N|FLAG_CW_N)
|
||||
|
||||
|
||||
/*
|
||||
* Mode Bitmap from offset 0x06 or 0x0f in VFO/Memory Record.
|
||||
*
|
||||
* used when READING modes from FT-890
|
||||
*
|
||||
*/
|
||||
|
||||
#define MODE_LSB 0x00
|
||||
#define MODE_USB 0x01
|
||||
#define MODE_CW 0x02
|
||||
#define MODE_AM 0x03
|
||||
#define MODE_FM 0x04
|
||||
|
||||
/* All relevant bits */
|
||||
#define MODE_MASK (MODE_LSB|MODE_USB|MODE_CW|MODE_AM|MODE_FM)
|
||||
|
||||
|
||||
/*
|
||||
* Command string parameter offsets
|
||||
*/
|
||||
|
||||
#define P1 3
|
||||
#define P2 2
|
||||
#define P3 1
|
||||
#define P4 0
|
||||
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*
|
||||
*/
|
||||
|
||||
static int ft890_init(RIG *rig);
|
||||
static int ft890_cleanup(RIG *rig);
|
||||
static int ft890_open(RIG *rig);
|
||||
static int ft890_close(RIG *rig);
|
||||
|
||||
static int ft890_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft890_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft890_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft890_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft890_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int ft890_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
|
||||
static int ft890_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft890_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
|
||||
static int ft890_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft890_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft890_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft890_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
|
||||
static int ft890_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
|
||||
static int ft890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
|
||||
static int ft890_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
|
||||
#endif /* _FT890_H */
|
||||
|
|
|
@ -42,6 +42,14 @@
|
|||
#include "ft891.h"
|
||||
#include "idx_builtin.h"
|
||||
|
||||
/* Prototypes */
|
||||
static int ft891_init(RIG *rig);
|
||||
static int ft891_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
static int ft891_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width);
|
||||
static int ft891_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width);
|
||||
static int ft891_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft891_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
|
||||
/*
|
||||
* FT-891 rig capabilities
|
||||
*/
|
||||
|
@ -253,7 +261,7 @@ const struct rig_caps ft891_caps =
|
|||
* the correct TX VFO is selected by the rig in split mode.
|
||||
* An error is returned if vfo and tx_vfo are the same.
|
||||
*/
|
||||
int ft891_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
||||
static int ft891_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
||||
{
|
||||
struct newcat_priv_data *priv;
|
||||
struct rig_state *state;
|
||||
|
@ -322,7 +330,7 @@ int ft891_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
*
|
||||
* Comments: The passed value for the vfo is ignored since can only split one way
|
||||
*/
|
||||
int ft891_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
||||
static int ft891_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
||||
{
|
||||
struct newcat_priv_data *priv;
|
||||
int err;
|
||||
|
@ -380,7 +388,7 @@ int ft891_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft891_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||
static int ft891_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||
pbwidth_t *tx_width)
|
||||
{
|
||||
struct newcat_priv_data *priv;
|
||||
|
@ -427,7 +435,7 @@ int ft891_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
|||
*
|
||||
*/
|
||||
|
||||
int ft891_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
static int ft891_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
pbwidth_t tx_width)
|
||||
{
|
||||
struct newcat_priv_data *priv;
|
||||
|
@ -493,7 +501,7 @@ int ft891_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
|||
}
|
||||
|
||||
|
||||
int ft891_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
static int ft891_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
struct newcat_priv_data *priv;
|
||||
int err;
|
||||
|
@ -515,7 +523,7 @@ int ft891_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int ft891_init(RIG *rig)
|
||||
static int ft891_init(RIG *rig)
|
||||
{
|
||||
int ret;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called, version %s\n", __func__,
|
||||
|
|
|
@ -129,14 +129,6 @@
|
|||
|
||||
#define FT891_POST_WRITE_DELAY 50
|
||||
|
||||
/* Prototypes */
|
||||
int ft891_init(RIG *rig);
|
||||
static int ft891_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
static int ft891_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width);
|
||||
static int ft891_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width);
|
||||
static int ft891_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft891_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
|
||||
/* Reuse newcat_get_cmd */
|
||||
extern int newcat_get_cmd(RIG *rig);
|
||||
|
||||
|
|
|
@ -75,10 +75,55 @@
|
|||
#include "serial.h"
|
||||
#include "yaesu.h"
|
||||
#include "ft897.h"
|
||||
#include "ft857.h" //Needed for ft857_set_vfo, ft857_get_vfo
|
||||
#include "misc.h"
|
||||
#include "tones.h"
|
||||
#include "bandplan.h"
|
||||
|
||||
enum ft897_native_cmd_e {
|
||||
FT897_NATIVE_CAT_LOCK_ON = 0,
|
||||
FT897_NATIVE_CAT_LOCK_OFF,
|
||||
FT897_NATIVE_CAT_PTT_ON,
|
||||
FT897_NATIVE_CAT_PTT_OFF,
|
||||
FT897_NATIVE_CAT_SET_FREQ,
|
||||
FT897_NATIVE_CAT_SET_MODE_LSB,
|
||||
FT897_NATIVE_CAT_SET_MODE_USB,
|
||||
FT897_NATIVE_CAT_SET_MODE_CW,
|
||||
FT897_NATIVE_CAT_SET_MODE_CWR,
|
||||
FT897_NATIVE_CAT_SET_MODE_AM,
|
||||
FT897_NATIVE_CAT_SET_MODE_FM,
|
||||
FT897_NATIVE_CAT_SET_MODE_FM_N,
|
||||
FT897_NATIVE_CAT_SET_MODE_DIG,
|
||||
FT897_NATIVE_CAT_SET_MODE_PKT,
|
||||
FT897_NATIVE_CAT_CLAR_ON,
|
||||
FT897_NATIVE_CAT_CLAR_OFF,
|
||||
FT897_NATIVE_CAT_SET_CLAR_FREQ,
|
||||
FT897_NATIVE_CAT_SET_VFOAB,
|
||||
FT897_NATIVE_CAT_SPLIT_ON,
|
||||
FT897_NATIVE_CAT_SPLIT_OFF,
|
||||
FT897_NATIVE_CAT_SET_RPT_SHIFT_MINUS,
|
||||
FT897_NATIVE_CAT_SET_RPT_SHIFT_PLUS,
|
||||
FT897_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX,
|
||||
FT897_NATIVE_CAT_SET_RPT_OFFSET,
|
||||
FT897_NATIVE_CAT_SET_DCS_ON,
|
||||
FT897_NATIVE_CAT_SET_DCS_DEC_ON,
|
||||
FT897_NATIVE_CAT_SET_DCS_ENC_ON,
|
||||
FT897_NATIVE_CAT_SET_CTCSS_ON,
|
||||
FT897_NATIVE_CAT_SET_CTCSS_DEC_ON,
|
||||
FT897_NATIVE_CAT_SET_CTCSS_ENC_ON,
|
||||
FT897_NATIVE_CAT_SET_CTCSS_DCS_OFF,
|
||||
FT897_NATIVE_CAT_SET_CTCSS_FREQ,
|
||||
FT897_NATIVE_CAT_SET_DCS_CODE,
|
||||
FT897_NATIVE_CAT_GET_RX_STATUS,
|
||||
FT897_NATIVE_CAT_GET_TX_STATUS,
|
||||
FT897_NATIVE_CAT_GET_FREQ_MODE_STATUS,
|
||||
FT897_NATIVE_CAT_PWR_WAKE,
|
||||
FT897_NATIVE_CAT_PWR_ON,
|
||||
FT897_NATIVE_CAT_PWR_OFF,
|
||||
FT897_NATIVE_CAT_EEPROM_READ,
|
||||
FT897_NATIVE_SIZE /* end marker */
|
||||
};
|
||||
|
||||
struct ft897_priv_data
|
||||
{
|
||||
yaesu_cmd_set_t pcs[FT897_NATIVE_SIZE]; /* TODO: why? */
|
||||
|
@ -106,8 +151,6 @@ static int ft897_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
|||
static int ft897_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
static int ft897_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft897_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
extern int ft857_set_vfo(RIG *rig, vfo_t vfo);
|
||||
extern int ft857_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
static int ft897_set_split_vfo(RIG *rig, vfo_t vfo, split_t split,
|
||||
vfo_t tx_vfo);
|
||||
static int ft897_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split,
|
||||
|
|
|
@ -67,52 +67,7 @@
|
|||
*/
|
||||
#define FT897_CACHE_TIMEOUT 50
|
||||
|
||||
|
||||
enum ft897_native_cmd_e {
|
||||
FT897_NATIVE_CAT_LOCK_ON = 0,
|
||||
FT897_NATIVE_CAT_LOCK_OFF,
|
||||
FT897_NATIVE_CAT_PTT_ON,
|
||||
FT897_NATIVE_CAT_PTT_OFF,
|
||||
FT897_NATIVE_CAT_SET_FREQ,
|
||||
FT897_NATIVE_CAT_SET_MODE_LSB,
|
||||
FT897_NATIVE_CAT_SET_MODE_USB,
|
||||
FT897_NATIVE_CAT_SET_MODE_CW,
|
||||
FT897_NATIVE_CAT_SET_MODE_CWR,
|
||||
FT897_NATIVE_CAT_SET_MODE_AM,
|
||||
FT897_NATIVE_CAT_SET_MODE_FM,
|
||||
FT897_NATIVE_CAT_SET_MODE_FM_N,
|
||||
FT897_NATIVE_CAT_SET_MODE_DIG,
|
||||
FT897_NATIVE_CAT_SET_MODE_PKT,
|
||||
FT897_NATIVE_CAT_CLAR_ON,
|
||||
FT897_NATIVE_CAT_CLAR_OFF,
|
||||
FT897_NATIVE_CAT_SET_CLAR_FREQ,
|
||||
FT897_NATIVE_CAT_SET_VFOAB,
|
||||
FT897_NATIVE_CAT_SPLIT_ON,
|
||||
FT897_NATIVE_CAT_SPLIT_OFF,
|
||||
FT897_NATIVE_CAT_SET_RPT_SHIFT_MINUS,
|
||||
FT897_NATIVE_CAT_SET_RPT_SHIFT_PLUS,
|
||||
FT897_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX,
|
||||
FT897_NATIVE_CAT_SET_RPT_OFFSET,
|
||||
FT897_NATIVE_CAT_SET_DCS_ON,
|
||||
FT897_NATIVE_CAT_SET_DCS_DEC_ON,
|
||||
FT897_NATIVE_CAT_SET_DCS_ENC_ON,
|
||||
FT897_NATIVE_CAT_SET_CTCSS_ON,
|
||||
FT897_NATIVE_CAT_SET_CTCSS_DEC_ON,
|
||||
FT897_NATIVE_CAT_SET_CTCSS_ENC_ON,
|
||||
FT897_NATIVE_CAT_SET_CTCSS_DCS_OFF,
|
||||
FT897_NATIVE_CAT_SET_CTCSS_FREQ,
|
||||
FT897_NATIVE_CAT_SET_DCS_CODE,
|
||||
FT897_NATIVE_CAT_GET_RX_STATUS,
|
||||
FT897_NATIVE_CAT_GET_TX_STATUS,
|
||||
FT897_NATIVE_CAT_GET_FREQ_MODE_STATUS,
|
||||
FT897_NATIVE_CAT_PWR_WAKE,
|
||||
FT897_NATIVE_CAT_PWR_ON,
|
||||
FT897_NATIVE_CAT_PWR_OFF,
|
||||
FT897_NATIVE_CAT_EEPROM_READ,
|
||||
FT897_NATIVE_SIZE /* end marker */
|
||||
};
|
||||
|
||||
|
||||
typedef enum ft897_native_cmd_e ft897_native_cmd_t;
|
||||
extern int ft857_set_vfo(RIG *rig, vfo_t vfo);
|
||||
extern int ft857_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
|
||||
#endif /* _FT897_H */
|
||||
|
|
|
@ -71,6 +71,270 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Native FT900 functions. More to come :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft900_native_cmd_e {
|
||||
FT900_NATIVE_SPLIT_OFF = 0,
|
||||
FT900_NATIVE_SPLIT_ON,
|
||||
FT900_NATIVE_RECALL_MEM,
|
||||
FT900_NATIVE_VFO_TO_MEM,
|
||||
FT900_NATIVE_VFO_A,
|
||||
FT900_NATIVE_VFO_B,
|
||||
FT900_NATIVE_MEM_TO_VFO,
|
||||
FT900_NATIVE_CLARIFIER_OPS,
|
||||
FT900_NATIVE_FREQ_SET,
|
||||
FT900_NATIVE_MODE_SET,
|
||||
FT900_NATIVE_PACING,
|
||||
FT900_NATIVE_PTT_OFF,
|
||||
FT900_NATIVE_PTT_ON,
|
||||
FT900_NATIVE_MEM_CHNL,
|
||||
FT900_NATIVE_OP_DATA,
|
||||
FT900_NATIVE_VFO_DATA,
|
||||
FT900_NATIVE_MEM_CHNL_DATA,
|
||||
FT900_NATIVE_TUNER_OFF,
|
||||
FT900_NATIVE_TUNER_ON,
|
||||
FT900_NATIVE_TUNER_START,
|
||||
FT900_NATIVE_READ_METER,
|
||||
FT900_NATIVE_READ_FLAGS,
|
||||
FT900_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
};
|
||||
|
||||
typedef enum ft900_native_cmd_e ft900_native_cmd_t;
|
||||
|
||||
|
||||
/*
|
||||
* Internal MODES - when setting modes via FT900_NATIVE_MODE_SET
|
||||
*
|
||||
*/
|
||||
|
||||
#define MODE_SET_LSB 0x00
|
||||
#define MODE_SET_USB 0x01
|
||||
#define MODE_SET_CW_W 0x02
|
||||
#define MODE_SET_CW_N 0x03
|
||||
#define MODE_SET_AM_W 0x04
|
||||
#define MODE_SET_AM_N 0x05
|
||||
#define MODE_SET_FM 0x06
|
||||
|
||||
|
||||
/*
|
||||
* Internal Clarifier parms - when setting clarifier via
|
||||
* FT900_NATIVE_CLARIFIER_OPS
|
||||
*
|
||||
* The manual seems to be incorrect with regard to P1 and P2 values
|
||||
* P1 = 0x00 clarifier off
|
||||
* P1 = 0x01 clarifier on
|
||||
* P1 = 0xff clarifier set
|
||||
* P2 = 0x00 clarifier up
|
||||
* P2 = 0xff clarifier down
|
||||
*/
|
||||
|
||||
/* P1 values */
|
||||
#define CLAR_RX_OFF 0x00
|
||||
#define CLAR_RX_ON 0x01
|
||||
#define CLAR_SET_FREQ 0xff
|
||||
|
||||
/* P2 values */
|
||||
#define CLAR_OFFSET_PLUS 0x00
|
||||
#define CLAR_OFFSET_MINUS 0xff
|
||||
|
||||
|
||||
/*
|
||||
* Some useful offsets in the status update flags (offset)
|
||||
* SUMO--Status Update Memory Offset?
|
||||
*
|
||||
* SF_ bit tests are now grouped with flag bytes for ease of reference
|
||||
*
|
||||
* FIXME: complete flags and bits
|
||||
*
|
||||
* CAT command 0xFA requests the FT-900 to return its status flags.
|
||||
* These flags consist of 3 bytes (plus 2 filler bytes) and are documented
|
||||
* in the FT-900 manual on page 33.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT900_SUMO_DISPLAYED_STATUS_0 0x00 /* Status flag byte 0 */
|
||||
#define SF_GC (1<<1) /* General Coverage Reception selected */
|
||||
#define SF_SPLIT (1<<2) /* Split active */
|
||||
#define SF_MCK (1<<3) /* memory Checking in progress */
|
||||
#define SF_MT (1<<4) /* Memory Tuning in progress */
|
||||
#define SF_MR (1<<5) /* Memory Mode selected */
|
||||
#define SF_A (0<<6) /* bit 6 clear, VFO A */
|
||||
#define SF_B (1<<6) /* bit 6 set, VFO B */
|
||||
#define SF_VFO (1<<7) /* bit 7 set, VFO A or B active */
|
||||
|
||||
#define SF_VFOA (SF_VFO|SF_A) /* bit 7 set, bit 6 clear, VFO A */
|
||||
#define SF_VFOB (SF_VFO|SF_B) /* bit 7 set, bit 6 set, VFO B */
|
||||
#define SF_VFO_MASK (SF_VFOB) /* bits 6 and 7 */
|
||||
#define SF_MEM_MASK (SF_MCK|SF_MT|SF_MR) /* bits 3, 4 and 5 */
|
||||
|
||||
|
||||
#define FT900_SUMO_DISPLAYED_STATUS_1 0x01 /* Status flag byte 1 */
|
||||
|
||||
|
||||
#define FT900_SUMO_DISPLAYED_STATUS_2 0x02 /* Status flag byte 1 */
|
||||
#define SF_PTT_OFF (0<<7) /* bit 7 set, PTT open */
|
||||
#define SF_PTT_ON (1<<7) /* bit 7 set, PTT closed */
|
||||
#define SF_PTT_MASK (SF_PTT_ON)
|
||||
|
||||
|
||||
/*
|
||||
* Offsets for VFO record retrieved via 0x10 P1 = 02, 03, 04
|
||||
*
|
||||
* The FT-900 returns frequency and mode data via three separate commands.
|
||||
* CAT command 0x10, P1 = 02 returns the current main and sub displays' data (19 bytes)
|
||||
* CAT command 0x10, P1 = 03 returns VFO A & B data (18 bytes)
|
||||
* CAT command 0x10, P1 = 04, P4 = 0x01-0x20 returns memory channel data (19 bytes)
|
||||
* In all cases the format is (from the FT-900 manual page 32):
|
||||
*
|
||||
* Offset Value
|
||||
* 0x00 Band Selection (BPF selection: 0x00 - 0x30 (bit 7 =1 on a blanked memory))
|
||||
* 0x01 Operating Frequency (Hex value of display--Not BCD!)
|
||||
* 0x04 Clarifier Offset (signed value between -999d (0xfc19) and +999d (0x03e7))
|
||||
* 0x06 Mode Data
|
||||
* 0x07 CTCSS tone code (0x00 - 0x20)
|
||||
* 0x08 Flags (Operating flags -- manual page 33)
|
||||
*
|
||||
* Memory Channel data has the same layout and offsets as the operating
|
||||
* data record.
|
||||
* When either of the 19 byte records is read (P1 = 02, 04), the offset is
|
||||
* +1 as the leading byte is the memory channel number.
|
||||
* The VFO data command (P1 = 03) returns 18 bytes and the VFO B data has
|
||||
* the same layout, but the offset starts at 0x09 and continues through 0x12
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT900_SUMO_MEM_CHANNEL 0x00 /* Memory Channel from 0xfa, P1 = 1 */
|
||||
#define FT900_SUMO_DISPLAYED_FREQ 0x02 /* Current main display, can be VFO A, Memory data, Memory tune (3 bytes) */
|
||||
#define FT900_SUMO_DISPLAYED_CLAR 0x05 /* RIT offset -- current display */
|
||||
#define FT900_SUMO_DISPLAYED_MODE 0x07 /* Current main display mode */
|
||||
#define FT900_SUMO_DISPLAYED_FLAG 0x09
|
||||
|
||||
#define FT900_SUMO_VFO_A_FREQ 0x01 /* VFO A frequency, not necessarily currently displayed! */
|
||||
#define FT900_SUMO_VFO_A_CLAR 0x04 /* RIT offset -- VFO A */
|
||||
#define FT900_SUMO_VFO_A_MODE 0x06 /* VFO A mode, not necessarily currently displayed! */
|
||||
#define FT900_SUMO_VFO_A_FLAG 0x08
|
||||
|
||||
#define FT900_SUMO_VFO_B_FREQ 0x0a /* Current sub display && VFO B */
|
||||
#define FT900_SUMO_VFO_B_CLAR 0x0d /* RIT offset -- VFO B */
|
||||
#define FT900_SUMO_VFO_B_MODE 0x0f /* Current sub display && VFO B */
|
||||
#define FT900_SUMO_VFO_B_FLAG 0x11
|
||||
|
||||
|
||||
/*
|
||||
* Read meter offset
|
||||
*
|
||||
* FT-900 returns the level of the S meter when in RX and ALC or PO or SWR
|
||||
* when in TX. The level is replicated in the first four bytes sent by the
|
||||
* rig with the final byte being a constant 0xf7
|
||||
*
|
||||
* The manual states that the returned value will range between 0x00 and 0xff
|
||||
* while "in practice the highest value returned will be around 0xf0". The
|
||||
* manual is silent when this value is returned as my rig returns 0x00 for
|
||||
* S0, 0x44 for S9 and 0x9D for S9 +60.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT900_SUMO_METER 0x00 /* Meter level */
|
||||
|
||||
|
||||
/*
|
||||
* Narrow filter selection flag from offset 0x08 or 0x11
|
||||
* in VFO/Memory Record
|
||||
*
|
||||
* used when READING modes from FT-900
|
||||
*
|
||||
*/
|
||||
|
||||
#define FLAG_AM_N (1<<6)
|
||||
#define FLAG_CW_N (1<<7)
|
||||
#define FLAG_MASK (FLAG_AM_N|FLAG_CW_N)
|
||||
|
||||
|
||||
/*
|
||||
* Mode Bitmap from offset 0x06 or 0x0f in VFO/Memory Record.
|
||||
*
|
||||
* used when READING modes from FT-900
|
||||
*
|
||||
*/
|
||||
|
||||
#define MODE_LSB 0x00
|
||||
#define MODE_USB 0x01
|
||||
#define MODE_CW 0x02
|
||||
#define MODE_AM 0x03
|
||||
#define MODE_FM 0x04
|
||||
|
||||
/* All relevant bits */
|
||||
#define MODE_MASK (MODE_LSB|MODE_USB|MODE_CW|MODE_AM|MODE_FM)
|
||||
|
||||
|
||||
/*
|
||||
* Command string parameter offsets
|
||||
*/
|
||||
|
||||
#define P1 3
|
||||
#define P2 2
|
||||
#define P3 1
|
||||
#define P4 0
|
||||
|
||||
/*
|
||||
* Two calibration sets for the smeter/power readings
|
||||
*/
|
||||
|
||||
#define FT900_STR_CAL_SMETER { 3, \
|
||||
{ \
|
||||
{ 0, -54 }, /* S0 */ \
|
||||
{0x44, 0 }, /* S9 */ \
|
||||
{0x9d, 60 }, /* +60dB */ \
|
||||
} }
|
||||
|
||||
#define FT900_STR_CAL_POWER { 5, \
|
||||
{ \
|
||||
{ 0, 0 }, /* 0W */ \
|
||||
{0x44, 10 }, /* 10W */ \
|
||||
{0x69, 25 }, /* 25W */ \
|
||||
{0x92, 50 }, /* 50W */ \
|
||||
{0xCE, 100 }, /* 100W */ \
|
||||
} }
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*
|
||||
*/
|
||||
|
||||
static int ft900_init(RIG *rig);
|
||||
static int ft900_cleanup(RIG *rig);
|
||||
static int ft900_open(RIG *rig);
|
||||
static int ft900_close(RIG *rig);
|
||||
|
||||
static int ft900_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft900_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft900_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft900_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft900_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int ft900_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
|
||||
static int ft900_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft900_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
|
||||
static int ft900_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft900_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft900_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft900_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
|
||||
static int ft900_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
|
||||
static int ft900_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
|
||||
static int ft900_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
|
||||
|
||||
|
||||
/* Private helper function prototypes */
|
||||
|
||||
|
|
|
@ -104,268 +104,4 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Native FT900 functions. More to come :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft900_native_cmd_e {
|
||||
FT900_NATIVE_SPLIT_OFF = 0,
|
||||
FT900_NATIVE_SPLIT_ON,
|
||||
FT900_NATIVE_RECALL_MEM,
|
||||
FT900_NATIVE_VFO_TO_MEM,
|
||||
FT900_NATIVE_VFO_A,
|
||||
FT900_NATIVE_VFO_B,
|
||||
FT900_NATIVE_MEM_TO_VFO,
|
||||
FT900_NATIVE_CLARIFIER_OPS,
|
||||
FT900_NATIVE_FREQ_SET,
|
||||
FT900_NATIVE_MODE_SET,
|
||||
FT900_NATIVE_PACING,
|
||||
FT900_NATIVE_PTT_OFF,
|
||||
FT900_NATIVE_PTT_ON,
|
||||
FT900_NATIVE_MEM_CHNL,
|
||||
FT900_NATIVE_OP_DATA,
|
||||
FT900_NATIVE_VFO_DATA,
|
||||
FT900_NATIVE_MEM_CHNL_DATA,
|
||||
FT900_NATIVE_TUNER_OFF,
|
||||
FT900_NATIVE_TUNER_ON,
|
||||
FT900_NATIVE_TUNER_START,
|
||||
FT900_NATIVE_READ_METER,
|
||||
FT900_NATIVE_READ_FLAGS,
|
||||
FT900_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
};
|
||||
|
||||
typedef enum ft900_native_cmd_e ft900_native_cmd_t;
|
||||
|
||||
|
||||
/*
|
||||
* Internal MODES - when setting modes via FT900_NATIVE_MODE_SET
|
||||
*
|
||||
*/
|
||||
|
||||
#define MODE_SET_LSB 0x00
|
||||
#define MODE_SET_USB 0x01
|
||||
#define MODE_SET_CW_W 0x02
|
||||
#define MODE_SET_CW_N 0x03
|
||||
#define MODE_SET_AM_W 0x04
|
||||
#define MODE_SET_AM_N 0x05
|
||||
#define MODE_SET_FM 0x06
|
||||
|
||||
|
||||
/*
|
||||
* Internal Clarifier parms - when setting clarifier via
|
||||
* FT900_NATIVE_CLARIFIER_OPS
|
||||
*
|
||||
* The manual seems to be incorrect with regard to P1 and P2 values
|
||||
* P1 = 0x00 clarifier off
|
||||
* P1 = 0x01 clarifier on
|
||||
* P1 = 0xff clarifier set
|
||||
* P2 = 0x00 clarifier up
|
||||
* P2 = 0xff clarifier down
|
||||
*/
|
||||
|
||||
/* P1 values */
|
||||
#define CLAR_RX_OFF 0x00
|
||||
#define CLAR_RX_ON 0x01
|
||||
#define CLAR_SET_FREQ 0xff
|
||||
|
||||
/* P2 values */
|
||||
#define CLAR_OFFSET_PLUS 0x00
|
||||
#define CLAR_OFFSET_MINUS 0xff
|
||||
|
||||
|
||||
/*
|
||||
* Some useful offsets in the status update flags (offset)
|
||||
* SUMO--Status Update Memory Offset?
|
||||
*
|
||||
* SF_ bit tests are now grouped with flag bytes for ease of reference
|
||||
*
|
||||
* FIXME: complete flags and bits
|
||||
*
|
||||
* CAT command 0xFA requests the FT-900 to return its status flags.
|
||||
* These flags consist of 3 bytes (plus 2 filler bytes) and are documented
|
||||
* in the FT-900 manual on page 33.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT900_SUMO_DISPLAYED_STATUS_0 0x00 /* Status flag byte 0 */
|
||||
#define SF_GC (1<<1) /* General Coverage Reception selected */
|
||||
#define SF_SPLIT (1<<2) /* Split active */
|
||||
#define SF_MCK (1<<3) /* memory Checking in progress */
|
||||
#define SF_MT (1<<4) /* Memory Tuning in progress */
|
||||
#define SF_MR (1<<5) /* Memory Mode selected */
|
||||
#define SF_A (0<<6) /* bit 6 clear, VFO A */
|
||||
#define SF_B (1<<6) /* bit 6 set, VFO B */
|
||||
#define SF_VFO (1<<7) /* bit 7 set, VFO A or B active */
|
||||
|
||||
#define SF_VFOA (SF_VFO|SF_A) /* bit 7 set, bit 6 clear, VFO A */
|
||||
#define SF_VFOB (SF_VFO|SF_B) /* bit 7 set, bit 6 set, VFO B */
|
||||
#define SF_VFO_MASK (SF_VFOB) /* bits 6 and 7 */
|
||||
#define SF_MEM_MASK (SF_MCK|SF_MT|SF_MR) /* bits 3, 4 and 5 */
|
||||
|
||||
|
||||
#define FT900_SUMO_DISPLAYED_STATUS_1 0x01 /* Status flag byte 1 */
|
||||
|
||||
|
||||
#define FT900_SUMO_DISPLAYED_STATUS_2 0x02 /* Status flag byte 1 */
|
||||
#define SF_PTT_OFF (0<<7) /* bit 7 set, PTT open */
|
||||
#define SF_PTT_ON (1<<7) /* bit 7 set, PTT closed */
|
||||
#define SF_PTT_MASK (SF_PTT_ON)
|
||||
|
||||
|
||||
/*
|
||||
* Offsets for VFO record retrieved via 0x10 P1 = 02, 03, 04
|
||||
*
|
||||
* The FT-900 returns frequency and mode data via three separate commands.
|
||||
* CAT command 0x10, P1 = 02 returns the current main and sub displays' data (19 bytes)
|
||||
* CAT command 0x10, P1 = 03 returns VFO A & B data (18 bytes)
|
||||
* CAT command 0x10, P1 = 04, P4 = 0x01-0x20 returns memory channel data (19 bytes)
|
||||
* In all cases the format is (from the FT-900 manual page 32):
|
||||
*
|
||||
* Offset Value
|
||||
* 0x00 Band Selection (BPF selection: 0x00 - 0x30 (bit 7 =1 on a blanked memory))
|
||||
* 0x01 Operating Frequency (Hex value of display--Not BCD!)
|
||||
* 0x04 Clarifier Offset (signed value between -999d (0xfc19) and +999d (0x03e7))
|
||||
* 0x06 Mode Data
|
||||
* 0x07 CTCSS tone code (0x00 - 0x20)
|
||||
* 0x08 Flags (Operating flags -- manual page 33)
|
||||
*
|
||||
* Memory Channel data has the same layout and offsets as the operating
|
||||
* data record.
|
||||
* When either of the 19 byte records is read (P1 = 02, 04), the offset is
|
||||
* +1 as the leading byte is the memory channel number.
|
||||
* The VFO data command (P1 = 03) returns 18 bytes and the VFO B data has
|
||||
* the same layout, but the offset starts at 0x09 and continues through 0x12
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT900_SUMO_MEM_CHANNEL 0x00 /* Memory Channel from 0xfa, P1 = 1 */
|
||||
#define FT900_SUMO_DISPLAYED_FREQ 0x02 /* Current main display, can be VFO A, Memory data, Memory tune (3 bytes) */
|
||||
#define FT900_SUMO_DISPLAYED_CLAR 0x05 /* RIT offset -- current display */
|
||||
#define FT900_SUMO_DISPLAYED_MODE 0x07 /* Current main display mode */
|
||||
#define FT900_SUMO_DISPLAYED_FLAG 0x09
|
||||
|
||||
#define FT900_SUMO_VFO_A_FREQ 0x01 /* VFO A frequency, not necessarily currently displayed! */
|
||||
#define FT900_SUMO_VFO_A_CLAR 0x04 /* RIT offset -- VFO A */
|
||||
#define FT900_SUMO_VFO_A_MODE 0x06 /* VFO A mode, not necessarily currently displayed! */
|
||||
#define FT900_SUMO_VFO_A_FLAG 0x08
|
||||
|
||||
#define FT900_SUMO_VFO_B_FREQ 0x0a /* Current sub display && VFO B */
|
||||
#define FT900_SUMO_VFO_B_CLAR 0x0d /* RIT offset -- VFO B */
|
||||
#define FT900_SUMO_VFO_B_MODE 0x0f /* Current sub display && VFO B */
|
||||
#define FT900_SUMO_VFO_B_FLAG 0x11
|
||||
|
||||
|
||||
/*
|
||||
* Read meter offset
|
||||
*
|
||||
* FT-900 returns the level of the S meter when in RX and ALC or PO or SWR
|
||||
* when in TX. The level is replicated in the first four bytes sent by the
|
||||
* rig with the final byte being a constant 0xf7
|
||||
*
|
||||
* The manual states that the returned value will range between 0x00 and 0xff
|
||||
* while "in practice the highest value returned will be around 0xf0". The
|
||||
* manual is silent when this value is returned as my rig returns 0x00 for
|
||||
* S0, 0x44 for S9 and 0x9D for S9 +60.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT900_SUMO_METER 0x00 /* Meter level */
|
||||
|
||||
|
||||
/*
|
||||
* Narrow filter selection flag from offset 0x08 or 0x11
|
||||
* in VFO/Memory Record
|
||||
*
|
||||
* used when READING modes from FT-900
|
||||
*
|
||||
*/
|
||||
|
||||
#define FLAG_AM_N (1<<6)
|
||||
#define FLAG_CW_N (1<<7)
|
||||
#define FLAG_MASK (FLAG_AM_N|FLAG_CW_N)
|
||||
|
||||
|
||||
/*
|
||||
* Mode Bitmap from offset 0x06 or 0x0f in VFO/Memory Record.
|
||||
*
|
||||
* used when READING modes from FT-900
|
||||
*
|
||||
*/
|
||||
|
||||
#define MODE_LSB 0x00
|
||||
#define MODE_USB 0x01
|
||||
#define MODE_CW 0x02
|
||||
#define MODE_AM 0x03
|
||||
#define MODE_FM 0x04
|
||||
|
||||
/* All relevant bits */
|
||||
#define MODE_MASK (MODE_LSB|MODE_USB|MODE_CW|MODE_AM|MODE_FM)
|
||||
|
||||
|
||||
/*
|
||||
* Command string parameter offsets
|
||||
*/
|
||||
|
||||
#define P1 3
|
||||
#define P2 2
|
||||
#define P3 1
|
||||
#define P4 0
|
||||
|
||||
/*
|
||||
* Two calibration sets for the smeter/power readings
|
||||
*/
|
||||
|
||||
#define FT900_STR_CAL_SMETER { 3, \
|
||||
{ \
|
||||
{ 0, -54 }, /* S0 */ \
|
||||
{0x44, 0 }, /* S9 */ \
|
||||
{0x9d, 60 }, /* +60dB */ \
|
||||
} }
|
||||
|
||||
#define FT900_STR_CAL_POWER { 5, \
|
||||
{ \
|
||||
{ 0, 0 }, /* 0W */ \
|
||||
{0x44, 10 }, /* 10W */ \
|
||||
{0x69, 25 }, /* 25W */ \
|
||||
{0x92, 50 }, /* 50W */ \
|
||||
{0xCE, 100 }, /* 100W */ \
|
||||
} }
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*
|
||||
*/
|
||||
|
||||
static int ft900_init(RIG *rig);
|
||||
static int ft900_cleanup(RIG *rig);
|
||||
static int ft900_open(RIG *rig);
|
||||
static int ft900_close(RIG *rig);
|
||||
|
||||
static int ft900_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft900_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft900_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft900_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft900_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int ft900_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
|
||||
static int ft900_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft900_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
|
||||
static int ft900_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft900_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft900_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft900_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
|
||||
static int ft900_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
|
||||
static int ft900_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
|
||||
static int ft900_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
|
||||
#endif /* _FT900_H */
|
||||
|
|
|
@ -66,6 +66,264 @@
|
|||
* get_ptt
|
||||
*/
|
||||
|
||||
/*
|
||||
* Native FT920 functions. More to come :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft920_native_cmd_e {
|
||||
FT920_NATIVE_SPLIT_OFF = 0,
|
||||
FT920_NATIVE_SPLIT_ON,
|
||||
FT920_NATIVE_RECALL_MEM,
|
||||
FT920_NATIVE_VFO_TO_MEM,
|
||||
FT920_NATIVE_VFO_A,
|
||||
FT920_NATIVE_VFO_B,
|
||||
FT920_NATIVE_MEM_TO_VFO,
|
||||
FT920_NATIVE_CLARIFIER_OPS,
|
||||
FT920_NATIVE_VFO_A_FREQ_SET,
|
||||
FT920_NATIVE_MODE_SET,
|
||||
FT920_NATIVE_PACING,
|
||||
FT920_NATIVE_PTT_OFF,
|
||||
FT920_NATIVE_PTT_ON,
|
||||
FT920_NATIVE_MEM_CHNL,
|
||||
FT920_NATIVE_OP_DATA,
|
||||
FT920_NATIVE_VFO_DATA,
|
||||
FT920_NATIVE_MEM_CHNL_DATA,
|
||||
FT920_NATIVE_TUNER_BYPASS,
|
||||
FT920_NATIVE_TUNER_INLINE,
|
||||
FT920_NATIVE_TUNER_START,
|
||||
FT920_NATIVE_VFO_B_FREQ_SET,
|
||||
FT920_NATIVE_VFO_A_PASSBAND_WIDE,
|
||||
FT920_NATIVE_VFO_A_PASSBAND_NAR,
|
||||
FT920_NATIVE_VFO_B_PASSBAND_WIDE,
|
||||
FT920_NATIVE_VFO_B_PASSBAND_NAR,
|
||||
FT920_NATIVE_STATUS_FLAGS,
|
||||
FT920_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
};
|
||||
|
||||
/*
|
||||
* Internal MODES - when setting modes via FT920_NATIVE_MODE_SET
|
||||
*
|
||||
*/
|
||||
|
||||
/* VFO A */
|
||||
#define MODE_SET_A_LSB 0x00
|
||||
#define MODE_SET_A_USB 0x01
|
||||
#define MODE_SET_A_CW_U 0x02
|
||||
#define MODE_SET_A_CW_L 0x03
|
||||
#define MODE_SET_A_AM_W 0x04
|
||||
#define MODE_SET_A_AM_N 0x05
|
||||
#define MODE_SET_A_FM_W 0x06
|
||||
#define MODE_SET_A_FM_N 0x07
|
||||
#define MODE_SET_A_DATA_L 0x08
|
||||
#define MODE_SET_A_DATA_U 0x0a
|
||||
#define MODE_SET_A_DATA_F 0x0b
|
||||
|
||||
/* VFO B */
|
||||
#define MODE_SET_B_LSB 0x80
|
||||
#define MODE_SET_B_USB 0x81
|
||||
#define MODE_SET_B_CW_U 0x82
|
||||
#define MODE_SET_B_CW_L 0x83
|
||||
#define MODE_SET_B_AM_W 0x84
|
||||
#define MODE_SET_B_AM_N 0x85
|
||||
#define MODE_SET_B_FM_W 0x86
|
||||
#define MODE_SET_B_FM_N 0x87
|
||||
#define MODE_SET_B_DATA_L 0x88
|
||||
#define MODE_SET_B_DATA_U 0x8a
|
||||
#define MODE_SET_B_DATA_F 0x8b
|
||||
|
||||
|
||||
/*
|
||||
* Internal Clarifier parms - when setting clarifier via
|
||||
* FT920_NATIVE_CLARIFIER_OPS
|
||||
*
|
||||
*/
|
||||
|
||||
/* P1 values */
|
||||
#define CLAR_RX_OFF 0x00
|
||||
#define CLAR_RX_ON 0x01
|
||||
#define CLAR_TX_OFF 0x80
|
||||
#define CLAR_TX_ON 0x81
|
||||
#define CLAR_SET_FREQ 0xff
|
||||
|
||||
/* P2 values */
|
||||
#define CLAR_OFFSET_PLUS 0x00
|
||||
#define CLAR_OFFSET_MINUS 0xff
|
||||
|
||||
|
||||
/* Tuner status values used to set the
|
||||
* tuner state and indicate tuner status.
|
||||
*/
|
||||
#define TUNER_BYPASS 0
|
||||
#define TUNER_INLINE 1
|
||||
#define TUNER_TUNING 2
|
||||
|
||||
/*
|
||||
* Local VFO CMD's, according to spec
|
||||
*
|
||||
*/
|
||||
|
||||
//#define FT920_VFO_A 0x00
|
||||
//#define FT920_VFO_B 0x01
|
||||
|
||||
|
||||
/*
|
||||
* Some useful offsets in the status update flags (offset)
|
||||
* SUMO--Status Update Memory Offset?
|
||||
*
|
||||
* SF_ bit tests are now grouped with flag bytes for ease of reference
|
||||
*
|
||||
* FIXME: complete flags and bits
|
||||
*
|
||||
* CAT command 0xFA, P1 = 01 requests the FT-920 to return its status flags.
|
||||
* These flags consist of 8 bytes and are documented in the FT-920 manual
|
||||
* on page 89.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT920_SUMO_DISPLAYED_STATUS_0 0x00 /* Status flag byte 0 */
|
||||
#define SF_VFOA 0x00 /* bits 0 & 1, VFO A TX/RX == 0 */
|
||||
#define SF_SPLITA (1<<0) /* Split operation with VFO-B on TX */
|
||||
#define SF_SPLITB (1<<1) /* Split operation with VFO-B on RX */
|
||||
#define SF_VFOB (SF_SPLITA|SF_SPLITB) /* bits 0 & 1, VFO B TX/RX == 3 */
|
||||
#define SF_TUNER_TUNE (1<<2) /* Antenna tuner On and Tuning for match*/
|
||||
#define SF_PTT_OFF (0<<7) /* Receive mode (PTT line open) */
|
||||
#define SF_PTT_ON (1<<7) /* Transmission in progress (PTT line grounded) */
|
||||
#define SF_PTT_MASK (SF_PTT_ON)
|
||||
|
||||
#define FT920_SUMO_DISPLAYED_STATUS_1 0x01 /* Status flag byte 1 */
|
||||
#define SF_QMB (1<<3) /* Quick Memory Bank (QMB) selected */
|
||||
#define SF_MT (1<<4) /* Memory Tuning in progress */
|
||||
#define SF_VFO (1<<5) /* VFO operation selected */
|
||||
#define SF_MR (1<<6) /* Memory Mode selected */
|
||||
#define SF_GC (1<<7) /* General Coverage Reception selected */
|
||||
#define SF_VFO_MASK (SF_QMB|SF_MT|SF_VFO|SF_MR)
|
||||
|
||||
#define FT920_SUMO_DISPLAYED_STATUS_2 0x02 /* Status flag byte 2 */
|
||||
#define SF_TUNER_INLINE (1<<1) /* Antenna tuner is inline or bypass */
|
||||
#define SF_VFOB_LOCK (1<<2) /* VFO B tuning lock status */
|
||||
#define SF_VFOA_LOCK (1<<3) /* VFO A tuning lock status */
|
||||
|
||||
/*
|
||||
* Offsets for VFO record retrieved via 0x10 P1 = 02, 03
|
||||
*
|
||||
* The FT-920 returns frequency and mode data via three separate commands.
|
||||
* CAT command 0x10, P1 = 02 returns the current main and sub displays' data (28 bytes)
|
||||
* CAT command 0x10, P1 = 03 returns VFO A data and the sub display data (sub display is always VFO B) (28 bytes)
|
||||
* CAT command 0x10, P1 = 04, P4 = 0x00-0x89 returns memory channel data (14 bytes)
|
||||
* In all cases the format is (from the FT-920 manual page 90):
|
||||
*
|
||||
* Offset Value
|
||||
* 0x00 Band Selection (not documented!)
|
||||
* 0x01 Operating Frequency (Hex value of display--Not BCD!)
|
||||
* 0x05 Clarifier Offset (Hex value)
|
||||
* 0x07 Mode Data
|
||||
* 0x08 Flag
|
||||
* 0x09 Filter Data 1
|
||||
* 0x0a Filter Data 2
|
||||
* 0x0b CTCSS Encoder Data
|
||||
* 0x0c CTCSS Decoder Data
|
||||
* 0x0d Memory recall Flag
|
||||
*
|
||||
* Memory Channel data has the same layout and offsets
|
||||
* VFO B data has the same layout, but the offset starts at 0x0e and
|
||||
* continues through 0x1b
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT920_SUMO_DISPLAYED_FREQ 0x01 /* Current main display, can be VFO A, Memory data, Memory tune */
|
||||
#define FT920_SUMO_VFO_A_FREQ 0x01 /* VFO A frequency, not necessarily currently displayed! */
|
||||
#define FT920_SUMO_DISPLAYED_CLAR 0x05 /* RIT/XIT offset -- current display */
|
||||
#define FT920_SUMO_VFO_A_CLAR 0x05 /* RIT/XIT offset -- VFO A */
|
||||
#define FT920_SUMO_DISPLAYED_MODE 0x07 /* Current main display mode */
|
||||
#define FT920_SUMO_VFO_A_MODE 0x07 /* VFO A mode, not necessarily currently displayed! */
|
||||
#define FT920_SUMO_VFO_B_FREQ 0x0f /* Current sub display && VFO B */
|
||||
#define FT920_SUMO_VFO_B_CLAR 0x13 /* RIT/XIT offset -- VFO B */
|
||||
#define FT920_SUMO_VFO_B_MODE 0x15 /* Current sub display && VFO B */
|
||||
|
||||
/*
|
||||
* Mode Bitmap from offset 0x07 or 0x16 in VFO Record.
|
||||
* Bits 5 and 6 ignored
|
||||
* used when READING modes from FT-920
|
||||
*
|
||||
*/
|
||||
|
||||
#define MODE_LSB 0x00
|
||||
#define MODE_CW_L 0x01 /* CW listening on LSB */
|
||||
#define MODE_AM 0x02
|
||||
#define MODE_FM 0x03
|
||||
#define MODE_DATA_L 0x04 /* DATA on LSB */
|
||||
#define MODE_DATA_U 0x05 /* DATA on USB (who does that? :) */
|
||||
#define MODE_DATA_F 0x06 /* DATA on FM */
|
||||
#define MODE_USB 0x40
|
||||
#define MODE_CW_U 0x41 /* CW listening on USB */
|
||||
/* Narrow filter selected */
|
||||
#define MODE_LSBN 0x80 /* Not sure this actually exists */
|
||||
#define MODE_CW_LN 0x81
|
||||
#define MODE_AMN 0x82
|
||||
#define MODE_FMN 0x83
|
||||
#define MODE_DATA_LN 0x84
|
||||
#define MODE_DATA_UN 0x85
|
||||
#define MODE_DATA_FN 0x86
|
||||
#define MODE_USBN 0xc0 /* Not sure this actually exists */
|
||||
#define MODE_CW_UN 0xc1
|
||||
|
||||
/* All relevant bits */
|
||||
#define MODE_MASK 0xc7
|
||||
|
||||
|
||||
/*
|
||||
* Command string parameter offsets
|
||||
*/
|
||||
|
||||
#define P1 3
|
||||
#define P2 2
|
||||
#define P3 1
|
||||
#define P4 0
|
||||
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*
|
||||
*/
|
||||
|
||||
static int ft920_init(RIG *rig);
|
||||
static int ft920_cleanup(RIG *rig);
|
||||
static int ft920_open(RIG *rig);
|
||||
static int ft920_close(RIG *rig);
|
||||
|
||||
static int ft920_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft920_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft920_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft920_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft920_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int ft920_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
|
||||
static int ft920_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft920_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft920_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
|
||||
static int ft920_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq);
|
||||
|
||||
static int ft920_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width);
|
||||
static int ft920_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width);
|
||||
|
||||
static int ft920_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft920_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
|
||||
static int ft920_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit);
|
||||
static int ft920_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit);
|
||||
|
||||
/* not documented in my FT-920 manual, but it works! - N0NB */
|
||||
static int ft920_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft920_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
|
||||
static int ft920_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
static int ft920_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
|
||||
|
||||
/* Private helper function prototypes */
|
||||
|
||||
|
|
|
@ -95,265 +95,4 @@
|
|||
#define FT920_BCD_RIT 3
|
||||
|
||||
|
||||
/*
|
||||
* Native FT920 functions. More to come :-)
|
||||
*
|
||||
*/
|
||||
|
||||
enum ft920_native_cmd_e {
|
||||
FT920_NATIVE_SPLIT_OFF = 0,
|
||||
FT920_NATIVE_SPLIT_ON,
|
||||
FT920_NATIVE_RECALL_MEM,
|
||||
FT920_NATIVE_VFO_TO_MEM,
|
||||
FT920_NATIVE_VFO_A,
|
||||
FT920_NATIVE_VFO_B,
|
||||
FT920_NATIVE_MEM_TO_VFO,
|
||||
FT920_NATIVE_CLARIFIER_OPS,
|
||||
FT920_NATIVE_VFO_A_FREQ_SET,
|
||||
FT920_NATIVE_MODE_SET,
|
||||
FT920_NATIVE_PACING,
|
||||
FT920_NATIVE_PTT_OFF,
|
||||
FT920_NATIVE_PTT_ON,
|
||||
FT920_NATIVE_MEM_CHNL,
|
||||
FT920_NATIVE_OP_DATA,
|
||||
FT920_NATIVE_VFO_DATA,
|
||||
FT920_NATIVE_MEM_CHNL_DATA,
|
||||
FT920_NATIVE_TUNER_BYPASS,
|
||||
FT920_NATIVE_TUNER_INLINE,
|
||||
FT920_NATIVE_TUNER_START,
|
||||
FT920_NATIVE_VFO_B_FREQ_SET,
|
||||
FT920_NATIVE_VFO_A_PASSBAND_WIDE,
|
||||
FT920_NATIVE_VFO_A_PASSBAND_NAR,
|
||||
FT920_NATIVE_VFO_B_PASSBAND_WIDE,
|
||||
FT920_NATIVE_VFO_B_PASSBAND_NAR,
|
||||
FT920_NATIVE_STATUS_FLAGS,
|
||||
FT920_NATIVE_SIZE /* end marker, value indicates number of */
|
||||
/* native cmd entries */
|
||||
};
|
||||
|
||||
typedef enum ft920_native_cmd_e ft920_native_cmd_t;
|
||||
|
||||
|
||||
/*
|
||||
* Internal MODES - when setting modes via FT920_NATIVE_MODE_SET
|
||||
*
|
||||
*/
|
||||
|
||||
/* VFO A */
|
||||
#define MODE_SET_A_LSB 0x00
|
||||
#define MODE_SET_A_USB 0x01
|
||||
#define MODE_SET_A_CW_U 0x02
|
||||
#define MODE_SET_A_CW_L 0x03
|
||||
#define MODE_SET_A_AM_W 0x04
|
||||
#define MODE_SET_A_AM_N 0x05
|
||||
#define MODE_SET_A_FM_W 0x06
|
||||
#define MODE_SET_A_FM_N 0x07
|
||||
#define MODE_SET_A_DATA_L 0x08
|
||||
#define MODE_SET_A_DATA_U 0x0a
|
||||
#define MODE_SET_A_DATA_F 0x0b
|
||||
|
||||
/* VFO B */
|
||||
#define MODE_SET_B_LSB 0x80
|
||||
#define MODE_SET_B_USB 0x81
|
||||
#define MODE_SET_B_CW_U 0x82
|
||||
#define MODE_SET_B_CW_L 0x83
|
||||
#define MODE_SET_B_AM_W 0x84
|
||||
#define MODE_SET_B_AM_N 0x85
|
||||
#define MODE_SET_B_FM_W 0x86
|
||||
#define MODE_SET_B_FM_N 0x87
|
||||
#define MODE_SET_B_DATA_L 0x88
|
||||
#define MODE_SET_B_DATA_U 0x8a
|
||||
#define MODE_SET_B_DATA_F 0x8b
|
||||
|
||||
|
||||
/*
|
||||
* Internal Clarifier parms - when setting clarifier via
|
||||
* FT920_NATIVE_CLARIFIER_OPS
|
||||
*
|
||||
*/
|
||||
|
||||
/* P1 values */
|
||||
#define CLAR_RX_OFF 0x00
|
||||
#define CLAR_RX_ON 0x01
|
||||
#define CLAR_TX_OFF 0x80
|
||||
#define CLAR_TX_ON 0x81
|
||||
#define CLAR_SET_FREQ 0xff
|
||||
|
||||
/* P2 values */
|
||||
#define CLAR_OFFSET_PLUS 0x00
|
||||
#define CLAR_OFFSET_MINUS 0xff
|
||||
|
||||
|
||||
/* Tuner status values used to set the
|
||||
* tuner state and indicate tuner status.
|
||||
*/
|
||||
#define TUNER_BYPASS 0
|
||||
#define TUNER_INLINE 1
|
||||
#define TUNER_TUNING 2
|
||||
|
||||
/*
|
||||
* Local VFO CMD's, according to spec
|
||||
*
|
||||
*/
|
||||
|
||||
//#define FT920_VFO_A 0x00
|
||||
//#define FT920_VFO_B 0x01
|
||||
|
||||
|
||||
/*
|
||||
* Some useful offsets in the status update flags (offset)
|
||||
* SUMO--Status Update Memory Offset?
|
||||
*
|
||||
* SF_ bit tests are now grouped with flag bytes for ease of reference
|
||||
*
|
||||
* FIXME: complete flags and bits
|
||||
*
|
||||
* CAT command 0xFA, P1 = 01 requests the FT-920 to return its status flags.
|
||||
* These flags consist of 8 bytes and are documented in the FT-920 manual
|
||||
* on page 89.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT920_SUMO_DISPLAYED_STATUS_0 0x00 /* Status flag byte 0 */
|
||||
#define SF_VFOA 0x00 /* bits 0 & 1, VFO A TX/RX == 0 */
|
||||
#define SF_SPLITA (1<<0) /* Split operation with VFO-B on TX */
|
||||
#define SF_SPLITB (1<<1) /* Split operation with VFO-B on RX */
|
||||
#define SF_VFOB (SF_SPLITA|SF_SPLITB) /* bits 0 & 1, VFO B TX/RX == 3 */
|
||||
#define SF_TUNER_TUNE (1<<2) /* Antenna tuner On and Tuning for match*/
|
||||
#define SF_PTT_OFF (0<<7) /* Receive mode (PTT line open) */
|
||||
#define SF_PTT_ON (1<<7) /* Transmission in progress (PTT line grounded) */
|
||||
#define SF_PTT_MASK (SF_PTT_ON)
|
||||
|
||||
#define FT920_SUMO_DISPLAYED_STATUS_1 0x01 /* Status flag byte 1 */
|
||||
#define SF_QMB (1<<3) /* Quick Memory Bank (QMB) selected */
|
||||
#define SF_MT (1<<4) /* Memory Tuning in progress */
|
||||
#define SF_VFO (1<<5) /* VFO operation selected */
|
||||
#define SF_MR (1<<6) /* Memory Mode selected */
|
||||
#define SF_GC (1<<7) /* General Coverage Reception selected */
|
||||
#define SF_VFO_MASK (SF_QMB|SF_MT|SF_VFO|SF_MR)
|
||||
|
||||
#define FT920_SUMO_DISPLAYED_STATUS_2 0x02 /* Status flag byte 2 */
|
||||
#define SF_TUNER_INLINE (1<<1) /* Antenna tuner is inline or bypass */
|
||||
#define SF_VFOB_LOCK (1<<2) /* VFO B tuning lock status */
|
||||
#define SF_VFOA_LOCK (1<<3) /* VFO A tuning lock status */
|
||||
|
||||
/*
|
||||
* Offsets for VFO record retrieved via 0x10 P1 = 02, 03
|
||||
*
|
||||
* The FT-920 returns frequency and mode data via three separate commands.
|
||||
* CAT command 0x10, P1 = 02 returns the current main and sub displays' data (28 bytes)
|
||||
* CAT command 0x10, P1 = 03 returns VFO A data and the sub display data (sub display is always VFO B) (28 bytes)
|
||||
* CAT command 0x10, P1 = 04, P4 = 0x00-0x89 returns memory channel data (14 bytes)
|
||||
* In all cases the format is (from the FT-920 manual page 90):
|
||||
*
|
||||
* Offset Value
|
||||
* 0x00 Band Selection (not documented!)
|
||||
* 0x01 Operating Frequency (Hex value of display--Not BCD!)
|
||||
* 0x05 Clarifier Offset (Hex value)
|
||||
* 0x07 Mode Data
|
||||
* 0x08 Flag
|
||||
* 0x09 Filter Data 1
|
||||
* 0x0a Filter Data 2
|
||||
* 0x0b CTCSS Encoder Data
|
||||
* 0x0c CTCSS Decoder Data
|
||||
* 0x0d Memory recall Flag
|
||||
*
|
||||
* Memory Channel data has the same layout and offsets
|
||||
* VFO B data has the same layout, but the offset starts at 0x0e and
|
||||
* continues through 0x1b
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT920_SUMO_DISPLAYED_FREQ 0x01 /* Current main display, can be VFO A, Memory data, Memory tune */
|
||||
#define FT920_SUMO_VFO_A_FREQ 0x01 /* VFO A frequency, not necessarily currently displayed! */
|
||||
#define FT920_SUMO_DISPLAYED_CLAR 0x05 /* RIT/XIT offset -- current display */
|
||||
#define FT920_SUMO_VFO_A_CLAR 0x05 /* RIT/XIT offset -- VFO A */
|
||||
#define FT920_SUMO_DISPLAYED_MODE 0x07 /* Current main display mode */
|
||||
#define FT920_SUMO_VFO_A_MODE 0x07 /* VFO A mode, not necessarily currently displayed! */
|
||||
#define FT920_SUMO_VFO_B_FREQ 0x0f /* Current sub display && VFO B */
|
||||
#define FT920_SUMO_VFO_B_CLAR 0x13 /* RIT/XIT offset -- VFO B */
|
||||
#define FT920_SUMO_VFO_B_MODE 0x15 /* Current sub display && VFO B */
|
||||
|
||||
/*
|
||||
* Mode Bitmap from offset 0x07 or 0x16 in VFO Record.
|
||||
* Bits 5 and 6 ignored
|
||||
* used when READING modes from FT-920
|
||||
*
|
||||
*/
|
||||
|
||||
#define MODE_LSB 0x00
|
||||
#define MODE_CW_L 0x01 /* CW listening on LSB */
|
||||
#define MODE_AM 0x02
|
||||
#define MODE_FM 0x03
|
||||
#define MODE_DATA_L 0x04 /* DATA on LSB */
|
||||
#define MODE_DATA_U 0x05 /* DATA on USB (who does that? :) */
|
||||
#define MODE_DATA_F 0x06 /* DATA on FM */
|
||||
#define MODE_USB 0x40
|
||||
#define MODE_CW_U 0x41 /* CW listening on USB */
|
||||
/* Narrow filter selected */
|
||||
#define MODE_LSBN 0x80 /* Not sure this actually exists */
|
||||
#define MODE_CW_LN 0x81
|
||||
#define MODE_AMN 0x82
|
||||
#define MODE_FMN 0x83
|
||||
#define MODE_DATA_LN 0x84
|
||||
#define MODE_DATA_UN 0x85
|
||||
#define MODE_DATA_FN 0x86
|
||||
#define MODE_USBN 0xc0 /* Not sure this actually exists */
|
||||
#define MODE_CW_UN 0xc1
|
||||
|
||||
/* All relevant bits */
|
||||
#define MODE_MASK 0xc7
|
||||
|
||||
|
||||
/*
|
||||
* Command string parameter offsets
|
||||
*/
|
||||
|
||||
#define P1 3
|
||||
#define P2 2
|
||||
#define P3 1
|
||||
#define P4 0
|
||||
|
||||
|
||||
/*
|
||||
* API local implementation
|
||||
*
|
||||
*/
|
||||
|
||||
static int ft920_init(RIG *rig);
|
||||
static int ft920_cleanup(RIG *rig);
|
||||
static int ft920_open(RIG *rig);
|
||||
static int ft920_close(RIG *rig);
|
||||
|
||||
static int ft920_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft920_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
|
||||
static int ft920_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft920_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
|
||||
static int ft920_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int ft920_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
|
||||
static int ft920_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft920_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
|
||||
static int ft920_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
|
||||
static int ft920_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq);
|
||||
|
||||
static int ft920_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width);
|
||||
static int ft920_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width);
|
||||
|
||||
static int ft920_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft920_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
|
||||
static int ft920_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit);
|
||||
static int ft920_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit);
|
||||
|
||||
/* not documented in my FT-920 manual, but it works! - N0NB */
|
||||
static int ft920_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft920_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
|
||||
static int ft920_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
static int ft920_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
|
||||
#endif /* _FT920_H */
|
||||
|
|
|
@ -47,6 +47,98 @@
|
|||
#include "yaesu.h"
|
||||
#include "ft990.h"
|
||||
|
||||
// FT990 native commands
|
||||
enum ft990_native_cmd_e {
|
||||
FT990_NATIVE_SPLIT_OFF = 0,
|
||||
FT990_NATIVE_SPLIT_ON,
|
||||
FT990_NATIVE_RECALL_MEM,
|
||||
FT990_NATIVE_VFO_TO_MEM,
|
||||
FT990_NATIVE_LOCK_OFF,
|
||||
FT990_NATIVE_LOCK_ON,
|
||||
FT990_NATIVE_VFO_A,
|
||||
FT990_NATIVE_VFO_B,
|
||||
FT990_NATIVE_MEM_TO_VFO,
|
||||
FT990_NATIVE_VFO_STEP_UP,
|
||||
FT990_NATIVE_VFO_STEP_UP_FAST,
|
||||
FT990_NATIVE_VFO_STEP_DOWN,
|
||||
FT990_NATIVE_VFO_STEP_DOWN_FAST,
|
||||
FT990_NATIVE_RX_CLARIFIER_OFF,
|
||||
FT990_NATIVE_RX_CLARIFIER_ON,
|
||||
FT990_NATIVE_TX_CLARIFIER_OFF,
|
||||
FT990_NATIVE_TX_CLARIFIER_ON,
|
||||
FT990_NATIVE_CLEAR_CLARIFIER_OFFSET,
|
||||
FT990_NATIVE_CLARIFIER_OPS,
|
||||
FT990_NATIVE_FREQ_SET,
|
||||
FT990_NATIVE_MODE_SET_LSB,
|
||||
FT990_NATIVE_MODE_SET_USB,
|
||||
FT990_NATIVE_MODE_SET_CW_W,
|
||||
FT990_NATIVE_MODE_SET_CW_N,
|
||||
FT990_NATIVE_MODE_SET_AM_W,
|
||||
FT990_NATIVE_MODE_SET_AM_N,
|
||||
FT990_NATIVE_MODE_SET_FM,
|
||||
FT990_NATIVE_MODE_SET_RTTY_LSB,
|
||||
FT990_NATIVE_MODE_SET_RTTY_USB,
|
||||
FT990_NATIVE_MODE_SET_PKT_LSB,
|
||||
FT990_NATIVE_MODE_SET_PKT_FM,
|
||||
FT990_NATIVE_PACING,
|
||||
FT990_NATIVE_PTT_OFF,
|
||||
FT990_NATIVE_PTT_ON,
|
||||
FT990_NATIVE_UPDATE_ALL_DATA,
|
||||
FT990_NATIVE_UPDATE_MEM_CHNL,
|
||||
FT990_NATIVE_UPDATE_OP_DATA,
|
||||
FT990_NATIVE_UPDATE_VFO_DATA,
|
||||
FT990_NATIVE_UPDATE_MEM_CHNL_DATA,
|
||||
FT990_NATIVE_TUNER_OFF,
|
||||
FT990_NATIVE_TUNER_ON,
|
||||
FT990_NATIVE_TUNER_START,
|
||||
FT990_NATIVE_RPTR_SHIFT_NONE,
|
||||
FT990_NATIVE_RPTR_SHIFT_MINUS,
|
||||
FT990_NATIVE_RPTR_SHIFT_PLUS,
|
||||
FT990_NATIVE_VFO_TO_VFO,
|
||||
FT990_NATIVE_BANDWIDTH,
|
||||
FT990_NATIVE_OP_FREQ_STEP_UP,
|
||||
FT990_NATIVE_OP_FREQ_STEP_DOWN,
|
||||
FT990_NATIVE_READ_METER,
|
||||
FT990_NATIVE_DIM_LEVEL,
|
||||
FT990_NATIVE_RPTR_OFFSET,
|
||||
FT990_NATIVE_READ_FLAGS,
|
||||
FT990_NATIVE_SIZE
|
||||
};
|
||||
|
||||
|
||||
/* HAMLIB API implementation */
|
||||
static int ft990_init(RIG *rig);
|
||||
static int ft990_cleanup(RIG *rig);
|
||||
static int ft990_open(RIG *rig);
|
||||
static int ft990_close(RIG *rig);
|
||||
static int ft990_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft990_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
static int ft990_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft990_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
static int ft990_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int ft990_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
static int ft990_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft990_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
static int ft990_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
|
||||
static int ft990_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
|
||||
static int ft990_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs);
|
||||
static int ft990_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
static int ft990_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
static int ft990_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
static int ft990_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
static int ft990_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
static int ft990_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
static int ft990_set_parm(RIG *rig, setting_t parm, value_t val);
|
||||
static int ft990_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit);
|
||||
static int ft990_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit);
|
||||
static int ft990_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
static int ft990_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
static int ft990_set_mem(RIG *rig, vfo_t vfo, int ch);
|
||||
static int ft990_get_mem(RIG *rig, vfo_t vfo, int *ch);
|
||||
static int ft990_set_channel (RIG *rig, vfo_t vfo, const channel_t *chan);
|
||||
static int ft990_get_channel (RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -87,98 +87,6 @@
|
|||
|
||||
#define FT990_DEFAULT_READ_TIMEOUT FT990_ALL_DATA_LENGTH * ( 5 + (FT990_PACING_INTERVAL * FT990_PACING_DEFAULT_VALUE))
|
||||
|
||||
// FT990 native commands
|
||||
typedef enum ft990_native_cmd_e {
|
||||
FT990_NATIVE_SPLIT_OFF = 0,
|
||||
FT990_NATIVE_SPLIT_ON,
|
||||
FT990_NATIVE_RECALL_MEM,
|
||||
FT990_NATIVE_VFO_TO_MEM,
|
||||
FT990_NATIVE_LOCK_OFF,
|
||||
FT990_NATIVE_LOCK_ON,
|
||||
FT990_NATIVE_VFO_A,
|
||||
FT990_NATIVE_VFO_B,
|
||||
FT990_NATIVE_MEM_TO_VFO,
|
||||
FT990_NATIVE_VFO_STEP_UP,
|
||||
FT990_NATIVE_VFO_STEP_UP_FAST,
|
||||
FT990_NATIVE_VFO_STEP_DOWN,
|
||||
FT990_NATIVE_VFO_STEP_DOWN_FAST,
|
||||
FT990_NATIVE_RX_CLARIFIER_OFF,
|
||||
FT990_NATIVE_RX_CLARIFIER_ON,
|
||||
FT990_NATIVE_TX_CLARIFIER_OFF,
|
||||
FT990_NATIVE_TX_CLARIFIER_ON,
|
||||
FT990_NATIVE_CLEAR_CLARIFIER_OFFSET,
|
||||
FT990_NATIVE_CLARIFIER_OPS,
|
||||
FT990_NATIVE_FREQ_SET,
|
||||
FT990_NATIVE_MODE_SET_LSB,
|
||||
FT990_NATIVE_MODE_SET_USB,
|
||||
FT990_NATIVE_MODE_SET_CW_W,
|
||||
FT990_NATIVE_MODE_SET_CW_N,
|
||||
FT990_NATIVE_MODE_SET_AM_W,
|
||||
FT990_NATIVE_MODE_SET_AM_N,
|
||||
FT990_NATIVE_MODE_SET_FM,
|
||||
FT990_NATIVE_MODE_SET_RTTY_LSB,
|
||||
FT990_NATIVE_MODE_SET_RTTY_USB,
|
||||
FT990_NATIVE_MODE_SET_PKT_LSB,
|
||||
FT990_NATIVE_MODE_SET_PKT_FM,
|
||||
FT990_NATIVE_PACING,
|
||||
FT990_NATIVE_PTT_OFF,
|
||||
FT990_NATIVE_PTT_ON,
|
||||
FT990_NATIVE_UPDATE_ALL_DATA,
|
||||
FT990_NATIVE_UPDATE_MEM_CHNL,
|
||||
FT990_NATIVE_UPDATE_OP_DATA,
|
||||
FT990_NATIVE_UPDATE_VFO_DATA,
|
||||
FT990_NATIVE_UPDATE_MEM_CHNL_DATA,
|
||||
FT990_NATIVE_TUNER_OFF,
|
||||
FT990_NATIVE_TUNER_ON,
|
||||
FT990_NATIVE_TUNER_START,
|
||||
FT990_NATIVE_RPTR_SHIFT_NONE,
|
||||
FT990_NATIVE_RPTR_SHIFT_MINUS,
|
||||
FT990_NATIVE_RPTR_SHIFT_PLUS,
|
||||
FT990_NATIVE_VFO_TO_VFO,
|
||||
FT990_NATIVE_BANDWIDTH,
|
||||
FT990_NATIVE_OP_FREQ_STEP_UP,
|
||||
FT990_NATIVE_OP_FREQ_STEP_DOWN,
|
||||
FT990_NATIVE_READ_METER,
|
||||
FT990_NATIVE_DIM_LEVEL,
|
||||
FT990_NATIVE_RPTR_OFFSET,
|
||||
FT990_NATIVE_READ_FLAGS,
|
||||
FT990_NATIVE_SIZE
|
||||
} ft990_native_cmd_t;
|
||||
|
||||
|
||||
/* HAMLIB API implementation */
|
||||
int ft990_init(RIG *rig);
|
||||
int ft990_cleanup(RIG *rig);
|
||||
int ft990_open(RIG *rig);
|
||||
int ft990_close(RIG *rig);
|
||||
int ft990_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
int ft990_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
int ft990_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
int ft990_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
int ft990_set_vfo(RIG *rig, vfo_t vfo);
|
||||
int ft990_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
int ft990_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
int ft990_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
int ft990_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
|
||||
int ft990_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
|
||||
int ft990_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs);
|
||||
int ft990_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
int ft990_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
|
||||
int ft990_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
|
||||
int ft990_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
|
||||
int ft990_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
int ft990_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
int ft990_set_parm(RIG *rig, setting_t parm, value_t val);
|
||||
int ft990_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit);
|
||||
int ft990_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit);
|
||||
int ft990_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
int ft990_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
int ft990_set_mem(RIG *rig, vfo_t vfo, int ch);
|
||||
int ft990_get_mem(RIG *rig, vfo_t vfo, int *ch);
|
||||
int ft990_set_channel (RIG *rig, vfo_t vfo, const channel_t *chan);
|
||||
int ft990_get_channel (RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
|
||||
|
||||
|
||||
/*
|
||||
* The definitions below are copied from the kft990
|
||||
* project and are hereby made available to the
|
||||
|
|
|
@ -41,6 +41,24 @@
|
|||
#include "ft991.h"
|
||||
#include "idx_builtin.h"
|
||||
|
||||
/* Prototypes */
|
||||
static int ft991_init(RIG *rig);
|
||||
static int ft991_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||
pbwidth_t *tx_width);
|
||||
static int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
pbwidth_t tx_width);
|
||||
static int ft991_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
|
||||
static int ft991_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq);
|
||||
static void debug_ft991info_data(const ft991info *rdata);
|
||||
static int ft991_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft991_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone);
|
||||
static int ft991_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft991_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code);
|
||||
static int ft991_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft991_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone);
|
||||
static int ft991_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code);
|
||||
static int ft991_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code);
|
||||
|
||||
/*
|
||||
* FT-991 rig capabilities
|
||||
*/
|
||||
|
@ -349,7 +367,7 @@ ft991_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft991_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||
static int ft991_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||
pbwidth_t *tx_width)
|
||||
{
|
||||
struct newcat_priv_data *priv;
|
||||
|
@ -435,7 +453,7 @@ static void debug_ft991info_data(const ft991info *rdata)
|
|||
*
|
||||
*/
|
||||
|
||||
int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
static int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
pbwidth_t tx_width)
|
||||
{
|
||||
struct newcat_priv_data *priv;
|
||||
|
@ -517,7 +535,7 @@ int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
|||
return newcat_set_cmd(rig);
|
||||
}
|
||||
|
||||
int ft991_init(RIG *rig)
|
||||
static int ft991_init(RIG *rig)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -158,21 +158,4 @@ typedef struct
|
|||
char terminator; /* ';' */
|
||||
} ft991info;
|
||||
|
||||
/* Prototypes */
|
||||
static int ft991_init(RIG *rig);
|
||||
static int ft991_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||
pbwidth_t *tx_width);
|
||||
static int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
pbwidth_t tx_width);
|
||||
static int ft991_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
|
||||
static int ft991_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq);
|
||||
static void debug_ft991info_data(const ft991info *rdata);
|
||||
static int ft991_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft991_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone);
|
||||
static int ft991_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code);
|
||||
static int ft991_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code);
|
||||
static int ft991_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone);
|
||||
static int ft991_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone);
|
||||
static int ft991_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code);
|
||||
static int ft991_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code);
|
||||
#endif /* _FT991_H */
|
||||
|
|
|
@ -45,6 +45,119 @@
|
|||
#include "yaesu.h"
|
||||
#include "vx1700.h"
|
||||
|
||||
// VX-1700 native commands
|
||||
typedef enum vx1700_native_cmd_e {
|
||||
VX1700_NATIVE_RECALL_MEM = 0, /* 0x02, p1=ch */
|
||||
VX1700_NATIVE_VFO_TO_MEM, /* 0x03, p1=ch, p2=0 */
|
||||
VX1700_NATIVE_MEM_HIDE, /* 0x03, p1=ch, p2=1 */
|
||||
VX1700_NATIVE_VFO_A, /* 0x05 */
|
||||
VX1700_NATIVE_FREQ_SET, /* 0x0a, p1:4=freq */
|
||||
VX1700_NATIVE_MODE_SET_LSB, /* 0x0c, p1=0x00 */
|
||||
VX1700_NATIVE_MODE_SET_USB, /* 0x0c, p1=0x01 */
|
||||
VX1700_NATIVE_MODE_SET_CW_W, /* 0x0c, p1=0x02 */
|
||||
VX1700_NATIVE_MODE_SET_CW_N, /* 0x0c, p1=0x03 */
|
||||
VX1700_NATIVE_MODE_SET_AM, /* 0x0c, p1=0x04 */
|
||||
VX1700_NATIVE_MODE_SET_RTTY_LSB_W, /* 0x0c, p1=0x08 */
|
||||
VX1700_NATIVE_MODE_SET_RTTY_USB_W, /* 0x0c, p1=0x09 */
|
||||
VX1700_NATIVE_MODE_SET_H3E, /* 0x0c, p1=0x0d */
|
||||
VX1700_NATIVE_MODE_SET_RTTY_LSB_N, /* 0x0c, p1=0x0e */
|
||||
VX1700_NATIVE_MODE_SET_RTTY_USB_N, /* 0x0c, p1=0x0f */
|
||||
VX1700_NATIVE_PTT_OFF, /* 0x0f, p1=0 */
|
||||
VX1700_NATIVE_PTT_ON, /* 0x0f, p1=1 */
|
||||
VX1700_NATIVE_UPDATE_MEM_CHNL, /* 0x10, p1=1 */
|
||||
VX1700_NATIVE_UPDATE_OP_DATA, /* 0x10, p1=2 */
|
||||
VX1700_NATIVE_UPDATE_VFO_DATA, /* 0x10, p1=3 */
|
||||
VX1700_NATIVE_TX_POWER_LOW, /* 0x18 */
|
||||
VX1700_NATIVE_TX_POWER_MID, /* 0x28 */
|
||||
VX1700_NATIVE_TX_POWER_HI, /* 0x48 */
|
||||
VX1700_NATIVE_CPY_RX_TO_TX, /* 0x85 */
|
||||
VX1700_NATIVE_TX_FREQ_SET, /* 0x8a, p1:4=freq */
|
||||
VX1700_NATIVE_OP_FREQ_STEP_UP, /* 0x8e, p1=0 */
|
||||
VX1700_NATIVE_OP_FREQ_STEP_DOWN, /* 0x8e, p1=1 */
|
||||
VX1700_NATIVE_READ_METER, /* 0xf7 */
|
||||
VX1700_NATIVE_READ_FLAGS, /* 0xfa */
|
||||
VX1700_NATIVE_SIZE
|
||||
} vx1700_native_cmd_t;
|
||||
|
||||
// OpCode Declarations
|
||||
#define VX1700_CMD_RECALLMEM 0x02
|
||||
#define VX1700_CMD_VFO2MEM 0x03
|
||||
#define VX1700_CMD_SEL_VFOA 0x05
|
||||
#define VX1700_CMD_SET_VFOA 0x0a
|
||||
#define VX1700_CMD_SEL_OP_MODE 0x0c
|
||||
#define VX1700_CMD_PTT 0x0f
|
||||
#define VX1700_CMD_UPDATE 0x10
|
||||
#define VX1700_CMD_RX2TX 0x85
|
||||
#define VX1700_CMD_STEP_VFO 0x8e
|
||||
#define VX1700_CMD_RD_METER 0xf7
|
||||
#define VX1700_CMD_RD_FLAGS 0xfa
|
||||
|
||||
// Return codes
|
||||
#define VX1700_CMD_RETCODE_OK 0x00
|
||||
#define VX1700_CMD_RETCODE_ERROR 0xF0
|
||||
|
||||
// Operating Mode Status
|
||||
#define VX1700_MODE_LSB 0x00
|
||||
#define VX1700_MODE_USB 0x01
|
||||
#define VX1700_MODE_CW_W 0x02
|
||||
#define VX1700_MODE_CW_N 0x03
|
||||
#define VX1700_MODE_AM 0x04
|
||||
#define VX1700_MODE_RTTY 0x05
|
||||
|
||||
// Operation Mode Selection
|
||||
#define VX1700_OP_MODE_LSB 0x00
|
||||
#define VX1700_OP_MODE_USB 0x01
|
||||
#define VX1700_OP_MODE_CW_W 0x02
|
||||
#define VX1700_OP_MODE_CW_N 0x03
|
||||
#define VX1700_OP_MODE_AM 0x04
|
||||
#define VX1700_OP_MODE_RTTY_LSB_W 0x08
|
||||
#define VX1700_OP_MODE_RTTY_USB_W 0x09
|
||||
#define VX1700_OP_MODE_H3E 0x0d
|
||||
#define VX1700_OP_MODE_RTTY_LSB_N 0x0e
|
||||
#define VX1700_OP_MODE_RTTY_USB_N 0x0f
|
||||
|
||||
// Status Flag 1 Masks
|
||||
#define VX1700_SF_LOCKED 0x01 /* LOCK is activated */
|
||||
#define VX1700_SF_MEM 0x20 /* Memory Mode */
|
||||
#define VX1700_SF_VFO 0x80 /* VFO Mode */
|
||||
|
||||
// Status Flag 2 Masks
|
||||
#define VX1700_SF_PTT_BY_CAT 0x01 /* PTT closed by CAT */
|
||||
#define VX1700_SF_MEM_SCAN_PAUSE 0x02 /* Scanning paused */
|
||||
#define VX1700_SF_MEM_SCAN 0x04 /* Scanning enabled */
|
||||
#define VX1700_SF_RTTY_FILTER_NARROW 0x08 /* Narrow RTTY filter selected */
|
||||
#define VX1700_SF_CW_FILTER_NARROW 0x10 /* Narrow CW filter selected */
|
||||
#define VX1700_SF_RTTY_USB 0x20 /* USB selected for RTTY */
|
||||
|
||||
// Status Flag 3 Masks
|
||||
#define VX1700_SF_10W_TX 0x20 /* 10 Watt TX output selected */
|
||||
#define VX1700_SF_TUNER_ON 0x20 /* Antenna Tuner working */
|
||||
#define VX1700_SF_TRANSMISSION_ON 0x80 /* Transmission in progress */
|
||||
|
||||
|
||||
/* HAMLIB API implementation */
|
||||
static int vx1700_init(RIG *rig);
|
||||
static int vx1700_open(RIG *rig);
|
||||
static int vx1700_cleanup(RIG *rig);
|
||||
static const char * vx1700_get_info(RIG *rig);
|
||||
|
||||
static int vx1700_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int vx1700_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
static int vx1700_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int vx1700_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
static int vx1700_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
|
||||
static int vx1700_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq);
|
||||
static int vx1700_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int vx1700_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
static int vx1700_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int vx1700_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
static int vx1700_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
static int vx1700_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
static int vx1700_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
|
||||
static int vx1700_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
static int vx1700_set_mem(RIG *rig, vfo_t vfo, int ch);
|
||||
static int vx1700_get_mem(RIG *rig, vfo_t vfo, int *ch);
|
||||
static int vx1700_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
|
||||
static const yaesu_cmd_set_t ncmd[] =
|
||||
{
|
||||
|
|
|
@ -60,118 +60,5 @@
|
|||
#define VX1700_BCD_DIAL 8
|
||||
|
||||
|
||||
// VX-1700 native commands
|
||||
typedef enum vx1700_native_cmd_e {
|
||||
VX1700_NATIVE_RECALL_MEM = 0, /* 0x02, p1=ch */
|
||||
VX1700_NATIVE_VFO_TO_MEM, /* 0x03, p1=ch, p2=0 */
|
||||
VX1700_NATIVE_MEM_HIDE, /* 0x03, p1=ch, p2=1 */
|
||||
VX1700_NATIVE_VFO_A, /* 0x05 */
|
||||
VX1700_NATIVE_FREQ_SET, /* 0x0a, p1:4=freq */
|
||||
VX1700_NATIVE_MODE_SET_LSB, /* 0x0c, p1=0x00 */
|
||||
VX1700_NATIVE_MODE_SET_USB, /* 0x0c, p1=0x01 */
|
||||
VX1700_NATIVE_MODE_SET_CW_W, /* 0x0c, p1=0x02 */
|
||||
VX1700_NATIVE_MODE_SET_CW_N, /* 0x0c, p1=0x03 */
|
||||
VX1700_NATIVE_MODE_SET_AM, /* 0x0c, p1=0x04 */
|
||||
VX1700_NATIVE_MODE_SET_RTTY_LSB_W, /* 0x0c, p1=0x08 */
|
||||
VX1700_NATIVE_MODE_SET_RTTY_USB_W, /* 0x0c, p1=0x09 */
|
||||
VX1700_NATIVE_MODE_SET_H3E, /* 0x0c, p1=0x0d */
|
||||
VX1700_NATIVE_MODE_SET_RTTY_LSB_N, /* 0x0c, p1=0x0e */
|
||||
VX1700_NATIVE_MODE_SET_RTTY_USB_N, /* 0x0c, p1=0x0f */
|
||||
VX1700_NATIVE_PTT_OFF, /* 0x0f, p1=0 */
|
||||
VX1700_NATIVE_PTT_ON, /* 0x0f, p1=1 */
|
||||
VX1700_NATIVE_UPDATE_MEM_CHNL, /* 0x10, p1=1 */
|
||||
VX1700_NATIVE_UPDATE_OP_DATA, /* 0x10, p1=2 */
|
||||
VX1700_NATIVE_UPDATE_VFO_DATA, /* 0x10, p1=3 */
|
||||
VX1700_NATIVE_TX_POWER_LOW, /* 0x18 */
|
||||
VX1700_NATIVE_TX_POWER_MID, /* 0x28 */
|
||||
VX1700_NATIVE_TX_POWER_HI, /* 0x48 */
|
||||
VX1700_NATIVE_CPY_RX_TO_TX, /* 0x85 */
|
||||
VX1700_NATIVE_TX_FREQ_SET, /* 0x8a, p1:4=freq */
|
||||
VX1700_NATIVE_OP_FREQ_STEP_UP, /* 0x8e, p1=0 */
|
||||
VX1700_NATIVE_OP_FREQ_STEP_DOWN, /* 0x8e, p1=1 */
|
||||
VX1700_NATIVE_READ_METER, /* 0xf7 */
|
||||
VX1700_NATIVE_READ_FLAGS, /* 0xfa */
|
||||
VX1700_NATIVE_SIZE
|
||||
} vx1700_native_cmd_t;
|
||||
|
||||
// OpCode Declarations
|
||||
#define VX1700_CMD_RECALLMEM 0x02
|
||||
#define VX1700_CMD_VFO2MEM 0x03
|
||||
#define VX1700_CMD_SEL_VFOA 0x05
|
||||
#define VX1700_CMD_SET_VFOA 0x0a
|
||||
#define VX1700_CMD_SEL_OP_MODE 0x0c
|
||||
#define VX1700_CMD_PTT 0x0f
|
||||
#define VX1700_CMD_UPDATE 0x10
|
||||
#define VX1700_CMD_RX2TX 0x85
|
||||
#define VX1700_CMD_STEP_VFO 0x8e
|
||||
#define VX1700_CMD_RD_METER 0xf7
|
||||
#define VX1700_CMD_RD_FLAGS 0xfa
|
||||
|
||||
// Return codes
|
||||
#define VX1700_CMD_RETCODE_OK 0x00
|
||||
#define VX1700_CMD_RETCODE_ERROR 0xF0
|
||||
|
||||
// Operating Mode Status
|
||||
#define VX1700_MODE_LSB 0x00
|
||||
#define VX1700_MODE_USB 0x01
|
||||
#define VX1700_MODE_CW_W 0x02
|
||||
#define VX1700_MODE_CW_N 0x03
|
||||
#define VX1700_MODE_AM 0x04
|
||||
#define VX1700_MODE_RTTY 0x05
|
||||
|
||||
// Operation Mode Selection
|
||||
#define VX1700_OP_MODE_LSB 0x00
|
||||
#define VX1700_OP_MODE_USB 0x01
|
||||
#define VX1700_OP_MODE_CW_W 0x02
|
||||
#define VX1700_OP_MODE_CW_N 0x03
|
||||
#define VX1700_OP_MODE_AM 0x04
|
||||
#define VX1700_OP_MODE_RTTY_LSB_W 0x08
|
||||
#define VX1700_OP_MODE_RTTY_USB_W 0x09
|
||||
#define VX1700_OP_MODE_H3E 0x0d
|
||||
#define VX1700_OP_MODE_RTTY_LSB_N 0x0e
|
||||
#define VX1700_OP_MODE_RTTY_USB_N 0x0f
|
||||
|
||||
// Status Flag 1 Masks
|
||||
#define VX1700_SF_LOCKED 0x01 /* LOCK is activated */
|
||||
#define VX1700_SF_MEM 0x20 /* Memory Mode */
|
||||
#define VX1700_SF_VFO 0x80 /* VFO Mode */
|
||||
|
||||
// Status Flag 2 Masks
|
||||
#define VX1700_SF_PTT_BY_CAT 0x01 /* PTT closed by CAT */
|
||||
#define VX1700_SF_MEM_SCAN_PAUSE 0x02 /* Scanning paused */
|
||||
#define VX1700_SF_MEM_SCAN 0x04 /* Scanning enabled */
|
||||
#define VX1700_SF_RTTY_FILTER_NARROW 0x08 /* Narrow RTTY filter selected */
|
||||
#define VX1700_SF_CW_FILTER_NARROW 0x10 /* Narrow CW filter selected */
|
||||
#define VX1700_SF_RTTY_USB 0x20 /* USB selected for RTTY */
|
||||
|
||||
// Status Flag 3 Masks
|
||||
#define VX1700_SF_10W_TX 0x20 /* 10 Watt TX output selected */
|
||||
#define VX1700_SF_TUNER_ON 0x20 /* Antenna Tuner working */
|
||||
#define VX1700_SF_TRANSMISSION_ON 0x80 /* Transmission in progress */
|
||||
|
||||
|
||||
/* HAMLIB API implementation */
|
||||
static int vx1700_init(RIG *rig);
|
||||
static int vx1700_open(RIG *rig);
|
||||
static int vx1700_cleanup(RIG *rig);
|
||||
static const char * vx1700_get_info(RIG *rig);
|
||||
|
||||
static int vx1700_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int vx1700_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
static int vx1700_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int vx1700_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
static int vx1700_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
|
||||
static int vx1700_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq);
|
||||
static int vx1700_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int vx1700_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
static int vx1700_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int vx1700_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
static int vx1700_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
|
||||
static int vx1700_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
static int vx1700_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
|
||||
static int vx1700_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
static int vx1700_set_mem(RIG *rig, vfo_t vfo, int ch);
|
||||
static int vx1700_get_mem(RIG *rig, vfo_t vfo, int *ch);
|
||||
static int vx1700_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
|
||||
#endif /* _VX1700_H */
|
||||
|
|
Ładowanie…
Reference in New Issue