mirror of
https://github.com/Hamlib/Hamlib.git
synced 2024-09-21 18:37:18 +00:00
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
This commit is contained in:
parent
15acf131b2
commit
04aaca80c6
1054
yaesu/ft817.c
1054
yaesu/ft817.c
File diff suppressed because it is too large
Load Diff
@ -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,12 +33,46 @@
|
||||
#ifndef _FT817_H
|
||||
#define _FT817_H 1
|
||||
|
||||
/*
|
||||
* No need to wait between written characters.
|
||||
*/
|
||||
#define FT817_WRITE_DELAY 0
|
||||
#define FT817_POST_WRITE_DELAY 300
|
||||
#define FT817_DEFAULT_READ_TIMEOUT 2000
|
||||
|
||||
/*
|
||||
* 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,
|
||||
@ -46,6 +84,7 @@ enum ft817_native_cmd_e {
|
||||
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,
|
||||
@ -58,12 +97,10 @@ enum ft817_native_cmd_e {
|
||||
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_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,
|
||||
@ -80,15 +117,22 @@ 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? */
|
||||
|
||||
/* rx status */
|
||||
struct timeval rx_status_tv;
|
||||
unsigned char rx_status;
|
||||
|
||||
/* tx status */
|
||||
struct timeval tx_status_tv;
|
||||
unsigned char tx_status;
|
||||
unsigned char freq_mode_status;
|
||||
|
||||
/* freq & mode status */
|
||||
struct timeval fm_status_tv;
|
||||
unsigned char fm_status[YAESU_CMD_LENGTH];
|
||||
};
|
||||
|
||||
|
||||
/* 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);
|
||||
@ -97,18 +141,21 @@ 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
|
||||
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);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user