Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
SparkFun_VEML6030.hpp File Reference

Public driver declarations and configuration constants. More...

#include <TwoWire.hpp>
#include <cox.h>

Classes

class  SparkFun_VEML6030
 VEML6030 ambient and white-light sensor driver. Register reads/writes do not expose transport error status. Configure gain and integration time before setting lux-based interrupt thresholds. More...

Macros

#define ENABLE   0x01
 Enable a VEML6030 register feature.
#define DISABLE   0x00
 Disable a VEML6030 register feature.
#define SHUTDOWN   0x01
 VEML6030 shutdown bit value.
#define POWER   0x00
 VEML6030 powered-on bit value.
#define NO_INT   0x00
 No decoded VEML6030 interrupt.
#define INT_HIGH   0x01
 Decoded VEML6030 upper-threshold interrupt.
#define INT_LOW   0x02
 Decoded VEML6030 lower-threshold interrupt.
#define UNKNOWN_ERROR   0xFF
 VEML6030 invalid-setting sentinel, 0xFF.

Enumerations

enum  VEML6030_16BIT_REGISTERS {
  SETTING_REG = 0x00 , H_THRESH_REG , L_THRESH_REG , POWER_SAVE_REG ,
  AMBIENT_LIGHT_DATA_REG , WHITE_LIGHT_DATA_REG , INTERRUPT_REG
}
 VEML6030 register addresses. More...
enum  VEML6030_16BIT_REG_MASKS {
  THRESH_MASK = 0x0 , GAIN_MASK = 0xE7FF , INTEG_MASK = 0xFC3F , PERS_PROT_MASK = 0xFFCF ,
  INT_EN_MASK = 0xFFFD , SD_MASK = 0xFFFE , POW_SAVE_EN_MASK = 0x06 , POW_SAVE_MASK = 0x01 ,
  INT_MASK = 0xC000
}
 Masks retaining unrelated VEML6030 register bits. More...
enum  REGISTER_BIT_POSITIONS {
  NO_SHIFT = 0x00 , INT_EN_POS = 0x01 , PSM_POS = 0x01 , PERS_PROT_POS = 0x04 ,
  INTEG_POS = 0x06 , GAIN_POS = 0xB , INT_POS = 0xE
}
 Bit positions of VEML6030 register fields. More...

Variables

const uint8_t defAddr = 0x48
 Default 7-bit sensor address, 0x48.
const uint8_t altAddr = 0x10
 Alternative 7-bit sensor address, 0x10.
const float eightHIt [] = {.0036, .0072, .0288, .0576}
 Lux-per-count conversion factors for 800 ms integration, indexed by gain bits.
const float fourHIt [] = {.0072, .0144, .0576, .1152}
 Lux-per-count conversion factors for 400 ms integration, indexed by gain bits.
const float twoHIt [] = {.0144, .0288, .1152, .2304}
 Lux-per-count conversion factors for 200 ms integration, indexed by gain bits.
const float oneHIt [] = {.0288, .0576, .2304, .4608}
 Lux-per-count conversion factors for 100 ms integration, indexed by gain bits.
const float fiftyIt [] = {.0576, .1152, .4608, .9216}
 Lux-per-count conversion factors for 50 ms integration, indexed by gain bits.
const float twentyFiveIt [] = {.1152, .2304, .9216, 1.8432}
 Lux-per-count conversion factors for 25 ms integration, indexed by gain bits.

Detailed Description

Public driver declarations and configuration constants.