37 #ifndef DRIVER_BH1750FVI_H
38 #define DRIVER_BH1750FVI_H
128 #define DRIVER_BH1750FVI_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
136 #define DRIVER_BH1750FVI_LINK_IIC_INIT(HANDLE, FUC) (HANDLE)->iic_init = FUC
144 #define DRIVER_BH1750FVI_LINK_IIC_DEINIT(HANDLE, FUC) (HANDLE)->iic_deinit = FUC
152 #define DRIVER_BH1750FVI_LINK_IIC_READ_CMD(HANDLE, FUC) (HANDLE)->iic_read_cmd = FUC
160 #define DRIVER_BH1750FVI_LINK_IIC_WRITE_CMD(HANDLE, FUC) (HANDLE)->iic_write_cmd = FUC
168 #define DRIVER_BH1750FVI_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
176 #define DRIVER_BH1750FVI_LINK_DEBUG_PEINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
uint8_t bh1750fvi_stop_continuous_read(bh1750fvi_handle_t *handle)
stop chip reading
uint8_t bh1750fvi_reset(bh1750fvi_handle_t *handle)
reset
uint8_t bh1750fvi_single_read(bh1750fvi_handle_t *handle, uint16_t *raw, float *lux)
read data from the chip once
uint8_t bh1750fvi_get_addr_pin(bh1750fvi_handle_t *handle, bh1750fvi_address_t *addr_pin)
get the address pin
uint8_t bh1750fvi_deinit(bh1750fvi_handle_t *handle)
close the chip
uint8_t bh1750fvi_start_continuous_read(bh1750fvi_handle_t *handle)
start chip reading
struct bh1750fvi_info_s bh1750fvi_info_t
bh1750fvi information structure definition
struct bh1750fvi_handle_s bh1750fvi_handle_t
bh1750fvi handle structure definition
uint8_t bh1750fvi_set_measurement_time(bh1750fvi_handle_t *handle, uint8_t t)
set the measurement time
uint8_t bh1750fvi_continuous_read(bh1750fvi_handle_t *handle, uint16_t *raw, float *lux)
read data from the chip continuously
uint8_t bh1750fvi_set_addr_pin(bh1750fvi_handle_t *handle, bh1750fvi_address_t addr_pin)
set the address pin
uint8_t bh1750fvi_info(bh1750fvi_info_t *info)
get chip's information
uint8_t bh1750fvi_power_down(bh1750fvi_handle_t *handle)
power down
bh1750fvi_mode_t
bh1750fvi mode enumeration definition
uint8_t bh1750fvi_power_on(bh1750fvi_handle_t *handle)
power on
uint8_t bh1750fvi_init(bh1750fvi_handle_t *handle)
initialize the chip
bh1750fvi_address_t
bh1750fvi address enumeration definition
uint8_t bh1750fvi_get_mode(bh1750fvi_handle_t *handle, bh1750fvi_mode_t *mode)
get the mode
uint8_t bh1750fvi_set_mode(bh1750fvi_handle_t *handle, bh1750fvi_mode_t mode)
set the mode
@ BH1750FVI_MODE_HIGH_RESOLUTION_MODE
@ BH1750FVI_MODE_LOW_RESOLUTION_MODE
@ BH1750FVI_MODE_HIGH_RESOLUTION_MODE2
uint8_t bh1750fvi_get_reg(bh1750fvi_handle_t *handle, uint8_t *buf, uint16_t len)
get the chip register
uint8_t bh1750fvi_set_reg(bh1750fvi_handle_t *handle, uint8_t *buf, uint16_t len)
set the chip register
bh1750fvi handle structure definition
void(* delay_ms)(uint32_t ms)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* iic_read_cmd)(uint8_t addr, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
uint8_t(* iic_write_cmd)(uint8_t addr, uint8_t *buf, uint16_t len)
bh1750fvi information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v