Hall Switch  2.1.0
C++ library of Infineon single Hall-effect switch family for magnetic sensing applications
HallSwitch::GPIO Class Referenceabstract

#include <hall-pal-gpio.hpp>

Inheritance diagram for HallSwitch::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 HallSwitch::Error_t init ()=0
 Initializes the GPIO. More...
 
virtual HallSwitch::Error_t deinit ()=0
 Deinitializes the GPIO. More...
 
virtual HallSwitch::Error_t enableInt (HallSwitch *ptr)=0
 Enables the hardware interrupt. More...
 
virtual HallSwitch::Error_t disableInt ()=0
 Disables the 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 HallSwitch::Error_t write (VLevel_t level)=0
 Writes the GPIO output voltage level. More...
 
virtual HallSwitch::Error_t enable ()=0
 Enables the GPIO output according to the GPIO logic. More...
 
virtual HallSwitch::Error_t disable ()=0
 Disables the GPIO output according to the GPIO logic. More...
 

Member Enumeration Documentation

Enumerator
INT_FALLING_EDGE 

Interrupt on falling edge

INT_RISING_EDGE 

Interrupt on rising edge

Enumerator
GPIO_LOW 

Level low

GPIO_HIGH 

Level high

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

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

Initializes the GPIO.

Returns
GPIO error code
Return values
OKif success
INTF_ERRORif initialization error

Implemented in GPIOWiced, GPIOIno, and GPIORpi.

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

Deinitializes the GPIO.

Returns
GPIO error code
Return values
OKif success
INTF_ERRORif deinitialization error

Implemented in GPIOWiced, GPIOIno, and GPIORpi.

virtual HallSwitch::Error_t HallSwitch::GPIO::enableInt ( HallSwitch ptr)
pure virtual

Enables the hardware interrupt.

Parameters
[in]*ptrHallSwith object pointer which holds the interrupt
Returns
GPIO error code
Return values
OKif success
INTF_ERRORif initialization error

Implemented in GPIOWiced, GPIOIno, and GPIORpi.

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

Disables the hardware interrupt.

Returns
GPIO error code
Return values
OKif success
INTF_ERRORif disable error

Implemented in GPIOWiced, GPIOIno, and GPIORpi.

virtual IntEvent_t HallSwitch::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 GPIOWiced, GPIOIno, and GPIORpi.

virtual VLevel_t HallSwitch::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 GPIOWiced, GPIOIno, and GPIORpi.

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

Writes the GPIO output voltage level.

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

Implemented in GPIOWiced, GPIOIno, and GPIORpi.

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

Enables the GPIO output according to the GPIO logic.

  • Low if negative
  • High if positive
    Returns
    GPIO interrupt event
    Return values
    OKif success
    INTF_ERRORif write error

Implemented in GPIOWiced, GPIOIno, and GPIORpi.

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

Disables the GPIO output according to the GPIO logic.

  • Low if positive
  • High if negative
    Returns
    GPIO error code
    Return values
    OKif success
    INTF_ERRORif write error

Implemented in GPIOWiced, GPIOIno, and GPIORpi.


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