Updated: October 28, 2024 |
For analog output, the function pcl711_write_analog() is used:
void pcl711_write_analog (pcl711_t *pcl, int value) { out8 (pcl -> port + PCL711_ANALOG_LOW, value & 0xff); out8 (pcl -> port + PCL711_ANALOG_HIGH, (value & 0xf00) >> 8); }
This function simply writes the low byte of the value to the register PCL711_ANALOG_LOW and then writes the high byte (actually, bits 8 through 11) of the value to PCL711_ANALOG_HIGH.
Just something to watch out for.