PAS CO2 Sensor  1.0.3
C++ library for Infineon Photoacoustic Spectroscopy (PAS) XENSIV™ CO2 miniaturized sensor
pas-co2-pal-i2c.hpp
Go to the documentation of this file.
1 
10 #ifndef PAS_CO2_I2CPAL_HPP_
11 #define PAS_CO2_I2CPAL_HPP_
12 
13 #include "pas-co2-conf.hpp"
14 
15 #if IS_INTF(PAS_CO2_INTF_I2C)
16 
17 #include <stdint.h>
18 #include "pas-co2-types.hpp"
19 
20 namespace pasco2
21 {
22 
28 class I2CPAL
29 {
30  public:
31 
38  virtual Error_t init () = 0;
39 
46  virtual Error_t deinit () = 0;
47 
55  virtual Error_t setClockFreq (const uint32_t clockHz) = 0;
56 
73  virtual Error_t read (const uint8_t slave7BAddr, const uint8_t memAddr, uint8_t * data, uint16_t & length) = 0;
74 
91  virtual Error_t write (const uint8_t slave7BAddr, const uint8_t memAddr, const uint8_t * data, uint16_t & length) = 0;
92 };
93 
96 }
97 
98 #endif
99 #endif
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.
virtual Error_t init()=0
Initializes the I2C interface.
virtual Error_t deinit()=0
Deinitializes the I2C interface.
virtual Error_t setClockFreq(const uint32_t clockHz)=0
Sets the I2C bus frequency.
Definition: pas-co2-i2c.hpp:21
Error_t
Definition: pas-co2-types.hpp:24
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.
Definition: pas-co2-pal-i2c.hpp:28
PAS CO2 Types.
PAS CO2 Library Configuration.