#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. | |
| 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_GPIO * | output |
| Result_t | bfieldVal |
| CBack_t | cBack |
| MeasMode_t | measMode |
| Hall_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. |