radar-bgt60  1.1.1
C++ library for the BGT60LTR11AIP - XENSIV™ 60 Ghz Radar from Infineon
Collaboration diagram for PAL:

Data Structures

class  GPIORpi
 

Detailed Description


Data Structure Documentation

◆ GPIORpi

class GPIORpi
Inheritance diagram for GPIORpi:
Collaboration diagram for GPIORpi:

Public Types

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

Public Member Functions

 GPIORpi ()
 GPIO Rpi constructor. More...
 
 GPIORpi (uint8_t pin, uint8_t mode, VLogic_t logic)
 GPIO Rpi default constructor. More...
 
 ~GPIORpi ()
 GPIO Rpi destructor. More...
 
Error_t init ()
 Initializes the Raspberry Pi GPIO. More...
 
Error_t deinit ()
 Deinitializes the Raspberry Pi GPIO. More...
 
VLevel_t read ()
 Reads the Raspberry Pi GPIO voltage level. More...
 
Error_t write (VLevel_t level)
 Writes the Raspberry Pi GPIO output voltage level. More...
 
Error_t enable ()
 Enable the GPIO. More...
 
Error_t disable ()
 Disable the GPIO. More...
 
Error_t enableInt (void(*cback)(void), IntEvent_t mode)
 Enables the Raspberry Pi GPIO interrupt. More...
 
Error_t disableInt ()
 Disable Raspberry Pi GPIO interrupt. More...
 
IntEvent_t intEvent ()
 Gets the latest Raspberry Pi interrupt event. More...
 

Constructor & Destructor Documentation

◆ GPIORpi() [1/2]

GPIORpi::GPIORpi ( )

GPIO Rpi constructor.

This function sets the basics for a GPIO.

◆ GPIORpi() [2/2]

GPIORpi::GPIORpi ( uint8_t  pin,
uint8_t  mode,
VLogic_t  logic 
)

GPIO Rpi default constructor.

This function is setting the basics for a GPIO. It allows to set the pin number, mode of the pin and the logic level.

Parameters
[in]pinNumber of the desired pin
[in]modeDefines the mode of the pin (INPUT, OUTPUT, etc.)
[in]logicDefines the logic level of the pin

◆ ~GPIORpi()

GPIORpi::~GPIORpi ( )

GPIO Rpi destructor.

This function does cleanup for class object and its class members when the object is destroyed

Member Function Documentation

◆ init()

Error_t GPIORpi::init ( )
virtual

Initializes the Raspberry Pi GPIO.

This function initializes the chosen pin.

Returns
GPIO error code
Return values
OKif success
INTF_ERRORif initialization error

Implements bgt60::GPIO.

◆ deinit()

Error_t GPIORpi::deinit ( )
virtual

Deinitializes the Raspberry Pi GPIO.

This function deinitializes the chosen pin

Returns
GPIO error code
Return values
OKalways

Implements bgt60::GPIO.

◆ read()

GPIORpi::VLevel_t GPIORpi::read ( )
inlinevirtual

Reads the Raspberry Pi GPIO voltage level.

This function reads the logic level of the chosen pin and returns the logic level value.

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

Implements bgt60::GPIO.

◆ write()

Error_t GPIORpi::write ( VLevel_t  level)
inlinevirtual

Writes the Raspberry Pi GPIO output voltage level.

This functions sets the logic level of the chosen pin.

Parameters
[in]levelVoltage level
Returns
GPIO error code
Return values
OKalways

Implements bgt60::GPIO.

◆ enable()

Error_t GPIORpi::enable ( )
inlinevirtual

Enable the GPIO.

Enables the Raspberry Pi GPIO output according to the GPIO logic

  • Low if negative
  • High if positive
    Returns
    GPIO interrupt event
    Return values
    OKalways

Implements bgt60::GPIO.

◆ disable()

Error_t GPIORpi::disable ( )
inlinevirtual

Disable the GPIO.

Disables the Raspberry Pi GPIO output according to the GPIO logic

  • Low if positive
  • High if negative
    Returns
    GPIO error code
    Return values
    OKalways

Implements bgt60::GPIO.

◆ enableInt()

Error_t GPIORpi::enableInt ( void(*)(void)  cback,
IntEvent_t  mode 
)
virtual

Enables the Raspberry Pi GPIO interrupt.

This function enables the interrupt on chosen pin. Depending on the mode, it triggers the interrupt.

Parameters
[in]*cbackFunction pointer of the interrupt callback
[in]modeEvent at which the interrupt will occur
Returns
GPIO error code
Return values
OKif success
INTF_ERRORif error

Implements bgt60::GPIO.

◆ disableInt()

Error_t GPIORpi::disableInt ( )
inlinevirtual

Disable Raspberry Pi GPIO interrupt.

This function disables the interrupt on chosen pin.

Note
Not supported by low level framework.
Returns
GPIO error code
Return values
INTFError always

Implements bgt60::GPIO.

◆ intEvent()

GPIORpi::IntEvent_t GPIORpi::intEvent ( )
inlinevirtual

Gets the latest Raspberry Pi interrupt event.

This function gets the latest interrupt event on the earlier configured GPIO pin.

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

Implements bgt60::GPIO.