62#ifndef BA234_READ_TIMEOUT
63 #define BA234_READ_TIMEOUT 2000
145#define DRIVER_BA234_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
153#define DRIVER_BA234_LINK_UART_INIT(HANDLE, FUC) (HANDLE)->uart_init = FUC
161#define DRIVER_BA234_LINK_UART_DEINIT(HANDLE, FUC) (HANDLE)->uart_deinit = FUC
169#define DRIVER_BA234_LINK_UART_READ(HANDLE, FUC) (HANDLE)->uart_read = FUC
177#define DRIVER_BA234_LINK_UART_WRITE(HANDLE, FUC) (HANDLE)->uart_write = FUC
185#define DRIVER_BA234_LINK_UART_FLUSH(HANDLE, FUC) (HANDLE)->uart_flush = FUC
193#define DRIVER_BA234_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
201#define DRIVER_BA234_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
struct ba234_info_s ba234_info_t
ba234 information structure definition
uint8_t ba234_info(ba234_info_t *info)
get chip's information
uint8_t ba234_get_last_status(ba234_handle_t *handle, ba234_status_t *status)
get last status
uint8_t ba234_init(ba234_handle_t *handle)
initialize the chip
uint8_t ba234_deinit(ba234_handle_t *handle)
close the chip
struct ba234_handle_s ba234_handle_t
ba234 handle structure definition
uint8_t ba234_salinity_calibration(ba234_handle_t *handle, uint16_t value)
salinity calibration
uint8_t ba234_baseline_calibration(ba234_handle_t *handle)
baseline calibration
uint8_t ba234_read(ba234_handle_t *handle, ba234_data_t *data)
read the data
struct ba234_data_s ba234_data_t
ba234 data structure definition
uint8_t ba234_salinity_convert_to_data(ba234_handle_t *handle, uint16_t reg, float *percentage)
convert the register raw data to the salinity
uint8_t ba234_salinity_convert_to_register(ba234_handle_t *handle, float percentage, uint16_t *reg)
convert the salinity to the register raw data
ba234_status_t
ba234 status enumeration definition
@ BA234_STATUS_CALIBRATION_ERROR
@ BA234_STATUS_FRAME_ERROR
uint8_t ba234_get_buffer(ba234_handle_t *handle, uint8_t *buf, uint16_t len)
get buffer
uint8_t ba234_set_buffer(ba234_handle_t *handle, uint8_t *buf, uint16_t len)
set buffer
ba234 data structure definition
float temperature_degrees_celsius
float electrical_conductivity_us_cm
float salinity_percentage
uint16_t specific_gravity_raw
uint16_t water_hardness_raw
uint32_t electrical_conductivity_raw
ba234 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)
ba234 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v