120#define DRIVER_BA111_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
128#define DRIVER_BA111_LINK_UART_INIT(HANDLE, FUC) (HANDLE)->uart_init = FUC
136#define DRIVER_BA111_LINK_UART_DEINIT(HANDLE, FUC) (HANDLE)->uart_deinit = FUC
144#define DRIVER_BA111_LINK_UART_READ(HANDLE, FUC) (HANDLE)->uart_read = FUC
152#define DRIVER_BA111_LINK_UART_WRITE(HANDLE, FUC) (HANDLE)->uart_write = FUC
160#define DRIVER_BA111_LINK_UART_FLUSH(HANDLE, FUC) (HANDLE)->uart_flush = FUC
168#define DRIVER_BA111_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
176#define DRIVER_BA111_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
239 uint16_t *temperature_raw,
float *temperature);
struct ba111_handle_s ba111_handle_t
ba111 handle structure definition
uint8_t ba111_init(ba111_handle_t *handle)
initialize the chip
struct ba111_info_s ba111_info_t
ba111 information structure definition
uint8_t ba111_set_ntc_resistance(ba111_handle_t *handle, uint32_t ohm)
set ntc resistance
uint8_t ba111_info(ba111_info_t *info)
get chip's information
ba111_status_t
ba111 status enumeration definition
uint8_t ba111_baseline_calibration(ba111_handle_t *handle)
baseline calibration
uint8_t ba111_read(ba111_handle_t *handle, uint16_t *tds_raw, uint16_t *tds_ppm, uint16_t *temperature_raw, float *temperature)
read the data
uint8_t ba111_deinit(ba111_handle_t *handle)
close the chip
uint8_t ba111_set_ntc_b(ba111_handle_t *handle, uint16_t value)
set ntc b
uint8_t ba111_get_last_status(ba111_handle_t *handle, ba111_status_t *status)
get last status
@ BA111_STATUS_TEMPERATURE_OUT_OF_RANGE
@ BA111_STATUS_CHECK_ERROR
@ BA111_STATUS_FRAME_ERROR
uint8_t ba111_set_buffer(ba111_handle_t *handle, uint8_t *buf, uint16_t len)
set buffer
uint8_t ba111_get_buffer(ba111_handle_t *handle, uint8_t *buf, uint16_t len)
get buffer
ba111 handle structure definition
uint8_t(* uart_flush)(void)
uint8_t(* uart_write)(uint8_t *buf, uint16_t len)
void(* delay_ms)(uint32_t ms)
uint8_t(* uart_deinit)(void)
void(* debug_print)(const char *const fmt,...)
uint16_t(* uart_read)(uint8_t *buf, uint16_t len)
uint8_t(* uart_init)(void)
ba111 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v