42#define CHIP_NAME "JXCT JED1XX"
43#define MANUFACTURER_NAME "JXCT"
44#define SUPPLY_VOLTAGE_MIN 3.3f
45#define SUPPLY_VOLTAGE_MAX 5.0f
46#define MAX_CURRENT 25.0f
47#define TEMPERATURE_MIN -40.0f
48#define TEMPERATURE_MAX 85.0f
49#define DRIVER_VERSION 1000
54#define JED1XX_ADDRESS 0x54
67static uint8_t a_jed1xx_iic_read(
jed1xx_handle_t *handle, uint8_t reg, uint8_t *data, uint16_t len)
88static uint8_t a_jed1xx_iic_write(
jed1xx_handle_t *handle, uint8_t reg, uint8_t *data, uint16_t len)
114 handle->
type = (uint32_t)(type);
162 handle->
debug_print(
"jed1xx: iic_init is null.\n");
168 handle->
debug_print(
"jed1xx: iic_deinit is null.\n");
174 handle->
debug_print(
"jed1xx: iic_read is null.\n");
180 handle->
debug_print(
"jed1xx: iic_write is null.\n");
186 handle->
debug_print(
"jed1xx: delay_ms is null.\n");
225 handle->
debug_print(
"jed1xx: iic deinit failed.\n");
260 res = a_jed1xx_iic_read(handle, 0xA1, buf, 2);
263 handle->
debug_print(
"jed1xx: read data failed.\n");
267 *raw = (((uint16_t)buf[0]) << 8) | buf[1];
268 *ppm = (float)(*raw) / 10000.0f * (float)(handle->
type);
297 if (a_jed1xx_iic_write(handle, reg, buf, len) != 0)
330 if (a_jed1xx_iic_read(handle, reg, buf, len) != 0)
#define SUPPLY_VOLTAGE_MAX
#define JED1XX_ADDRESS
chip address definition
#define MANUFACTURER_NAME
#define SUPPLY_VOLTAGE_MIN
#define CHIP_NAME
chip information definition
driver jed1xx header file
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
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
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)
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v