Qwiic_VEML6030_Py  2.0.0
Python for SFE Qwiic VEML6030
Loading...
Searching...
No Matches
qwiic_veml6030.QwiicVEML6030 Class Reference
Inheritance diagram for qwiic_veml6030.QwiicVEML6030:

Public Member Functions

def __init__ (self, address=None, i2c_driver=None)
 Constructor. More...
 
def is_connected (self)
 Determines if this device is connected. More...
 
def begin (self)
 Initializes this device with default parameters. More...
 
def set_gain (self, gain_val)
 Sets the gain. More...
 
def read_gain (self)
 Gets the gain. More...
 
def set_integ_time (self, time)
 Sets the integration time. More...
 
def read_integ_time (self)
 Gets the integration time. More...
 
def set_protect (self, prot_val)
 Sets the persistence protect number. More...
 
def read_protect (self)
 Gets the persistence protect number. More...
 
def enable_int (self)
 Enables interrupts. More...
 
def disable_int (self)
 Disables interrupts. More...
 
def read_int_setting (self)
 Gets whether interrupts are enabled. More...
 
def shut_down (self)
 Shuts down the device. More...
 
def power_on (self)
 Powers on the device. More...
 
def enable_pow_save (self)
 Enables power saving mode. More...
 
def disable_pow_save (self)
 Disables power saving mode. More...
 
def read_pow_sav_enabled (self)
 Gets whether power saving is enabled. More...
 
def set_pow_sav_mode (self, mode_val)
 Sets the power saving mode. More...
 
def read_pow_sav_mode (self)
 Gets the power saving mode. More...
 
def read_interrupt (self)
 Gets whether an interrupt has triggered. More...
 
def set_int_low_thresh (self, lux_val)
 Sets the low threshold for interrupts. More...
 
def read_low_thresh (self)
 Gets the low threshold for interrupts. More...
 
def set_int_high_thresh (self, lux_val)
 Sets the high threshold for interrupts. More...
 
def read_high_thresh (self)
 Gets the high threshold for interrupts. More...
 
def read_light (self)
 Gets the measured ambient light in lux. More...
 
def read_white_light (self)
 Gets the measured white light in lux. More...
 

Public Attributes

 address
 

Static Public Attributes

 device_name = _DEFAULT_NAME
 
 available_addresses = _AVAILABLE_I2C_ADDRESS
 
int VEML6030_ENABLE = 0x01
 
int VEML6030_DISABLE = 0x00
 
int VEML6030_SHUTDOWN = 0x01
 
int VEML6030_POWER = 0x00
 
int VEML6030_NO_INT = 0x00
 
int VEML6030_INT_HIGH = 0x01
 
int VEML6030_INT_LOW = 0x02
 
int VEML6030_UNKNOWN_ERROR = 0xFF
 
int VEML6030_SETTING_REG = 0x00
 
int VEML6030_H_THRESH_REG = 0x01
 
int VEML6030_L_THRESH_REG = 0x02
 
int VEML6030_POWER_SAVE_REG = 0x03
 
int VEML6030_AMBIENT_LIGHT_DATA_REG = 0x04
 
int VEML6030_WHITE_LIGHT_DATA_REG = 0x05
 
int VEML6030_INTERRUPT_REG = 0x06
 
int VEML6030_THRESH_MASK = 0x0
 
int VEML6030_GAIN_MASK = 0xE7FF
 
int VEML6030_INTEG_MASK = 0xFC3F
 
int VEML6030_PERS_PROT_MASK = 0xFFCF
 
int VEML6030_INT_EN_MASK = 0xFFFD
 
int VEML6030_SD_MASK = 0xFFFE
 
int VEML6030_POW_SAVE_EN_MASK = 0x06
 
int VEML6030_POW_SAVE_MASK = 0x01
 
int VEML6030_INT_MASK = 0xC000
 
int VEML6030_NO_SHIFT = 0x00
 
int VEML6030_INT_EN_POS = 0x01
 
int VEML6030_PSM_POS = 0x01
 
int VEML6030_PERS_PROT_POS = 0x04
 
int VEML6030_INTEG_POS = 0x06
 
int VEML6030_GAIN_POS = 0xB
 
int VEML6030_INT_POS = 0xE
 
list VEML6030_EIGHT_HIT = [0.0036, 0.0072, 0.0288, 0.0576]
 
list VEML6030_FOUR_HIT = [0.0072, 0.0144, 0.0576, 0.1152]
 
list VEML6030_TWO_HIT = [0.0144, 0.0288, 0.1152, 0.2304]
 
list VEML6030_ONE_HIT = [0.0288, 0.0576, 0.2304, 0.4608]
 
list VEML6030_FIFTY_IT = [0.0576, 0.1152, 0.4608, 0.9216]
 
list VEML6030_TWENTY_FIVE_IT = [0.1152, 0.2304, 0.9216, 1.8432]
 
float VEML6030_GAIN_1_8 = 0.125
 
float VEML6030_GAIN_1_4 = 0.25
 
float VEML6030_GAIN_1 = 1.0
 
float VEML6030_GAIN_2 = 2.0
 
int VEML6030_INTEG_TIME_800 = 800
 
int VEML6030_INTEG_TIME_400 = 400
 
int VEML6030_INTEG_TIME_200 = 200
 
int VEML6030_INTEG_TIME_100 = 100
 
int VEML6030_INTEG_TIME_50 = 50
 
int VEML6030_INTEG_TIME_25 = 25
 

Properties

 connected = property(is_connected)
 

Constructor & Destructor Documentation

◆ __init__()

def qwiic_veml6030.QwiicVEML6030.__init__ (   self,
  address = None,
  i2c_driver = None 
)

Constructor.

Parameters
int,optionaladdress: The I2C address to use for the device If not provided, the default address is used
I2CDriver,optionali2c_driver: An existing i2c driver object If not provided, a driver object is created

Member Function Documentation

◆ begin()

def qwiic_veml6030.QwiicVEML6030.begin (   self)

Initializes this device with default parameters.

Returns
bool Returns True if successful, otherwise False

◆ disable_int()

def qwiic_veml6030.QwiicVEML6030.disable_int (   self)

Disables interrupts.

◆ disable_pow_save()

def qwiic_veml6030.QwiicVEML6030.disable_pow_save (   self)

Disables power saving mode.

◆ enable_int()

def qwiic_veml6030.QwiicVEML6030.enable_int (   self)

Enables interrupts.

◆ enable_pow_save()

def qwiic_veml6030.QwiicVEML6030.enable_pow_save (   self)

Enables power saving mode.

◆ is_connected()

def qwiic_veml6030.QwiicVEML6030.is_connected (   self)

Determines if this device is connected.

Returns
bool True if connected, otherwise False

◆ power_on()

def qwiic_veml6030.QwiicVEML6030.power_on (   self)

Powers on the device.

◆ read_gain()

def qwiic_veml6030.QwiicVEML6030.read_gain (   self)

Gets the gain.

Returns
float Gain, possible values: 1/8, 1/4, 1, and 2

◆ read_high_thresh()

def qwiic_veml6030.QwiicVEML6030.read_high_thresh (   self)

Gets the high threshold for interrupts.

Returns
float High threshold in lux

◆ read_int_setting()

def qwiic_veml6030.QwiicVEML6030.read_int_setting (   self)

Gets whether interrupts are enabled.

Returns
bool True if interrupts are enabled, otherwise False

◆ read_integ_time()

def qwiic_veml6030.QwiicVEML6030.read_integ_time (   self)

Gets the integration time.

Returns
int Integration time, ms

◆ read_interrupt()

def qwiic_veml6030.QwiicVEML6030.read_interrupt (   self)

Gets whether an interrupt has triggered.

Returns
int Interrupt, can be the following: VEML6030_NO_INT, VEML6030_INT_HIGH, or VEML6030_INT_LOW (or VEML6030_UNKOWN_ERROR on error)

◆ read_light()

def qwiic_veml6030.QwiicVEML6030.read_light (   self)

Gets the measured ambient light in lux.

Returns
float Measure ambient light in lux

◆ read_low_thresh()

def qwiic_veml6030.QwiicVEML6030.read_low_thresh (   self)

Gets the low threshold for interrupts.

Returns
float Low threshold in lux

◆ read_pow_sav_enabled()

def qwiic_veml6030.QwiicVEML6030.read_pow_sav_enabled (   self)

Gets whether power saving is enabled.

Returns
bool True if power saving is enabled, otherwise False

◆ read_pow_sav_mode()

def qwiic_veml6030.QwiicVEML6030.read_pow_sav_mode (   self)

Gets the power saving mode.

See datasheet for the effects of each value

Returns
int Power saving mode number, can be 1-4 (or VEML6030_UNKOWN_ERROR on error)

◆ read_protect()

def qwiic_veml6030.QwiicVEML6030.read_protect (   self)

Gets the persistence protect number.

Returns
int Protect number (or VEML6030_UNKOWN_ERROR on error)

◆ read_white_light()

def qwiic_veml6030.QwiicVEML6030.read_white_light (   self)

Gets the measured white light in lux.

Returns
float Measure white light in lux

◆ set_gain()

def qwiic_veml6030.QwiicVEML6030.set_gain (   self,
  gain_val 
)

Sets the gain.

Parameters
gain_valGain, possible values: 1/8, 1/4, 1, and 2 :type: float

◆ set_int_high_thresh()

def qwiic_veml6030.QwiicVEML6030.set_int_high_thresh (   self,
  lux_val 
)

Sets the high threshold for interrupts.

Parameters
floatlux_val: High threshold in lux

◆ set_int_low_thresh()

def qwiic_veml6030.QwiicVEML6030.set_int_low_thresh (   self,
  lux_val 
)

Sets the low threshold for interrupts.

Parameters
floatlux_val: Low threshold in lux

◆ set_integ_time()

def qwiic_veml6030.QwiicVEML6030.set_integ_time (   self,
  time 
)

Sets the integration time.

Parameters
inttime: Integration time in ms, possible values: 25, 50, 100, 200, 400, and 800

◆ set_pow_sav_mode()

def qwiic_veml6030.QwiicVEML6030.set_pow_sav_mode (   self,
  mode_val 
)

Sets the power saving mode.

See datasheet for the effects of each value

Parameters
intmode_val: Power saving mode number, can be 1-4

◆ set_protect()

def qwiic_veml6030.QwiicVEML6030.set_protect (   self,
  prot_val 
)

Sets the persistence protect number.

Parameters
intprot_val: Protect number

◆ shut_down()

def qwiic_veml6030.QwiicVEML6030.shut_down (   self)

Shuts down the device.

Member Data Documentation

◆ address

qwiic_veml6030.QwiicVEML6030.address

◆ available_addresses

qwiic_veml6030.QwiicVEML6030.available_addresses = _AVAILABLE_I2C_ADDRESS
static

◆ device_name

qwiic_veml6030.QwiicVEML6030.device_name = _DEFAULT_NAME
static

◆ VEML6030_AMBIENT_LIGHT_DATA_REG

int qwiic_veml6030.QwiicVEML6030.VEML6030_AMBIENT_LIGHT_DATA_REG = 0x04
static

◆ VEML6030_DISABLE

int qwiic_veml6030.QwiicVEML6030.VEML6030_DISABLE = 0x00
static

◆ VEML6030_EIGHT_HIT

list qwiic_veml6030.QwiicVEML6030.VEML6030_EIGHT_HIT = [0.0036, 0.0072, 0.0288, 0.0576]
static

◆ VEML6030_ENABLE

int qwiic_veml6030.QwiicVEML6030.VEML6030_ENABLE = 0x01
static

◆ VEML6030_FIFTY_IT

list qwiic_veml6030.QwiicVEML6030.VEML6030_FIFTY_IT = [0.0576, 0.1152, 0.4608, 0.9216]
static

◆ VEML6030_FOUR_HIT

list qwiic_veml6030.QwiicVEML6030.VEML6030_FOUR_HIT = [0.0072, 0.0144, 0.0576, 0.1152]
static

◆ VEML6030_GAIN_1

float qwiic_veml6030.QwiicVEML6030.VEML6030_GAIN_1 = 1.0
static

◆ VEML6030_GAIN_1_4

float qwiic_veml6030.QwiicVEML6030.VEML6030_GAIN_1_4 = 0.25
static

◆ VEML6030_GAIN_1_8

float qwiic_veml6030.QwiicVEML6030.VEML6030_GAIN_1_8 = 0.125
static

◆ VEML6030_GAIN_2

float qwiic_veml6030.QwiicVEML6030.VEML6030_GAIN_2 = 2.0
static

◆ VEML6030_GAIN_MASK

int qwiic_veml6030.QwiicVEML6030.VEML6030_GAIN_MASK = 0xE7FF
static

◆ VEML6030_GAIN_POS

int qwiic_veml6030.QwiicVEML6030.VEML6030_GAIN_POS = 0xB
static

◆ VEML6030_H_THRESH_REG

int qwiic_veml6030.QwiicVEML6030.VEML6030_H_THRESH_REG = 0x01
static

◆ VEML6030_INT_EN_MASK

int qwiic_veml6030.QwiicVEML6030.VEML6030_INT_EN_MASK = 0xFFFD
static

◆ VEML6030_INT_EN_POS

int qwiic_veml6030.QwiicVEML6030.VEML6030_INT_EN_POS = 0x01
static

◆ VEML6030_INT_HIGH

int qwiic_veml6030.QwiicVEML6030.VEML6030_INT_HIGH = 0x01
static

◆ VEML6030_INT_LOW

int qwiic_veml6030.QwiicVEML6030.VEML6030_INT_LOW = 0x02
static

◆ VEML6030_INT_MASK

int qwiic_veml6030.QwiicVEML6030.VEML6030_INT_MASK = 0xC000
static

◆ VEML6030_INT_POS

int qwiic_veml6030.QwiicVEML6030.VEML6030_INT_POS = 0xE
static

◆ VEML6030_INTEG_MASK

int qwiic_veml6030.QwiicVEML6030.VEML6030_INTEG_MASK = 0xFC3F
static

◆ VEML6030_INTEG_POS

int qwiic_veml6030.QwiicVEML6030.VEML6030_INTEG_POS = 0x06
static

◆ VEML6030_INTEG_TIME_100

int qwiic_veml6030.QwiicVEML6030.VEML6030_INTEG_TIME_100 = 100
static

◆ VEML6030_INTEG_TIME_200

int qwiic_veml6030.QwiicVEML6030.VEML6030_INTEG_TIME_200 = 200
static

◆ VEML6030_INTEG_TIME_25

int qwiic_veml6030.QwiicVEML6030.VEML6030_INTEG_TIME_25 = 25
static

◆ VEML6030_INTEG_TIME_400

int qwiic_veml6030.QwiicVEML6030.VEML6030_INTEG_TIME_400 = 400
static

◆ VEML6030_INTEG_TIME_50

int qwiic_veml6030.QwiicVEML6030.VEML6030_INTEG_TIME_50 = 50
static

◆ VEML6030_INTEG_TIME_800

int qwiic_veml6030.QwiicVEML6030.VEML6030_INTEG_TIME_800 = 800
static

◆ VEML6030_INTERRUPT_REG

int qwiic_veml6030.QwiicVEML6030.VEML6030_INTERRUPT_REG = 0x06
static

◆ VEML6030_L_THRESH_REG

int qwiic_veml6030.QwiicVEML6030.VEML6030_L_THRESH_REG = 0x02
static

◆ VEML6030_NO_INT

int qwiic_veml6030.QwiicVEML6030.VEML6030_NO_INT = 0x00
static

◆ VEML6030_NO_SHIFT

int qwiic_veml6030.QwiicVEML6030.VEML6030_NO_SHIFT = 0x00
static

◆ VEML6030_ONE_HIT

list qwiic_veml6030.QwiicVEML6030.VEML6030_ONE_HIT = [0.0288, 0.0576, 0.2304, 0.4608]
static

◆ VEML6030_PERS_PROT_MASK

int qwiic_veml6030.QwiicVEML6030.VEML6030_PERS_PROT_MASK = 0xFFCF
static

◆ VEML6030_PERS_PROT_POS

int qwiic_veml6030.QwiicVEML6030.VEML6030_PERS_PROT_POS = 0x04
static

◆ VEML6030_POW_SAVE_EN_MASK

int qwiic_veml6030.QwiicVEML6030.VEML6030_POW_SAVE_EN_MASK = 0x06
static

◆ VEML6030_POW_SAVE_MASK

int qwiic_veml6030.QwiicVEML6030.VEML6030_POW_SAVE_MASK = 0x01
static

◆ VEML6030_POWER

int qwiic_veml6030.QwiicVEML6030.VEML6030_POWER = 0x00
static

◆ VEML6030_POWER_SAVE_REG

int qwiic_veml6030.QwiicVEML6030.VEML6030_POWER_SAVE_REG = 0x03
static

◆ VEML6030_PSM_POS

int qwiic_veml6030.QwiicVEML6030.VEML6030_PSM_POS = 0x01
static

◆ VEML6030_SD_MASK

int qwiic_veml6030.QwiicVEML6030.VEML6030_SD_MASK = 0xFFFE
static

◆ VEML6030_SETTING_REG

int qwiic_veml6030.QwiicVEML6030.VEML6030_SETTING_REG = 0x00
static

◆ VEML6030_SHUTDOWN

int qwiic_veml6030.QwiicVEML6030.VEML6030_SHUTDOWN = 0x01
static

◆ VEML6030_THRESH_MASK

int qwiic_veml6030.QwiicVEML6030.VEML6030_THRESH_MASK = 0x0
static

◆ VEML6030_TWENTY_FIVE_IT

list qwiic_veml6030.QwiicVEML6030.VEML6030_TWENTY_FIVE_IT = [0.1152, 0.2304, 0.9216, 1.8432]
static

◆ VEML6030_TWO_HIT

list qwiic_veml6030.QwiicVEML6030.VEML6030_TWO_HIT = [0.0144, 0.0288, 0.1152, 0.2304]
static

◆ VEML6030_UNKNOWN_ERROR

int qwiic_veml6030.QwiicVEML6030.VEML6030_UNKNOWN_ERROR = 0xFF
static

◆ VEML6030_WHITE_LIGHT_DATA_REG

int qwiic_veml6030.QwiicVEML6030.VEML6030_WHITE_LIGHT_DATA_REG = 0x05
static

Property Documentation

◆ connected

qwiic_veml6030.QwiicVEML6030.connected = property(is_connected)
static

The documentation for this class was generated from the following file: