#include <hall-switch-rpi.hpp>


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 |
| GPIO * | output |
| Result_t | bfieldVal |
| CBack_t | cBack |
| MeasMode_t | measMode |
| GPIO * | power |
| PowerMode_t | powerMode |
| 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:
Optional arguments:
| [in] | outputPin | Hall switch output pin |
| [in] | cBack | Callback for interrupt mode. When passed, it enables interrupt mode. |
| [in] | powerPin | Hall switch power pin. When passed, enabled the sensor switch controlled mode. |
| HallSwitchRpi::HallSwitchRpi | ( | PlatformRpi_t | hwPlatf, |
| CBack_t | cBack = NULL |
||
| ) |
Hall switch Raspberry Pi instance constructor with predefined Raspberry Pi hardware platform.
Mandatory arguments:
Optional arguments:
| [in] | hwPlatf | Predefined Raspberry Pi hardware platform. |
| [in] | cBack | Callback for interrupt mode. When passed, it enables interrupt mode. |