LibDriver BA121
Loading...
Searching...
No Matches
driver_ba121.h File Reference

driver ba121 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_ba121.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ba121_handle_s
 ba121 handle structure definition More...
struct  ba121_info_s
 ba121 information structure definition More...

Macros

#define DRIVER_BA121_LINK_INIT(HANDLE, STRUCTURE)
 initialize ba121_handle_t structure
#define DRIVER_BA121_LINK_UART_INIT(HANDLE, FUC)
 link uart_init function
#define DRIVER_BA121_LINK_UART_DEINIT(HANDLE, FUC)
 link uart_deinit function
#define DRIVER_BA121_LINK_UART_READ(HANDLE, FUC)
 link uart_read function
#define DRIVER_BA121_LINK_UART_WRITE(HANDLE, FUC)
 link uart_write function
#define DRIVER_BA121_LINK_UART_FLUSH(HANDLE, FUC)
 link uart_flush function
#define DRIVER_BA121_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_BA121_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct ba121_handle_s ba121_handle_t
 ba121 handle structure definition
typedef struct ba121_info_s ba121_info_t
 ba121 information structure definition

Enumerations

enum  ba121_status_t {
  BA121_STATUS_OK = 0x00 , BA121_STATUS_FRAME_ERROR = 0x01 , BA121_STATUS_BUSY = 0x02 , BA121_STATUS_CHECK_ERROR = 0x03 ,
  BA121_STATUS_TEMPERATURE_OUT_OF_RANGE = 0x04
}
 ba121 status enumeration definition More...

Functions

uint8_t ba121_info (ba121_info_t *info)
 get chip's information
uint8_t ba121_init (ba121_handle_t *handle)
 initialize the chip
uint8_t ba121_deinit (ba121_handle_t *handle)
 close the chip
uint8_t ba121_read (ba121_handle_t *handle, uint16_t *conductivity_raw, uint16_t *conductivity_us_cm, uint16_t *temperature_raw, float *temperature)
 read the data
uint8_t ba121_baseline_calibration (ba121_handle_t *handle)
 baseline calibration
uint8_t ba121_set_ntc_resistance (ba121_handle_t *handle, uint32_t ohm)
 set ntc resistance
uint8_t ba121_set_ntc_b (ba121_handle_t *handle, uint16_t value)
 set ntc b
uint8_t ba121_get_last_status (ba121_handle_t *handle, ba121_status_t *status)
 get last status
uint8_t ba121_set_buffer (ba121_handle_t *handle, uint8_t *buf, uint16_t len)
 set buffer
uint8_t ba121_get_buffer (ba121_handle_t *handle, uint8_t *buf, uint16_t len)
 get buffer

Detailed Description

driver ba121 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2025-05-15

history

Date Version Author Description
2025/05/15 1.0 Shifeng Li first upload

Definition in file driver_ba121.h.