SELKIELogger  1.0.0
I2C Device communication
Collaboration diagram for I2C Device communication:

Modules

 INA219: Register addresses
 
 SN3218 Register Addresses
 
 SN3218 Control Functions
 
 TI ADS1015: Interface functions
 
 INA219: Configuration values
 
 INA219: Interface functions
 

Files

file  I2C-INA219.h
 
file  I2C-SN3218.h
 
file  I2CConnection.h
 

Typedefs

typedef float(* i2c_dev_read_fn) (const int, const int, const void *)
 Device specific callback functions.
 

Functions

int i2c_openConnection (const char *bus)
 Set up a connection to the specified bus. More...
 
void i2c_closeConnection (int handle)
 Close existing connection. More...
 
int16_t i2c_swapbytes (const int16_t in)
 Swap word byte order. More...
 

Detailed Description

Function Documentation

◆ i2c_closeConnection()

void i2c_closeConnection ( int  handle)

Close existing connection.

Close connection previously opened with i2c_openConnection()

Parameters
[in]handleFile handle returned by i2c_openConnection()

Definition at line 46 of file I2CConnection.c.

◆ i2c_openConnection()

int i2c_openConnection ( const char *  bus)

Set up a connection to the specified bus.

Opens the specified bus in read/write mode

Parameters
[in]busPath to I2C bus device
Returns
Handle to opened bus, or -1 on failure

Definition at line 34 of file I2CConnection.c.

◆ i2c_swapbytes()

int16_t i2c_swapbytes ( const int16_t  in)

Swap word byte order.

Swap the bytes read or written using the SMBus commands

Not sure if the need to do this is a misunderstanding or a documentation issue.

Parameters
[in]inWord to be swapped
Returns
Input, with byte order reversed

Definition at line 58 of file I2CConnection.c.