27#include <sfTk/sfToolkit.h>
30#include <sfTk/sfTkII2C.h>
35#define SF_VEML7700_DEFAULT_ADDRESS 0x10
130 sfTkError_t
begin(sfTkIBus *theBus =
nullptr);
524 sfTkError_t
getLux(
float &lux);
580 } sfDevVEML7700Config_t;
597 } VEML7700_INTERRUPT_STATUS_REGISTER_t;
601 static constexpr uint8_t VEML7700_CONFIGURATION_REGISTER = 0;
602 static constexpr uint8_t VEML7700_HIGH_THRESHOLD = 1;
603 static constexpr uint8_t VEML7700_LOW_THRESHOLD = 2;
604 static constexpr uint8_t VEML7700_ALS_OUTPUT = 4;
605 static constexpr uint8_t VEML7700_WHITE_OUTPUT = 5;
606 static constexpr uint8_t VEML7700_INTERRUPT_STATUS = 6;
611 VEML7700_CONFIG_INTEGRATION_25ms = 0b1100,
612 VEML7700_CONFIG_INTEGRATION_50ms = 0b1000,
613 VEML7700_CONFIG_INTEGRATION_100ms = 0b0000,
614 VEML7700_CONFIG_INTEGRATION_200ms = 0b0001,
615 VEML7700_CONFIG_INTEGRATION_400ms = 0b0010,
616 VEML7700_CONFIG_INTEGRATION_800ms = 0b0011,
617 VEML7700_CONFIG_INTEGRATION_INVALID
618 } VEML7700_config_integration_time_t;
633 sfTkError_t updateConfiguration(sfDevVEML7700Config_t &config);
Driver class for the VEML7700 ambient light sensor.
Definition: sfDevVEML7700.h:115
VEML7700_sensitivity_mode_t sensitivityMode(void)
Gets the current sensitivity mode setting of the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:369
VEML7700_interrupt_status_t interruptStatus(void)
Retrieves the current interrupt status from the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:542
sfTkError_t powerOn(void)
Powers on the VEML7700 device by clearing the shutdown mode.
Definition: sfDevVEML7700.h:158
VEML7700_integration_time_t integrationTime(void)
Gets the current integration time setting of the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:313
uint16_t lowThreshold(void)
Gets the current low threshold value of the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:438
VEML7700_sensitivity_mode_t getSensitivityMode(void)
Get the Sensitivity Mode object - this is for backward compatibility.
Definition: sfDevVEML7700.h:370
uint16_t getHighThreshold(void)
Get the High Threshold object - this is for backward compatibility.
Definition: sfDevVEML7700.h:431
sfTkError_t shutdown(void)
Puts the VEML7700 device into shutdown mode.
Definition: sfDevVEML7700.h:169
const char * integrationTimeString(void)
Returns a string representation of the current integration time setting.
Definition: sfDevVEML7700.cpp:324
VEML7700_persistence_protect_t getPersistenceProtect(void)
Get the Persistence Protect object - this is for backward compatibility.
Definition: sfDevVEML7700.h:245
bool isConnected()
Checks if the VEML7700 sensor is connected and responding.
Definition: sfDevVEML7700.cpp:147
sfTkError_t enableInterrupt(bool)
Enables or disables the interrupt functionality of the VEML7700 device.
Definition: sfDevVEML7700.cpp:188
const char * sensitivityModeString(void)
Returns a string representation of the current sensitivity mode setting.
Definition: sfDevVEML7700.cpp:382
float getLux(void)
Reads the current ambient light level in lux.
Definition: sfDevVEML7700.cpp:528
sfDevVEML7700()
Definition: sfDevVEML7700.h:117
const char * getIntegrationTimeStr(void)
Get the Integration Time string - this is for backward compatibility.
Definition: sfDevVEML7700.h:328
sfTkError_t setPersistenceProtect(VEML7700_persistence_protect_t pp)
Sets the persistence protection mode for the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:221
uint16_t getWhiteLevel(void)
Reads the current white light level from the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:477
sfTkError_t setIntegrationTime(VEML7700_integration_time_t it)
Sets the integration time for the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:278
VEML7700_interrupt_status_t getInterruptStatus(void)
Gets the interrupt status of the VEML7700 sensor.
Definition: sfDevVEML7700.h:557
bool isShutdown(void)
Checks if the VEML7700 device is currently in shutdown mode.
Definition: sfDevVEML7700.cpp:174
uint16_t highThreshold(void)
Gets the current high threshold value of the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:411
VEML7700_integration_time_t getIntegrationTime(void)
Get the Integration Time object - this is for backward compatibility.
Definition: sfDevVEML7700.h:309
sfTkError_t setHighThreshold(uint16_t threshold)
Sets the high threshold value for the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:395
const char * getSensitivityModeStr(void)
Get the Sensitivity Mode string - this is for backward compatibility.
Definition: sfDevVEML7700.h:390
bool isInterruptEnabled(void)
Checks if the interrupt feature is enabled on the VEML7700 device.
Definition: sfDevVEML7700.cpp:205
VEML7700_persistence_protect_t persistenceProtect(void)
Gets the current persistence protection setting of the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:256
uint16_t getLowThreshold(void)
Get the Low Threshold object - this is for backward compatibility.
Definition: sfDevVEML7700.h:472
sfTkError_t setSensitivityMode(VEML7700_sensitivity_mode_t sm)
Sets the sensitivity mode for the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:337
const char * persistenceProtectString(void)
Returns a string representation of the current persistence protection setting.
Definition: sfDevVEML7700.cpp:265
sfTkError_t setLowThreshold(uint16_t threshold)
Sets the low threshold value for the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:422
sfTkError_t begin(sfTkIBus *theBus=nullptr)
Initializes the VEML7700 device on the specified bus.
Definition: sfDevVEML7700.cpp:121
const char * getPersistenceProtectStr(void)
Get the Persistence Protect object - this is for backward compatibility.
Definition: sfDevVEML7700.h:265
uint16_t getAmbientLight(void)
Reads the ambient light measurement from the VEML7700 sensor.
Definition: sfDevVEML7700.cpp:457
sfTkError_t setShutdown(bool)
Sets the shutdown mode of the VEML7700 device.
Definition: sfDevVEML7700.cpp:156
VEML7700_interrupt_enable_t
Definition: sfDevVEML7700.h:73
@ VEML7700_INT_INVALID
Definition: sfDevVEML7700.h:76
@ VEML7700_INT_ENABLE
Definition: sfDevVEML7700.h:75
@ VEML7700_INT_DISABLE
Definition: sfDevVEML7700.h:74
VEML7700_integration_time_t
Definition: sfDevVEML7700.h:51
@ VEML7700_INTEGRATION_50ms
Definition: sfDevVEML7700.h:53
@ VEML7700_INTEGRATION_100ms
Definition: sfDevVEML7700.h:54
@ VEML7700_INTEGRATION_200ms
Definition: sfDevVEML7700.h:55
@ VEML7700_INTEGRATION_400ms
Definition: sfDevVEML7700.h:56
@ VEML7700_INTEGRATION_25ms
Definition: sfDevVEML7700.h:52
@ VEML7700_INTEGRATION_800ms
Definition: sfDevVEML7700.h:57
@ VEML7700_INTEGRATION_INVALID
Definition: sfDevVEML7700.h:58
const uint16_t kVEML7700ValueError
Definition: sfDevVEML7700.h:96
VEML7700_shutdown_t
Definition: sfDevVEML7700.h:90
@ VEML7700_SHUT_DOWN
Definition: sfDevVEML7700.h:92
@ VEML7700_SHUTDOWN_INVALID
Definition: sfDevVEML7700.h:93
@ VEML7700_POWER_ON
Definition: sfDevVEML7700.h:91
VEML7700_interrupt_status_t
Definition: sfDevVEML7700.h:80
@ VEML7700_INT_STATUS_HIGH
Definition: sfDevVEML7700.h:82
@ VEML7700_INT_STATUS_BOTH
Definition: sfDevVEML7700.h:84
@ VEML7700_INT_STATUS_LOW
Definition: sfDevVEML7700.h:83
@ VEML7700_INT_STATUS_INVALID
Definition: sfDevVEML7700.h:85
@ VEML7700_INT_STATUS_NONE
Definition: sfDevVEML7700.h:81
uint16_t VEML7700_t
Definition: sfDevVEML7700.h:32
VEML7700_sensitivity_mode_t
Definition: sfDevVEML7700.h:39
@ VEML7700_SENSITIVITY_x2
Definition: sfDevVEML7700.h:41
@ VEML7700_SENSITIVITY_INVALID
Definition: sfDevVEML7700.h:44
@ VEML7700_SENSITIVITY_x1
Definition: sfDevVEML7700.h:40
@ VEML7700_SENSITIVITY_x1_8
Definition: sfDevVEML7700.h:42
@ VEML7700_SENSITIVITY_x1_4
Definition: sfDevVEML7700.h:43
VEML7700_persistence_protect_t
Definition: sfDevVEML7700.h:63
@ VEML7700_PERSISTENCE_8
Definition: sfDevVEML7700.h:67
@ VEML7700_PERSISTENCE_4
Definition: sfDevVEML7700.h:66
@ VEML7700_PERSISTENCE_2
Definition: sfDevVEML7700.h:65
@ VEML7700_PERSISTENCE_1
Definition: sfDevVEML7700.h:64
@ VEML7700_PERSISTENCE_INVALID
Definition: sfDevVEML7700.h:68