LibDriver BA111
Loading...
Searching...
No Matches
ba111 basic driver function

ba111 basic driver modules More...

Collaboration diagram for ba111 basic driver function:

Data Structures

struct  ba111_handle_s
 ba111 handle structure definition More...
struct  ba111_info_s
 ba111 information structure definition More...

Typedefs

typedef struct ba111_handle_s ba111_handle_t
 ba111 handle structure definition
typedef struct ba111_info_s ba111_info_t
 ba111 information structure definition

Enumerations

enum  ba111_status_t {
  BA111_STATUS_OK = 0x00 , BA111_STATUS_FRAME_ERROR = 0x01 , BA111_STATUS_BUSY = 0x02 , BA111_STATUS_CHECK_ERROR = 0x03 ,
  BA111_STATUS_TEMPERATURE_OUT_OF_RANGE = 0x04
}
 ba111 status enumeration definition More...

Functions

uint8_t ba111_info (ba111_info_t *info)
 get chip's information
uint8_t ba111_init (ba111_handle_t *handle)
 initialize the chip
uint8_t ba111_deinit (ba111_handle_t *handle)
 close the chip
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_baseline_calibration (ba111_handle_t *handle)
 baseline calibration
uint8_t ba111_set_ntc_resistance (ba111_handle_t *handle, uint32_t ohm)
 set ntc resistance
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

Detailed Description

ba111 basic driver modules

Typedef Documentation

◆ ba111_handle_t

ba111 handle structure definition

◆ ba111_info_t

typedef struct ba111_info_s ba111_info_t

ba111 information structure definition

Enumeration Type Documentation

◆ ba111_status_t

ba111 status enumeration definition

Enumerator
BA111_STATUS_OK 

ok

BA111_STATUS_FRAME_ERROR 

frame error

BA111_STATUS_BUSY 

busy

BA111_STATUS_CHECK_ERROR 

check error

BA111_STATUS_TEMPERATURE_OUT_OF_RANGE 

temperature out of range

Definition at line 62 of file driver_ba111.h.

Function Documentation

◆ ba111_baseline_calibration()

uint8_t ba111_baseline_calibration ( ba111_handle_t * handle)

baseline calibration

Parameters
[in]*handlepointer to a ba111 handle structure
Returns
status code
  • 0 success
  • 1 baseline calibration failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 frame error
  • 5 response error
Note
none

Definition at line 327 of file driver_ba111.c.

◆ ba111_deinit()

uint8_t ba111_deinit ( ba111_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a ba111 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 222 of file driver_ba111.c.

◆ ba111_get_last_status()

uint8_t ba111_get_last_status ( ba111_handle_t * handle,
ba111_status_t * status )

get last status

Parameters
[in]*handlepointer to a ba111 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 537 of file driver_ba111.c.

◆ ba111_info()

uint8_t ba111_info ( ba111_info_t * info)

get chip's information

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

Definition at line 639 of file driver_ba111.c.

◆ ba111_init()

uint8_t ba111_init ( ba111_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a ba111 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 153 of file driver_ba111.c.

◆ ba111_read()

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

Parameters
[in]*handlepointer to a ba111 handle structure
[out]*tds_rawpointer to a tds raw data buffer
[out]*tds_ppmpointer to a tds ppm data buffer
[out]*temperature_rawpointer to a temperature raw data buffer
[out]*temperaturepointer to a converted temperature data buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 frame error
Note
none

Definition at line 259 of file driver_ba111.c.

◆ ba111_set_ntc_b()

uint8_t ba111_set_ntc_b ( ba111_handle_t * handle,
uint16_t value )

set ntc b

Parameters
[in]*handlepointer to a ba111 handle structure
[in]valuentc value
Returns
status code
  • 0 success
  • 1 set ntc b failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 frame error
  • 5 response error
Note
none

Definition at line 469 of file driver_ba111.c.

◆ ba111_set_ntc_resistance()

uint8_t ba111_set_ntc_resistance ( ba111_handle_t * handle,
uint32_t ohm )

set ntc resistance

Parameters
[in]*handlepointer to a ba111 handle structure
[in]ohmresistance ohm
Returns
status code
  • 0 success
  • 1 set ntc resistance failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 frame error
  • 5 response error
Note
none

Definition at line 398 of file driver_ba111.c.