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

#include <pas-co2-sbus.hpp>

Inheritance diagram for pasco2::SBus:

Public Types

Serial protocol
enum  Proto_t { BUS_PROTO_I2C = 0, BUS_PROTO_UART = 1 }
 

Public Member Functions

virtual Error_t init (void)=0
 Initializes the serial interface. More...
 
virtual Error_t deinit (void)=0
 Deinitializes the serial interface. More...
 
virtual Error_t write (const uint8_t regAddr, const uint8_t *data, uint16_t length=1)=0
 Writes data to a register or set of consecutive registers. More...
 
virtual Error_t read (const uint8_t regAddr, uint8_t *data, uint16_t length=1)=0
 Reads data from a register or set of consecutive registers. More...
 
virtual Proto_t getProtocol (void)=0
 Gets the specific serial protocol. More...
 

Member Enumeration Documentation

◆ Proto_t

Enumerator
BUS_PROTO_I2C 

I2C protocol

BUS_PROTO_UART 

UART protocol

Member Function Documentation

◆ init()

virtual Error_t pasco2::SBus::init ( void  )
pure virtual

Initializes the serial interface.

Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in pasco2::UART, and pasco2::I2C.

◆ deinit()

virtual Error_t pasco2::SBus::deinit ( void  )
pure virtual

Deinitializes the serial interface.

Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in pasco2::UART, and pasco2::I2C.

◆ write()

virtual Error_t pasco2::SBus::write ( const uint8_t  regAddr,
const uint8_t *  data,
uint16_t  length = 1 
)
pure virtual

Writes data to a register or set of consecutive registers.

Parameters
[in]regAddrRegister start write address
[in]*dataPointer to the data array to be written
[in]lengthNumber of registers to be written in the bus
Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in pasco2::UART, and pasco2::I2C.

◆ read()

virtual Error_t pasco2::SBus::read ( const uint8_t  regAddr,
uint8_t *  data,
uint16_t  length = 1 
)
pure virtual

Reads data from a register or set of consecutive registers.

Parameters
[in]regAddrRegister start read address
[out]*dataPointer to the array that will store the read data
[in]lengthNumber of registers to be read from the bus
Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in pasco2::UART, and pasco2::I2C.

◆ getProtocol()

virtual Proto_t pasco2::SBus::getProtocol ( void  )
pure virtual

Gets the specific serial protocol.

Returns
PAS CO2 serial protocol
Return values
BUS_PROTO_I2C
BUS_PROTO_UART

Implemented in pasco2::I2C, and pasco2::UART.


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