kopia lustrzana https://github.com/Hamlib/Hamlib
2002-11-03
Update: Miscellaneous formating cleanup. git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1235 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.1.4
rodzic
1083331fce
commit
e10a0458c9
|
@ -12,7 +12,7 @@
|
||||||
* pages 86 to 90
|
* pages 86 to 90
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Id: ft920.c,v 1.4 2002-11-01 04:39:47 n0nb Exp $
|
* $Id: ft920.c,v 1.5 2002-11-04 05:16:19 n0nb Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -29,7 +29,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,11 +54,14 @@
|
||||||
static int ft920_get_update_data(RIG *rig, unsigned char ci, unsigned char rl);
|
static int ft920_get_update_data(RIG *rig, unsigned char ci, unsigned char rl);
|
||||||
static int ft920_send_priv_cmd(RIG *rig, unsigned char ci);
|
static int ft920_send_priv_cmd(RIG *rig, unsigned char ci);
|
||||||
|
|
||||||
/* Native ft920 cmd set prototypes. These are READ ONLY as each */
|
/*
|
||||||
/* rig instance will copy from these and modify if required . */
|
* Native ft920 cmd set prototypes. These are READ ONLY as each
|
||||||
/* Complete sequences (1) can be read and used directly as a cmd sequence . */
|
* rig instance will copy from these and modify if required.
|
||||||
/* Incomplete sequences (0) must be completed with extra parameters */
|
* Complete sequences (1) can be read and used directly as a cmd sequence.
|
||||||
/* eg: mem number, or freq etc.. */
|
* Incomplete sequences (0) must be completed with extra parameters
|
||||||
|
* eg: mem number, or freq etc..
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
static const yaesu_cmd_set_t ncmd[] = {
|
static const yaesu_cmd_set_t ncmd[] = {
|
||||||
{ 1, { 0x00, 0x00, 0x00, 0x00, 0x01 } }, /* split = off */
|
{ 1, { 0x00, 0x00, 0x00, 0x00, 0x01 } }, /* split = off */
|
||||||
|
@ -112,12 +114,10 @@ static const yaesu_cmd_set_t ncmd[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Receiver caps
|
* Receiver caps
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define FT920_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_USB|RIG_MODE_LSB)
|
#define FT920_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_USB|RIG_MODE_LSB)
|
||||||
#define FT920_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_USB|RIG_MODE_LSB)
|
#define FT920_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_USB|RIG_MODE_LSB)
|
||||||
#define FT920_AM_RX_MODES (RIG_MODE_AM)
|
#define FT920_AM_RX_MODES (RIG_MODE_AM)
|
||||||
|
@ -130,12 +130,9 @@ static const yaesu_cmd_set_t ncmd[] = {
|
||||||
|
|
||||||
#define FT920_OTHER_TX_MODES (RIG_MODE_CW| RIG_MODE_USB| RIG_MODE_LSB ) /* 100 W class */
|
#define FT920_OTHER_TX_MODES (RIG_MODE_CW| RIG_MODE_USB| RIG_MODE_LSB ) /* 100 W class */
|
||||||
#define FT920_AM_TX_MODES (RIG_MODE_AM ) /* set 25W max */
|
#define FT920_AM_TX_MODES (RIG_MODE_AM ) /* set 25W max */
|
||||||
|
|
||||||
#define FT920_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN) /* fix */
|
#define FT920_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN) /* fix */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* future - private data
|
* future - private data
|
||||||
*
|
*
|
||||||
|
@ -154,6 +151,7 @@ struct ft920_priv_data {
|
||||||
/*
|
/*
|
||||||
* ft920 rigs capabilities.
|
* ft920 rigs capabilities.
|
||||||
* Also this struct is READONLY!
|
* Also this struct is READONLY!
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const struct rig_caps ft920_caps = {
|
const struct rig_caps ft920_caps = {
|
||||||
|
@ -203,6 +201,7 @@ const struct rig_caps ft920_caps = {
|
||||||
.rx_range_list2 = {
|
.rx_range_list2 = {
|
||||||
{kHz(100), MHz(30), FT920_ALL_RX_MODES, -1, -1 }, /* General coverage + ham */
|
{kHz(100), MHz(30), FT920_ALL_RX_MODES, -1, -1 }, /* General coverage + ham */
|
||||||
{MHz(48), MHz(56), FT920_ALL_RX_MODES, -1, -1 }, /* 6m! */
|
{MHz(48), MHz(56), FT920_ALL_RX_MODES, -1, -1 }, /* 6m! */
|
||||||
|
|
||||||
RIG_FRNG_END,
|
RIG_FRNG_END,
|
||||||
}, /* Region 2 rx ranges */
|
}, /* Region 2 rx ranges */
|
||||||
|
|
||||||
|
@ -252,15 +251,16 @@ const struct rig_caps ft920_caps = {
|
||||||
|
|
||||||
RIG_TS_END,
|
RIG_TS_END,
|
||||||
|
|
||||||
/* The FT-920 has a Fine tuning step which increments in 1 Hz steps
|
/*
|
||||||
|
* The FT-920 has a Fine tuning step which increments in 1 Hz steps
|
||||||
* for SSB_CW_RX_MODES, and 10 Hz steps for AM_RX_MODES and
|
* for SSB_CW_RX_MODES, and 10 Hz steps for AM_RX_MODES and
|
||||||
* FM_RX_MODES. It doesn't appear that anything finer than 10 Hz
|
* FM_RX_MODES. It doesn't appear that anything finer than 10 Hz
|
||||||
* is available through the CAT interface, however. -N0NB
|
* is available through the CAT interface, however. -N0NB
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
},
|
},
|
||||||
|
|
||||||
/* mode/filter list, .remember = order matters! */
|
/* mode/filter list, .remember = order matters! */
|
||||||
|
|
||||||
.filters = {
|
.filters = {
|
||||||
{RIG_MODE_SSB, kHz(2.4)}, /* standard SSB filter bandwidth */
|
{RIG_MODE_SSB, kHz(2.4)}, /* standard SSB filter bandwidth */
|
||||||
{RIG_MODE_CW, kHz(2.4)}, /* normal CW filter */
|
{RIG_MODE_CW, kHz(2.4)}, /* normal CW filter */
|
||||||
|
@ -295,7 +295,6 @@ const struct rig_caps ft920_caps = {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
int ft920_init(RIG *rig) {
|
int ft920_init(RIG *rig) {
|
||||||
struct ft920_priv_data *p;
|
struct ft920_priv_data *p;
|
||||||
|
|
||||||
|
@ -311,11 +310,9 @@ int ft920_init(RIG *rig) {
|
||||||
/*
|
/*
|
||||||
* Copy native cmd set to private cmd storage area
|
* Copy native cmd set to private cmd storage area
|
||||||
*/
|
*/
|
||||||
|
|
||||||
memcpy(p->pcs,ncmd,sizeof(ncmd));
|
memcpy(p->pcs,ncmd,sizeof(ncmd));
|
||||||
|
|
||||||
/* TODO: read pacing from preferences */
|
/* TODO: read pacing from preferences */
|
||||||
|
|
||||||
p->pacing = FT920_PACING_DEFAULT_VALUE; /* set pacing to minimum for now */
|
p->pacing = FT920_PACING_DEFAULT_VALUE; /* set pacing to minimum for now */
|
||||||
p->read_update_delay = FT920_DEFAULT_READ_TIMEOUT; /* set update timeout to safe value */
|
p->read_update_delay = FT920_DEFAULT_READ_TIMEOUT; /* set update timeout to safe value */
|
||||||
p->current_vfo = RIG_VFO_A; /* default to VFO_A ? */
|
p->current_vfo = RIG_VFO_A; /* default to VFO_A ? */
|
||||||
|
@ -328,6 +325,7 @@ int ft920_init(RIG *rig) {
|
||||||
/*
|
/*
|
||||||
* ft920_cleanup routine
|
* ft920_cleanup routine
|
||||||
* the serial port is closed by the frontend
|
* the serial port is closed by the frontend
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ft920_cleanup(RIG *rig) {
|
int ft920_cleanup(RIG *rig) {
|
||||||
|
@ -344,6 +342,7 @@ int ft920_cleanup(RIG *rig) {
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ft920_open routine
|
* ft920_open routine
|
||||||
*
|
*
|
||||||
|
@ -375,7 +374,6 @@ int ft920_open(RIG *rig) {
|
||||||
* ft920_close routine
|
* ft920_close routine
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ft920_close(RIG *rig) {
|
int ft920_close(RIG *rig) {
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE,"ft920: ft920_close called\n");
|
rig_debug(RIG_DEBUG_VERBOSE,"ft920: ft920_close called\n");
|
||||||
|
@ -383,7 +381,6 @@ int ft920_close(RIG *rig) {
|
||||||
if (!rig)
|
if (!rig)
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
|
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,7 +390,6 @@ int ft920_close(RIG *rig) {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
int ft920_set_freq(RIG *rig, vfo_t vfo, freq_t freq) {
|
int ft920_set_freq(RIG *rig, vfo_t vfo, freq_t freq) {
|
||||||
struct rig_state *rig_s;
|
struct rig_state *rig_s;
|
||||||
struct ft920_priv_data *p;
|
struct ft920_priv_data *p;
|
||||||
|
@ -404,7 +400,6 @@ int ft920_set_freq(RIG *rig, vfo_t vfo, freq_t freq) {
|
||||||
if (!rig)
|
if (!rig)
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
|
|
||||||
|
|
||||||
p = (struct ft920_priv_data*)rig->state.priv;
|
p = (struct ft920_priv_data*)rig->state.priv;
|
||||||
|
|
||||||
rig_s = &rig->state;
|
rig_s = &rig->state;
|
||||||
|
@ -420,13 +415,13 @@ int ft920_set_freq(RIG *rig, vfo_t vfo, freq_t freq) {
|
||||||
/*
|
/*
|
||||||
* Copy native cmd freq_set to private cmd storage area
|
* Copy native cmd freq_set to private cmd storage area
|
||||||
*/
|
*/
|
||||||
|
|
||||||
memcpy(&p->p_cmd,&ncmd[FT_920_NATIVE_FREQ_SET].nseq,YAESU_CMD_LENGTH);
|
memcpy(&p->p_cmd,&ncmd[FT_920_NATIVE_FREQ_SET].nseq,YAESU_CMD_LENGTH);
|
||||||
|
|
||||||
to_bcd(p->p_cmd,freq/10,8); /* store bcd format in in p_cmd */
|
to_bcd(p->p_cmd,freq/10,8); /* store bcd format in in p_cmd */
|
||||||
/* TODO -- fix 10Hz resolution -- FS */
|
/* TODO -- fix 10Hz resolution -- FS */
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE,"ft920: requested freq after conversion = %lli Hz\n", from_bcd(p->p_cmd,8)* 10 );
|
rig_debug(RIG_DEBUG_TRACE,"ft920: requested freq after conversion = %lli Hz\n",
|
||||||
|
from_bcd(p->p_cmd,8)* 10 );
|
||||||
|
|
||||||
cmd = p->p_cmd; /* get native sequence */
|
cmd = p->p_cmd; /* get native sequence */
|
||||||
write_block(&rig_s->rigport, cmd, YAESU_CMD_LENGTH);
|
write_block(&rig_s->rigport, cmd, YAESU_CMD_LENGTH);
|
||||||
|
@ -437,6 +432,7 @@ int ft920_set_freq(RIG *rig, vfo_t vfo, freq_t freq) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return Freq for a given VFO
|
* Return Freq for a given VFO
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ft920_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) {
|
int ft920_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) {
|
||||||
|
@ -451,7 +447,9 @@ int ft920_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) {
|
||||||
|
|
||||||
priv = (struct ft920_priv_data*)rig->state.priv;
|
priv = (struct ft920_priv_data*)rig->state.priv;
|
||||||
|
|
||||||
ft920_get_update_data(rig, FT_920_NATIVE_VFO_UPDATE, FT920_VFO_UPDATE_DATA_LENGTH); /* get VFO record from rig*/
|
/* get VFO record from rig*/
|
||||||
|
ft920_get_update_data(rig, FT_920_NATIVE_VFO_UPDATE,
|
||||||
|
FT920_VFO_UPDATE_DATA_LENGTH);
|
||||||
|
|
||||||
if (vfo == RIG_VFO_CURR )
|
if (vfo == RIG_VFO_CURR )
|
||||||
vfo = priv->current_vfo; /* from previous vfo cmd */
|
vfo = priv->current_vfo; /* from previous vfo cmd */
|
||||||
|
@ -499,12 +497,11 @@ int ft920_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width ) {
|
||||||
ft920_set_vfo(rig, vfo); /* select VFO first , new API */
|
ft920_set_vfo(rig, vfo); /* select VFO first , new API */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
rig_debug(RIG_DEBUG_TRACE,"ft920: generic mode = %x\n", mode);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* translate mode from generic to ft920 specific
|
* translate mode from generic to ft920 specific
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE,"ft920: generic mode = %x\n", mode);
|
|
||||||
|
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
case RIG_MODE_AM:
|
case RIG_MODE_AM:
|
||||||
cmd_index = FT_920_NATIVE_MODE_SET_AMW;
|
cmd_index = FT_920_NATIVE_MODE_SET_AMW;
|
||||||
|
@ -529,7 +526,6 @@ int ft920_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width ) {
|
||||||
/*
|
/*
|
||||||
* Now set width
|
* Now set width
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* FIXME: so far setting passband is buggy, only 0 is accepted -N0NB */
|
/* FIXME: so far setting passband is buggy, only 0 is accepted -N0NB */
|
||||||
switch(width) {
|
switch(width) {
|
||||||
case RIG_PASSBAND_NORMAL: /* easy case , no change to native sequence */
|
case RIG_PASSBAND_NORMAL: /* easy case , no change to native sequence */
|
||||||
|
@ -565,7 +561,6 @@ int ft920_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width ) {
|
||||||
/*
|
/*
|
||||||
* phew! now send cmd to rig
|
* phew! now send cmd to rig
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ft920_send_priv_cmd(rig,cmd_index);
|
ft920_send_priv_cmd(rig,cmd_index);
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE,"ft920: cmd_index = %i\n", cmd_index);
|
rig_debug(RIG_DEBUG_TRACE,"ft920: cmd_index = %i\n", cmd_index);
|
||||||
|
@ -575,6 +570,11 @@ int ft920_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* get mode : eg AM, CW etc for a given VFO
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
int ft920_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) {
|
int ft920_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) {
|
||||||
struct ft920_priv_data *p;
|
struct ft920_priv_data *p;
|
||||||
unsigned char mymode; /* ft920 mode */
|
unsigned char mymode; /* ft920 mode */
|
||||||
|
@ -586,10 +586,12 @@ int ft920_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) {
|
||||||
|
|
||||||
p = (struct ft920_priv_data*)rig->state.priv;
|
p = (struct ft920_priv_data*)rig->state.priv;
|
||||||
|
|
||||||
/* FIXME: Command passed is for VFO A & B, there should
|
/*
|
||||||
|
* FIXME: Command passed is for VFO A & B, there should
|
||||||
* be a complement for current display. e.g. mem tune -N0NB
|
* be a complement for current display. e.g. mem tune -N0NB
|
||||||
*/
|
*/
|
||||||
ft920_get_update_data(rig, FT_920_NATIVE_VFO_UPDATE, FT920_VFO_UPDATE_DATA_LENGTH);
|
ft920_get_update_data(rig, FT_920_NATIVE_VFO_UPDATE,
|
||||||
|
FT920_VFO_UPDATE_DATA_LENGTH);
|
||||||
|
|
||||||
mymode = p->update_data[FT920_SUMO_DISPLAYED_MODE];
|
mymode = p->update_data[FT920_SUMO_DISPLAYED_MODE];
|
||||||
mymode &= MODE_MASK; /* mask out bits 4, 5 and 6 */
|
mymode &= MODE_MASK; /* mask out bits 4, 5 and 6 */
|
||||||
|
@ -600,7 +602,6 @@ int ft920_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) {
|
||||||
* translate mode from ft920 to generic.
|
* translate mode from ft920 to generic.
|
||||||
* TODO: Add DATA, and Narrow modes. CW on LSB? -N0NB
|
* TODO: Add DATA, and Narrow modes. CW on LSB? -N0NB
|
||||||
*/
|
*/
|
||||||
|
|
||||||
switch(mymode) {
|
switch(mymode) {
|
||||||
case MODE_FM:
|
case MODE_FM:
|
||||||
(*mode) = RIG_MODE_FM;
|
(*mode) = RIG_MODE_FM;
|
||||||
|
@ -632,13 +633,12 @@ int ft920_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* set vfo and store requested vfo for later RIG_VFO_CURR
|
* set vfo and store requested vfo for later RIG_VFO_CURR
|
||||||
* requests.
|
* requests.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ft920_set_vfo(RIG *rig, vfo_t vfo) {
|
int ft920_set_vfo(RIG *rig, vfo_t vfo) {
|
||||||
struct rig_state *rig_s;
|
struct rig_state *rig_s;
|
||||||
struct ft920_priv_data *p;
|
struct ft920_priv_data *p;
|
||||||
|
@ -656,8 +656,6 @@ int ft920_set_vfo(RIG *rig, vfo_t vfo) {
|
||||||
/*
|
/*
|
||||||
* TODO : check for errors -- FS
|
* TODO : check for errors -- FS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
switch(vfo) {
|
switch(vfo) {
|
||||||
case RIG_VFO_A:
|
case RIG_VFO_A:
|
||||||
cmd_index = FT_920_NATIVE_VFO_A;
|
cmd_index = FT_920_NATIVE_VFO_A;
|
||||||
|
@ -693,7 +691,6 @@ int ft920_set_vfo(RIG *rig, vfo_t vfo) {
|
||||||
/*
|
/*
|
||||||
* phew! now send cmd to rig
|
* phew! now send cmd to rig
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ft920_send_priv_cmd(rig,cmd_index);
|
ft920_send_priv_cmd(rig,cmd_index);
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
|
@ -701,6 +698,12 @@ int ft920_set_vfo(RIG *rig, vfo_t vfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* get vfo and store requested vfo for later RIG_VFO_CURR
|
||||||
|
* requests.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
int ft920_get_vfo(RIG *rig, vfo_t *vfo) {
|
int ft920_get_vfo(RIG *rig, vfo_t *vfo) {
|
||||||
struct ft920_priv_data *p;
|
struct ft920_priv_data *p;
|
||||||
unsigned char status; /* ft920 status flag */
|
unsigned char status; /* ft920 status flag */
|
||||||
|
@ -713,7 +716,8 @@ int ft920_get_vfo(RIG *rig, vfo_t *vfo) {
|
||||||
p = (struct ft920_priv_data*)rig->state.priv;
|
p = (struct ft920_priv_data*)rig->state.priv;
|
||||||
|
|
||||||
/* Get flags for VFO status */
|
/* Get flags for VFO status */
|
||||||
ft920_get_update_data(rig, FT_920_NATIVE_UPDATE, FT920_STATUS_UPDATE_DATA_LENGTH);
|
ft920_get_update_data(rig, FT_920_NATIVE_UPDATE,
|
||||||
|
FT920_STATUS_UPDATE_DATA_LENGTH);
|
||||||
|
|
||||||
status = p->update_data[FT920_SUMO_DISPLAYED_STATUS];
|
status = p->update_data[FT920_SUMO_DISPLAYED_STATUS];
|
||||||
status &= SF_VFOAB; /* check VFO bit*/
|
status &= SF_VFOAB; /* check VFO bit*/
|
||||||
|
@ -723,7 +727,6 @@ int ft920_get_vfo(RIG *rig, vfo_t *vfo) {
|
||||||
/*
|
/*
|
||||||
* translate vfo status from ft920 to generic.
|
* translate vfo status from ft920 to generic.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case SF_VFOAB:
|
case SF_VFOAB:
|
||||||
(*vfo) = RIG_VFO_B;
|
(*vfo) = RIG_VFO_B;
|
||||||
|
@ -758,6 +761,7 @@ int ft920_get_vfo(RIG *rig, vfo_t *vfo) {
|
||||||
* need to use this when doing ft920_get_* stuff
|
* need to use this when doing ft920_get_* stuff
|
||||||
*
|
*
|
||||||
* Variables: ci = command index, rl = read length of returned data
|
* Variables: ci = command index, rl = read length of returned data
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int ft920_get_update_data(RIG *rig, unsigned char ci, unsigned char rl) {
|
static int ft920_get_update_data(RIG *rig, unsigned char ci, unsigned char rl) {
|
||||||
|
@ -783,12 +787,10 @@ static int ft920_get_update_data(RIG *rig, unsigned char ci, unsigned char rl) {
|
||||||
rig_debug(RIG_DEBUG_TRACE,"ft920: read pacing = %i\n",p->pacing);
|
rig_debug(RIG_DEBUG_TRACE,"ft920: read pacing = %i\n",p->pacing);
|
||||||
|
|
||||||
/* send PACING cmd to rig */
|
/* send PACING cmd to rig */
|
||||||
|
|
||||||
cmd = p->p_cmd;
|
cmd = p->p_cmd;
|
||||||
write_block(&rig_s->rigport, cmd, YAESU_CMD_LENGTH);
|
write_block(&rig_s->rigport, cmd, YAESU_CMD_LENGTH);
|
||||||
|
|
||||||
/* send UPDATE comand to fetch data*/
|
/* send UPDATE comand to fetch data*/
|
||||||
|
|
||||||
ft920_send_priv_cmd(rig, ci);
|
ft920_send_priv_cmd(rig, ci);
|
||||||
|
|
||||||
n = read_block(&rig_s->rigport, p->update_data, rl);
|
n = read_block(&rig_s->rigport, p->update_data, rl);
|
||||||
|
@ -798,9 +800,9 @@ static int ft920_get_update_data(RIG *rig, unsigned char ci, unsigned char rl) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* init_ft920 is called by rig_backend_load
|
* init_ft920 is called by rig_backend_load
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int init_ft920(void *be_handle) {
|
int init_ft920(void *be_handle) {
|
||||||
|
@ -810,11 +812,11 @@ int init_ft920(void *be_handle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* private helper function to send a private command
|
* private helper function to send a private command
|
||||||
* sequence . Must only be complete sequences.
|
* sequence . Must only be complete sequences.
|
||||||
* TODO: place variant of this in yaesu.c
|
* TODO: place variant of this in yaesu.c
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int ft920_send_priv_cmd(RIG *rig, unsigned char ci) {
|
static int ft920_send_priv_cmd(RIG *rig, unsigned char ci) {
|
||||||
|
@ -845,4 +847,3 @@ static int ft920_send_priv_cmd(RIG *rig, unsigned char ci) {
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
* via serial interface to an FT-920 using the "CAT" interface
|
* via serial interface to an FT-920 using the "CAT" interface
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Id: ft920.h,v 1.4 2002-11-01 04:39:47 n0nb Exp $
|
* $Id: ft920.h,v 1.5 2002-11-04 05:16:19 n0nb Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -52,24 +52,24 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 8N2 and 1 start bit = 11 bits at 4800 bps => effective byte rate = 1 byte in 2.2917 msec
|
* 8N2 and 1 start bit = 11 bits at 4800 bps => effective byte rate = 1 byte in 2.2917 msec
|
||||||
* => 345 bytes in 790 msec
|
* => 28 bytes in 64 msec
|
||||||
*
|
*
|
||||||
* delay for 1 byte = 2.2917 + (pace_interval * 5)
|
* delay for 1 byte = 2.2917 + (pace_interval * 5)
|
||||||
*
|
*
|
||||||
* pace_interval time to read 345 bytes
|
* pace_interval time to read 345 bytes
|
||||||
* ------------ ----------------------
|
* ------------ ----------------------
|
||||||
*
|
*
|
||||||
* 0 790 msec
|
* 0 64 msec
|
||||||
* 1 2515 msec
|
* 1 321 msec
|
||||||
* 2 4240 msec
|
* 2 642 msec
|
||||||
* 255 441 sec => 7 min 21 seconds
|
* 255 16.4 sec
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Native FT920 functions. This is what I have to work with :-)
|
* Native FT920 functions. More to come :-)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -105,8 +105,10 @@ enum ft920_native_cmd_e {
|
||||||
typedef enum ft920_native_cmd_e ft920_native_cmd_t;
|
typedef enum ft920_native_cmd_e ft920_native_cmd_t;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
/* Internal MODES - when setting modes via cmd_mode_set() */
|
* Internal MODES - when setting modes via cmd_mode_set()
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#define MODE_SET_LSB 0x00
|
#define MODE_SET_LSB 0x00
|
||||||
#define MODE_SET_USB 0x01
|
#define MODE_SET_USB 0x01
|
||||||
|
@ -121,6 +123,7 @@ typedef enum ft920_native_cmd_e ft920_native_cmd_t;
|
||||||
/*
|
/*
|
||||||
* Mode Bitmap. Bits 5 and 6 unused
|
* Mode Bitmap. Bits 5 and 6 unused
|
||||||
* When READING modes
|
* When READING modes
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define MODE_LSB 0x00
|
#define MODE_LSB 0x00
|
||||||
|
@ -149,6 +152,7 @@ typedef enum ft920_native_cmd_e ft920_native_cmd_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Status Flag Masks when reading
|
* Status Flag Masks when reading
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SF_DLOCK 0x01
|
#define SF_DLOCK 0x01
|
||||||
|
@ -164,6 +168,7 @@ typedef enum ft920_native_cmd_e ft920_native_cmd_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local VFO CMD's, according to spec
|
* Local VFO CMD's, according to spec
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define FT920_VFO_A 0x00
|
#define FT920_VFO_A 0x00
|
||||||
|
@ -173,8 +178,6 @@ typedef enum ft920_native_cmd_e ft920_native_cmd_t;
|
||||||
/*
|
/*
|
||||||
* Some useful offsets in the status update map (offset)
|
* Some useful offsets in the status update map (offset)
|
||||||
*
|
*
|
||||||
* Manual appears to be full of mistakes regarding offsets etc.. -- FS
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define FT920_SUMO_DISPLAYED_MODE 0x07
|
#define FT920_SUMO_DISPLAYED_MODE 0x07
|
||||||
|
@ -187,6 +190,7 @@ typedef enum ft920_native_cmd_e ft920_native_cmd_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* API local implementation
|
* API local implementation
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ft920_init(RIG *rig);
|
int ft920_init(RIG *rig);
|
||||||
|
@ -204,46 +208,4 @@ int ft920_set_vfo(RIG *rig, vfo_t vfo); /* select vfo */
|
||||||
int ft920_get_vfo(RIG *rig, vfo_t *vfo); /* get vfo */
|
int ft920_get_vfo(RIG *rig, vfo_t *vfo); /* get vfo */
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Below is leftovers of old interface. TODO
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/*
|
|
||||||
* Allow TX commands to be disabled
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#undef TX_ENABLED
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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 /* narrow bit set only */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Map band data value to band.
|
|
||||||
*
|
|
||||||
* Band "n" is from band_data[n] to band_data[n+1]
|
|
||||||
*/
|
|
||||||
|
|
||||||
const float band_data[11] = { 0.0, 0.1, 2.5, 4.0, 7.5, 10.5, 14.5, 18.5, 21.5, 25.0, 30.0 };
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* _FT920_H */
|
#endif /* _FT920_H */
|
||||||
|
|
Ładowanie…
Reference in New Issue