37#ifndef DRIVER_AOX4000_H
38#define DRIVER_AOX4000_H
63#ifndef AOX4000_UART_DELAY_MS
64 #define AOX4000_UART_DELAY_MS 200
70#ifndef AOX4000_UART_POLL_DELAY_MS
71 #define AOX4000_UART_POLL_DELAY_MS 3500
146#define DRIVER_AOX4000_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
154#define DRIVER_AOX4000_LINK_UART_INIT(HANDLE, FUC) (HANDLE)->uart_init = FUC
162#define DRIVER_AOX4000_LINK_UART_DEINIT(HANDLE, FUC) (HANDLE)->uart_deinit = FUC
170#define DRIVER_AOX4000_LINK_UART_READ(HANDLE, FUC) (HANDLE)->uart_read = FUC
178#define DRIVER_AOX4000_LINK_UART_WRITE(HANDLE, FUC) (HANDLE)->uart_write = FUC
186#define DRIVER_AOX4000_LINK_UART_FLUSH(HANDLE, FUC) (HANDLE)->uart_flush = FUC
194#define DRIVER_AOX4000_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
202#define DRIVER_AOX4000_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
264 float *oxygen_density_percentage,
265 float *temperature_degree,
float *pressure_mbar);
uint8_t aox4000_read(aox4000_handle_t *handle, float *oxygen_ppo2_mbar, float *oxygen_density_percentage, float *temperature_degree, float *pressure_mbar)
read data
uint8_t aox4000_read_oxygen_density(aox4000_handle_t *handle, float *percentage)
read oxygen density
uint8_t aox4000_info(aox4000_info_t *info)
get chip's information
struct aox4000_handle_s aox4000_handle_t
aox4000 handle structure definition
aox4000_status_t
aox4000 status enumeration definition
uint8_t aox4000_read_temperature(aox4000_handle_t *handle, float *degree)
read temperature
uint8_t aox4000_get_last_error(aox4000_handle_t *handle, aox4000_status_t *status)
get last error
uint8_t aox4000_deinit(aox4000_handle_t *handle)
close the chip
aox4000_mode_t
aox4000 mode enumeration definition
uint8_t aox4000_init(aox4000_handle_t *handle)
initialize the chip
struct aox4000_info_s aox4000_info_t
aox4000 information structure definition
uint8_t aox4000_read_oxygen_ppo2(aox4000_handle_t *handle, float *mbar)
read oxygen ppo2
uint8_t aox4000_read_pressure(aox4000_handle_t *handle, float *mbar)
read pressure
uint8_t aox4000_get_mode(aox4000_handle_t *handle, aox4000_mode_t *mode)
get mode
uint8_t aox4000_set_mode(aox4000_handle_t *handle, aox4000_mode_t mode)
set mode
@ AOX4000_STATUS_INVALID_FRAME
@ AOX4000_STATUS_INVALID_PARAM
@ AOX4000_STATUS_INVALID_COMMAND
uint8_t aox4000_command_read(aox4000_handle_t *handle, char *buf, uint16_t len)
command read
uint8_t aox4000_command_write(aox4000_handle_t *handle, char *buf, uint16_t len)
command write
aox4000 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)
aox4000 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v