Logo Search packages:      
Sourcecode: hamlib version File versions

static int tt565_set_freq ( RIG rig,
vfo_t  vfo,
freq_t  freq 
)

Set a frequence into the specified VFO.

Parameters:
rig must != NULL
vfo RIG_VFO_A or RIG_VFO_B
freq assumes rig->state.priv!=NULL
assumes priv->mode in AM,CW,LSB or USB.

Definition at line 319 of file orion.c.

References EOM, tt565_transaction(), and which_vfo().

{
      int cmd_len, retval;
      char cmdbuf[TT565_BUFSIZE];
#ifdef TT565_ASCII_FREQ
/*  Use ASCII mode to set frequencies */
      cmd_len = sprintf (cmdbuf, "*%cF%"PRIll EOM, 
                  which_vfo(rig, vfo),
                  (long long)freq);
#else
    /* Use binary mode */
    /* Set frequency using Orion's binary mode (short) sequence. 
    The short sequence transfers faster and may require less Orion
    firmware effort. */

    /* Construct command packet by brute force. */
      unsigned int myfreq;
      myfreq = freq;
      cmd_len = 7;
      cmdbuf[0] = '*';
      cmdbuf[1] = which_vfo(rig,vfo);
      cmdbuf[2] = (myfreq & 0xff000000) >> 24;
      cmdbuf[3] = (myfreq & 0x00ff0000) >> 16;
      cmdbuf[4] = (myfreq & 0x0000ff00) >> 8;
      cmdbuf[5] =  myfreq & 0x000000ff;
      cmdbuf[6] = '\r';   /* i.e. EOM */
#endif
      retval = tt565_transaction (rig, cmdbuf, cmd_len, NULL, NULL);

      return retval;
}


Generated by  Doxygen 1.6.0   Back to index