MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / write_latch

Function write_latch

rigs/flexradio/sdr1k.c:453–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451
452
453int
454write_latch(RIG *rig, latch_t which, unsigned value, unsigned mask)
455{
456 struct sdr1k_priv_data *priv = (struct sdr1k_priv_data *)STATE(rig)->priv;
457 hamlib_port_t *pport = RIGPORT(rig);
458
459 if (!(L_EXT <= which && which <= L_DDS1))
460 {
461 return -RIG_EINVAL;
462 }
463
464 par_lock(pport);
465 priv->shadow[which] = (priv->shadow[which] & ~mask) | (value & mask);
466 par_write_data(pport, priv->shadow[which]);
467 pdelay(rig);
468 par_write_control(pport, 0x0F ^ (1 << which));
469 pdelay(rig);
470 par_write_control(pport, 0x0F);
471 pdelay(rig);
472 par_unlock(pport);
473
474 return RIG_OK;
475}
476
477
478int

Callers 4

set_bandFunction · 0.85
sdr1k_resetFunction · 0.85
dds_write_regFunction · 0.85
set_bitFunction · 0.85

Calls 5

par_lockFunction · 0.85
par_write_dataFunction · 0.85
pdelayFunction · 0.85
par_write_controlFunction · 0.85
par_unlockFunction · 0.85

Tested by

no test coverage detected