40static uint8_t gs_flag = 0;
64static void a_receive_callback(uint8_t type)
104 float low_threshold,
float high_threshold, uint32_t times)
driver opt300x interrupt test header file
uint8_t opt300x_set_fault_count(opt300x_handle_t *handle, opt300x_fault_count_t count)
set fault count
uint8_t opt300x_info(opt300x_info_t *info)
get chip's information
uint8_t opt3002_continuous_read(opt300x_handle_t *handle, uint16_t *raw, float *nw_cm2)
read data from the chip continuously
uint8_t opt3005_set_range(opt300x_handle_t *handle, opt3005_range_t range)
set range
uint8_t opt300x_set_type(opt300x_handle_t *handle, opt300x_t type)
set the chip type
uint8_t opt300x_set_mask_exponent(opt300x_handle_t *handle, opt300x_bool_t enable)
enable or disable mask exponent
opt300x_address_t
opt300x address enumeration definition
uint8_t opt300x_set_high_limit(opt300x_handle_t *handle, uint16_t limit)
set high limit
uint8_t opt300x_start_continuous_read(opt300x_handle_t *handle)
start the chip reading
uint8_t opt300x_continuous_read(opt300x_handle_t *handle, uint16_t *raw, float *lux)
read data from the chip continuously
uint8_t opt300x_set_low_limit(opt300x_handle_t *handle, uint16_t limit)
set low limit
struct opt300x_info_s opt300x_info_t
opt300x information structure definition
uint8_t opt300x_limit_convert_to_register(opt300x_handle_t *handle, float lux, uint16_t *reg)
convert the limit threshold to the register raw data
opt300x_t
opt300x type enumeration definition
uint8_t opt300x_set_interrupt_pin_polarity(opt300x_handle_t *handle, opt300x_interrupt_polarity_t polarity)
set interrupt pin polarity
uint8_t opt3002_limit_convert_to_register(opt300x_handle_t *handle, float nw_cm2, uint16_t *reg)
convert the limit threshold to the register raw data
uint8_t opt300x_set_conversion_time(opt300x_handle_t *handle, opt300x_conversion_time_t t)
set conversion time
uint8_t opt300x_set_interrupt_latch(opt300x_handle_t *handle, opt300x_bool_t enable)
enable or disable interrupt latch
uint8_t opt300x_set_range(opt300x_handle_t *handle, opt300x_range_t range)
set range
uint8_t opt300x_deinit(opt300x_handle_t *handle)
close the chip
uint8_t opt300x_stop_continuous_read(opt300x_handle_t *handle)
stop the chip reading
uint8_t opt300x_set_addr_pin(opt300x_handle_t *handle, opt300x_address_t addr_pin)
set the iic address pin
uint8_t opt300x_init(opt300x_handle_t *handle)
initialize the chip
uint8_t opt300x_irq_handler(opt300x_handle_t *handle)
irq handler
uint8_t opt3002_set_range(opt300x_handle_t *handle, opt3002_range_t range)
set range
struct opt300x_handle_s opt300x_handle_t
opt300x handle structure definition
@ OPT300X_CONVERSION_TIME_800_MS
@ OPT300X_INTERRUPT_HIGH_LIMIT
@ OPT300X_INTERRUPT_LOW_LIMIT
@ OPT300X_INTERRUPT_POLARITY_LOW
@ OPT300X_FAULT_COUNT_ONE
void opt300x_interface_delay_ms(uint32_t ms)
interface delay ms
void opt300x_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t opt300x_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
uint8_t opt300x_interface_iic_init(void)
interface iic bus init
uint8_t opt300x_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t opt300x_interface_iic_deinit(void)
interface iic bus deinit
#define DRIVER_OPT300X_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
#define DRIVER_OPT300X_LINK_INIT(HANDLE, STRUCTURE)
initialize opt300x_handle_t structure
#define DRIVER_OPT300X_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function
#define DRIVER_OPT300X_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
link receive_callback function
#define DRIVER_OPT300X_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_OPT300X_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_OPT300X_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_OPT300X_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
uint8_t opt300x_interrupt_test_irq_handler(void)
interrupt test irq
uint8_t opt300x_interrupt_test(opt300x_t type, opt300x_address_t addr_pin, float low_threshold, float high_threshold, uint32_t times)
interrupt test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v