| 308 | } |
| 309 | |
| 310 | static void ad_write(hamlib_port_t *port, unsigned long word, |
| 311 | unsigned char control) |
| 312 | { |
| 313 | int i; |
| 314 | |
| 315 | /* lock the parallel port */ |
| 316 | par_lock(port); |
| 317 | |
| 318 | /* shift out the least significant 32 bits of the word */ |
| 319 | for (i = 0; i < 32; i++) |
| 320 | { |
| 321 | |
| 322 | ad_bit(port, word & DATA); |
| 323 | |
| 324 | word >>= 1; |
| 325 | } |
| 326 | |
| 327 | /* write out the control byte */ |
| 328 | for (i = 0; i < 8; i++) |
| 329 | { |
| 330 | |
| 331 | ad_bit(port, control & DATA); |
| 332 | |
| 333 | control >>= 1; |
| 334 | } |
| 335 | |
| 336 | /* load the register */ |
| 337 | par_write_data(port, LOAD); |
| 338 | ad_delay(1); |
| 339 | par_write_data(port, 0); |
| 340 | |
| 341 | /* unlock the parallel port */ |
| 342 | par_unlock(port); |
| 343 | } |
| 344 | |
| 345 | |
| 346 | int dds60_set_freq(RIG *rig, vfo_t vfo, freq_t freq) |
no test coverage detected