From c7f8436bdfe5423bb5feaf1446e11c116280abaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Mon, 12 May 2003 22:29:59 +0000 Subject: [PATCH] added initial support for Argonaut V git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1472 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- tentec/Makefile.am | 6 +- tentec/argonaut.c | 160 ++++++++++++++++ tentec/tentec.c | 11 +- tentec/tentec.h | 7 +- tentec/tentec2.c | 466 +++++++++++++++++++++++++++++++++++++++++++++ tentec/tentec2.h | 53 ++++++ 6 files changed, 693 insertions(+), 10 deletions(-) create mode 100644 tentec/argonaut.c create mode 100644 tentec/tentec2.c create mode 100644 tentec/tentec2.h diff --git a/tentec/Makefile.am b/tentec/Makefile.am index f566277ae..f9f590169 100644 --- a/tentec/Makefile.am +++ b/tentec/Makefile.am @@ -1,8 +1,8 @@ -TENTECSRCLIST = rx320.c pegasus.c +TENTECSRCLIST = rx320.c pegasus.c argonaut.c lib_LTLIBRARIES = hamlib-tentec.la -hamlib_tentec_la_SOURCES = $(TENTECSRCLIST) tentec.c +hamlib_tentec_la_SOURCES = $(TENTECSRCLIST) tentec.c tentec2.c hamlib_tentec_la_LDFLAGS = -no-undefined -module -avoid-version hamlib_tentec_la_LIBADD = $(top_builddir)/src/libhamlib.la -noinst_HEADERS = tentec.h +noinst_HEADERS = tentec.h tentec2.h diff --git a/tentec/argonaut.c b/tentec/argonaut.c new file mode 100644 index 000000000..8a77ec92e --- /dev/null +++ b/tentec/argonaut.c @@ -0,0 +1,160 @@ +/* + * Hamlib TenTenc backend - TT-516 PC-Radio description + * Copyright (c) 2003 by Stephane Fillod + * + * $Id: argonaut.c,v 1.1 2003-05-12 22:29:59 fillods Exp $ + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include "tentec2.h" +#include "bandplan.h" + + +#define TT516_MODES (RIG_MODE_FM|RIG_MODE_CW|RIG_MODE_SSB) +#define TT516_RXMODES (TT516_MODES|RIG_MODE_AM) + +#define TT516_FUNCS (RIG_FUNC_NONE) + +#define TT516_LEVELS (RIG_LEVEL_STRENGTH|/* RIG_LEVEL_NB| */ \ + RIG_LEVEL_SQL|/*RIG_LEVEL_PBT|*/ \ + RIG_LEVEL_RFPOWER|RIG_LEVEL_KEYSPD| \ + RIG_LEVEL_SWR|RIG_LEVEL_ATT) + +#define TT516_ANTS 0 + +#define TT516_VFO (RIG_VFO_A|RIG_VFO_B) + + +/* + * tt516 receiver capabilities. + * + * protocol is documented at + * http://www.rfsquared.com/ + * + */ +const struct rig_caps tt516_caps = { +.rig_model = RIG_MODEL_TT516, +.model_name = "TT-516 Argonaut V", +.mfg_name = "Ten-Tec", +.version = "0.1", +.copyright = "LGPL", +.status = RIG_STATUS_UNTESTED, +.rig_type = RIG_TYPE_TRANSCEIVER, +.ptt_type = RIG_PTT_NONE, +.dcd_type = RIG_DCD_NONE, +.port_type = RIG_PORT_SERIAL, +.serial_rate_min = 1200, +.serial_rate_max = 1200, +.serial_data_bits = 8, +.serial_stop_bits = 1, +.serial_parity = RIG_PARITY_NONE, +.serial_handshake = RIG_HANDSHAKE_NONE, +.write_delay = 0, +.post_write_delay = 0, +.timeout = 400, +.retry = 3, + +.has_get_func = TT516_FUNCS, +.has_set_func = TT516_FUNCS, +.has_get_level = TT516_LEVELS, +.has_set_level = RIG_LEVEL_SET(TT516_LEVELS), +.has_get_parm = RIG_PARM_NONE, +.has_set_parm = RIG_PARM_NONE, +.level_gran = {}, /* FIXME: granularity */ +.parm_gran = {}, +.ctcss_list = NULL, +.dcs_list = NULL, +.preamp = { RIG_DBLST_END }, +.attenuator = { 15, RIG_DBLST_END }, +.max_rit = Hz(0), +.max_xit = Hz(0), +.max_ifshift = Hz(0), +.targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, +.transceive = RIG_TRN_OFF, +.bank_qty = 0, +.chan_desc_sz = 0, + +.chan_list = { + { 1, 100, RIG_MTYPE_MEM, TT_MEM_CAP }, + }, + +.rx_range_list1 = { + {kHz(500),MHz(30),TT516_RXMODES,-1,-1,TT516_VFO}, + RIG_FRNG_END, + }, +.tx_range_list1 = { + FRQ_RNG_HF(1,TT516_MODES, W(1),W(20),TT516_VFO,TT516_ANTS), + FRQ_RNG_HF(1,RIG_MODE_AM, W(1),W(5),TT516_VFO,TT516_ANTS), + RIG_FRNG_END, + }, + +.rx_range_list2 = { + {kHz(500),MHz(30),TT516_RXMODES,-1,-1,TT516_VFO}, + RIG_FRNG_END, + }, +.tx_range_list2 = { + FRQ_RNG_HF(2,TT516_MODES, W(1),W(20),TT516_VFO,TT516_ANTS), + FRQ_RNG_HF(2,RIG_MODE_AM, W(1),W(5),TT516_VFO,TT516_ANTS), + RIG_FRNG_END, + }, + +.tuning_steps = { + {RIG_MODE_SSB|RIG_MODE_CW,10}, + /* {RIG_MODE_SSB|RIG_MODE_CW,kHz(1)}, */ + {RIG_MODE_AM,100}, + /* {RIG_MODE_AM,kHz(5)}, */ + {RIG_MODE_FM,kHz(2.5)}, + /* {RIG_MODE_FM,kHz(5)}, */ + RIG_TS_END, + }, + /* mode/filter list, remember: order matters! */ +.filters = { + /* FIXME: add increments -> 34 filters? */ + {RIG_MODE_CW|RIG_MODE_SSB, kHz(2.8)}, + {RIG_MODE_CW|RIG_MODE_SSB, 200}, + {RIG_MODE_CW|RIG_MODE_SSB, 0}, /* Filters are 200 Hz to 1000 Hz in 50 Hz steps, 1000 to 2800 Hz in 100 Hz steps */ + {RIG_MODE_AM, kHz(4)}, + {RIG_MODE_AM, kHz(6)}, + {RIG_MODE_FM, kHz(15)}, + RIG_FLT_END, + }, +.priv = (void*)NULL, + +.set_freq = tentec2_set_freq, +.get_freq = tentec2_get_freq, +.set_vfo = tentec2_set_vfo, +.get_vfo = tentec2_get_vfo, +.set_mode = tentec2_set_mode, +.get_mode = tentec2_get_mode, +.set_split_vfo = tentec2_set_split_vfo, +.get_split_vfo = tentec2_get_split_vfo, +.set_ptt = tentec2_set_ptt, +.reset = tentec2_reset, +.get_info = tentec2_get_info, + +}; + +/* + * Function definitions below + */ + + diff --git a/tentec/tentec.c b/tentec/tentec.c index 0331585f0..d78dba92a 100644 --- a/tentec/tentec.c +++ b/tentec/tentec.c @@ -2,7 +2,7 @@ * Hamlib Tentec backend - main file * Copyright (c) 2001-2003 by Stephane Fillod * - * $Id: tentec.c,v 1.9 2003-05-05 10:46:43 fillods Exp $ + * $Id: tentec.c,v 1.10 2003-05-12 22:29:59 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -447,11 +447,12 @@ const char *tentec_get_info(RIG *rig) */ DECLARE_INITRIG_BACKEND(tentec) { - rig_debug(RIG_DEBUG_VERBOSE, "tentec: _init called\n"); + rig_debug(RIG_DEBUG_VERBOSE, "tentec: _init called\n"); - rig_register(&tt550_caps); - rig_register(&rx320_caps); + rig_register(&tt550_caps); + rig_register(&tt516_caps); + rig_register(&rx320_caps); - return RIG_OK; + return RIG_OK; } diff --git a/tentec/tentec.h b/tentec/tentec.h index f7390a43b..206ba12b8 100644 --- a/tentec/tentec.h +++ b/tentec/tentec.h @@ -2,7 +2,7 @@ * Hamlib Tentec backend - main header * Copyright (c) 2001-2003 by Stephane Fillod * - * $Id: tentec.h,v 1.5 2003-04-16 22:30:43 fillods Exp $ + * $Id: tentec.h,v 1.6 2003-05-12 22:29:59 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -48,6 +48,9 @@ struct tentec_priv_data { cal_table_t str_cal; }; +int tentec_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int *data_len); + +int tentec_init(RIG *rig); int tentec_init(RIG *rig); int tentec_cleanup(RIG *rig); int tentec_trx_open(RIG *rig); @@ -60,8 +63,8 @@ int tentec_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); const char* tentec_get_info(RIG *rig); extern const struct rig_caps rx320_caps; +extern const struct rig_caps tt516_caps; extern const struct rig_caps tt550_caps; #endif /* _TENTEC_H */ - diff --git a/tentec/tentec2.c b/tentec/tentec2.c new file mode 100644 index 000000000..93bf3e76b --- /dev/null +++ b/tentec/tentec2.c @@ -0,0 +1,466 @@ +/* + * Hamlib Tentec backend - Argonaut, Jupiter, RX-350 + * Copyright (c) 2001-2003 by Stephane Fillod + * + * $Id: tentec2.c,v 1.1 2003-05-12 22:29:59 fillods Exp $ + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include /* String function definitions */ +#include /* UNIX standard function definitions */ +#include + +#include "hamlib/rig.h" +#include "serial.h" +#include "misc.h" +#include "cal.h" +#include "register.h" + +#include "tentec.h" +#include "tentec2.h" + +#define EOM "\015" /* CR */ + +#define TT_AM '0' +#define TT_USB '1' +#define TT_LSB '2' +#define TT_CW '3' +#define TT_FM '4' + + + +/************************************************************************************* + * + * Specs from http://www.rfsquared.com + * + * TODO: [sg]et_split + * [sg]et_level: ATT, NB, PBT, KEYER_SPD, RFPOWER, SWR, SQL, STRENGTH, .. + * vfo_op: TO_VFO, FROM_VFO + emulated set_mem/get_mem + */ + + +/* + * tentec_set_freq + * assumes rig!=NULL, rig->state.priv!=NULL + * assumes priv->mode in AM,CW,LSB or USB. + */ +int tentec2_set_freq(RIG *rig, vfo_t vfo, freq_t freq) +{ + struct rig_state *rs = &rig->state; + int freq_len, retval; + unsigned char freqbuf[16]; + int vfo_val; + + /* + * TODO: make use of rig_state.current_vfo + */ + if (vfo == RIG_VFO_CURR) { + retval = tentec2_get_vfo(rig, &vfo); + if (retval != RIG_OK) + return retval; + } + + switch(vfo) { + case RIG_VFO_A: vfo_val = 'A'; break; + case RIG_VFO_B: vfo_val = 'B'; break; + default: + rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", + __FUNCTION__, strvfo(vfo)); + return -RIG_EINVAL; + } + freq_len = sprintf(freqbuf, "*%c%c%c%c%c" EOM, + vfo_val, + (int)(freq >> 24) & 0xff, + (int)(freq >> 16) & 0xff, + (int)(freq >> 8) & 0xff, + (int)(freq & 0xff)); + + retval = write_block(&rs->rigport, freqbuf, freq_len); + if (retval != RIG_OK) + return retval; + + return RIG_OK; +} + +/* + * tentec2_get_freq + * Assumes rig!=NULL, freq!=NULL + */ +int tentec2_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) +{ + int freq_len, retval; + unsigned char freqbuf[16]; + int vfo_val; + + /* + * TODO: make use of rig_state.current_vfo + */ + if (vfo == RIG_VFO_CURR) { + retval = tentec2_get_vfo(rig, &vfo); + if (retval != RIG_OK) + return retval; + } + + switch(vfo) { + case RIG_VFO_A: vfo_val = 'A'; break; + case RIG_VFO_B: vfo_val = 'B'; break; + default: + rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", + __FUNCTION__, strvfo(vfo)); + return -RIG_EINVAL; + } + freq_len = sprintf(freqbuf, "?%c" EOM, vfo_val); + + retval = tentec_transaction (rig, freqbuf, freq_len, freqbuf, &freq_len); + if (retval != RIG_OK) + return retval; + + if (freq_len != 6) + return -RIG_EPROTO; + + *freq = (freqbuf[2] << 24) |(freqbuf[3] << 16) | (freqbuf[4] << 8) | freqbuf[5]; + + return RIG_OK; +} + +/* + * tentec2_set_vfo + * Assumes rig!=NULL + */ +int tentec2_set_vfo(RIG *rig, vfo_t vfo) +{ + struct rig_state *rs = &rig->state; + int vfo_len, retval; + unsigned char vfobuf[16]; + int vfo_val; + + /* + * TODO: make use of rig_state.current_vfo + */ + if ((vfo & ~RIG_VFO_MEM) == RIG_VFO_NONE || vfo == RIG_VFO_VFO) { + vfo_t cvfo; + retval = tentec2_get_vfo(rig, &cvfo); + if (retval != RIG_OK) + return retval; + vfo = (cvfo&(RIG_VFO_A|RIG_VFO_B)) | (vfo & RIG_VFO_MEM); + } + + switch(vfo & ~RIG_VFO_MEM) { + case RIG_VFO_A: vfo_val = 'A'; break; + case RIG_VFO_B: vfo_val = 'B'; break; + default: + rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", + __FUNCTION__, strvfo(vfo)); + return -RIG_EINVAL; + } + vfo_len = sprintf(vfobuf, "*E%c%c" EOM, + vfo_val, + vfo & RIG_VFO_MEM ? 'M' : 'V' + ); + + retval = write_block(&rs->rigport, vfobuf, vfo_len); + if (retval != RIG_OK) + return retval; + + return RIG_OK; +} + +/* + * tentec2_get_vfo + * Assumes rig!=NULL + */ +int tentec2_get_vfo(RIG *rig, vfo_t *vfo) +{ + int vfo_len, retval; + unsigned char vfobuf[16]; + + retval = tentec_transaction (rig, "?E" EOM, 3, vfobuf, &vfo_len); + if (retval != RIG_OK) + return retval; + + if (vfo_len != 4) + return -RIG_EPROTO; + + *vfo = vfobuf[3] == 'A' ? RIG_VFO_A : RIG_VFO_B; + if (vfobuf[2] == 'M') + *vfo |= RIG_VFO_MEM; + + return RIG_OK; +} + + + +/* + * tentec2_set_split_vfo + * Assumes rig!=NULL + */ +int tentec2_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) +{ + struct rig_state *rs = &rig->state; + + /* + * TODO: handle tx_vfo + */ + return write_block(&rs->rigport, split==RIG_SPLIT_ON? "*O\1"EOM:"*O\0"EOM, 4); +} + +/* + * tentec2_get_split_vfo + * Assumes rig!=NULL + */ +int tentec2_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) +{ + int split_len, retval; + unsigned char splitbuf[16]; + + /* + * TODO: handle tx_vfo + */ + retval = tentec_transaction (rig, "?O"EOM, 3, splitbuf, &split_len); + if (retval != RIG_OK) + return retval; + + if (split_len != 3) { + return -RIG_EPROTO; + } + + *split = splitbuf[2] == '\0' ? RIG_SPLIT_OFF : RIG_SPLIT_ON; + + return RIG_OK; +} + + + +/* + * tentec2_set_mode + * Assumes rig!=NULL + */ +int tentec2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) +{ + struct rig_state *rs = &rig->state; + unsigned char ttmode, ttmode_a, ttmode_b; + int mdbuf_len, ttfilter, retval; + unsigned char mdbuf[32]; + + switch (mode) { + case RIG_MODE_USB: ttmode = TT_USB; break; + case RIG_MODE_LSB: ttmode = TT_LSB; break; + case RIG_MODE_CW: ttmode = TT_CW; break; + case RIG_MODE_AM: ttmode = TT_AM; break; + case RIG_MODE_FM: ttmode = TT_FM; break; + default: + rig_debug(RIG_DEBUG_ERR, "%s: unsupported mode %d\n", + __FUNCTION__, mode); + return -RIG_EINVAL; + } + + if (width == RIG_PASSBAND_NORMAL) + width = rig_passband_normal(rig, mode); + + /* + * Filter 0: 200 + * .. + * Filter 16: 1000 + * .. + * Filter 36: 3000 + */ + if (width < 1000) + ttfilter = (width / 50) - 4; + else + ttfilter = (width / 100) + 6; + + retval = tentec_transaction (rig, "?M"EOM, 3, mdbuf, &mdbuf_len); + if (retval != RIG_OK) + return retval; + + if (mdbuf_len != 4) { + /* return -RIG_EPROTO; */ + } + ttmode_a = mdbuf[2]; + ttmode_b = mdbuf[3]; + + /* + * TODO: make use of rig_state.current_vfo + */ + if (vfo == RIG_VFO_CURR) { + retval = tentec2_get_vfo(rig, &vfo); + if (retval != RIG_OK) + return retval; + } + + switch(vfo) { + case RIG_VFO_A: ttmode_a = ttmode; break; + case RIG_VFO_B: ttmode_b = ttmode; break; + default: + rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", + __FUNCTION__, strvfo(vfo)); + return -RIG_EINVAL; + } + + /* + * FIXME: the 'W' command is not VFO targetable + */ + mdbuf_len = sprintf(mdbuf, "*W%c" EOM "*M%c%c" EOM, + ttfilter, + ttmode_a, + ttmode_b + ); + retval = write_block(&rs->rigport, mdbuf, mdbuf_len); + if (retval != RIG_OK) { + return retval; + } + + return RIG_OK; +} + + + +/* + * tentec2_get_mode + * Assumes rig!=NULL, mode!=NULL + */ +int tentec2_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) +{ + unsigned char ttmode; + int mdbuf_len, ttfilter, retval; + unsigned char mdbuf[32]; + + /* + * TODO: make use of rig_state.current_vfo + */ + if (vfo == RIG_VFO_CURR) { + retval = tentec2_get_vfo(rig, &vfo); + if (retval != RIG_OK) + return retval; + } + + retval = tentec_transaction (rig, "?M"EOM, 3, mdbuf, &mdbuf_len); + if (retval != RIG_OK) + return retval; + + if (mdbuf_len != 4) { + /* return -RIG_EPROTO; */ + } + + switch(vfo) { + case RIG_VFO_A: ttmode = mdbuf[2]; break; + case RIG_VFO_B: ttmode = mdbuf[3]; break; + default: + rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", + __FUNCTION__, strvfo(vfo)); + return -RIG_EINVAL; + } + switch (ttmode) { + case TT_USB: *mode = RIG_MODE_USB; break; + case TT_LSB: *mode = RIG_MODE_LSB; break; + case TT_CW: *mode = RIG_MODE_CW; break; + case TT_AM: *mode = RIG_MODE_AM; break; + case TT_FM: *mode = RIG_MODE_FM; break; + default: + rig_debug(RIG_DEBUG_ERR, "%s: unsupported mode '%c'\n", + __FUNCTION__, ttmode); + return -RIG_EPROTO; + } + + retval = tentec_transaction (rig, "?W"EOM, 3, mdbuf, &mdbuf_len); + if (retval != RIG_OK) + return retval; + + if (mdbuf_len != 3) { + /* return -RIG_EPROTO; */ + } + + /* + * Filter 0: 200 + * .. + * Filter 16: 1000 + * .. + * Filter 36: 3000 + */ + ttfilter = mdbuf[2]; + if (ttfilter < 16) + *width = (ttfilter + 4) * 50; + else + *width = (ttfilter - 6) * 100; + + return RIG_OK; +} + + +/* + * tentec2_set_ptt + * Assumes rig!=NULL + */ +int tentec2_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) +{ + struct rig_state *rs = &rig->state; + + return write_block(&rs->rigport, ptt==RIG_PTT_ON? "#1"EOM:"#0"EOM, 3); +} + + +/* + * Software restart + */ +int tentec2_reset(RIG *rig, reset_t reset) +{ + int retval, reset_len; + char reset_buf[32]; + + retval = tentec_transaction (rig, "*X" EOM, 3, reset_buf, &reset_len); + if (retval != RIG_OK) + return retval; + + if (!strstr(reset_buf, "RADIO START")) + return -RIG_EPROTO; + + return RIG_OK; +} + + +/* + * tentec2_get_info + * Assumes rig!=NULL + */ +const char *tentec2_get_info(RIG *rig) +{ + static char buf[100]; /* FIXME: reentrancy */ + int firmware_len, retval; + + /* + * protocol version + */ + firmware_len = 7; + retval = tentec_transaction (rig, "?V" EOM, 3, buf, &firmware_len); + + /* "VER 1010-516" */ + if (retval != RIG_OK || firmware_len != 12) { + rig_debug(RIG_DEBUG_ERR,"%s: ack NG, len=%d\n", + __FUNCTION__, firmware_len); + return NULL; + } + buf[firmware_len] = '\0'; + + return buf; +} + + diff --git a/tentec/tentec2.h b/tentec/tentec2.h new file mode 100644 index 000000000..d6171b298 --- /dev/null +++ b/tentec/tentec2.h @@ -0,0 +1,53 @@ +/* + * Hamlib Tentec backend - Argonaut, Jupiter, RX-350 header + * Copyright (c) 2001-2003 by Stephane Fillod + * + * $Id: tentec2.h,v 1.1 2003-05-12 22:29:59 fillods Exp $ + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#ifndef _TENTEC2_H +#define _TENTEC2_H 1 + +#include + +/* + * Mem caps to be checked.. + */ +#define TT_MEM_CAP { \ + .freq = 1, \ + .mode = 1, \ + .width = 1, \ + .tx_freq = 1, \ + .tx_mode = 1, \ + .tx_width = 1, \ + .split = 1, \ +} + +int tentec2_set_freq(RIG *rig, vfo_t vfo, freq_t freq); +int tentec2_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); +int tentec2_set_vfo(RIG *rig, vfo_t vfo); +int tentec2_get_vfo(RIG *rig, vfo_t *vfo); +int tentec2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); +int tentec2_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); +int tentec2_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo); +int tentec2_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo); +int tentec2_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); +int tentec2_reset(RIG *rig, reset_t reset); +const char* tentec2_get_info(RIG *rig); + +#endif /* _TENTEC2_H */