LibDriver AOX4000
Loading...
Searching...
No Matches
aox4000 basic driver function

aox4000 basic driver modules More...

Collaboration diagram for aox4000 basic driver function:

Data Structures

struct  aox4000_handle_s
 aox4000 handle structure definition More...
struct  aox4000_info_s
 aox4000 information structure definition More...

Macros

#define AOX4000_UART_DELAY_MS   200
 aox4000 uart delay definition
#define AOX4000_UART_POLL_DELAY_MS   3500
 aox4000 uart poll delay definition

Typedefs

typedef struct aox4000_handle_s aox4000_handle_t
 aox4000 handle structure definition
typedef struct aox4000_info_s aox4000_info_t
 aox4000 information structure definition

Enumerations

enum  aox4000_status_t {
  AOX4000_STATUS_OK = 0x00 , AOX4000_STATUS_OVERRUN = 0x01 , AOX4000_STATUS_INVALID_COMMAND = 0x02 , AOX4000_STATUS_INVALID_FRAME = 0x03 ,
  AOX4000_STATUS_INVALID_PARAM = 0x04 , AOX4000_STATUS_UNKNOWN = 0x05
}
 aox4000 status enumeration definition More...
enum  aox4000_mode_t { AOX4000_MODE_AUTO = 0x00 , AOX4000_MODE_REQUEST = 0x01 }
 aox4000 mode enumeration definition More...

Functions

uint8_t aox4000_info (aox4000_info_t *info)
 get chip's information
uint8_t aox4000_init (aox4000_handle_t *handle)
 initialize the chip
uint8_t aox4000_deinit (aox4000_handle_t *handle)
 close the chip
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_ppo2 (aox4000_handle_t *handle, float *mbar)
 read oxygen ppo2
uint8_t aox4000_read_oxygen_density (aox4000_handle_t *handle, float *percentage)
 read oxygen density
uint8_t aox4000_read_temperature (aox4000_handle_t *handle, float *degree)
 read temperature
uint8_t aox4000_read_pressure (aox4000_handle_t *handle, float *mbar)
 read pressure
uint8_t aox4000_set_mode (aox4000_handle_t *handle, aox4000_mode_t mode)
 set mode
uint8_t aox4000_get_mode (aox4000_handle_t *handle, aox4000_mode_t *mode)
 get mode
uint8_t aox4000_get_last_error (aox4000_handle_t *handle, aox4000_status_t *status)
 get last error

Detailed Description

aox4000 basic driver modules

Macro Definition Documentation

◆ AOX4000_UART_DELAY_MS

#define AOX4000_UART_DELAY_MS   200

aox4000 uart delay definition

200ms

Definition at line 64 of file driver_aox4000.h.

◆ AOX4000_UART_POLL_DELAY_MS

#define AOX4000_UART_POLL_DELAY_MS   3500

aox4000 uart poll delay definition

3500ms

Definition at line 71 of file driver_aox4000.h.

Typedef Documentation

◆ aox4000_handle_t

aox4000 handle structure definition

◆ aox4000_info_t

aox4000 information structure definition

Enumeration Type Documentation

◆ aox4000_mode_t

aox4000 mode enumeration definition

Enumerator
AOX4000_MODE_AUTO 

auto mode

AOX4000_MODE_REQUEST 

request mode

Definition at line 90 of file driver_aox4000.h.

◆ aox4000_status_t

aox4000 status enumeration definition

Enumerator
AOX4000_STATUS_OK 

ok

AOX4000_STATUS_OVERRUN 

overrun

AOX4000_STATUS_INVALID_COMMAND 

invalid command

AOX4000_STATUS_INVALID_FRAME 

invalid frame

AOX4000_STATUS_INVALID_PARAM 

invalid param

AOX4000_STATUS_UNKNOWN 

unknown

Definition at line 77 of file driver_aox4000.h.

Function Documentation

◆ aox4000_deinit()

uint8_t aox4000_deinit ( aox4000_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to an aox4000 handle structure
Returns
status code
  • 0 success
  • 1 uart deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 400 of file driver_aox4000.c.

◆ aox4000_get_last_error()

uint8_t aox4000_get_last_error ( aox4000_handle_t * handle,
aox4000_status_t * status )

get last error

Parameters
[in]*handlepointer to an aox4000 handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 432 of file driver_aox4000.c.

◆ aox4000_get_mode()

uint8_t aox4000_get_mode ( aox4000_handle_t * handle,
aox4000_mode_t * mode )

get mode

Parameters
[in]*handlepointer to an aox4000 handle structure
[out]*modepointer to a chip mode buffer
Returns
status code
  • 0 success
  • 1 get mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 533 of file driver_aox4000.c.

◆ aox4000_info()

uint8_t aox4000_info ( aox4000_info_t * info)

get chip's information

Parameters
[out]*infopointer to an aox4000 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 1162 of file driver_aox4000.c.

◆ aox4000_init()

uint8_t aox4000_init ( aox4000_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an aox4000 handle structure
Returns
status code
  • 0 success
  • 1 uart initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 331 of file driver_aox4000.c.

◆ aox4000_read()

uint8_t aox4000_read ( aox4000_handle_t * handle,
float * oxygen_ppo2_mbar,
float * oxygen_density_percentage,
float * temperature_degree,
float * pressure_mbar )

read data

Parameters
[in]*handlepointer to an aox4000 handle structure
[out]*oxygen_ppo2_mbarpointer to a oxygen ppo2 mbar buffer
[out]*oxygen_density_percentagepointer to an oxygen density percentage buffer
[out]*temperature_degreepointer to a temperature degree buffer
[out]*pressure_mbarpointer to a pressure mbar buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 604 of file driver_aox4000.c.

◆ aox4000_read_oxygen_density()

uint8_t aox4000_read_oxygen_density ( aox4000_handle_t * handle,
float * percentage )

read oxygen density

Parameters
[in]*handlepointer to an aox4000 handle structure
[out]*percentagepointer to an oxygen density percentage buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 796 of file driver_aox4000.c.

◆ aox4000_read_oxygen_ppo2()

uint8_t aox4000_read_oxygen_ppo2 ( aox4000_handle_t * handle,
float * mbar )

read oxygen ppo2

Parameters
[in]*handlepointer to an aox4000 handle structure
[out]*mbarpointer to a oxygen ppo2 mbar buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 699 of file driver_aox4000.c.

◆ aox4000_read_pressure()

uint8_t aox4000_read_pressure ( aox4000_handle_t * handle,
float * mbar )

read pressure

Parameters
[in]*handlepointer to an aox4000 handle structure
[out]*mbarpointer to a pressure mbar buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 893 of file driver_aox4000.c.

◆ aox4000_read_temperature()

uint8_t aox4000_read_temperature ( aox4000_handle_t * handle,
float * degree )

read temperature

Parameters
[in]*handlepointer to an aox4000 handle structure
[out]*degreepointer to a temperature degree buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 989 of file driver_aox4000.c.

◆ aox4000_set_mode()

uint8_t aox4000_set_mode ( aox4000_handle_t * handle,
aox4000_mode_t mode )

set mode

Parameters
[in]*handlepointer to an aox4000 handle structure
[in]modechip mode
Returns
status code
  • 0 success
  • 1 set mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 459 of file driver_aox4000.c.