Logo Search packages:      
Sourcecode: hamlib version File versions

int par_ptt_set ( hamlib_port_t p,
ptt_t  pttx 
)

Set or unset Push to talk bit on Parallel Port.

Parameters:
p 
pttx RIG_PTT_ON --> Set PTT
Returns:
RIG_OK or < 0 error

Definition at line 371 of file parallel.c.

References par_read_data(), par_write_data(), hamlib_port_t::parallel, hamlib_port_t::parm, hamlib_port_t::ptt, rig_debug(), RIG_DEBUG_ERR, RIG_EINVAL, RIG_OK, RIG_PTT_ON, RIG_PTT_PARALLEL, and hamlib_port_t::type.

Referenced by rig_set_ptt().

{
      switch(p->type.ptt) {
      case RIG_PTT_PARALLEL:
            {
            unsigned char reg;
            int status;

            status = par_read_data(p, &reg);
            if (status != RIG_OK)
                  return status;
            if (pttx == RIG_PTT_ON)
                  reg |=   1 << p->parm.parallel.pin;
            else
                  reg &= ~(1 << p->parm.parallel.pin);
            return par_write_data(p, reg);
            }
      default:
            rig_debug(RIG_DEBUG_ERR,"Unsupported PTT type %d\n", 
                                    p->type.ptt);
            return -RIG_EINVAL;
      }
      return RIG_OK;
}


Generated by  Doxygen 1.6.0   Back to index