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

#include <pas-co2-pal-gpio.hpp>

Inheritance diagram for pasco2::GPIO:

Public Types

Interrupt event
enum  IntEvent_t { INT_FALLING_EDGE = 0, INT_RISING_EDGE = 1 }
 
Voltage level
enum  VLevel_t { GPIO_LOW = 0, GPIO_HIGH = 1 }
 
Voltage logic
enum  VLogic_t { NEGATIVE = 1, POSITIVE = 2 }
 

Public Member Functions

virtual Error_t init ()=0
 Initializes the GPIO. More...
 
virtual Error_t deinit ()=0
 Deinitializes the GPIO. More...
 
virtual Error_t enableInt (void(*cback)(void *))=0
 Enables the GPIO hardware interrupt. More...
 
virtual Error_t disableInt ()=0
 Disables the GPIO hardware interrupt. More...
 
virtual IntEvent_t intEvent ()=0
 Gets the latest interrupt event. More...
 
virtual VLevel_t read ()=0
 Reads the GPIO voltage level. More...
 
virtual Error_t write (VLevel_t level)=0
 Writes the GPIO output voltage level. More...
 
virtual Error_t enable ()=0
 Enables the GPIO output according to the GPIO logic. More...
 
virtual Error_t disable ()=0
 Disables the GPIO output according to the GPIO logic. More...
 

Member Enumeration Documentation

◆ IntEvent_t

Enumerator
INT_FALLING_EDGE 

Interrupt on falling edge

INT_RISING_EDGE 

Interrupt on rising edge

◆ VLevel_t

Enumerator
GPIO_LOW 

Level low

GPIO_HIGH 

Level high

◆ VLogic_t

Enumerator
NEGATIVE 

Negative logic. 0 on voltage level high, 1 on voltage low

POSITIVE 

Positive logic. 1 on voltage level high, 0 on voltage low

Member Function Documentation

◆ init()

virtual Error_t pasco2::GPIO::init ( )
pure virtual

Initializes the GPIO.

Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in GPIOIno.

◆ deinit()

virtual Error_t pasco2::GPIO::deinit ( )
pure virtual

Deinitializes the GPIO.

Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in GPIOIno.

◆ enableInt()

virtual Error_t pasco2::GPIO::enableInt ( void(*)(void *)  cback)
pure virtual

Enables the GPIO hardware interrupt.

Parameters
[in]*cbackFunction pointer of the interrupt callback
Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif error

Implemented in GPIOIno.

◆ disableInt()

virtual Error_t pasco2::GPIO::disableInt ( )
pure virtual

Disables the GPIO hardware interrupt.

Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif disable error

Implemented in GPIOIno.

◆ intEvent()

virtual IntEvent_t pasco2::GPIO::intEvent ( )
pure virtual

Gets the latest interrupt event.

Returns
GPIO interrupt event
Return values
INT_FALLING_EDGEif falling edge event
INT_RISING_EDGEif rising edge event

Implemented in GPIOIno.

◆ read()

virtual VLevel_t pasco2::GPIO::read ( )
pure virtual

Reads the GPIO voltage level.

Returns
GPIO voltage level
Return values
GPIO_LOWif voltage low
GPIO_HIGHif voltage high

Implemented in GPIOIno.

◆ write()

virtual Error_t pasco2::GPIO::write ( VLevel_t  level)
pure virtual

Writes the GPIO output voltage level.

Parameters
[in]levelVoltage level
Returns
PAS CO2 error code
Return values
OKif success
INTF_ERRORif write error

Implemented in GPIOIno.

◆ enable()

virtual Error_t pasco2::GPIO::enable ( )
pure virtual

Enables the GPIO output according to the GPIO logic.

  • Low if negative logic
  • High if positive logic
    Returns
    PAS CO2 error code
    Return values
    OKif success
    INTF_ERRORif error

Implemented in GPIOIno.

◆ disable()

virtual Error_t pasco2::GPIO::disable ( )
pure virtual

Disables the GPIO output according to the GPIO logic.

  • Low if positive logic
  • High if negative logic
    Returns
    PAS CO2 error code
    Return values
    OKif success
    INTF_ERRORif error

Implemented in GPIOIno.


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