KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ltc2489.c
1 /*
2  * KM3NeT CLB v2 Firmware
3  * ----------------------
4  *
5  * Copyright 2013 KM3NeT Collaboration
6  *
7  * All Rights Reserved.
8  *
9  *
10  * File : ltc2489.c
11  * Created : 14 mrt. 2013
12  * Author : Vincent van Beveren
13  */
14 
15 
16 #include <stdio.h>
17 
18 #include "drv/i2c/ltc2489.h"
19 
20 bool ltc2489Read(I2C_Device * dev, int addr)
21 {
22 
23  uint8_t data[3];
24  if (!i2cRead(dev, addr, data, sizeof(data))) return errRebase("LTC2489");
25  return 1;
26 }
Structure defines OpenCores I2C Device.
Definition: dev_i2c.h:55
bool ltc2489Read(I2C_Device *dev, int addr)
Reads the LTC ADC at I2C address &#39;addr&#39;.
Definition: ltc2489.c:20
bool i2cRead(I2C_Device *dev, i2cAddr addr, uint8_t *bytes, int len)
Reads from the I2C device.
Definition: i2c.c:161
static bool errRebase(const char *name)
Rebases the cause of the error message.
Definition: err.h:104
Reads a value from the LTC2489 ADC.