LibDriver VEML7700
Loading...
Searching...
No Matches
driver_veml7700.h File Reference

driver veml7700 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_veml7700.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  veml7700_handle_s
 veml7700 handle structure definition More...
struct  veml7700_info_s
 veml7700 information structure definition More...

Macros

#define VEML7700_AUTO_RANGE_HIGH_THRESHOLD   0xFF00U
 veml7700 auto range high threshold definition
#define VEML7700_AUTO_RANGE_LOW_THRESHOLD   0x00FFU
 veml7700 auto range low threshold definition
#define DRIVER_VEML7700_LINK_INIT(HANDLE, STRUCTURE)
 initialize veml7700_handle_t structure
#define DRIVER_VEML7700_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_VEML7700_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_VEML7700_LINK_IIC_READ(HANDLE, FUC)
 link iic_read function
#define DRIVER_VEML7700_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_VEML7700_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_VEML7700_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct veml7700_handle_s veml7700_handle_t
 veml7700 handle structure definition
typedef struct veml7700_info_s veml7700_info_t
 veml7700 information structure definition

Enumerations

enum  veml7700_bool_t { VEML7700_BOOL_DISABLE = 0x0 , VEML7700_BOOL_ENABLE = 0x1 }
 veml7700 bool enumeration definition More...
enum  veml7700_als_gain_t { VEML7700_ALS_GAIN_1 = 0x0 , VEML7700_ALS_GAIN_2 = 0x1 , VEML7700_ALS_GAIN_1_DIV_8 = 0x2 , VEML7700_ALS_GAIN_1_DIV_4 = 0x3 }
 veml7700 als gain enumeration definition More...
enum  veml7700_als_integration_time_t {
  VEML7700_ALS_INTEGRATION_TIME_25MS = 0xC , VEML7700_ALS_INTEGRATION_TIME_50MS = 0x8 , VEML7700_ALS_INTEGRATION_TIME_100MS = 0x0 , VEML7700_ALS_INTEGRATION_TIME_200MS = 0x1 ,
  VEML7700_ALS_INTEGRATION_TIME_400MS = 0x2 , VEML7700_ALS_INTEGRATION_TIME_800MS = 0x3
}
 veml7700 als integration time enumeration definition More...
enum  veml7700_als_persistence_t { VEML7700_ALS_PERSISTENCE_1 = 0x0 , VEML7700_ALS_PERSISTENCE_2 = 0x1 , VEML7700_ALS_PERSISTENCE_4 = 0x2 , VEML7700_ALS_PERSISTENCE_8 = 0x3 }
 veml7700 als persistence enumeration definition More...
enum  veml7700_als_mode_t { VEML7700_ALS_MODE_POWER_ON = 0x0 , VEML7700_ALS_MODE_SHUT_DOWN = 0x1 }
 veml7700 als mode enumeration definition More...
enum  veml7700_power_saving_mode_t { VEML7700_POWER_SAVING_MODE1 = 0x0 , VEML7700_POWER_SAVING_MODE2 = 0x1 , VEML7700_POWER_SAVING_MODE3 = 0x2 , VEML7700_POWER_SAVING_MODE4 = 0x3 }
 veml7700 power saving mode enumeration definition More...

Functions

uint8_t veml7700_info (veml7700_info_t *info)
 get chip's information
uint8_t veml7700_init (veml7700_handle_t *handle)
 initialize the chip
uint8_t veml7700_deinit (veml7700_handle_t *handle)
 close the chip
uint8_t veml7700_read_als (veml7700_handle_t *handle, uint16_t *raw, double *lux)
 read als channel
uint8_t veml7700_read_white (veml7700_handle_t *handle, uint16_t *raw)
 read white channel
uint8_t veml7700_set_auto_range (veml7700_handle_t *handle, veml7700_bool_t enable)
 set auto range
uint8_t veml7700_get_auto_range (veml7700_handle_t *handle, veml7700_bool_t *enable)
 get auto range
uint8_t veml7700_set_als_gain (veml7700_handle_t *handle, veml7700_als_gain_t gain)
 set als gain
uint8_t veml7700_get_als_gain (veml7700_handle_t *handle, veml7700_als_gain_t *gain)
 get als gain
uint8_t veml7700_set_als_integration_time (veml7700_handle_t *handle, veml7700_als_integration_time_t t)
 set als integration time
uint8_t veml7700_get_als_integration_time (veml7700_handle_t *handle, veml7700_als_integration_time_t *t)
 get als integration time
uint8_t veml7700_set_als_persistence (veml7700_handle_t *handle, veml7700_als_persistence_t persistence)
 set als persistence
uint8_t veml7700_get_als_persistence (veml7700_handle_t *handle, veml7700_als_persistence_t *persistence)
 get als persistence
uint8_t veml7700_set_als_interrupt (veml7700_handle_t *handle, veml7700_bool_t enable)
 enable or disable als interrupt
uint8_t veml7700_get_als_interrupt (veml7700_handle_t *handle, veml7700_bool_t *enable)
 get als interrupt status
uint8_t veml7700_set_als_mode (veml7700_handle_t *handle, veml7700_als_mode_t mode)
 set als mode
uint8_t veml7700_get_als_mode (veml7700_handle_t *handle, veml7700_als_mode_t *mode)
 get als mode
uint8_t veml7700_set_als_high_threshold (veml7700_handle_t *handle, uint16_t threshold)
 set als high threshold
uint8_t veml7700_get_als_high_threshold (veml7700_handle_t *handle, uint16_t *threshold)
 get als high threshold
uint8_t veml7700_set_als_low_threshold (veml7700_handle_t *handle, uint16_t threshold)
 set als low threshold
uint8_t veml7700_get_als_low_threshold (veml7700_handle_t *handle, uint16_t *threshold)
 get als low threshold
uint8_t veml7700_set_power_saving_mode (veml7700_handle_t *handle, veml7700_power_saving_mode_t mode)
 set power saving mode
uint8_t veml7700_get_power_saving_mode (veml7700_handle_t *handle, veml7700_power_saving_mode_t *mode)
 get power saving mode
uint8_t veml7700_set_power_saving (veml7700_handle_t *handle, veml7700_bool_t enable)
 enable or disable power saving
uint8_t veml7700_get_power_saving (veml7700_handle_t *handle, veml7700_bool_t *enable)
 get power saving status
uint8_t veml7700_get_interrupt_status (veml7700_handle_t *handle, veml7700_bool_t *low_threshold, veml7700_bool_t *high_threshold)
 get interrupt status
uint8_t veml7700_set_reg (veml7700_handle_t *handle, uint8_t reg, uint16_t data)
 set the chip register
uint8_t veml7700_get_reg (veml7700_handle_t *handle, uint8_t reg, uint16_t *data)
 get the chip register

Detailed Description

driver veml7700 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2025-11-30

history

Date Version Author Description
2025/11/30 1.0 Shifeng Li first upload

Definition in file driver_veml7700.h.