![]() |
LibDriver STCC4
|
driver stcc4 header file More...
#include <stdio.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | stcc4_handle_s |
| stcc4 handle structure definition More... | |
| struct | stcc4_info_s |
| stcc4 information structure definition More... | |
Macros | |
| #define | DRIVER_STCC4_LINK_INIT(HANDLE, STRUCTURE) |
| initialize stcc4_handle_t structure | |
| #define | DRIVER_STCC4_LINK_IIC_INIT(HANDLE, FUC) |
| link iic_init function | |
| #define | DRIVER_STCC4_LINK_IIC_DEINIT(HANDLE, FUC) |
| link iic_deinit function | |
| #define | DRIVER_STCC4_LINK_IIC_READ_COMMAND(HANDLE, FUC) |
| link iic_read_cmd function | |
| #define | DRIVER_STCC4_LINK_IIC_WRITE_COMMAND(HANDLE, FUC) |
| link iic_write_cmd function | |
| #define | DRIVER_STCC4_LINK_DELAY_MS(HANDLE, FUC) |
| link delay_ms function | |
| #define | DRIVER_STCC4_LINK_DEBUG_PRINT(HANDLE, FUC) |
| link debug_print function | |
Typedefs | |
| typedef struct stcc4_handle_s | stcc4_handle_t |
| stcc4 handle structure definition | |
| typedef struct stcc4_info_s | stcc4_info_t |
| stcc4 information structure definition | |
Enumerations | |
| enum | stcc4_address_t { STCC4_ADDRESS_0 = (0x64 << 1) , STCC4_ADDRESS_1 = (0x65 << 1) } |
| stcc4 address enumeration definition More... | |
| enum | stcc4_bool_t { STCC4_BOOL_FALSE = 0x00 , STCC4_BOOL_TRUE = 0x01 } |
| stcc4 bool enumeration definition More... | |
Functions | |
| uint8_t | stcc4_info (stcc4_info_t *info) |
| get chip information | |
| uint8_t | stcc4_set_address_pin (stcc4_handle_t *handle, stcc4_address_t address) |
| set address pin | |
| uint8_t | stcc4_get_address_pin (stcc4_handle_t *handle, stcc4_address_t *address) |
| get address pin | |
| uint8_t | stcc4_init (stcc4_handle_t *handle) |
| initialize the chip | |
| uint8_t | stcc4_deinit (stcc4_handle_t *handle) |
| close the chip | |
| uint8_t | stcc4_read (stcc4_handle_t *handle, int16_t *co2_raw, int16_t *co2_ppm, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s, uint16_t *sensor_status) |
| read data | |
| uint8_t | stcc4_start_continuous_measurement (stcc4_handle_t *handle) |
| start continuous measurement | |
| uint8_t | stcc4_stop_continuous_measurement (stcc4_handle_t *handle) |
| stop continuous measurement | |
| uint8_t | stcc4_set_rht_compensation (stcc4_handle_t *handle, uint16_t temperature_raw, uint16_t humidity_raw) |
| set rht compensation | |
| uint8_t | stcc4_set_pressure_compensation (stcc4_handle_t *handle, uint16_t pressure_raw) |
| set pressure compensation | |
| uint8_t | stcc4_measure_single_shot (stcc4_handle_t *handle) |
| measure single shot | |
| uint8_t | stcc4_enter_sleep_mode (stcc4_handle_t *handle) |
| enter sleep mode | |
| uint8_t | stcc4_exit_sleep_mode (stcc4_handle_t *handle) |
| exit sleep mode | |
| uint8_t | stcc4_perform_conditioning (stcc4_handle_t *handle) |
| perform conditioning | |
| uint8_t | stcc4_perform_soft_reset (stcc4_handle_t *handle) |
| perform soft reset | |
| uint8_t | stcc4_perform_factory_reset (stcc4_handle_t *handle) |
| perform factory reset | |
| uint8_t | stcc4_perform_self_test (stcc4_handle_t *handle, uint16_t *result) |
| perform self test | |
| uint8_t | stcc4_enable_testing_mode (stcc4_handle_t *handle) |
| enable testing mode | |
| uint8_t | stcc4_disable_testing_mode (stcc4_handle_t *handle) |
| disable testing mode | |
| uint8_t | stcc4_perform_forced_recalibration (stcc4_handle_t *handle, uint16_t target_co2, uint16_t *correct_co2) |
| perform forced recalibration | |
| uint8_t | stcc4_get_product_id (stcc4_handle_t *handle, uint32_t *product_id, uint8_t unique_serial_number[8]) |
| get product id | |
| uint8_t | stcc4_frc_co2_convert_to_register (stcc4_handle_t *handle, float ppm, uint16_t *reg) |
| convert the frc co2 to the register raw data | |
| uint8_t | stcc4_frc_co2_convert_to_data (stcc4_handle_t *handle, uint16_t reg, float *ppm) |
| convert the register raw data to frc co2 ppm | |
| uint8_t | stcc4_humidity_convert_to_register (stcc4_handle_t *handle, float percentage, uint16_t *reg) |
| convert the humidity to the register raw data | |
| uint8_t | stcc4_humidity_convert_to_data (stcc4_handle_t *handle, uint16_t reg, float *percentage) |
| convert the register raw data to humidity | |
| uint8_t | stcc4_temperature_convert_to_register (stcc4_handle_t *handle, float deg, uint16_t *reg) |
| convert the temperature to the register raw data | |
| uint8_t | stcc4_temperature_convert_to_data (stcc4_handle_t *handle, uint16_t reg, float *deg) |
| convert the register raw data to temperature | |
| uint8_t | stcc4_pressure_convert_to_register (stcc4_handle_t *handle, float pa, uint16_t *reg) |
| convert the pressure to the register raw data | |
| uint8_t | stcc4_pressure_convert_to_data (stcc4_handle_t *handle, uint16_t reg, float *pa) |
| convert the register raw data to pressure | |
| uint8_t | stcc4_set_reg (stcc4_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len) |
| set the chip register | |
| uint8_t | stcc4_get_reg (stcc4_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len, uint16_t delay_ms) |
| get the chip register | |
driver stcc4 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.
| Date | Version | Author | Description |
|---|---|---|---|
| 2025/10/25 | 1.0 | Shifeng Li | first upload |
Definition in file driver_stcc4.h.