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

#include <pas-co2-serial-ino.hpp>

Inheritance diagram for PASCO2SerialIno:
Collaboration diagram for PASCO2SerialIno:

Public Member Functions

 PASCO2SerialIno (TwoWire *wire=nullptr, uint8_t intPin=GPIOIno::unusedPin, uint8_t protoSelectPin=GPIOIno::unusedPin, uint8_t power3V3Pin=GPIOIno::unusedPin, uint8_t power12VPin=GPIOIno::unusedPin)
 PAS CO2 Serial Arduino Constructor. More...
 
 PASCO2SerialIno (HardwareSerial *serial, uint8_t intPin=GPIOIno::unusedPin, uint8_t protoSelectPin=GPIOIno::unusedPin, uint8_t power3V3Pin=GPIOIno::unusedPin, uint8_t power12VPin=GPIOIno::unusedPin)
 PAS CO2 Serial Arduino Constructor. More...
 
 ~PASCO2SerialIno ()
 PAS CO2 Serial Arduino Destructor. More...
 
Error_t begin ()
 Begins the sensor. More...
 
Error_t end ()
 Ends the sensor. More...
 
- Public Member Functions inherited from PASCO2Serial
 PASCO2Serial (pasco2::SBus *const sbus, pasco2::Timer *const timer=nullptr, pasco2::GPIO *const interrupt=nullptr, pasco2::GPIO *const protoSelect=nullptr, pasco2::GPIO *const power3V3=nullptr, pasco2::GPIO *const power12V=nullptr)
 PAS CO2 Serial Constructor. More...
 
virtual ~PASCO2Serial ()
 PAS CO2 Serial Destructor. More...
 
Error_t enable ()
 Enables the sensor. More...
 
Error_t disable ()
 Disables the sensor. More...
 
Error_t startMeasure (int16_t periodInSec=0, int16_t alarmTh=0, void(*cback)(void *)=nullptr)
 Triggers the internal measuring of the sensor. More...
 
Error_t stopMeasure ()
 Stops the internal measuring of the sensor. More...
 
Error_t getCO2 (int16_t &CO2PPM)
 Gets the CO2 concentration measured. More...
 
Error_t getDiagnosis (Diag_t &diagnosis)
 Gets diagnosis information. More...
 
Error_t calibrate (ABOC_t aboc, int16_t abocRef, uint16_t pressRef)
 Calibrates the sensor. More...
 
Error_t reset ()
 Resets the sensor. More...
 
Error_t getDeviceID (uint8_t &prodID, uint8_t &revID)
 Gets device product identifier. More...
 

Constructor & Destructor Documentation

◆ PASCO2SerialIno() [1/2]

PASCO2SerialIno::PASCO2SerialIno ( TwoWire *  wire = nullptr,
uint8_t  intPin = GPIOIno::unusedPin,
uint8_t  protoSelectPin = GPIOIno::unusedPin,
uint8_t  power3V3Pin = GPIOIno::unusedPin,
uint8_t  power12VPin = GPIOIno::unusedPin 
)

PAS CO2 Serial Arduino Constructor.

Mandatory arguments:

  • The TwoWire instance needs to be provided

Optional arguments:

  • All other pins instances.

Most of the GPIO will be fixed by hardware. In particular those enabling the sensor main power and the emitter power. They are part of the sensor library to provide potential absolute control by software. The hardware interface and its features, are also provided in the library. But it can be as well handled externally

Parameters
[in]*wireTwoWire interface instance
[in]intPinInterrupt pin. Default is UnusedPin
[in]protoSelectPinProtocol select pin. Default is UnusedPin
[in]power3V3PinPower 3V3 pin. Default is UnusedPin
[in]power12VPinPower 12V pin. Default is UnusedPin
Precondition
None

◆ PASCO2SerialIno() [2/2]

PASCO2SerialIno::PASCO2SerialIno ( HardwareSerial *  serial,
uint8_t  intPin = GPIOIno::unusedPin,
uint8_t  protoSelectPin = GPIOIno::unusedPin,
uint8_t  power3V3Pin = GPIOIno::unusedPin,
uint8_t  power12VPin = GPIOIno::unusedPin 
)

PAS CO2 Serial Arduino Constructor.

Mandatory arguments:

  • The HardwareSerial instance needs to be provided

Optional arguments:

  • All other pins instances.

Most of the GPIO will be fixed by hardware. In particular those enabling the sensor main power and the emitter power. They are part of the sensor library to provide potential absolute control by software. The hardware interface and its features, are also provided in the library. But it can be as well handled externally

Parameters
[in]*serialSerial interface instance
[in]intPinInterrupt pin. Default is UnusedPin
[in]protoSelectPinProtocol select pin. Default is UnusedPin
[in]power3V3PinPower 3V3 pin. Default is UnusedPin
[in]power12VPinPower 12V pin. Default is UnusedPin
Precondition
None

◆ ~PASCO2SerialIno()

PASCO2SerialIno::~PASCO2SerialIno ( )

PAS CO2 Serial Arduino Destructor.

It disables the sensor and deletes all the dynamically created PAL instances in the constructor

Precondition
None
Here is the call graph for this function:

Member Function Documentation

◆ begin()

Error_t PASCO2SerialIno::begin ( )
inline

Begins the sensor.

Note
Optional call. The sensor initializes and enables the sensor directly in the rest of API calls.
Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif interface error
IC_POWERON_ERRORif power-on error
Here is the call graph for this function:

◆ end()

Error_t PASCO2SerialIno::end ( )
inline

Ends the sensor.

Note
Optional call. The sensor initializes and enables the sensor directly in the rest of API calls.
Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif interface error
Here is the call graph for this function:

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