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

Driver of the LTC2499 ADC as found on the power board. More...

#include "drv/wb/i2c.h"

Go to the source code of this file.

Macros

#define LTC2499_MAX_VALUE   0x00FFFFFF
 
#define LTC2499_MIN_VALUE   0xFF000000
 
#define LTC2499_CH_KEEPPREV   0xFF
 

Enumerations

enum  LTC2499Status { ltc2499StatusOk, ltc2499StatusOverFlow, ltc2499StatusUnderFlow }
 The status enum, indicating any issues with the value (underflow/overflow). More...
 
enum  LTC2499Filter { ltc2499Filter50Hz, ltc2499Filter60Hz, ltc2499Filter50And60Hz }
 

Functions

bool ltc2499Read (I2C_Device *dev, int addr, int32_t *value, LTC2499Status *result)
 Reads the LTC ADC at I2C address 'addr'. More...
 
bool ltc2499CfgExt (I2C_Device *dev, int addr, bool diff, uint8_t posCh, LTC2499Filter fltCfg, bool speed2x)
 Configure LTC2499 with external input. More...
 
bool ltc24499CfgTemp (I2C_Device *dev, int addr, LTC2499Filter fltCfg)
 Configure LTC2499 for temperature reading. More...
 

Detailed Description

Driver of the LTC2499 ADC as found on the power board.

Definition in file ltc2499.h.

Enumeration Type Documentation

The status enum, indicating any issues with the value (underflow/overflow).

Enumerator
ltc2499StatusOk 

Conversion is ok.

ltc2499StatusOverFlow 

Overflow.

ltc2499StatusUnderFlow 

Underflow.

Definition at line 32 of file ltc2499.h.

Function Documentation

bool ltc24499CfgTemp ( I2C_Device dev,
int  addr,
LTC2499Filter  fltCfg 
)

Configure LTC2499 for temperature reading.

Parameters
devThe I2C device
addrThe I2C address
fltCfgFilter configuration.
Return values
trueNo serious errors.
falseAn error occured, check err module for error.
bool ltc2499CfgExt ( I2C_Device dev,
int  addr,
bool  diff,
uint8_t  posCh,
LTC2499Filter  fltCfg,
bool  speed2x 
)

Configure LTC2499 with external input.

When selecting differential input (diff = true), you only need to specify the positive input channel. The negative input channel is the LSB's bit complement. E.g. selecting channel 0 as positive, means channel 1 is the negative input. When selecting channel as positive input, channel 4 is the negative input. Optionally you can select LTC2499_CH_KEEPPREV to keep the previous channel configuration.

Parameters
devThe I2C device
addrThe I2C address
diffWhen true, use differential input
posChPositive input channel, or LTC2499_CH_KEEPPREV.
fltCfgFilter configuration
speed2xAcquire twice as fast
Return values
trueNo serious errors.
falseAn error occured, check err module for error.

Definition at line 77 of file ltc2499.c.

bool ltc2499Read ( I2C_Device dev,
int  addr,
int32_t *  value,
LTC2499Status result 
)

Reads the LTC ADC at I2C address 'addr'.

Parameters
devThe I2C device
addrThe I2C address
valueThe value as a full-range range 32 bit signed integer.
statusThe conversion status.
Return values
trueNo serious errors.
falseAn error occured, check err module for error.

Definition at line 41 of file ltc2499.c.