Hall Switch 2.1.0
C++ library of Infineon single Hall-effect switch family for magnetic sensing applications
 
Loading...
Searching...
No Matches
HallSwitchRpi Class Reference

#include <hall-switch-rpi.hpp>

Inheritance diagram for HallSwitchRpi:
Collaboration diagram for HallSwitchRpi:

Public Member Functions

 HallSwitchRpi (uint8_t outputPin, CBack_t cBack=NULL, uint8_t powerPin=UNUSED_PIN)
 Hall switch Raspberry Pi instance constructor with Raspberry Pi pins.
 
 HallSwitchRpi (PlatformRpi_t hwPlatf, CBack_t cBack=NULL)
 Hall switch Raspberry Pi instance constructor with predefined Raspberry Pi hardware platform.
 
- Public Member Functions inherited from HallSwitch
 HallSwitch ()
 Hall Switch Default Constructor.
 
 HallSwitch (Hall_GPIO *output, CBack_t cBack=NULL, Hall_GPIO *power=NULL)
 Hall Switch Constructor.
 
 ~HallSwitch ()
 Hall Switch Destructor Disables the sensor:
 
Error_t init ()
 Initializes the hardware interfaces.
 
Error_t deinit ()
 Deinitializes the hardware interfaces.
 
Error_t enable ()
 Enables the sensor.
 
Error_t disable ()
 Disables the sensor.
 
Status_t getStatus ()
 Gets the sensor status.
 
Error_t updateBField ()
 Updates instance magnetic field value.
 
Result_t getBField ()
 Gets magnetic field.
 

Additional Inherited Members

- Public Types inherited from HallSwitch
typedef void(* CBack_t) (Result_t)
 Callback function type for interrupt mode.
 
enum  Error_t { OK = 0 , INTF_ERROR = -1 , CONF_ERROR = -2 }
 
enum  PowerMode_t { MAIN = 1 , SWITCH = 2 }
 
enum  Status_t { UNINITED = 0 , INITED = 1 , POWER_ON = 2 , POWER_OFF = 3 }
 
enum  MeasMode_t { POLLING = 1 , INTERRUPT = 2 }
 
enum  Result_t { B_FIELD_UNDEF = -1 , B_FIELD_OFF = 0 , B_FIELD_ON = 1 }
 
- Protected Member Functions inherited from HallSwitch
virtual void callback ()
 Interrupt mode callback function.
 
- Protected Attributes inherited from HallSwitch
Status_t status
 
Hall_GPIOoutput
 
Result_t bfieldVal
 
CBack_t cBack
 
MeasMode_t measMode
 
Hall_GPIOpower
 
PowerMode_t powerMode
 

Constructor & Destructor Documentation

◆ HallSwitchRpi() [1/2]

HallSwitchRpi::HallSwitchRpi ( uint8_t  outputPin,
CBack_t  cBack = NULL,
uint8_t  powerPin = UNUSED_PIN 
)

Hall switch Raspberry Pi instance constructor with Raspberry Pi pins.

Mandatory arguments:

  • sensor output pin

Optional arguments:

  • interrupt callback. By default NULL. Required to enable interrupt mode.
  • sensor power pin (only for switch powered mode platform). By default it is UNUSED.
Parameters
[in]outputPinHall switch output pin
[in]cBackCallback for interrupt mode. When passed, it enables interrupt mode.
[in]powerPinHall switch power pin. When passed, enabled the sensor switch controlled mode.
Returns
void

◆ HallSwitchRpi() [2/2]

HallSwitchRpi::HallSwitchRpi ( PlatformRpi_t  hwPlatf,
CBack_t  cBack = NULL 
)

Hall switch Raspberry Pi instance constructor with predefined Raspberry Pi hardware platform.

Mandatory arguments:

  • hardware platform

Optional arguments:

  • interrupt callback. By default NULL. Required to enable interrupt mode.
Parameters
[in]hwPlatfPredefined Raspberry Pi hardware platform.
[in]cBackCallback for interrupt mode. When passed, it enables interrupt mode.
Returns
void

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