62 BH1792(
int bus = 0,
int addr = 0x5b);
291 void InstallISR(mraa_gpio_edge_t edge,
int pin,
void (*isr)(
void *),
302 void InstallISR(
int pin,
void (*isr)(
void *),
void *isr_args);
void RemoveISR()
Removes the ISR if it is installed.
Definition: bh1792.cxx:290
int GetIrLedCurrent()
Gets the green LED current value.
Definition: bh1792.cxx:112
std::string RegistersDump()
Gets a dump of configuration registers as a string.
Definition: bh1792.cxx:295
LED_TYPES
LED light types.
Definition: bh1792.h:68
int GetFifoSize()
Gets the current size of built-in FIFO.
Definition: bh1792.cxx:141
bh1792 sensor context
Definition: bh1792.h:95
std::vector< int > GetGreenData()
Gets the values from using green LED light.
Definition: bh1792.cxx:216
void SetIrThreshold(uint16_t threshold)
Sets interrupt IR threshold value for non-synchronized mode.
Definition: bh1792.cxx:123
C API for the bh1792 driver.
Definition: bh1792.hpp:50
void InstallISR(mraa_gpio_edge_t edge, int pin, void(*isr)(void *), void *isr_args)
Installs the ISR to a given GPIO pin.
Definition: bh1792.cxx:276
void EnableSingleMode(LED_TYPES led_type, uint16_t current)
Enables and configures the sensor to use single mode. This sets the sensor to take only one measureme...
Definition: bh1792.cxx:269
float GetMeasurementTimeMS()
Gets the value of measurement time is milli-seconds.
Definition: bh1792.cxx:62
BH1792(int bus=0, int addr=0x5b)
Init the sensor with specific bus and address. Before starting measurement, one of (EnableSyncMode...
Definition: bh1792.cxx:31
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
void StartMeasurement()
Starts the measuremnt on sensor or enable the sensor.
Definition: bh1792.cxx:166
bool IsEnabled()
Checks if the measuremnt on sensor is enabled.
Definition: bh1792.cxx:50
void SetIrLedCurrent(uint16_t current)
Sets the IR LED Current value.
Definition: bh1792.cxx:98
virtual ~BH1792()
Close and free sensor.
Definition: bh1792.cxx:38
void DiscardFifoData()
Reads and discard the 32 FIFO entries to reset the WATERMARK interrupt flag.
Definition: bh1792.cxx:209
void SoftReset()
Initiates a software reset to the sensor. All register values will be written to their defaults...
Definition: bh1792.cxx:55
std::vector< std::vector< int > > GetFifoData()
Gets the fifo data of 32 entries and resets the WATERMARK interrupt flag.
Definition: bh1792.cxx:187
int GetIrThreshold()
Gets interrupt IR threshold value.
Definition: bh1792.cxx:130
void StopMeasurement()
Definition: bh1792.cxx:173
void ClearInterrupt()
Clears the interrupt flag allowing more interrupts to be raised.
Definition: bh1792.cxx:159
void DisableInterrupt()
Disables interrupt function. Interrupt is enabled by default on all operation modes, so this have to be called after enabling a specific operation mode.
Definition: bh1792.cxx:152
void CheckWhoAmI()
Check "who am I" register value to identify the sensor.
Definition: bh1792.cxx:43
int GetGreenLedsCurrent()
Gets the green LED current value.
Definition: bh1792.cxx:87
void RestartMeasurement()
Restart the measurement, This function stops measurement, then re-writes the configuration registers ...
Definition: bh1792.cxx:180
void EnableNonSyncMode(uint16_t ir_current, uint16_t threshold)
Enabled and configures the sensor to use non-synchronized mode. This mode uses IR_THRESHOLD interrupt...
Definition: bh1792.cxx:262
void EnableSyncMode(uint16_t measFreq, uint16_t green_current)
Enables and configures the sensor to use synchronized mode. This will use the built-in FIFO and raise...
Definition: bh1792.cxx:248
void SetGreenLedsCurrent(uint16_t current)
Sets the green LED Current value.
Definition: bh1792.cxx:73
std::vector< int > GetIrData()
Gets the values from using IR LED light.
Definition: bh1792.cxx:232