KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ltc2631.h File Reference

Driver of the LTC2631 DAC as found on the power board. More...

#include "drv/wb/i2c.h"

Go to the source code of this file.

Macros

#define LTC2631_MAX   0xFFFF
 

Enumerations

enum  LTC2631Oper { ltc2631OperUpdate, ltc2631OperPowerDown, ltc2631OperSelIntRef, ltc2631OperSelExtRef }
 

Functions

bool ltc2631Write (I2C_Device *dev, uint8_t addr, uint16_t value, bool update)
 Sets the DAC value on the input register. More...
 
bool ltc2631Operation (I2C_Device *dev, uint8_t addr, LTC2631Oper oper)
 Executes a DAC operation. More...
 

Detailed Description

Driver of the LTC2631 DAC as found on the power board.

Definition in file ltc2631.h.

Enumeration Type Documentation

Enumerator
ltc2631OperUpdate 

Adjust output voltage with value in input buffer.

ltc2631OperPowerDown 

Power down the LTC2631.

ltc2631OperSelIntRef 

Select internal reference.

ltc2631OperSelExtRef 

Select external reference.

Definition at line 31 of file ltc2631.h.

Function Documentation

bool ltc2631Operation ( I2C_Device dev,
uint8_t  addr,
LTC2631Oper  oper 
)

Executes a DAC operation.

See LTC2631Oper enumeration for possible options.

Parameters
devThe I2C device.
addrThe I2C address
operThe operation to execute.
Return values
trueSuccess
falseFailure, see err module for error.

Definition at line 37 of file ltc2631.c.

bool ltc2631Write ( I2C_Device dev,
uint8_t  addr,
uint16_t  value,
bool  update 
)

Sets the DAC value on the input register.

When update is false, the output voltage is not immediately adjusted to the value of the input register. To apply the set input value invoke the ltc2631Operation with the ltc2631OperUpdate operation.

Parameters
devThe I2C device.
addrThe I2C address
valueThe DAC value to set
updateImmediately update
Return values
trueSuccess
falseFailure, see err module for error.

Definition at line 26 of file ltc2631.c.