dac8571.c 289 B

12345678910111213141516
  1. #include "i2c.h"
  2. #include "dac8571.h"
  3. void dac8571_set(unsigned int data, unsigned char a0){
  4. static unsigned char d[2];
  5. unsigned char addr = DAC8571_BASE_ADDR;
  6. if(a0)
  7. addr |= _BV(2);
  8. d[0] = data>>8;
  9. d[1] = data&0xff;
  10. i2cSend(DAC8571_CMD_WRITE_TEMP_AND_LOAD, 2, d, addr);
  11. }