LibDriver SCD30
Loading...
Searching...
No Matches
driver_scd30.h File Reference

driver scd30 header file More...

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

Go to the source code of this file.

Data Structures

struct  scd30_handle_s
 scd30 handle structure definition More...
struct  scd30_data_s
 scd30 data structure definition More...
struct  scd30_info_s
 scd30 information structure definition More...

Macros

#define DRIVER_SCD30_LINK_INIT(HANDLE, STRUCTURE)
 initialize scd30_handle_t structure
#define DRIVER_SCD30_LINK_UART_INIT(HANDLE, FUC)
 link uart_init function
#define DRIVER_SCD30_LINK_UART_DEINIT(HANDLE, FUC)
 link uart_deinit function
#define DRIVER_SCD30_LINK_UART_READ(HANDLE, FUC)
 link uart_read function
#define DRIVER_SCD30_LINK_UART_WRITE(HANDLE, FUC)
 link uart_write function
#define DRIVER_SCD30_LINK_UART_FLUSH(HANDLE, FUC)
 link uart_flush function
#define DRIVER_SCD30_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_SCD30_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_SCD30_LINK_IIC_WRITE_COMMAND(HANDLE, FUC)
 link iic_write_cmd function
#define DRIVER_SCD30_LINK_IIC_READ_COMMAND(HANDLE, FUC)
 link iic_read_cmd function
#define DRIVER_SCD30_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_SCD30_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct scd30_handle_s scd30_handle_t
 scd30 handle structure definition
typedef struct scd30_data_s scd30_data_t
 scd30 data structure definition
typedef struct scd30_info_s scd30_info_t
 scd30 information structure definition

Enumerations

enum  scd30_interface_t { SCD30_INTERFACE_IIC = 0x00 , SCD30_INTERFACE_UART = 0x01 }
 scd30 interface enumeration definition More...
enum  scd30_bool_t { SCD30_BOOL_FALSE = 0x0000 , SCD30_BOOL_TRUE = 0x0001 }
 scd30 bool enumeration definition More...

Functions

uint8_t scd30_info (scd30_info_t *info)
 get chip information
uint8_t scd30_set_interface (scd30_handle_t *handle, scd30_interface_t interface)
 set the chip interface
uint8_t scd30_get_interface (scd30_handle_t *handle, scd30_interface_t *interface)
 get the chip interface
uint8_t scd30_init (scd30_handle_t *handle)
 initialize the chip
uint8_t scd30_deinit (scd30_handle_t *handle)
 close the chip
uint8_t scd30_read (scd30_handle_t *handle, scd30_data_t *data)
 read the result
uint8_t scd30_start_measurement_with_pressure_compensation (scd30_handle_t *handle, uint16_t mbar)
 start the measurement with pressure compensation
uint8_t scd30_start_measurement (scd30_handle_t *handle)
 start the measurement
uint8_t scd30_stop_measurement (scd30_handle_t *handle)
 stop the measurement
uint8_t scd30_set_measurement_interval (scd30_handle_t *handle, uint16_t second)
 set the measurement interval
uint8_t scd30_get_measurement_interval (scd30_handle_t *handle, uint16_t *second)
 get the measurement interval
uint8_t scd30_get_data_ready_status (scd30_handle_t *handle, uint16_t *status)
 get data ready status
uint8_t scd30_set_automatic_self_calibration (scd30_handle_t *handle, scd30_bool_t enable)
 set automatic self calibration
uint8_t scd30_get_automatic_self_calibration (scd30_handle_t *handle, scd30_bool_t *enable)
 get automatic self calibration
uint8_t scd30_set_forced_recalibration (scd30_handle_t *handle, uint16_t co2_ppm)
 set forced recalibration
uint8_t scd30_get_forced_recalibration (scd30_handle_t *handle, uint16_t *co2_ppm)
 get forced recalibration
uint8_t scd30_set_temperature_offset (scd30_handle_t *handle, uint16_t deg)
 set temperature offset
uint8_t scd30_get_temperature_offset (scd30_handle_t *handle, uint16_t *deg)
 get temperature offset
uint8_t scd30_temperature_offset_convert_to_register (scd30_handle_t *handle, float deg, uint16_t *reg)
 convert the temperature offset to the register raw data
uint8_t scd30_temperature_offset_convert_to_data (scd30_handle_t *handle, uint16_t reg, float *deg)
 convert the register raw data to the temperature offset
uint8_t scd30_set_altitude_compensation (scd30_handle_t *handle, uint16_t m)
 set altitude compensation
uint8_t scd30_get_altitude_compensation (scd30_handle_t *handle, uint16_t *m)
 get altitude compensation
uint8_t scd30_get_firmware_version (scd30_handle_t *handle, uint16_t *version)
 get firmware version
uint8_t scd30_soft_reset (scd30_handle_t *handle)
 soft reset
uint8_t scd30_set_reg_iic (scd30_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
 set the chip register with iic interface
uint8_t scd30_get_reg_iic (scd30_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
 get the chip register with iic interface
uint8_t scd30_set_get_reg_uart (scd30_handle_t *handle, uint8_t *input, uint16_t in_len, uint8_t *output, uint16_t out_len)
 set and get the chip register with uart interface

Detailed Description

driver scd30 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
2024-08-30

history

Date Version Author Description
2024/08/30 1.0 Shifeng Li first upload

Definition in file driver_scd30.h.