Data Structures | |
class | Bgt60Rpi |
Functions | |
Bgt60Rpi::Bgt60Rpi (uint8_t targetDet, uint8_t phaseDet) | |
Constructor of the RaspberryPi Bgt60 object. More... | |
Bgt60Rpi::~Bgt60Rpi () | |
Destructor of the RaspberryPi Bgt60 object. More... | |
Error_t | Bgt60Rpi::enableInterrupt (std::function< void(void)> &cback) |
Enable interrupt. More... | |
class Bgt60Rpi |
Public Types | |
enum | Motion_t { NO_MOTION = 1 , MOTION = 2 } |
States of motion. More... | |
enum | Direction_t { NO_DIR = 0 , APPROACHING = 1 , DEPARTING = 2 } |
States of direction. More... | |
Public Member Functions | |
Bgt60Rpi (uint8_t targetDet, uint8_t phaseDet) | |
Constructor of the RaspberryPi Bgt60 object. More... | |
~Bgt60Rpi () | |
Destructor of the RaspberryPi Bgt60 object. More... | |
Error_t | enableInterrupt (std::function< void(void)> &cback) |
Enable interrupt. More... | |
Error_t | enableInterrupt (void(*cback)(void)) |
Enables the hardware interrupt. More... | |
Error_t | init () |
Initialize the Bgt60 class object. More... | |
Error_t | deinit () |
De-Initialize the Bgt60 class object. More... | |
Error_t | getMotion (Motion_t &motion) |
Read out target-detect-pin. More... | |
Error_t | getDirection (Direction_t &direction) |
Read out phase-detect-pin. More... | |
Error_t | enableInterrupt (void(*cback)(void)) |
Enables the hardware interrupt. More... | |
Error_t | disableInterrupt (void) |
Disables the hardware interrupt. More... | |
|
inherited |
|
inherited |
Error_t Bgt60::enableInterrupt |
|
inherited |
|
inherited |
Read out target-detect-pin.
This function reads out the target-detect-pin. Depending on the choosen mode of the board it is either actively polling the status of the pin or mapping an interrupt to the corresponding pin.
[in,out] | motion | This variable stores the actual state of the target-detect-pin Possible Values:
|
OK | if success |
INTF_ERROR | if error |
|
inherited |
Read out phase-detect-pin.
This function reads out the phase-detect-pin. Depending on the choosen mode of the board it is either actively polling the status of the pin or mapping an interrupt to the corresponding pin.
[in,out] | direction | This variable stores the actual state of the phase-detect-pin Possible Values:
|
OK | if success |
INTF_ERROR | if error |
|
inherited |
Bgt60Rpi::Bgt60Rpi | ( | uint8_t | targetDet, |
uint8_t | phaseDet | ||
) |
Constructor of the RaspberryPi Bgt60 object.
This function is the instance constructor. It accepts the Raspberry Pi GPIO pins utilized for target and phase detect from the user. These pins are initialized by creating instances to GPIORpi and then mapped to main Bgt60 class.
[in] | targetDet | Pin number of the target detect pin |
[in] | phaseDet | Pin number of the phase detect pin |
[in] | pinMode | Desired mode of the board, polling or interrupt driven |
Bgt60Rpi::~Bgt60Rpi | ( | ) |
Destructor of the RaspberryPi Bgt60 object.
Error_t Bgt60Rpi::enableInterrupt | ( | std::function< void(void)> & | cback | ) |
Enable interrupt.
[in] | cback | Pointer to the interrupt callback function |
OK | if success |
INTF_ERROR | if error |
CONF_ERROR | if callback resource allocation not avaiable |