Hall Switch  2.1.0
C++ library of Infineon single Hall-effect switch family for magnetic sensing applications
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. More...
 
 HallSwitchRpi (PlatformRpi_t hwPlatf, CBack_t cBack=NULL)
 Hall switch Raspberry Pi instance constructor with predefined Raspberry Pi hardware platform. More...
 
- Public Member Functions inherited from HallSwitch
 HallSwitch ()
 Hall Switch Default Constructor. More...
 
 HallSwitch (GPIO *output, CBack_t cBack=NULL, GPIO *power=NULL)
 Hall Switch Constructor. More...
 
 ~HallSwitch ()
 Hall Switch Destructor Disables the sensor: More...
 
Error_t init ()
 Initializes the hardware interfaces. More...
 
Error_t deinit ()
 Deinitializes the hardware interfaces. More...
 
Error_t enable ()
 Enables the sensor. More...
 
Error_t disable ()
 Disables the sensor. More...
 
Status_t getStatus ()
 Gets the sensor status. More...
 
Error_t updateBField ()
 Updates instance magnetic field value. More...
 
Result_t getBField ()
 Gets magnetic field. More...
 

Additional Inherited Members

- Public Types inherited from HallSwitch
typedef void(* CBack_t) (Result_t)
 Callback function type for interrupt mode. More...
 
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. More...
 
- Protected Attributes inherited from HallSwitch
Status_t status
 
GPIOoutput
 
Result_t bfieldVal
 
CBack_t cBack
 
MeasMode_t measMode
 
GPIOpower
 
PowerMode_t powerMode
 

Constructor & Destructor Documentation

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::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: