37#ifndef DRIVER_JED1XX_H
38#define DRIVER_JED1XX_H
87 uint8_t (*
iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
88 uint8_t (*
iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
128#define DRIVER_JED1XX_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
136#define DRIVER_JED1XX_LINK_IIC_INIT(HANDLE, FUC) (HANDLE)->iic_init = FUC
144#define DRIVER_JED1XX_LINK_IIC_DEINIT(HANDLE, FUC) (HANDLE)->iic_deinit = FUC
152#define DRIVER_JED1XX_LINK_IIC_READ(HANDLE, FUC) (HANDLE)->iic_read = FUC
160#define DRIVER_JED1XX_LINK_IIC_WRITE(HANDLE, FUC) (HANDLE)->iic_write = FUC
168#define DRIVER_JED1XX_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
176#define DRIVER_JED1XX_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
uint8_t jed1xx_deinit(jed1xx_handle_t *handle)
close the chip
struct jed1xx_handle_s jed1xx_handle_t
jed1xx handle structure definition
struct jed1xx_info_s jed1xx_info_t
jed1xx information structure definition
uint8_t jed1xx_set_type(jed1xx_handle_t *handle, jed1xx_type_t type)
set the chip type
uint8_t jed1xx_read(jed1xx_handle_t *handle, uint16_t *raw, float *ppm)
read data
jed1xx_type_t
jed1xx type enumeration definition
uint8_t jed1xx_info(jed1xx_info_t *info)
get chip's information
uint8_t jed1xx_init(jed1xx_handle_t *handle)
initialize the chip
uint8_t jed1xx_get_type(jed1xx_handle_t *handle, jed1xx_type_t *type)
get the chip type
@ JED1XX_TYPE_117_CH3COCH3
uint8_t jed1xx_get_reg(jed1xx_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
get the chip register
uint8_t jed1xx_set_reg(jed1xx_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
set the chip register
jed1xx handle structure definition
void(* delay_ms)(uint32_t ms)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
jed1xx information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v