LibDriver BH1750FVI  1.0.0
BH1750FVI full-featured driver
driver_bh1750fvi.h File Reference

driver bh1750fvi header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  bh1750fvi_handle_s
 bh1750fvi handle structure definition More...
 
struct  bh1750fvi_info_s
 bh1750fvi information structure definition More...
 

Macros

#define DRIVER_BH1750FVI_LINK_INIT(HANDLE, STRUCTURE)   memset(HANDLE, 0, sizeof(STRUCTURE))
 initialize bh1750fvi_handle_t structure More...
 
#define DRIVER_BH1750FVI_LINK_IIC_INIT(HANDLE, FUC)   (HANDLE)->iic_init = FUC
 link iic_init function More...
 
#define DRIVER_BH1750FVI_LINK_IIC_DEINIT(HANDLE, FUC)   (HANDLE)->iic_deinit = FUC
 link iic_deinit function More...
 
#define DRIVER_BH1750FVI_LINK_IIC_READ_CMD(HANDLE, FUC)   (HANDLE)->iic_read_cmd = FUC
 link iic_read_cmd function More...
 
#define DRIVER_BH1750FVI_LINK_IIC_WRITE_CMD(HANDLE, FUC)   (HANDLE)->iic_write_cmd = FUC
 link iic_write_cmd function More...
 
#define DRIVER_BH1750FVI_LINK_DELAY_MS(HANDLE, FUC)   (HANDLE)->delay_ms = FUC
 link delay_ms function More...
 
#define DRIVER_BH1750FVI_LINK_DEBUG_PEINT(HANDLE, FUC)   (HANDLE)->debug_print = FUC
 link debug_print function More...
 

Typedefs

typedef struct bh1750fvi_handle_s bh1750fvi_handle_t
 bh1750fvi handle structure definition More...
 
typedef struct bh1750fvi_info_s bh1750fvi_info_t
 bh1750fvi information structure definition More...
 

Enumerations

enum  bh1750fvi_address_t { BH1750FVI_ADDRESS_LOW = 0x46 , BH1750FVI_ADDRESS_HIGH = 0xB8 }
 bh1750fvi address enumeration definition More...
 
enum  bh1750fvi_mode_t { BH1750FVI_MODE_HIGH_RESOLUTION_MODE = 0x0 , BH1750FVI_MODE_HIGH_RESOLUTION_MODE2 = 0x1 , BH1750FVI_MODE_LOW_RESOLUTION_MODE = 0x2 }
 bh1750fvi mode enumeration definition More...
 

Functions

uint8_t bh1750fvi_info (bh1750fvi_info_t *info)
 get chip's information More...
 
uint8_t bh1750fvi_set_addr_pin (bh1750fvi_handle_t *handle, bh1750fvi_address_t addr_pin)
 set the address pin More...
 
uint8_t bh1750fvi_get_addr_pin (bh1750fvi_handle_t *handle, bh1750fvi_address_t *addr_pin)
 get the address pin More...
 
uint8_t bh1750fvi_set_mode (bh1750fvi_handle_t *handle, bh1750fvi_mode_t mode)
 set the mode More...
 
uint8_t bh1750fvi_get_mode (bh1750fvi_handle_t *handle, bh1750fvi_mode_t *mode)
 get the mode More...
 
uint8_t bh1750fvi_init (bh1750fvi_handle_t *handle)
 initialize the chip More...
 
uint8_t bh1750fvi_deinit (bh1750fvi_handle_t *handle)
 close the chip More...
 
uint8_t bh1750fvi_single_read (bh1750fvi_handle_t *handle, uint16_t *raw, float *lux)
 read data from the chip once More...
 
uint8_t bh1750fvi_continuous_read (bh1750fvi_handle_t *handle, uint16_t *raw, float *lux)
 read data from the chip continuously More...
 
uint8_t bh1750fvi_start_continuous_read (bh1750fvi_handle_t *handle)
 start chip reading More...
 
uint8_t bh1750fvi_stop_continuous_read (bh1750fvi_handle_t *handle)
 stop chip reading More...
 
uint8_t bh1750fvi_power_down (bh1750fvi_handle_t *handle)
 power down More...
 
uint8_t bh1750fvi_power_on (bh1750fvi_handle_t *handle)
 power on More...
 
uint8_t bh1750fvi_reset (bh1750fvi_handle_t *handle)
 reset More...
 
uint8_t bh1750fvi_set_measurement_time (bh1750fvi_handle_t *handle, uint8_t t)
 set the measurement time More...
 
uint8_t bh1750fvi_set_reg (bh1750fvi_handle_t *handle, uint8_t *buf, uint16_t len)
 set the chip register More...
 
uint8_t bh1750fvi_get_reg (bh1750fvi_handle_t *handle, uint8_t *buf, uint16_t len)
 get the chip register More...
 

Detailed Description

driver bh1750fvi 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
2022-11-30

history

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

Definition in file driver_bh1750fvi.h.