19 #define _LTC2631_OPER_WRITE 0x00
20 #define _LTC2631_OPER_UPDATE 0x10
21 #define _LTC2631_OPER_WRITE_UPDATE 0x30
22 #define _LTC2631_OPER_POWER_DOWN 0x40
23 #define _LTC2631_OPER_REF_INTERNAL 0x60
24 #define _LTC2631_OPER_REF_EXTERNAL 0x70
30 out[0] = update ? _LTC2631_OPER_WRITE_UPDATE : _LTC2631_OPER_WRITE;
31 out[1] = 0xff & (value >> 8);
32 out[2] = 0xff & value;
34 return i2cWrite(dev, addr, out,
sizeof(out));
52 return i2cWrite(dev, addr, out,
sizeof(out));
bool i2cWrite(I2C_Device *dev, i2cAddr addr, uint8_t *bytes, int len)
Writes to the I2C device.
bool ltc2631Write(I2C_Device *dev, uint8_t addr, uint16_t value, bool update)
Sets the DAC value on the input register.
Driver of the LTC2631 DAC as found on the power board.
Select external reference.
bool ltc2631Operation(I2C_Device *dev, uint8_t addr, LTC2631Oper oper)
Executes a DAC operation.
Structure defines OpenCores I2C Device.
#define E_INVARGUMENT
Generic error: invalid argument.
This module is responsible for distributing error codes.
Select internal reference.
Adjust output voltage with value in input buffer.
bool errSet(uint32_t code, const char *error, const char *name)
Sets an error.
#define ERROR(CODE,...)
Expands an error code to an error code with a description (if ERROR_W_DESCR is declared).