From 04aaca80c6121c522bc33546c546f0e5db9b4891 Mon Sep 17 00:00:00 2001 From: Alexandru Csete OZ9AEC Date: Sun, 4 Sep 2005 10:44:23 +0000 Subject: [PATCH] Applied Tommi's improvements from the FT-857 backend with the following changes and additions: - Frequency ranges, tuning steps and TX power levels. - Added ROG_MODE_PKTFM and disabled set WFM since it cannot be explicily set. - Added narrow CW modes. - Enabled set_powerstat. - Created private DCS codes list (not all from tone.h are supported). - Modified CTCSS and DCS code; it is a little different than the 857. - Added RIG_LEVEL_RAWSTR and RIG_OP_TOGGLE. - Added set_split_vfo to toggle split ON/OFF (vfo args are silently ignored). get_split_vfo left out becasue it only works when PTT is ON :o) git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2038 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- yaesu/ft817.c | 1426 +++++++++++++++++++++++++++++++++---------------- yaesu/ft817.h | 189 ++++--- 2 files changed, 1068 insertions(+), 547 deletions(-) diff --git a/yaesu/ft817.c b/yaesu/ft817.c index b519bf289..dfe4fd9fc 100644 --- a/yaesu/ft817.c +++ b/yaesu/ft817.c @@ -6,8 +6,12 @@ * via serial interface to an FT-817 using the "CAT" interface. * The starting point for this code was Frank's ft847 implementation. * + * Then, Tommi OH2BNS improved the code a lot in the framework of the + * FT-857 backend. These improvements have now (August 2005) been + * copied back and adopted for the FT-817. * - * $Id: ft817.c,v 1.11 2005-04-03 19:27:59 fillods Exp $ + * + * $Id: ft817.c,v 1.12 2005-09-04 10:44:22 csete Exp $ * * * This library is free software; you can redistribute it and/or @@ -26,6 +30,29 @@ * */ +/* + * Unimplemented features supported by the FT-817: + * + * - RIT ON/OFF without touching the RIT offset. This would + * need frontend support (eg. a new RIG_FUNC_xxx) + * + * - RX status command returns info that is not used: + * - discriminator centered (yes/no flag) + * - received ctcss/dcs matched (yes/no flag) TBC + * + * - TX status command returns info that is not used: + * - split on/off flag; actually this could have been used + * for get_split_vfo, but the flag is valid only when + * PTT is ON. + * - high swr flag + * + * Todo / tocheck list (oz9aec): + * - check power meter reading, add power2mW, mW2power + * - test get_dcd; rigctl does not support it? + * - squelch + * - the many "fixme" stuff around + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -34,15 +61,17 @@ #include /* String function definitions */ #include /* UNIX standard function definitions */ +#ifdef HAVE_SYS_TIME_H +#include +#endif + #include "hamlib/rig.h" #include "serial.h" #include "yaesu.h" #include "ft817.h" #include "misc.h" - -/* prototypes */ - -static int ft817_send_priv_cmd(RIG *rig, unsigned char ci); +#include "tones.h" +#include "bandplan.h" /* Native ft817 cmd set prototypes. These are READ ONLY as each */ @@ -50,550 +79,997 @@ static int ft817_send_priv_cmd(RIG *rig, unsigned char ci); /* Complete sequences (1) can be read and used directly as a cmd sequence . */ /* Incomplete sequences (0) must be completed with extra parameters */ /* eg: mem number, or freq etc.. */ - static const yaesu_cmd_set_t ncmd[] = { - { 1, { 0x00, 0x00, 0x00, 0x00, 0x00 } }, /* lock on */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x80 } }, /* lock off */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x08 } }, /* ptt on */ - { 1, { 0x00, 0x00, 0x00, 0x01, 0x88 } }, /* ptt off */ - { 0, { 0x00, 0x00, 0x00, 0x00, 0x01 } }, /* set freq */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main LSB */ - { 1, { 0x01, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main USB */ - { 1, { 0x02, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main CW */ - { 1, { 0x03, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main CWR */ - { 1, { 0x04, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main AM */ - { 1, { 0x08, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM */ - { 1, { 0x0a, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main DIG */ - { 1, { 0x0c, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main PKT */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x05 } }, /* clar on */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* clar off */ - { 0, { 0x00, 0x00, 0x00, 0x00, 0xf5 } }, /* set clar freq */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x81 } }, /* toggle vfo a/b */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x02 } }, /* split on */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x82 } }, /* split off */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x09 } }, /* set RPT shift MINUS */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x49 } }, /* set RPT shift PLUS */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x89 } }, /* set RPT shift SIMPLEX */ - { 0, { 0x00, 0x00, 0x00, 0x00, 0xf9 } }, /* set RPT offset freq */ -/* fix me */ - { 1, { 0x0a, 0x00, 0x00, 0x00, 0x0a } }, /* set DCS on */ - { 1, { 0x2a, 0x00, 0x00, 0x00, 0x0a } }, /* set CTCSS/DCS enc/dec on */ - { 1, { 0x4a, 0x00, 0x00, 0x00, 0x0a } }, /* set CTCSS/DCS enc on */ - { 1, { 0x8a, 0x00, 0x00, 0x00, 0x0a } }, /* set CTCSS/DCS off */ -/* em xif */ - { 0, { 0x00, 0x00, 0x00, 0x00, 0x0b } }, /* set CTCSS tone */ - { 0, { 0x00, 0x00, 0x00, 0x00, 0x0c } }, /* set DCS code */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0xe7 } }, /* get RX status */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0xf7 } }, /* get TX status */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x03 } }, /* get FREQ and MODE status */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x00 } }, /* pwr wakeup sequence */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x0f } }, /* pwr on */ - { 1, { 0x00, 0x00, 0x00, 0x00, 0x8f } } /* pwr off */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x00 } }, /* lock on */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x80 } }, /* lock off */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x08 } }, /* ptt on */ + { 1, { 0x00, 0x00, 0x00, 0x01, 0x88 } }, /* ptt off */ + { 0, { 0x00, 0x00, 0x00, 0x00, 0x01 } }, /* set freq */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main LSB */ + { 1, { 0x01, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main USB */ + { 1, { 0x02, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main CW */ + { 1, { 0x03, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main CWR */ + { 1, { 0x04, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main AM */ + { 1, { 0x08, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM */ + { 1, { 0x88, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM-N */ + { 1, { 0x0a, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main DIG */ + { 1, { 0x0c, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main PKT */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x05 } }, /* clar on */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* clar off */ + { 0, { 0x00, 0x00, 0x00, 0x00, 0xf5 } }, /* set clar freq */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x81 } }, /* toggle vfo a/b */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x02 } }, /* split on */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x82 } }, /* split off */ + { 1, { 0x09, 0x00, 0x00, 0x00, 0x09 } }, /* set RPT shift MINUS */ + { 1, { 0x49, 0x00, 0x00, 0x00, 0x09 } }, /* set RPT shift PLUS */ + { 1, { 0x89, 0x00, 0x00, 0x00, 0x09 } }, /* set RPT shift SIMPLEX */ + { 0, { 0x00, 0x00, 0x00, 0x00, 0xf9 } }, /* set RPT offset freq */ + { 1, { 0x0a, 0x00, 0x00, 0x00, 0x0a } }, /* set DCS on */ + { 1, { 0x2a, 0x00, 0x00, 0x00, 0x0a } }, /* set CTCSS on */ + { 1, { 0x4a, 0x00, 0x00, 0x00, 0x0a } }, /* set CTCSS encoder on */ + { 1, { 0x8a, 0x00, 0x00, 0x00, 0x0a } }, /* set CTCSS/DCS off */ + { 0, { 0x00, 0x00, 0x00, 0x00, 0x0b } }, /* set CTCSS tone */ + { 0, { 0x00, 0x00, 0x00, 0x00, 0x0c } }, /* set DCS code */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0xe7 } }, /* get RX status */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0xf7 } }, /* get TX status */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x03 } }, /* get FREQ and MODE status */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x00 } }, /* pwr wakeup sequence */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x0f } }, /* pwr on */ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x8f } }, /* pwr off */ }; +static const tone_t static_ft817_dcs_list[] = { + 23, 25, 26, 31, 32, 36, 43, 47, 51, 53, + 54, 65, 71, 72, 73, 74, 114, 115, 116, 122, + 125, 131, 132, 134, 143, 145, 152, 155, 156, 162, + 165, 172, 174, 205, 212, 223, 225, 226, 243, 244, + 245, 246, 251, 252, 255, 261, 263, 265, 266, 271, + 274, 306, 311, 315, 325, 331, 332, 343, 346, 351, + 356, 364, 365, 371, 411, 412, 413, 423, 431, 432, + 445, 446, 452, 454, 455, 462, 464, 465, 466, 503, + 506, 516, 523, 526, 532, 546, 565, 606, 612, 624, + 627, 631, 632, 654, 662, 664, 703, 712, 723, 731, + 732, 734, 743, 754, 0 +}; -#define FT817_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_USB|RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM) -#define FT817_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_USB|RIG_MODE_LSB) -#define FT817_AM_FM_RX_MODES (RIG_MODE_AM|RIG_MODE_FM) +#define FT817_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_PKTFM|\ + RIG_MODE_USB|RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM) +#define FT817_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|RIG_MODE_LSB|RIG_MODE_RTTY) +#define FT817_CWN_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_RTTY) +#define FT817_AM_FM_RX_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_PKTFM) -#define FT817_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_USB|RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM) -#define FT817_AM_TX_MODES (RIG_MODE_AM) -#define FT817_GET_RIG_LEVELS (RIG_LEVEL_STRENGTH|RIG_LEVEL_RFPOWER) -#define FT817_FUNC_ALL (RIG_FUNC_LOCK|RIG_FUNC_TONE|RIG_FUNC_TSQL) +#define FT817_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|\ + RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM) +#define FT817_AM_TX_MODES (RIG_MODE_AM) + +#define FT817_VFO_ALL (RIG_VFO_A|RIG_VFO_B) +#define FT817_ANTS 0 const struct rig_caps ft817_caps = { - .rig_model = RIG_MODEL_FT817, - .model_name = "FT-817", - .mfg_name = "Yaesu", - .version = "0.1", - .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, - .rig_type = RIG_TYPE_TRANSCEIVER, - .ptt_type = RIG_PTT_RIG, - .dcd_type = RIG_DCD_NONE, - .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 4800, - .serial_rate_max = 38400, - .serial_data_bits = 8, - .serial_stop_bits = 2, - .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_NONE, - .write_delay = FT817_WRITE_DELAY, - .post_write_delay = FT817_POST_WRITE_DELAY, - .timeout = 100, - .retry = 0, - .has_get_func = RIG_FUNC_NONE, - .has_set_func = FT817_FUNC_ALL, - .has_get_level = FT817_GET_RIG_LEVELS, - .has_set_level = RIG_LEVEL_NONE, - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ - .level_gran = {}, /* granularity */ - .parm_gran = {}, - .ctcss_list = NULL, /* FIXME: CTCSS/DCS list */ - .dcs_list = NULL, - .preamp = { RIG_DBLST_END, }, /* FIXME! */ - .attenuator = { RIG_DBLST_END, }, - .max_rit = Hz(9999), - .max_xit = Hz(0), - .max_ifshift = Hz(0), - .targetable_vfo = 0, - .transceive = RIG_TRN_OFF, - .bank_qty = 0, - .chan_desc_sz = 0, + .rig_model = RIG_MODEL_FT817, + .model_name = "FT-817", + .mfg_name = "Yaesu", + .version = "0.2", + .copyright = "LGPL", + .status = RIG_STATUS_BETA, + .rig_type = RIG_TYPE_TRANSCEIVER, + .ptt_type = RIG_PTT_RIG, + .dcd_type = RIG_DCD_RIG, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 4800, + .serial_rate_max = 38400, + .serial_data_bits = 8, + .serial_stop_bits = 2, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = FT817_WRITE_DELAY, + .post_write_delay = FT817_POST_WRITE_DELAY, + .timeout = FT817_TIMEOUT, + .retry = 0, + .has_get_func = RIG_FUNC_NONE, + .has_set_func = RIG_FUNC_LOCK | RIG_FUNC_TONE | RIG_FUNC_TSQL, + .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RAWSTR | RIG_LEVEL_RFPOWER, + .has_set_level = RIG_LEVEL_NONE, + .has_get_parm = RIG_PARM_NONE, + .has_set_parm = RIG_PARM_NONE, + .level_gran = {}, /* granularity */ + .parm_gran = {}, + .ctcss_list = static_common_ctcss_list, + .dcs_list = static_ft817_dcs_list, /* only 104 out of 106 supported */ + .preamp = { RIG_DBLST_END, }, + .attenuator = { RIG_DBLST_END, }, + .max_rit = Hz(9990), + .max_xit = Hz(0), + .max_ifshift = Hz(0), + .vfo_ops = RIG_OP_TOGGLE, + .targetable_vfo = 0, + .transceive = RIG_TRN_OFF, + .bank_qty = 0, + .chan_desc_sz = 0, + .chan_list = { RIG_CHAN_END, }, - .chan_list = { RIG_CHAN_END, }, /* FIXME: memory chan list: 78 */ + .rx_range_list1 = { + {kHz(100),MHz(56), FT817_ALL_RX_MODES,-1,-1}, + {MHz(76), MHz(108),RIG_MODE_WFM, -1,-1}, + {MHz(118),MHz(164),FT817_ALL_RX_MODES,-1,-1}, + {MHz(420),MHz(470),FT817_ALL_RX_MODES,-1,-1}, + RIG_FRNG_END, + }, + .tx_range_list1 = { + FRQ_RNG_HF(1, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS), + FRQ_RNG_HF(1, FT817_AM_TX_MODES, W(0.5),W(1.5), FT817_VFO_ALL, FT817_ANTS), - .rx_range_list1 = { RIG_FRNG_END, }, /* FIXME: enter region 1 setting */ - .tx_range_list1 = { RIG_FRNG_END, }, - .rx_range_list2 = { - {kHz(100),MHz(56), FT817_ALL_RX_MODES,-1,-1}, - {MHz(76), MHz(108),RIG_MODE_WFM, -1,-1}, - {MHz(108),MHz(154),FT817_ALL_RX_MODES,-1,-1}, - {MHz(420),MHz(470),FT817_ALL_RX_MODES,-1,-1}, - RIG_FRNG_END, - }, + FRQ_RNG_6m(1, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS), + FRQ_RNG_6m(1, FT817_AM_TX_MODES, W(0.5),W(1.5), FT817_VFO_ALL, FT817_ANTS), - .tx_range_list2 = { - {MHz(1.8), MHz(2), FT817_OTHER_TX_MODES, W(0.5),W(0.5)}, - {MHz(1.8), MHz(2), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - {MHz(3.5), MHz(4), FT817_OTHER_TX_MODES, W(0.5),W(5.0)}, - {MHz(3.5), MHz(4), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - {MHz(7), MHz(7.3), FT817_OTHER_TX_MODES, W(0.5),W(5.0)}, - {MHz(7), MHz(7.3), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - {MHz(10), MHz(10.150), FT817_OTHER_TX_MODES, W(0.5),W(5.0)}, - {MHz(10), MHz(10.150), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - {MHz(14), MHz(14.350), FT817_OTHER_TX_MODES, W(0.5),W(5.0)}, - {MHz(14), MHz(14.350), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - {MHz(18.068),MHz(18.168), FT817_OTHER_TX_MODES, W(0.5),W(5.0)}, - {MHz(18.068),MHz(18.168), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - {MHz(21), MHz(21.450), FT817_OTHER_TX_MODES, W(0.5),W(5.0)}, - {MHz(21), MHz(21.450), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - {MHz(24.890),MHz(24.990), FT817_OTHER_TX_MODES, W(0.5),W(5.0)}, - {MHz(24.890),MHz(24.990), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - {MHz(28), MHz(29.7), FT817_OTHER_TX_MODES, W(0.5),W(5.0)}, - {MHz(28), MHz(29.7), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - {MHz(50), MHz(54), FT817_OTHER_TX_MODES, W(0.5),W(5.0)}, - {MHz(50), MHz(54), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - {MHz(144), MHz(148), FT817_OTHER_TX_MODES, W(0.5),W(5.0)}, - {MHz(144), MHz(148), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - {MHz(430), MHz(440), FT817_OTHER_TX_MODES, W(0.5),W(5.0)}, - {MHz(430), MHz(440), FT817_AM_TX_MODES, W(0.5),W(1.5)}, - RIG_FRNG_END, - }, + FRQ_RNG_2m(1, FT817_OTHER_TX_MODES, W(0.5),W(5),FT817_VFO_ALL,FT817_ANTS), + FRQ_RNG_2m(1, FT817_AM_TX_MODES, W(0.5),W(1.5),FT817_VFO_ALL,FT817_ANTS), - .tuning_steps = { - {FT817_SSB_CW_RX_MODES,10}, - {FT817_SSB_CW_RX_MODES,100}, - {FT817_AM_FM_RX_MODES,10}, - {FT817_AM_FM_RX_MODES,100}, - RIG_TS_END, - }, + FRQ_RNG_70cm(1, FT817_OTHER_TX_MODES, W(0.5),W(5),FT817_VFO_ALL,FT817_ANTS), + FRQ_RNG_70cm(1, FT817_AM_TX_MODES, W(0.5),W(1.5),FT817_VFO_ALL,FT817_ANTS), - .filters = { - RIG_FLT_END, - }, + RIG_FRNG_END, + }, - .priv = NULL, - .rig_init = ft817_init, - .rig_cleanup = ft817_cleanup, - .rig_open = ft817_open, - .rig_close = ft817_close, - .set_freq = ft817_set_freq, - .get_freq = ft817_get_freq, - .set_mode = ft817_set_mode, - .get_mode = ft817_get_mode, - .set_vfo = ft817_set_vfo, - .get_vfo = ft817_get_vfo, - .set_ptt = ft817_set_ptt, - .get_ptt = NULL, - .get_dcd = NULL, - .set_rptr_shift = NULL, - .get_rptr_shift = NULL, - .set_rptr_offs = NULL, - .get_rptr_offs = NULL, - .set_split_freq = NULL, - .get_split_freq = NULL, - .set_split_mode = NULL, - .get_split_mode = NULL, - .set_split_vfo = NULL, - .get_split_vfo = NULL, - .set_rit = NULL, - .get_rit = NULL, - .set_xit = NULL, - .get_xit = NULL, - .set_ts = NULL, - .get_ts = NULL, - .set_dcs_code = NULL, - .get_dcs_code = NULL, - .set_ctcss_tone = NULL, - .get_ctcss_tone = NULL, - .set_dcs_sql = NULL, - .get_dcs_sql = NULL, - .set_ctcss_sql = NULL, - .get_ctcss_sql = NULL, - .set_powerstat = NULL, - .get_powerstat = NULL, - .reset = NULL, - .set_ant = NULL, - .get_ant = NULL, - .set_level = NULL, - .get_level = NULL, - .set_func = NULL, - .get_func = NULL, - .set_parm = NULL, - .get_parm = NULL, + + .rx_range_list2 = { + {kHz(100),MHz(56), FT817_ALL_RX_MODES,-1,-1}, + {MHz(76), MHz(108),RIG_MODE_WFM, -1,-1}, + {MHz(118),MHz(164),FT817_ALL_RX_MODES,-1,-1}, + {MHz(420),MHz(470),FT817_ALL_RX_MODES,-1,-1}, + RIG_FRNG_END, + }, + + .tx_range_list2 = { + FRQ_RNG_HF(2, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS), + FRQ_RNG_HF(2, FT817_AM_TX_MODES, W(0.5),W(1.5), FT817_VFO_ALL, FT817_ANTS), + /* FIXME: 60 meters in US version */ + + FRQ_RNG_6m(2, FT817_OTHER_TX_MODES, W(0.5), W(5), FT817_VFO_ALL, FT817_ANTS), + FRQ_RNG_6m(2, FT817_AM_TX_MODES, W(0.5),W(1.5), FT817_VFO_ALL, FT817_ANTS), + + FRQ_RNG_2m(2, FT817_OTHER_TX_MODES, W(0.5),W(5),FT817_VFO_ALL,FT817_ANTS), + FRQ_RNG_2m(2, FT817_AM_TX_MODES, W(0.5),W(1.5),FT817_VFO_ALL,FT817_ANTS), + + FRQ_RNG_70cm(2, FT817_OTHER_TX_MODES, W(0.5),W(5),FT817_VFO_ALL,FT817_ANTS), + FRQ_RNG_70cm(2, FT817_AM_TX_MODES, W(0.5),W(1.5),FT817_VFO_ALL,FT817_ANTS), + + RIG_FRNG_END, + }, + + .tuning_steps = { + {FT817_SSB_CW_RX_MODES,Hz(10)}, + {FT817_AM_FM_RX_MODES|RIG_MODE_WFM,Hz(100)}, + RIG_TS_END, + }, + + .filters = { + {FT817_SSB_CW_RX_MODES, kHz(2.2)}, /* normal passband */ + {FT817_CWN_RX_MODES, 500}, /* CW and RTTY narrow */ + {RIG_MODE_AM, kHz(6)}, /* AM normal */ + {RIG_MODE_FM|RIG_MODE_PKTFM, kHz(9)}, + {RIG_MODE_WFM, kHz(15)}, + RIG_FLT_END, + }, + + .priv = NULL, + .rig_init = ft817_init, + .rig_cleanup = ft817_cleanup, + .rig_open = ft817_open, + .rig_close = ft817_close, + .set_freq = ft817_set_freq, + .get_freq = ft817_get_freq, + .set_mode = ft817_set_mode, + .get_mode = ft817_get_mode, + .set_vfo = NULL, + .get_vfo = NULL, + .set_ptt = ft817_set_ptt, + .get_ptt = ft817_get_ptt, + .get_dcd = ft817_get_dcd, + .set_rptr_shift = ft817_set_rptr_shift, + .get_rptr_shift = NULL, + .set_rptr_offs = ft817_set_rptr_offs, + .get_rptr_offs = NULL, + .set_split_freq = NULL, + .get_split_freq = NULL, + .set_split_mode = NULL, + .get_split_mode = NULL, + .set_split_vfo = ft817_set_split_vfo, + .get_split_vfo = NULL, /* possible, but works only if PTT is ON */ + .set_rit = ft817_set_rit, + .get_rit = NULL, + .set_xit = NULL, + .get_xit = NULL, + .set_ts = NULL, + .get_ts = NULL, + .set_dcs_code = ft817_set_dcs_code, + .get_dcs_code = NULL, + .set_tone = NULL, + .get_tone = NULL, + .set_ctcss_tone = ft817_set_ctcss_tone, + .get_ctcss_tone = NULL, + .set_tone = NULL, + .get_tone = NULL, + .set_dcs_sql = ft817_set_dcs_sql, + .get_dcs_sql = NULL, + .set_tone_sql = NULL, + .get_tone_sql = NULL, + .set_ctcss_sql = ft817_set_ctcss_sql, + .get_ctcss_sql = NULL, + .power2mW = NULL, + .mW2power = NULL, + .set_powerstat = ft817_set_powerstat, + .get_powerstat = NULL, + .reset = NULL, + .set_ant = NULL, + .get_ant = NULL, + .set_level = NULL, + .get_level = ft817_get_level, + .set_func = ft817_set_func, + .get_func = NULL, + .set_parm = NULL, + .get_parm = NULL, + .set_ext_level = NULL, + .get_ext_level = NULL, + .set_ext_parm = NULL, + .get_ext_parm = NULL, + .set_conf = NULL, + .get_conf = NULL, + .send_dtmf = NULL, + .recv_dtmf = NULL, + .send_morse = NULL, + .set_bank = NULL, + .set_mem = NULL, + .get_mem = NULL, + .vfo_op = ft817_vfo_op, + .scan = NULL, + .set_trn = NULL, + .get_trn = NULL, + .decode_event = NULL, + .set_channel = NULL, + .get_channel = NULL, + + /* there are some more */ }; +/* ---------------------------------------------------------------------- */ -int ft817_init(RIG *rig) { - struct ft817_priv_data *p; +int ft817_init (RIG *rig) +{ + struct ft817_priv_data *p; - if (!rig) return -RIG_EINVAL; + rig_debug (RIG_DEBUG_VERBOSE,"ft817: ft817_init called \n"); + + if ((p = calloc(1, sizeof(struct ft817_priv_data))) == NULL) + return -RIG_ENOMEM; + + /* Copy complete native cmd set to private cmd storage area */ + memcpy(p->pcs, ncmd, sizeof(ncmd)); + + rig->state.priv = (void*) p; - p = (struct ft817_priv_data*)malloc(sizeof(struct ft817_priv_data)); - if (!p) return -RIG_ENOMEM; - - rig_debug(RIG_DEBUG_VERBOSE,"ft817:ft817_init called \n"); - - /* - * Copy complete native cmd set to private cmd storage area - */ - - memcpy(p->pcs,ncmd,sizeof(ncmd)); - - p->current_vfo = RIG_VFO_A; /* no clue which VFO is active, so guess VFO 1 */ - rig->state.priv = (void*)p; - - return RIG_OK; + return RIG_OK; } -int ft817_cleanup(RIG *rig) { - if (!rig) - return -RIG_EINVAL; - - if (rig->state.priv) - free(rig->state.priv); - rig->state.priv = NULL; +int ft817_cleanup (RIG *rig) +{ + rig_debug (RIG_DEBUG_VERBOSE,"ft817: ft817_cleanup called \n"); - rig_debug(RIG_DEBUG_VERBOSE,"ft817:ft817_cleanup called \n"); + if (rig->state.priv) + free(rig->state.priv); + rig->state.priv = NULL; - return RIG_OK; + return RIG_OK; } -int ft817_open(RIG *rig) { +int ft817_open (RIG *rig) +{ + rig_debug (RIG_DEBUG_VERBOSE,"ft817: ft817_open called \n"); - rig_debug(RIG_DEBUG_VERBOSE,"ft817:ft817_open called \n"); - - return RIG_OK; + return RIG_OK; } -int ft817_close(RIG *rig) { +int ft817_close (RIG *rig) +{ + rig_debug (RIG_DEBUG_VERBOSE,"ft817: ft817_close called \n"); - rig_debug(RIG_DEBUG_VERBOSE,"ft817:ft817_close called \n"); + return RIG_OK; +} - return RIG_OK; +/* ---------------------------------------------------------------------- */ + +static inline long timediff(struct timeval *tv1, struct timeval *tv2) +{ + struct timeval tv; + + tv.tv_usec = tv1->tv_usec - tv2->tv_usec; + tv.tv_sec = tv1->tv_sec - tv2->tv_sec; + + return ((tv.tv_sec * 1000L) + (tv.tv_usec / 1000L)); +} + +static int check_cache_timeout(struct timeval *tv) +{ + struct timeval curr; + long t; + + if (tv->tv_sec == 0 && tv->tv_usec == 0) { + rig_debug(RIG_DEBUG_VERBOSE, "ft817: cache invalid\n"); + return 1; + } + + gettimeofday(&curr, NULL); + + if ((t = timediff(&curr, tv)) < FT817_CACHE_TIMEOUT) { + rig_debug(RIG_DEBUG_VERBOSE, "ft817: using cache (%ld ms)\n", t); + return 0; + } else { + rig_debug(RIG_DEBUG_VERBOSE, "ft817: cache timed out (%ld ms)\n", t); + return 1; + } +} + +static int ft817_get_status(RIG *rig, int status) +{ + struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; + struct timeval *tv; + unsigned char *data; + int len; + int n; + + switch (status) { + case FT817_NATIVE_CAT_GET_FREQ_MODE_STATUS: + data = p->fm_status; + len = YAESU_CMD_LENGTH; + tv = &p->fm_status_tv; + break; + case FT817_NATIVE_CAT_GET_RX_STATUS: + data = &p->rx_status; + len = 1; + tv = &p->rx_status_tv; + break; + case FT817_NATIVE_CAT_GET_TX_STATUS: + data = &p->tx_status; + len = 1; + tv = &p->tx_status_tv; + break; + default: + rig_debug(RIG_DEBUG_ERR, "ft817_get_status: Internal error!\n"); + return -RIG_EINTERNAL; + } + + serial_flush(&rig->state.rigport); + + write_block(&rig->state.rigport, p->pcs[status].nseq, YAESU_CMD_LENGTH); + + if ((n = read_block(&rig->state.rigport, data, len)) < 0) + return n; + + if (n != len) + return -RIG_EIO; + + gettimeofday(tv, NULL); + + return RIG_OK; +} + +/* ---------------------------------------------------------------------- */ + +int ft817_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) +{ + struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; + int n; + + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + if (check_cache_timeout(&p->fm_status_tv)) + if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_FREQ_MODE_STATUS)) < 0) + return n; + + *freq = from_bcd_be(p->fm_status, 8) * 10; + + return -RIG_OK; +} + +int ft817_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) +{ + struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; + int n; + + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + if (check_cache_timeout(&p->fm_status_tv)) + if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_FREQ_MODE_STATUS)) < 0) + return n; + + /* set normal width now, narrow will override this later */ + *width = RIG_PASSBAND_NORMAL; + + switch (p->fm_status[4]) { + case 0x00: + *mode = RIG_MODE_LSB; + break; + case 0x01: + *mode = RIG_MODE_USB; + break; + case 0x02: + *mode = RIG_MODE_CW; + break; + case 0x03: + *mode = RIG_MODE_CWR; + break; + case 0x04: + *mode = RIG_MODE_AM; + break; + case 0x06: + *mode = RIG_MODE_WFM; + break; + case 0x08: + *mode = RIG_MODE_FM; + break; + case 0x0A: + *mode = RIG_MODE_RTTY; + break; + case 0x0C: + *mode = RIG_MODE_PKTFM; + break; + + /* "extra modes" which are not documented in the manual */ + case 0x82: + *mode = RIG_MODE_CW; + *width = rig_passband_narrow (rig, RIG_MODE_CW); + break; + case 0x83: + *mode = RIG_MODE_CWR; + *width = rig_passband_narrow (rig, RIG_MODE_CW); + break; + case 0x8A: + *mode = RIG_MODE_RTTY; + *width = rig_passband_narrow (rig, RIG_MODE_CW); + break; + + default: + *mode = RIG_MODE_NONE; + } + + + return RIG_OK; +} + +int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) +{ + struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; + int n; + + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + if (check_cache_timeout(&p->tx_status_tv)) + if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_STATUS)) < 0) + return n; + + *ptt = ((p->tx_status & 0x80) == 0); + + return RIG_OK; +} + +static int ft817_get_pometer_level(RIG *rig, value_t *val) +{ + struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; + int n; + + if (check_cache_timeout(&p->tx_status_tv)) + if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_STATUS)) < 0) + return n; + + /* Valid only if PTT is on */ + if ((p->tx_status & 0x80) == 0) + val->f = ((p->tx_status & 0x0F) / 15.0); + else + val->f = 0.0; + + return RIG_OK; +} + +static int ft817_get_smeter_level(RIG *rig, value_t *val) +{ + struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; + int n; + + if (check_cache_timeout(&p->rx_status_tv)) + if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_RX_STATUS)) < 0) + return n; + + n = (p->rx_status & 0x0F) - 9; + + val->i = n * ((n > 0) ? 10 : 6); + + return RIG_OK; +} + +static int ft817_get_raw_smeter_level(RIG *rig, value_t *val) +{ + struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; + int n; + + if (check_cache_timeout(&p->rx_status_tv)) + if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_RX_STATUS)) < 0) + return n; + + val->i = p->rx_status & 0x0F; + + return RIG_OK; +} + + +int ft817_get_level (RIG *rig, vfo_t vfo, setting_t level, value_t *val) +{ + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + switch (level) { + + case RIG_LEVEL_STRENGTH: + return ft817_get_smeter_level(rig, val); + + case RIG_LEVEL_RAWSTR: + return ft817_get_raw_smeter_level(rig, val); + + case RIG_LEVEL_RFPOWER: + return ft817_get_pometer_level(rig, val); + + default: + return -RIG_EINVAL; + } + + return RIG_OK; +} + +int ft817_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) +{ + struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; + int n; + + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + if (check_cache_timeout(&p->rx_status_tv)) + if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_RX_STATUS)) < 0) + return n; + + /* TODO: consider bit 6 too ??? (CTCSS/DCS code match) */ + if (p->rx_status & 0x80) + *dcd = RIG_DCD_OFF; + else + *dcd = RIG_DCD_ON; + + return RIG_OK; +} + +/* ---------------------------------------------------------------------- */ + +static int ft817_read_ack(RIG *rig) +{ +#if (FT817_POST_WRITE_DELAY == 0) + unsigned char dummy; + int n; + + if ((n = read_block(&rig->state.rigport, &dummy, 1)) < 0) { + rig_debug(RIG_DEBUG_ERR, "ft817: error reading ack\n"); + return n; + } + + rig_debug(RIG_DEBUG_TRACE,"ft817: ack received (%d)\n", dummy); + + if (dummy != 0) + return -RIG_ERJCTED; +#endif + + return RIG_OK; } /* - * private helper function to send a private command - * sequence . Must only be complete sequences. - * + * private helper function to send a private command sequence. + * Must only be complete sequences. */ - -static int ft817_send_priv_cmd(RIG *rig, unsigned char cmd_index) { - - struct rig_state *rig_s; - struct ft817_priv_data *p; - unsigned char *cmd; /* points to sequence to send */ +static int ft817_send_cmd(RIG *rig, int index) +{ + struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; - if (!rig) return -RIG_EINVAL; + if (p->pcs[index].ncomp == 0) { + rig_debug(RIG_DEBUG_VERBOSE, "ft817: Incomplete sequence\n"); + return -RIG_EINTERNAL; + } - p = (struct ft817_priv_data*)rig->state.priv; - rig_s = &rig->state; - - if (! p->pcs[cmd_index].ncomp) { - rig_debug(RIG_DEBUG_VERBOSE,"ft817: Attempt to send incomplete sequence \n"); - return -RIG_EINVAL; - } - - cmd = (unsigned char *) p->pcs[cmd_index].nseq; /* get native sequence */ - write_block(&rig_s->rigport, cmd, YAESU_CMD_LENGTH); - - return RIG_OK; + write_block(&rig->state.rigport, p->pcs[index].nseq, YAESU_CMD_LENGTH); + return ft817_read_ack(rig); } - -int ft817_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { - struct rig_state *rig_s; - struct ft817_priv_data *p; - unsigned char *cmd; /* points to sequence to send */ - unsigned char cmd_index; /* index of sequence to send */ - - if (!rig) return -RIG_EINVAL; - - p = (struct ft817_priv_data*)rig->state.priv; - - rig_s = &rig->state; - - rig_debug(RIG_DEBUG_VERBOSE,"ft817: requested freq = %"PRIfreq" Hz \n", freq); - rig_debug(RIG_DEBUG_VERBOSE,"ft817: vfo =%i \n", vfo); - - if( ( vfo != RIG_VFO_CURR ) && - ( ft817_set_vfo( rig, vfo ) != RIG_OK ) ) return -RIG_ERJCTED; +/* + * The same for incomplete commands. + */ +static int ft817_send_icmd(RIG *rig, int index, unsigned char *data) +{ + struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; + unsigned char cmd[YAESU_CMD_LENGTH]; - switch( vfo ) { - case RIG_VFO_CURR: - case RIG_VFO_A: - case RIG_VFO_B: - cmd_index = FT817_NATIVE_CAT_SET_FREQ; - break; - default: - rig_debug(RIG_DEBUG_VERBOSE,"ft817: Unknown VFO \n"); - return -RIG_EINVAL; - } + if (p->pcs[index].ncomp == 1) { + rig_debug(RIG_DEBUG_VERBOSE, "ft817: Complete sequence\n"); + return -RIG_EINTERNAL; + } - memcpy(p->p_cmd,&ncmd[cmd_index].nseq,YAESU_CMD_LENGTH); + cmd[YAESU_CMD_LENGTH - 1] = p->pcs[index].nseq[YAESU_CMD_LENGTH - 1]; + memcpy(cmd, data, YAESU_CMD_LENGTH - 1); - to_bcd_be(p->p_cmd,freq/10,8); /* store bcd format in in p_cmd */ - /* TODO -- fix 10Hz resolution -- FS */ - - rig_debug(RIG_DEBUG_VERBOSE,"ft817: requested freq after conversion = %"PRIll" Hz \n", from_bcd_be(p->p_cmd,8)* 10 ); - - cmd = p->p_cmd; /* get native sequence */ - write_block(&rig_s->rigport, cmd, YAESU_CMD_LENGTH); - - return RIG_OK; + write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH); + return ft817_read_ack(rig); } -int ft817_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { +/* ---------------------------------------------------------------------- */ - int n = 0; - unsigned char data[ YAESU_CMD_LENGTH ]; +int ft817_set_freq(RIG *rig, vfo_t vfo, freq_t freq) +{ + unsigned char data[YAESU_CMD_LENGTH - 1]; - if( !rig ) return -RIG_EINVAL; - if( !freq ) return -RIG_EINVAL; + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; - serial_flush( &rig->state.rigport ); + rig_debug(RIG_DEBUG_VERBOSE,"ft817: requested freq = %"PRIfreq" Hz\n", freq); - ft817_send_priv_cmd( rig, FT817_NATIVE_CAT_GET_FREQ_MODE_STATUS ); + /* fill in the frequency */ + to_bcd_be(data, (freq + 5) / 10, 8); - n = read_block( &rig->state.rigport, data, YAESU_CMD_LENGTH ); + return ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_FREQ, data); +} - if( n == YAESU_CMD_LENGTH ) { -// printf( "[%.2x %.2x %.2x %.2x]", data[0], data[1], data[2], data[3] ); - *freq = MHz( 100*((data[0] & 0xf0) >> 4) ) + - MHz( 10*( data[0] & 0x0f) ) + - MHz( ((data[1] & 0xf0) >> 4) ) + - kHz( 100*( data[1] & 0x0f) ) + - kHz( 10*((data[2] & 0xf0) >> 4) ) + - kHz( ( data[2] & 0x0f) ) + - 100*((data[3] & 0xf0) >> 4) + - 10*( data[3] & 0x0f); +int ft817_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) +{ + int index; /* index of sequence to send */ - return RIG_OK; - } + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; - return -RIG_EIO; + rig_debug(RIG_DEBUG_VERBOSE,"ft817: generic mode = %x \n", mode); + + switch(mode) { + + case RIG_MODE_AM: + index = FT817_NATIVE_CAT_SET_MODE_AM; + break; + + case RIG_MODE_CW: + index = FT817_NATIVE_CAT_SET_MODE_CW; + break; + + case RIG_MODE_USB: + index = FT817_NATIVE_CAT_SET_MODE_USB; + break; + + case RIG_MODE_LSB: + index = FT817_NATIVE_CAT_SET_MODE_LSB; + break; + + case RIG_MODE_RTTY: + index = FT817_NATIVE_CAT_SET_MODE_DIG; + break; + + case RIG_MODE_FM: + index = FT817_NATIVE_CAT_SET_MODE_FM; + break; + + case RIG_MODE_WFM: + /* can not be set, it is implicit when changing band */ +// index = FT817_NATIVE_CAT_SET_MODE_FM; + return -RIG_EINVAL; + break; + + case RIG_MODE_CWR: + index = FT817_NATIVE_CAT_SET_MODE_CWR; + break; + + case RIG_MODE_PKTFM: + index = FT817_NATIVE_CAT_SET_MODE_PKT; + break; + + default: + return -RIG_EINVAL; + } + + /* just ignore passband */ +/* if (width != RIG_PASSBAND_NORMAL) */ +/* return -RIG_EINVAL; */ + + return ft817_send_cmd(rig, index); +} + +int ft817_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) +{ + int index, n; + + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + rig_debug(RIG_DEBUG_VERBOSE, "ft817: ft817_set_ptt called\n"); + + switch(ptt) { + case RIG_PTT_ON: + index = FT817_NATIVE_CAT_PTT_ON; + break; + case RIG_PTT_OFF: + index = FT817_NATIVE_CAT_PTT_OFF; + break; + default: + return -RIG_EINVAL; + } + + n = ft817_send_cmd(rig, index); + + if (n < 0 && n != -RIG_ERJCTED) + return n; + + return RIG_OK; +} + +int ft817_set_func (RIG *rig, vfo_t vfo, setting_t func, int status) +{ + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + switch (func) { + case RIG_FUNC_LOCK: + if (status) + return ft817_send_cmd (rig, FT817_NATIVE_CAT_LOCK_ON); + else + return ft817_send_cmd (rig, FT817_NATIVE_CAT_LOCK_OFF); + + case RIG_FUNC_TONE: + if (status) + return ft817_send_cmd (rig, FT817_NATIVE_CAT_SET_CTCSS_ENC_ON); + else + return ft817_send_cmd (rig, FT817_NATIVE_CAT_SET_CTCSS_DCS_OFF); + + case RIG_FUNC_TSQL: + if (status) + return ft817_send_cmd (rig, FT817_NATIVE_CAT_SET_CTCSS_ON); + else + return ft817_send_cmd (rig, FT817_NATIVE_CAT_SET_CTCSS_DCS_OFF); + + default: + return -RIG_EINVAL; + } +} + +int ft817_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code) +{ + unsigned char data[YAESU_CMD_LENGTH - 1]; +/* int n; */ + + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + rig_debug(RIG_DEBUG_VERBOSE, "ft817: set DCS code (%d)\n", code); + + if (code == 0) + return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_CTCSS_DCS_OFF); + + /* fill in the DCS code - the rig doesn't support separate codes... */ + to_bcd_be(data, code, 4); + to_bcd_be(data + 2, code, 4); + + + /* FT-817 does not have the DCS_ENC_ON command, so we just set the tone here */ + +/* if ((n = ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_DCS_CODE, data)) < 0) */ +/* return n; */ + +/* return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_DCS_ENC_ON); */ + + return ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_DCS_CODE, data); +} + +int ft817_set_dcs_sql (RIG *rig, vfo_t vfo, tone_t code) +{ + unsigned char data[YAESU_CMD_LENGTH - 1]; + int n; + + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + rig_debug(RIG_DEBUG_VERBOSE, "ft817: set DCS sql (%d)\n", code); + + if (code == 0) + return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_CTCSS_DCS_OFF); + + /* fill in the DCS code - the rig doesn't support separate codes... */ + to_bcd_be(data, code, 4); + to_bcd_be(data + 2, code, 4); + + if ((n = ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_DCS_CODE, data)) < 0) + return n; + + return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_DCS_ON); } -int ft817_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { - unsigned char cmd_index; /* index of sequence to send */ +int ft817_set_ctcss_tone (RIG *rig, vfo_t vfo, tone_t tone) +{ + unsigned char data[YAESU_CMD_LENGTH - 1]; + int n; - rig_debug(RIG_DEBUG_VERBOSE,"ft817: generic mode = %x \n", mode); + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; - switch(mode) { - case RIG_MODE_AM: - cmd_index = FT817_NATIVE_CAT_SET_MODE_AM; - break; - case RIG_MODE_CW: - cmd_index = FT817_NATIVE_CAT_SET_MODE_CW; - break; - case RIG_MODE_USB: - cmd_index = FT817_NATIVE_CAT_SET_MODE_USB; - break; - case RIG_MODE_LSB: - cmd_index = FT817_NATIVE_CAT_SET_MODE_LSB; - break; - case RIG_MODE_FM: - cmd_index = FT817_NATIVE_CAT_SET_MODE_FM; - break; - case RIG_MODE_RTTY: - cmd_index = FT817_NATIVE_CAT_SET_MODE_DIG; - break; - default: - return -RIG_EINVAL; - } + rig_debug(RIG_DEBUG_VERBOSE, "ft817: set CTCSS tone (%.1f)\n", tone / 10.0); - switch(width) { - case RIG_PASSBAND_NORMAL: - return ft817_send_priv_cmd(rig,cmd_index); - default: - return -RIG_EINVAL; - } + if (tone == 0) + return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_CTCSS_DCS_OFF); - return ft817_send_priv_cmd(rig,cmd_index); -} + /* fill in the CTCSS freq - the rig doesn't support separate tones... */ + to_bcd_be(data, tone, 4); + to_bcd_be(data + 2, tone, 4); -int ft817_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { + if ((n = ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_CTCSS_FREQ, data)) < 0) + return n; - int n = 0; - unsigned char data[ YAESU_CMD_LENGTH ]; - - if( !rig ) return -RIG_EINVAL; - if( !mode ) return -RIG_EINVAL; - if( !width ) return -RIG_EINVAL; - - serial_flush( &rig->state.rigport ); - ft817_send_priv_cmd( rig, FT817_NATIVE_CAT_GET_FREQ_MODE_STATUS ); - n = read_block( &rig->state.rigport, data, YAESU_CMD_LENGTH ); - if( n == YAESU_CMD_LENGTH ) { - - switch( data[4] ) { - case 0x00: - *mode = RIG_MODE_LSB; - break; - case 0x01: - *mode = RIG_MODE_USB; - break; - case 0x02: - *mode = RIG_MODE_CW; - break; - case 0x03: - *mode = RIG_MODE_CW; /* better suggestion? */ - break; - case 0x04: - *mode = RIG_MODE_AM; - break; - case 0x08: - *mode = RIG_MODE_FM; - break; - case 0x0a: - *mode = RIG_MODE_RTTY; - break; - default: - *mode = RIG_MODE_NONE; - }; - - *width = RIG_PASSBAND_NORMAL; /* TODO: be a bit more creative? */ - return RIG_OK; - } - - return -RIG_EIO; -} - -int ft817_set_vfo(RIG *rig, vfo_t vfo) { - - struct ft817_priv_data *p = (struct ft817_priv_data*)rig->state.priv; - - if (!rig) return -RIG_EINVAL; - - switch(vfo) { - case RIG_VFO_A: - case RIG_VFO_B: - if( p->current_vfo != vfo ) { - if( ft817_send_priv_cmd( rig, FT817_NATIVE_CAT_SET_VFOAB ) == RIG_OK ) { - p->current_vfo = vfo; - } else { - return -RIG_ERJCTED; - } - } - break; - default: - return -RIG_EINVAL; - } - - return RIG_OK; + return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_CTCSS_ENC_ON); } -int ft817_get_vfo(RIG *rig, vfo_t *vfo) { +int ft817_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) +{ + unsigned char data[YAESU_CMD_LENGTH - 1]; + int n; - if( !rig ) return -RIG_EINVAL; - if( !vfo ) return -RIG_EINVAL; - - /* No cmd to get vfo, return last-known value */ - *vfo = ((struct ft817_priv_data*)rig->state.priv)->current_vfo; + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; - return RIG_OK; + rig_debug(RIG_DEBUG_VERBOSE, "ft817: set CTCSS sql (%.1f)\n", tone / 10.0); + + if (tone == 0) + return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_CTCSS_DCS_OFF); + + /* fill in the CTCSS freq - the rig doesn't support separate tones... */ + to_bcd_be(data, tone, 4); + to_bcd_be(data + 2, tone, 4); + + if ((n = ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_CTCSS_FREQ, data)) < 0) + return n; + + return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_CTCSS_ON); +} + +int ft817_set_rptr_shift (RIG *rig, vfo_t vfo, rptr_shift_t shift) +{ + /* Note: this doesn't have effect unless FT817 is in FM mode + although the command is accepted in any mode. + */ + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + rig_debug(RIG_DEBUG_VERBOSE, "ft817: set repeter shift = %i\n", shift); + + switch (shift) { + + case RIG_RPT_SHIFT_NONE: + return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX); + + case RIG_RPT_SHIFT_MINUS: + return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_RPT_SHIFT_MINUS); + + case RIG_RPT_SHIFT_PLUS: + return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_RPT_SHIFT_PLUS); + + } + + return -RIG_EINVAL; +} + +int ft817_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) +{ + unsigned char data[YAESU_CMD_LENGTH - 1]; + + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + rig_debug(RIG_DEBUG_VERBOSE, "ft817: set repeter offs = %li\n", offs); + + /* fill in the offset freq */ + to_bcd_be(data, offs / 10, 8); + + return ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_RPT_OFFSET, data); +} + +int ft817_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) +{ + unsigned char data[YAESU_CMD_LENGTH - 1]; + int n; + + if (vfo != RIG_VFO_CURR) + return -RIG_ENTARGET; + + rig_debug(RIG_DEBUG_VERBOSE, "ft817: set rit = %li)\n", rit); + + /* fill in the RIT freq */ + data[0] = (rit < 0) ? 255 : 0; + data[1] = 0; + to_bcd_be(data + 2, labs(rit) / 10, 4); + + if ((n = ft817_send_icmd(rig, FT817_NATIVE_CAT_SET_CLAR_FREQ, data)) < 0) + return n; + + /* the rig rejects if these are repeated - don't confuse user with retcode */ + if (rit == 0) + ft817_send_cmd(rig, FT817_NATIVE_CAT_CLAR_OFF); + else + ft817_send_cmd(rig, FT817_NATIVE_CAT_CLAR_ON); + + return RIG_OK; } -/* TODO: consider the value of vfo */ -int ft817_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { +int ft817_set_powerstat(RIG *rig, powerstat_t status) +{ + switch (status) { + case RIG_POWER_OFF: + return ft817_send_cmd(rig, FT817_NATIVE_CAT_PWR_OFF); + case RIG_POWER_ON: + return ft817_send_cmd(rig, FT817_NATIVE_CAT_PWR_ON); + case RIG_POWER_STANDBY: + default: + return -RIG_EINVAL; + } +} - unsigned char cmd_index; +int ft817_vfo_op (RIG *rig, vfo_t vfo, vfo_op_t op) +{ + switch (op) { - rig_debug(RIG_DEBUG_VERBOSE,"ft817:ft817_set_ptt called \n"); + case RIG_OP_TOGGLE: + return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_VFOAB); - switch(ptt) { - case RIG_PTT_ON: - cmd_index = FT817_NATIVE_CAT_PTT_ON; - break; - case RIG_PTT_OFF: - cmd_index = FT817_NATIVE_CAT_PTT_OFF; - break; - default: - return -RIG_EINVAL; - } - - ft817_send_priv_cmd(rig,cmd_index); - - return RIG_OK; + default: + return -RIG_EINVAL; + } } -#if 0 -/* TODO: all of this */ -int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { - return -RIG_ENIMPL; +/* FIXME: this function silently ignores the vfo args and just turns + split ON or OFF. +*/ +int ft817_set_split_vfo (RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) +{ + int index, n; + +/* if (vfo != RIG_VFO_CURR) */ +/* return -RIG_ENTARGET; */ + + rig_debug(RIG_DEBUG_VERBOSE, "ft817: ft817_set_split_vfo called\n"); + + switch (split) { + + case RIG_SPLIT_ON: + index = FT817_NATIVE_CAT_SPLIT_ON; + break; + + case RIG_SPLIT_OFF: + index = FT817_NATIVE_CAT_SPLIT_OFF; + break; + + default: + return -RIG_EINVAL; + } + + n = ft817_send_cmd (rig, index); + + if (n < 0 && n != -RIG_ERJCTED) + return n; + + return RIG_OK; + } -/* TODO: all of this */ -int ft817_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { - return -RIG_ENIMPL; -} - - -/* TODO: all of this */ -int ft817_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { - - if( !rig ) return -RIG_EINVAL; - if( !val ) return -RIG_EINVAL; - - switch( level ) { - - case RIG_LEVEL_STRENGTH: - break; - case RIG_LEVEL_RFPOWER: - break; - default: - return -RIG_EINVAL; - } - - return -RIG_ENIMPL; -} - - -int ft817_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { - return -RIG_ENIMPL; -} - - -int ft817_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) { - return -RIG_ENIMPL; -} - - -int ft817_set_parm(RIG *rig, setting_t parm, value_t val) { - return -RIG_ENIMPL; -} - - -int ft817_get_parm(RIG *rig, setting_t parm, value_t *val) { - return -RIG_ENIMPL; -} -#endif +/* ---------------------------------------------------------------------- */ diff --git a/yaesu/ft817.h b/yaesu/ft817.h index e5be017bb..a222143dd 100644 --- a/yaesu/ft817.h +++ b/yaesu/ft817.h @@ -6,8 +6,12 @@ * via serial interface to an FT-817 using the "CAT" interface. * The starting point for this code was Frank's ft847 implementation. * + * Then, Tommi OH2BNS improved the code a lot in the framework of the + * FT-857 backend. These improvements have now (August 2005) been + * copied back and adopted for the FT-817. * - * $Id: ft817.h,v 1.4 2005-04-03 19:27:59 fillods Exp $ + * + * $Id: ft817.h,v 1.5 2005-09-04 10:44:23 csete Exp $ * * * This library is free software; you can redistribute it and/or @@ -29,50 +33,83 @@ #ifndef _FT817_H #define _FT817_H 1 -#define FT817_WRITE_DELAY 0 -#define FT817_POST_WRITE_DELAY 300 -#define FT817_DEFAULT_READ_TIMEOUT 2000 +/* + * No need to wait between written characters. + */ +#define FT817_WRITE_DELAY 0 + +/* + * Wait 'delay' milliseconds after writing a command sequence. + * + * Setting this to zero means no delay but wait for an acknowledgement + * from the rig after a command. This is undocumented but seems to work. + * It's also the most optimal way as long as it works... + * + * A non-zero value disables waiting for the ack. Processing a command + * seems to take about 60 ms so set this to 80 or so to be safe. + */ +#define FT817_POST_WRITE_DELAY 0 + +/* + * Read timeout. + */ +#define FT817_TIMEOUT 200 + +/* + * The time the TX, RX and FREQ/MODE status are cached (in millisec). + * This optimises the common case of doing eg. rig_get_freq() and + * rig_get_mode() in a row. + * + * The timeout is deliberately set lower than the time taken to process + * a single command (~ 60 ms) so that a sequence + * + * rig_get_freq(); + * rig_set_freq(); + * rig_get_freq(); + * + * doesn't return a bogus (cached) value in the last rig_get_freq(). + */ +#define FT817_CACHE_TIMEOUT 50 + enum ft817_native_cmd_e { - - FT817_NATIVE_CAT_LOCK_ON = 0, - FT817_NATIVE_CAT_LOCK_OFF, - FT817_NATIVE_CAT_PTT_ON, - FT817_NATIVE_CAT_PTT_OFF, - FT817_NATIVE_CAT_SET_FREQ, - FT817_NATIVE_CAT_SET_MODE_LSB, - FT817_NATIVE_CAT_SET_MODE_USB, - FT817_NATIVE_CAT_SET_MODE_CW, - FT817_NATIVE_CAT_SET_MODE_CWR, - FT817_NATIVE_CAT_SET_MODE_AM, - FT817_NATIVE_CAT_SET_MODE_FM, - FT817_NATIVE_CAT_SET_MODE_DIG, - FT817_NATIVE_CAT_SET_MODE_PKT, - FT817_NATIVE_CAT_CLAR_ON, - FT817_NATIVE_CAT_CLAR_OFF, - FT817_NATIVE_CAT_SET_CLAR_FREQ, - FT817_NATIVE_CAT_SET_VFOAB, - FT817_NATIVE_CAT_SPLIT_ON, - FT817_NATIVE_CAT_SPLIT_OFF, - FT817_NATIVE_CAT_SET_RPT_SHIFT_MINUS, - FT817_NATIVE_CAT_SET_RPT_SHIFT_PLUS, - FT817_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX, - FT817_NATIVE_CAT_SET_RPT_OFFSET, -/* fix me */ - FT817_NATIVE_CAT_SET_DCS_ON, - FT817_NATIVE_CAT_SET_CTCSS_ENC_ON, - FT817_NATIVE_CAT_SET_CTCSS_ENC_DEC_ON, - FT817_NATIVE_CAT_SET_CTCSS_DCS_OFF, -/* em xif */ - FT817_NATIVE_CAT_SET_CTCSS_FREQ, - FT817_NATIVE_CAT_SET_DCS_CODE, - FT817_NATIVE_CAT_GET_RX_STATUS, - FT817_NATIVE_CAT_GET_TX_STATUS, - FT817_NATIVE_CAT_GET_FREQ_MODE_STATUS, - FT817_NATIVE_CAT_PWR_WAKE, - FT817_NATIVE_CAT_PWR_ON, - FT817_NATIVE_CAT_PWR_OFF, - FT817_NATIVE_SIZE /* end marker */ + FT817_NATIVE_CAT_LOCK_ON = 0, + FT817_NATIVE_CAT_LOCK_OFF, + FT817_NATIVE_CAT_PTT_ON, + FT817_NATIVE_CAT_PTT_OFF, + FT817_NATIVE_CAT_SET_FREQ, + FT817_NATIVE_CAT_SET_MODE_LSB, + FT817_NATIVE_CAT_SET_MODE_USB, + FT817_NATIVE_CAT_SET_MODE_CW, + FT817_NATIVE_CAT_SET_MODE_CWR, + FT817_NATIVE_CAT_SET_MODE_AM, + FT817_NATIVE_CAT_SET_MODE_FM, + FT817_NATIVE_CAT_SET_MODE_FM_N, + FT817_NATIVE_CAT_SET_MODE_DIG, + FT817_NATIVE_CAT_SET_MODE_PKT, + FT817_NATIVE_CAT_CLAR_ON, + FT817_NATIVE_CAT_CLAR_OFF, + FT817_NATIVE_CAT_SET_CLAR_FREQ, + FT817_NATIVE_CAT_SET_VFOAB, + FT817_NATIVE_CAT_SPLIT_ON, + FT817_NATIVE_CAT_SPLIT_OFF, + FT817_NATIVE_CAT_SET_RPT_SHIFT_MINUS, + FT817_NATIVE_CAT_SET_RPT_SHIFT_PLUS, + FT817_NATIVE_CAT_SET_RPT_SHIFT_SIMPLEX, + FT817_NATIVE_CAT_SET_RPT_OFFSET, + FT817_NATIVE_CAT_SET_DCS_ON, + FT817_NATIVE_CAT_SET_CTCSS_ON, + FT817_NATIVE_CAT_SET_CTCSS_ENC_ON, + FT817_NATIVE_CAT_SET_CTCSS_DCS_OFF, + FT817_NATIVE_CAT_SET_CTCSS_FREQ, + FT817_NATIVE_CAT_SET_DCS_CODE, + FT817_NATIVE_CAT_GET_RX_STATUS, + FT817_NATIVE_CAT_GET_TX_STATUS, + FT817_NATIVE_CAT_GET_FREQ_MODE_STATUS, + FT817_NATIVE_CAT_PWR_WAKE, + FT817_NATIVE_CAT_PWR_ON, + FT817_NATIVE_CAT_PWR_OFF, + FT817_NATIVE_SIZE /* end marker */ }; @@ -80,35 +117,45 @@ typedef enum ft817_native_cmd_e ft817_native_cmd_t; struct ft817_priv_data { - unsigned char current_vfo; - unsigned char p_cmd[YAESU_CMD_LENGTH]; - yaesu_cmd_set_t pcs[FT817_NATIVE_SIZE]; /* TODO: why? */ - unsigned char rx_status; - unsigned char tx_status; - unsigned char freq_mode_status; + yaesu_cmd_set_t pcs[FT817_NATIVE_SIZE]; /* TODO: why? */ + + /* rx status */ + struct timeval rx_status_tv; + unsigned char rx_status; + + /* tx status */ + struct timeval tx_status_tv; + unsigned char tx_status; + + /* freq & mode status */ + struct timeval fm_status_tv; + unsigned char fm_status[YAESU_CMD_LENGTH]; }; - -static int ft817_init(RIG *rig); -static int ft817_open(RIG *rig); -static int ft817_cleanup(RIG *rig); -static int ft817_close(RIG *rig); -static int ft817_set_freq(RIG *rig, vfo_t vfo, freq_t freq); -static int ft817_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); -static int ft817_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); -static int ft817_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); -static int ft817_set_vfo(RIG *rig, vfo_t vfo); -static int ft817_get_vfo(RIG *rig, vfo_t *vfo); -static int ft817_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); -#if 0 -static int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); -static int ft817_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); -static int ft817_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); -static int ft817_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); -static int ft817_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status); -static int ft817_set_parm(RIG *rig, setting_t parm, value_t val); -static int ft817_get_parm(RIG *rig, setting_t parm, value_t *val); -#endif +/* fixme: why declare static? it has no effect */ +static int ft817_init (RIG *rig); +static int ft817_open (RIG *rig); +static int ft817_cleanup (RIG *rig); +static int ft817_close (RIG *rig); +static int ft817_set_freq (RIG *rig, vfo_t vfo, freq_t freq); +static int ft817_get_freq (RIG *rig, vfo_t vfo, freq_t *freq); +static int ft817_set_mode (RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); +static int ft817_get_mode (RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); +static int ft817_set_ptt (RIG *rig, vfo_t vfo, ptt_t ptt); +static int ft817_get_ptt (RIG *rig, vfo_t vfo, ptt_t *ptt); +static int ft817_get_level (RIG *rig, vfo_t vfo, setting_t level, value_t *val); +static int ft817_set_func (RIG *rig, vfo_t vfo, setting_t func, int status); +static int ft817_set_dcs_code (RIG *rig, vfo_t vfo, tone_t code); +static int ft817_set_ctcss_tone (RIG *rig, vfo_t vfo, tone_t code); +static int ft817_set_dcs_sql (RIG *rig, vfo_t vfo, tone_t code); +static int ft817_set_ctcss_sql (RIG *rig, vfo_t vfo, tone_t tone); +static int ft817_set_rptr_shift (RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift); +static int ft817_set_rptr_offs (RIG *rig, vfo_t vfo, shortfreq_t offs); +static int ft817_set_rit (RIG *rig, vfo_t vfo, shortfreq_t rit); +static int ft817_get_dcd (RIG *rig, vfo_t vfo, dcd_t *dcd); +static int ft817_set_powerstat (RIG *rig, powerstat_t status); +static int ft817_vfo_op (RIG *rig, vfo_t vfo, vfo_op_t op); +static int ft817_set_split_vfo (RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo); #endif /* _FT817_H */ @@ -118,5 +165,3 @@ static int ft817_get_parm(RIG *rig, setting_t parm, value_t *val); - -