radar-bgt60  1.1.1
C++ library for the BGT60LTR11AIP - XENSIV™ 60 Ghz Radar from Infineon
BGT60 API
Collaboration diagram for BGT60 API:

Data Structures

class  Bgt60
 

Error codes

enum  bgt60::Error_t {
  bgt60::OK = 0, bgt60::INTF_ERROR = -1, bgt60::CONF_ERROR = -2, bgt60::READ_ERROR = -3,
  bgt60::WRITE_ERROR = -4
}
 

Detailed Description


Data Structure Documentation

◆ Bgt60

class Bgt60
Inheritance diagram for Bgt60:

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

 Bgt60 (GPIO *tDet, GPIO *pDet)
 Radar Bgt60 constructor. More...
 
 ~Bgt60 ()
 Radar Bgt60 destructor. 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...
 

Member Enumeration Documentation

◆ Motion_t

States of motion.

Enumerator
NO_MOTION 

No presence

MOTION 

Presence

◆ Direction_t

States of direction.

Enumerator
NO_DIR 

No direction due to no motion

APPROACHING 

Target approaching

DEPARTING 

Target departing

Constructor & Destructor Documentation

◆ Bgt60()

Bgt60::Bgt60 ( GPIO tDet,
GPIO pDet 
)

Radar Bgt60 constructor.

This is the constructor of the Radar BGT60 board. The user has to pass the two desired pins for reading out the radar data, as well as the mode in which the board should acquire the data.

Parameters
[in]*tDetInstance of a GPIO to read the target-detect-pin
[in]*pDetInstance of a GPIO to read the phase-detect-pin

◆ ~Bgt60()

Bgt60::~Bgt60 ( )

Radar Bgt60 destructor.

Member Function Documentation

◆ init()

Error_t Bgt60::init ( )

Initialize the Bgt60 class object.

Returns
Bgt60 error code
Return values
OKif success
INTF_ERRORif error
Precondition
None
Here is the call graph for this function:

◆ deinit()

Error_t Bgt60::deinit ( )

De-Initialize the Bgt60 class object.

Returns
Bgt60 error code
Return values
OKif success
INTF_ERRORif error
Precondition
init()
Here is the call graph for this function:

◆ getMotion()

Error_t Bgt60::getMotion ( Motion_t motion)

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.

Note
If you're using the interrupt mode of the board just call this function once in the setup(). For each object of the BGT60 this function can be called once. Calling it more often can lead to undesired behavior of the radar board.
Parameters
[in,out]motionThis variable stores the actual state of the target-detect-pin Possible Values:
  • NO_MOTION
  • MOTION
Returns
Bgt60 error code
Return values
OKif success
INTF_ERRORif error
Precondition
init()
Here is the call graph for this function:

◆ getDirection()

Error_t Bgt60::getDirection ( Direction_t direction)

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.

Note
If you're using the interrupt mode of the board just call this function once in the setup(). For each object of the BGT60 this function can be called once. Calling it more often can lead to undesired behavior of the radar board.
Parameters
[in,out]directionThis variable stores the actual state of the phase-detect-pin Possible Values:
  • NO_DIR
  • APPROACHING
  • DEPARTING
Returns
Bgt60 error code
Return values
OKif success
INTF_ERRORif error
Precondition
init()
Here is the call graph for this function:

◆ enableInterrupt()

Error_t Bgt60::enableInterrupt ( void(*)(void)  cback)

Enables the hardware interrupt.

Parameters
[in]*cbackPointer to the interrupt callback function
Returns
Bgt60 error code
Return values
OKif success
INTF_ERRORif interface error
Precondition
init()
Here is the call graph for this function:

◆ disableInterrupt()

Error_t Bgt60::disableInterrupt ( void  )

Disables the hardware interrupt.

Returns
Bgt60 error code
Return values
OKif success
INTF_ERRORif interface error
Precondition
init()
Here is the call graph for this function:

Enumeration Type Documentation

◆ Error_t

Enumerator
OK 

No error

INTF_ERROR 

Interface error

CONF_ERROR 

Configuration error

READ_ERROR 

Read error

WRITE_ERROR 

Write error