LibDriver STTS22H
Loading...
Searching...
No Matches
driver_stts22h.h File Reference

driver stts22h header file More...

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

Go to the source code of this file.

Data Structures

struct  stts22h_handle_s
 stts22h handle structure definition More...
struct  stts22h_info_s
 stts22h information structure definition More...

Macros

#define DRIVER_STTS22H_LINK_INIT(HANDLE, STRUCTURE)
 initialize stts22h_handle_t structure
#define DRIVER_STTS22H_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_STTS22H_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_STTS22H_LINK_IIC_READ(HANDLE, FUC)
 link iic_read function
#define DRIVER_STTS22H_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_STTS22H_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_STTS22H_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function
#define DRIVER_STTS22H_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
 link receive_callback function

Typedefs

typedef struct stts22h_handle_s stts22h_handle_t
 stts22h handle structure definition
typedef struct stts22h_info_s stts22h_info_t
 stts22h information structure definition

Enumerations

enum  stts22h_address_t { STTS22H_ADDRESS_VDD = 0x70 , STTS22H_ADDRESS_15K = 0x78 , STTS22H_ADDRESS_56K = 0x7C , STTS22H_ADDRESS_GND = 0x7E }
 stts22h address enumeration definition More...
enum  stts22h_bool_t { STTS22H_BOOL_FALSE = 0x00 , STTS22H_BOOL_TRUE = 0x01 }
 stts22h bool enumeration definition More...
enum  stts22h_output_data_rate_t {
  STTS22H_OUTPUT_DATA_RATE_25HZ = 0x00 , STTS22H_OUTPUT_DATA_RATE_50HZ = 0x01 , STTS22H_OUTPUT_DATA_RATE_100HZ = 0x02 , STTS22H_OUTPUT_DATA_RATE_200HZ = 0x03 ,
  STTS22H_OUTPUT_DATA_RATE_1HZ = 0x04
}
 stts22h output data rate enumeration definition More...
enum  stts22h_status_t { STTS22H_STATUS_UNDER_LOW_LIMIT = (1 << 2) , STTS22H_STATUS_OVER_HIGH_LIMIT = (1 << 1) }
 stts22h status enumeration definition More...

Functions

uint8_t stts22h_info (stts22h_info_t *info)
 get chip's information
uint8_t stts22h_set_addr_pin (stts22h_handle_t *handle, stts22h_address_t addr_pin)
 set the iic address pin
uint8_t stts22h_get_addr_pin (stts22h_handle_t *handle, stts22h_address_t *addr_pin)
 get the iic address pin
uint8_t stts22h_irq_handler (stts22h_handle_t *handle)
 irq handler
uint8_t stts22h_init (stts22h_handle_t *handle)
 initialize the chip
uint8_t stts22h_deinit (stts22h_handle_t *handle)
 close the chip
uint8_t stts22h_single_read (stts22h_handle_t *handle, int16_t *raw, float *celsius_deg)
 read data from the chip once
uint8_t stts22h_start_continuous_read (stts22h_handle_t *handle)
 start the chip reading
uint8_t stts22h_stop_continuous_read (stts22h_handle_t *handle)
 stop the chip reading
uint8_t stts22h_continuous_read (stts22h_handle_t *handle, int16_t *raw, float *celsius_deg)
 read data from the chip continuously
uint8_t stts22h_set_temperature_high_limit (stts22h_handle_t *handle, uint8_t raw)
 set temperature high limit
uint8_t stts22h_get_temperature_high_limit (stts22h_handle_t *handle, uint8_t *raw)
 get temperature high limit
uint8_t stts22h_set_temperature_low_limit (stts22h_handle_t *handle, uint8_t raw)
 set temperature low limit
uint8_t stts22h_get_temperature_low_limit (stts22h_handle_t *handle, uint8_t *raw)
 get temperature low limit
uint8_t stts22h_set_output_data_rate (stts22h_handle_t *handle, stts22h_output_data_rate_t rate)
 set output data rate
uint8_t stts22h_get_output_data_rate (stts22h_handle_t *handle, stts22h_output_data_rate_t *rate)
 get output data rate
uint8_t stts22h_set_block_data_update (stts22h_handle_t *handle, stts22h_bool_t enable)
 enable or disable block data update
uint8_t stts22h_get_block_data_update (stts22h_handle_t *handle, stts22h_bool_t *enable)
 get block data update status
uint8_t stts22h_set_iic_address_auto_increment (stts22h_handle_t *handle, stts22h_bool_t enable)
 enable or disable iic address auto increment
uint8_t stts22h_get_iic_address_auto_increment (stts22h_handle_t *handle, stts22h_bool_t *enable)
 get iic address auto increment status
uint8_t stts22h_set_disable_smbus_timeout (stts22h_handle_t *handle, stts22h_bool_t enable)
 enable or disable disable smbus timeout
uint8_t stts22h_get_disable_smbus_timeout (stts22h_handle_t *handle, stts22h_bool_t *enable)
 get disable smbus timeout status
uint8_t stts22h_get_status (stts22h_handle_t *handle, uint8_t *status)
 get status
uint8_t stts22h_temperature_convert_to_register (stts22h_handle_t *handle, float celsius_deg, uint8_t *reg)
 convert the temperature to the register raw data
uint8_t stts22h_temperature_convert_to_data (stts22h_handle_t *handle, uint8_t reg, float *celsius_deg)
 convert the register raw data to the temperature
uint8_t stts22h_set_reg (stts22h_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t stts22h_get_reg (stts22h_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 get the chip register

Detailed Description

driver stts22h 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
2026-02-02

history

Date Version Author Description
2026/02/02 1.0 Shifeng Li first upload

Definition in file driver_stts22h.h.