PAS CO2 Sensor  1.0.3
C++ library for Infineon Photoacoustic Spectroscopy (PAS) XENSIV™ CO2 miniaturized sensor
I2CPALIno Class Reference

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

Inheritance diagram for I2CPALIno:
Collaboration diagram for I2CPALIno:

Public Member Functions

 I2CPALIno (TwoWire *wire=&Wire)
 I2C PAL Ino constructor. More...
 
 ~I2CPALIno ()
 I2C PAL Ino destructor. More...
 
Error_t init ()
 Initializes the I2C Arduino PAL. More...
 
Error_t deinit ()
 Deinitializes the I2C Arduino PAL. More...
 
Error_t setClockFreq (const uint32_t clockHz)
 Sets the I2C Arduino PAL frequency. More...
 
Error_t read (const uint8_t slave7BAddr, const uint8_t memAddr, uint8_t *data, uint16_t &length)
 Reads from the I2C Arduino PAL the device memory registers. More...
 
Error_t write (const uint8_t slave7BAddr, const uint8_t memAddr, const uint8_t *data, uint16_t &length)
 Writes in the I2C Arduino PAL the device memory registers. More...
 

Constructor & Destructor Documentation

◆ I2CPALIno()

I2CPALIno::I2CPALIno ( TwoWire *  wire = &Wire)

I2C PAL Ino constructor.

Parameters
[in]wireArduino Wire instance

◆ ~I2CPALIno()

I2CPALIno::~I2CPALIno ( )

I2C PAL Ino destructor.

Member Function Documentation

◆ init()

Error_t I2CPALIno::init ( void  )
virtual

Initializes the I2C Arduino PAL.

Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implements pasco2::I2CPAL.

◆ deinit()

Error_t I2CPALIno::deinit ( void  )
virtual

Deinitializes the I2C Arduino PAL.

Warning
end() call not implemented depending on core Arduino toolchain flags are not here declared.
Returns
PAS CO2 error code
Return values
OKalways

Implements pasco2::I2CPAL.

◆ setClockFreq()

Error_t I2CPALIno::setClockFreq ( const uint32_t  clockHz)
virtual

Sets the I2C Arduino PAL frequency.

Parameters
[in]clockHzClock frequency in Hertzs
Returns
PAS CO2 error code
Return values
OKalways

Implements pasco2::I2CPAL.

◆ read()

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

Reads from the I2C Arduino PAL 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

Implements pasco2::I2CPAL.

◆ write()

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

Writes in the I2C Arduino PAL 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

Implements pasco2::I2CPAL.


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