PAS CO2 Sensor  1.0.3
C++ library for Infineon Photoacoustic Spectroscopy (PAS) XENSIV™ CO2 miniaturized sensor
pasco2::I2CPAL Class Referenceabstract

#include <pas-co2-pal-i2c.hpp>

Inheritance diagram for pasco2::I2CPAL:

Public Member Functions

virtual Error_t init ()=0
 Initializes the I2C interface. More...
 
virtual Error_t deinit ()=0
 Deinitializes the I2C interface. More...
 
virtual Error_t setClockFreq (const uint32_t clockHz)=0
 Sets the I2C bus frequency. More...
 
virtual Error_t read (const uint8_t slave7BAddr, const uint8_t memAddr, uint8_t *data, uint16_t &length)=0
 Reads from the I2C interface the device memory registers. More...
 
virtual Error_t write (const uint8_t slave7BAddr, const uint8_t memAddr, const uint8_t *data, uint16_t &length)=0
 Writes in the I2C interface the device memory registers. More...
 

Member Function Documentation

◆ init()

virtual Error_t pasco2::I2CPAL::init ( )
pure virtual

Initializes the I2C interface.

Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in I2CPALIno.

◆ deinit()

virtual Error_t pasco2::I2CPAL::deinit ( )
pure virtual

Deinitializes the I2C interface.

Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in I2CPALIno.

◆ setClockFreq()

virtual Error_t pasco2::I2CPAL::setClockFreq ( const uint32_t  clockHz)
pure virtual

Sets the I2C bus frequency.

Parameters
[in]clockHzClock frequency in Hertzs
Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in I2CPALIno.

◆ read()

virtual Error_t pasco2::I2CPAL::read ( const uint8_t  slave7BAddr,
const uint8_t  memAddr,
uint8_t *  data,
uint16_t &  length 
)
pure virtual

Reads from the I2C interface the device memory registers.

The memory addresses length is 8 bits, which point to 8 bits word memory registers. In bulk read mode (length > 1 byte), the register address passed by argument will be the start read address, and the subsequent registers will be read up until the requested length is satisfied.

Parameters
[in]slave7BAddrSlave address 7 bits format. Without write/read bit (8 bit address right shifted 1 bit)
[in]memAddressDevice memory register start read address
[out]*dataPointer to the array that will store the read data
[in,out]lengthNumber of bytes to be read from the bus. Outputs the actual number of bytes read.
Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in I2CPALIno.

◆ write()

virtual Error_t pasco2::I2CPAL::write ( const uint8_t  slave7BAddr,
const uint8_t  memAddr,
const uint8_t *  data,
uint16_t &  length 
)
pure virtual

Writes in the I2C interface the device memory registers.

The memory addresses length is 8 bits, which point to 8 bits word memory registers. In bulk write mode (length > 1 byte), the register address passed by argument will be the start write address, and the subsequent registers will be written up until the requested length is satisfied.

Parameters
[in]slave7BAddrSlave address 7 bits format. Without write/read bit (8 bit address right shifted 1 bit)
[in]memAddressDevice memory register start write address
[in]*dataPointer to the data array to be written
[in,out]lengthNumber of bytes to be written in the bus. Outputs the actual number of bytes written.
Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in I2CPALIno.


The documentation for this class was generated from the following file: