hvac 2.0.0.0
hvac.h File Reference

This file contains API for HVAC Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  measuremen_data_t
 HVAC Click measurements object. More...
 
struct  feature_data_t
 HVAC Click feature data object. More...
 
struct  mass_and_num_cnt_data_t
 HVAC Click mass and number of particles object. More...
 
struct  hvac_t
 HVAC Click context object. More...
 
struct  hvac_cfg_t
 HVAC Click configuration object. More...
 

Macros

#define HVAC_START_PERIODIC_MEASUREMENT   0x21B1
 HVAC description setting.
 
#define HVAC_START_LOW_POWER_PERIODIC_MEASUREMENT   0x21AC
 
#define HVAC_START_ULTRA_LOW_POWER_PERIODIC_MEASUREMENT   0x21A7
 
#define HVAC_MEASURE_SINGLE_SHOT   0x219D
 
#define HVAC_MEASURE_SINGLE_SHOT_RHT_ONLY   0x2196
 
#define HVAC_READ_MEASUREMENT   0xEC05
 
#define HVAC_STOP_PERIODIC_MEASUREMENT   0x3F86
 
#define HVAC_GET_SERIAL_NUMBER   0x3682
 
#define HVAC_GET_FEATURE_SET_VERSION   0x202F
 
#define HVAC_GET_TEMPERATURE_OFFSET   0x2318
 
#define HVAC_SET_TEMPERATURE_OFFSET   0x241D
 
#define HVAC_PERFORM_FORCED_RECALIBRATION   0x362F
 
#define HVAC_GET_AUTOMATIC_SELF_CALIBRATION_ENABLED   0x2313
 
#define HVAC_SET_AUTOMATIC_SELF_CALIBRATION_ENABLED   0x2416
 
#define HVAC_GET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD   0x2340
 
#define HVAC_SET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD   0x2445
 
#define HVAC_GET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD   0x234B
 
#define HVAC_SET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD   0x244E
 
#define HVAC_PERSIST_SETTINGS   0x3615
 
#define HVAC_PERFORM_FACTORY_RESET   0x3632
 
#define HVAC_REINIT   0x3646
 
#define HVAC_SPS30_I2C_START_MEASUREMENT   0x0010
 HVAC I2C communication information.
 
#define HVAC_SPS30_I2C_STOP_MEASUREMENT   0x0104
 
#define HVAC_SPS30_I2C_READ_DATA_RDY_FLAG   0x0202
 
#define HVAC_SPS30_I2C_READ_MEASURED_VALUE   0x0300
 
#define HVAC_SPS30_I2C_SLEEP   0x1001
 
#define HVAC_SPS30_I2C_WAKEUP   0x1103
 
#define HVAC_SPS30_I2C_START_FAN_CLEANING   0x5607
 
#define HVAC_SPS30_I2C_AUTO_CLEANING_INTERVAL   0x8004
 
#define HVAC_SPS30_I2C_SET_AUTO_CLEANING_INTERVAL   0x8005
 
#define HVAC_SPS30_I2C_STOP_MEASUREMENT_DUMMY   0x0000
 
#define HVAC_SPS30_I2C_READ_PRODUCT_TYPE   0xD002
 
#define HVAC_SPS30_I2C_READ_SERIAL_NUMBER   0xD033
 
#define HVAC_SPS30_I2C_READ_VERSION   0xD100
 
#define HVAC_SPS30_I2C_READ_STATUS_REGISTER   0xD206
 
#define HVAC_SPS30_I2C_CLEAR_STATUS_REGISTER   0xD210
 
#define HVAC_SPS30_I2C_RESET   0xD304
 
#define HVAC_SPS30_NEW_DATA_NOT_READY   0x00
 HVAC new data ready Flag.
 
#define HVAC_SPS30_NEW_DATA_IS_READY   0x01
 
#define HVAC_SPS30_SLAVE_ADDR   0x69
 HVAC device address setting.
 
#define HVAC_SCD40_SLAVE_ADDR   0x62
 
#define HVAC_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  hvac_return_value_t { HVAC_OK = 0 , HVAC_ERROR = -1 }
 HVAC Click return value data. More...
 

Functions

void hvac_cfg_setup (hvac_cfg_t *cfg)
 HVAC configuration object setup function.
 
err_t hvac_init (hvac_t *ctx, hvac_cfg_t *cfg)
 HVAC initialization function.
 
err_t hvac_generic_write (hvac_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 HVAC I2C writing function.
 
err_t hvac_generic_read (hvac_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 HVAC I2C reading function.
 
err_t hvac_scd40_write_data (hvac_t *ctx, uint16_t reg, uint16_t tx_data)
 SCD40 generic write data function.
 
err_t hvac_scd40_read_data (hvac_t *ctx, uint16_t reg, uint16_t *rx_data)
 SCD40 generic read data function.
 
void hvac_scd40_send_cmd (hvac_t *ctx, uint16_t cmd)
 SCD40 send command function.
 
void hvac_scd40_read_measurement (hvac_t *ctx, measuremen_data_t *m_data)
 SCD40 read measurement function.
 
void hvac_scd40_get_serial_number (hvac_t *ctx, uint16_t *serial_number)
 SCD40 get serial number function.
 
void hvac_scd40_get_feature_set_version (hvac_t *ctx, feature_data_t *f_data)
 SCD40 get feature set version function.
 
void hvac_scd40_set_temperature_offset (hvac_t *ctx, float temp_offset)
 SCD40 set temperature offset function.
 
float hvac_scd40_get_temperature_offset (hvac_t *ctx)
 SCD40 get temperature offset function.
 
err_t hvac_sps30_i2c_write_data (hvac_t *ctx, uint16_t reg, uint16_t tx_data)
 SPS30 generic write data function.
 
err_t hvac_sps30_i2c_read_data (hvac_t *ctx, uint16_t reg, uint16_t *rx_data)
 SPS30 generic read data function.
 
void hvac_sps30_start_measurement (hvac_t *ctx)
 SPS30 start measurement command function.
 
void hvac_sps30_stop_measurement (hvac_t *ctx)
 SPS30 stop measurement command function.
 
void hvac_sps30_device_reset (hvac_t *ctx)
 SPS30 set device reset function.
 
uint8_t hvac_sps30_get_ready_flag (hvac_t *ctx)
 SPS30 get ready flag function.
 
void hvac_sps30_read_measured_data (hvac_t *ctx, mass_and_num_cnt_data_t *m_n_c_data)
 SPS30 read measured data function.
 

Detailed Description

This file contains API for HVAC Click Driver.

Enumeration Type Documentation

◆ hvac_return_value_t

HVAC Click return value data.

Predefined enum values for driver return values.

Enumerator
HVAC_OK 
HVAC_ERROR