#include <pas-co2-serial-ino.hpp>
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... | |
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:
Optional arguments:
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
[in] | *wire | TwoWire interface instance |
[in] | intPin | Interrupt pin. Default is UnusedPin |
[in] | protoSelectPin | Protocol select pin. Default is UnusedPin |
[in] | power3V3Pin | Power 3V3 pin. Default is UnusedPin |
[in] | power12VPin | Power 12V pin. Default is UnusedPin |
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:
Optional arguments:
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
[in] | *serial | Serial interface instance |
[in] | intPin | Interrupt pin. Default is UnusedPin |
[in] | protoSelectPin | Protocol select pin. Default is UnusedPin |
[in] | power3V3Pin | Power 3V3 pin. Default is UnusedPin |
[in] | power12VPin | Power 12V pin. Default is UnusedPin |
PASCO2SerialIno::~PASCO2SerialIno | ( | ) |
PAS CO2 Serial Arduino Destructor.
It disables the sensor and deletes all the dynamically created PAL instances in the constructor
|
inline |
Begins the sensor.
OK | if success |
INTF_ERROR | if interface error |
IC_POWERON_ERROR | if power-on error |
|
inline |
Ends the sensor.
OK | if success |
INTF_ERROR | if interface error |