Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
hvac_click.h File Reference

mikrosdk interface More...

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

Go to the source code of this file.

Macros

#define HVAC_MODE_PERIODIC   0 /* periodic mode. wakeup interval has to be >= 5 seconds (data sampling period) */
 
#define HVAC_MODE_PERIODIC_LP    1 /* low-power periodic mode. wakeup interval has to be >= 30 seconds (data sampling period) */
 
#define HVAC_MODE_SINGLE_WAIT   2 /* single-shot mode. 5 seconds wait time for data aquisition */
 
#define HVAC_MODE_SINGLE_WAIT_SLEEP   3 /* single-shot mode with sleep. 5 seconds wait time for data aquisition */
 
#define HVAC_MODE_SINGLE_NEXT   4 /* single shot, read data on next wake-up */
 
#define HVAC_MODE   HVAC_MODE_PERIODIC
 
#define HVAC_FACTORY_RESET   0
 
#define SCD41_MAXDLEN   9
 
#define SCD41_ADDLEN   3
 
#define SCD41_T_STOP   500 /* scd41 500 ms after stop periodic measurement */
 
#define SCD41_T_CAL   400 /* scd41 400 ms for forced calibration */
 
#define SCD41_T_SELF_TEST   10000 /* scd41 10 seconds for self test */
 
#define SCD41_T_FACTORY_RESET   1200 /* scd41 1200 ms factory reset */
 
#define SCD41_T_REINIT   20 /* scd41 20 ms reinitialisation */
 
#define SCD41_T_MEAS_SINGLE   5000 /* scd41 5 seconds measure single shot */
 
#define SCD41_T_MEAS_SINGLE_RHT   50 /* scd41 50 ms measure single shot for rh and t only */
 
#define SCD41_T_WAKEUP   20 /* scd41 20 ms wakeup time */
 
#define SCD41_T_TIMEOUT   10000 /* scd41 10 seconds timeout waiting for data */
 
#define SCD41_T_WAITPOLL   100 /* scd41 100 ms interval for wait polls */
 
#define HVAC_SCD41_NEW_DATA_NOT_READY   0x00
 
#define HVAC_SCD41_NEW_DATA_IS_READY   0x01
 
#define SCD41_CO2_TARGET   400
 
#define SCD41_CMD_START_PERIODIC_MEASUREMENT   0x21B1
 
#define SCD41_CMD_READ_MEASUREMENT   0xEC05
 
#define SCD41_CMD_STOP_PERIODIC_MEASUREMENT   0x3F86
 
#define SCD41_CMD_SET_TEMPERATURE_OFFSET   0x241D
 
#define SCD41_CMD_GET_TEMPERATURE_OFFSET   0x2318
 
#define SCD41_CMD_SET_SENSOR_ALTITUDE   0x2427
 
#define SCD41_CMD_GET_SENSOR_ALTITUDE   0x2322
 
#define SCD41_CMD_SET_AMBIENT_PRESSURE   0xE000
 
#define SCD41_CMD_PERFORM_FORCED_RECALIBRATION   0x362F
 
#define SCD41_CMD_SET_AUTOMATIC_SELF_CALIBRATION_ENABLED   0x2416
 
#define SCD41_CMD_GET_AUTOMATIC_SELF_CALIBRATION_ENABLED   0x2313
 
#define SCD41_CMD_START_LOW_POWER_PERIODIC_MEASUREMENT   0x21AC
 
#define SCD41_CMD_GET_DATA_READY_STATUS   0xE4B8
 
#define SCD41_CMD_PERSIST_SETTINGS   0x3615
 
#define SCD41_CMD_GET_SERIAL_NUMBER   0x3682
 
#define SCD41_CMD_PERFORM_SELF_TEST   0x3639
 
#define SCD41_CMD_PERFORM_FACTORY_RESET   0x3632
 
#define SCD41_CMD_REINIT   0x3646
 
#define SCD41_CMD_MEASURE_SINGLE_SHOT   0x219D
 
#define SCD41_CMD_MEASURE_SINGLE_SHOT_RHT_ONLY   0x2196
 
#define SCD41_CMD_POWER_DOWN   0x36E0
 
#define SCD41_CMD_WAKE_UP   0x36F6
 
#define SCD41_CMD_START_ULTRA_LOW_POWER_PERIODIC_MEASUREMENT   0x21A7
 
#define SCD41_CMD_GET_FEATURE_SET_VERSION   0x202F
 
#define SCD41_CMD_GET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD   0x2340
 
#define SCD41_CMD_SET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD   0x2445
 
#define SCD41_CMD_GET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD   0x234B
 
#define SCD41_CMD_SET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD   0x244E
 

Enumerations

enum  hvac_status { HVAC_ST_OK = 0 , HVAC_ST_WAITING = 1 , HVAC_ST_FAIL = 2 }
 

Functions

uint8_t MIKROSDK_HVAC_scd41_start_periodic_measurement (void)
 
uint8_t MIKROSDK_HVAC_scd41_start_low_power_periodic_measurement (void)
 
uint8_t MIKROSDK_HVAC_scd41_read_measurement (uint16_t *co2content, int16_t *temperature, int16_t *humitidity)
 
uint8_t MIKROSDK_HVAC_scd41_stop_periodic_measurement (void)
 
uint8_t MIKROSDK_HVAC_scd41_get_data_ready_status (uint8_t *ready)
 
uint8_t MIKROSDK_HVAC_scd41_set_temperature_offset (int16_t temp_offset)
 
uint8_t MIKROSDK_HVAC_scd41_get_temperature_offset (int16_t *temp_offset)
 
uint8_t MIKROSDK_HVAC_scd41_set_sensor_altitude (uint16_t altitude)
 
uint8_t MIKROSDK_HVAC_scd41_get_sensor_altitude (uint16_t *altitude)
 
uint8_t MIKROSDK_HVAC_scd41_set_ambient_pressure (uint16_t pressure)
 
uint8_t MIKROSDK_HVAC_scd41_perform_forced_calibration (void)
 
uint8_t MIKROSDK_HVAC_scd41_set_automatic_self_calibration_enabled (uint8_t enable)
 
uint8_t MIKROSDK_HVAC_scd41_get_automatic_self_calibration_enabled (uint8_t *enabled)
 
uint8_t MIKROSDK_HVAC_scd41_persist_settings (void)
 
uint8_t MIKROSDK_HVAC_scd41_get_serial_number (uint16_t *serial_number)
 
uint8_t MIKROSDK_HVAC_scd41_perform_self_test (void)
 
uint8_t MIKROSDK_HVAC_scd41_perform_factory_reset (void)
 
uint8_t MIKROSDK_HVAC_scd41_reinit (void)
 
uint8_t MIKROSDK_HVAC_scd41_measure_single_shot (void)
 
uint8_t MIKROSDK_HVAC_scd41_measure_single_shot_rht_only (void)
 
uint8_t MIKROSDK_HVAC_scd41_power_down (void)
 
uint8_t MIKROSDK_HVAC_scd41_wake_up (void)
 
uint8_t MIKROSDK_HVAC_Initialise (void)
 
uint8_t MIKROSDK_HVAC_Reinitialise (void)
 
uint8_t MIKROSDK_HVAC_Acquire (uint16_t *co2content, int16_t *humidity, int16_t *temperature)
 

Detailed Description

mikrosdk interface

Macro Definition Documentation

◆ HVAC_FACTORY_RESET

#define HVAC_FACTORY_RESET   0

◆ HVAC_MODE

#define HVAC_MODE   HVAC_MODE_PERIODIC

◆ HVAC_MODE_PERIODIC

#define HVAC_MODE_PERIODIC   0 /* periodic mode. wakeup interval has to be >= 5 seconds (data sampling period) */

◆ HVAC_MODE_PERIODIC_LP

#define HVAC_MODE_PERIODIC_LP    1 /* low-power periodic mode. wakeup interval has to be >= 30 seconds (data sampling period) */

◆ HVAC_MODE_SINGLE_NEXT

#define HVAC_MODE_SINGLE_NEXT   4 /* single shot, read data on next wake-up */

◆ HVAC_MODE_SINGLE_WAIT

#define HVAC_MODE_SINGLE_WAIT   2 /* single-shot mode. 5 seconds wait time for data aquisition */

◆ HVAC_MODE_SINGLE_WAIT_SLEEP

#define HVAC_MODE_SINGLE_WAIT_SLEEP   3 /* single-shot mode with sleep. 5 seconds wait time for data aquisition */

◆ HVAC_SCD41_NEW_DATA_IS_READY

#define HVAC_SCD41_NEW_DATA_IS_READY   0x01

◆ HVAC_SCD41_NEW_DATA_NOT_READY

#define HVAC_SCD41_NEW_DATA_NOT_READY   0x00

◆ SCD41_ADDLEN

#define SCD41_ADDLEN   3

◆ SCD41_CMD_GET_AUTOMATIC_SELF_CALIBRATION_ENABLED

#define SCD41_CMD_GET_AUTOMATIC_SELF_CALIBRATION_ENABLED   0x2313

◆ SCD41_CMD_GET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD

#define SCD41_CMD_GET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD   0x2340

◆ SCD41_CMD_GET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD

#define SCD41_CMD_GET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD   0x234B

◆ SCD41_CMD_GET_DATA_READY_STATUS

#define SCD41_CMD_GET_DATA_READY_STATUS   0xE4B8

◆ SCD41_CMD_GET_FEATURE_SET_VERSION

#define SCD41_CMD_GET_FEATURE_SET_VERSION   0x202F

◆ SCD41_CMD_GET_SENSOR_ALTITUDE

#define SCD41_CMD_GET_SENSOR_ALTITUDE   0x2322

◆ SCD41_CMD_GET_SERIAL_NUMBER

#define SCD41_CMD_GET_SERIAL_NUMBER   0x3682

◆ SCD41_CMD_GET_TEMPERATURE_OFFSET

#define SCD41_CMD_GET_TEMPERATURE_OFFSET   0x2318

◆ SCD41_CMD_MEASURE_SINGLE_SHOT

#define SCD41_CMD_MEASURE_SINGLE_SHOT   0x219D

◆ SCD41_CMD_MEASURE_SINGLE_SHOT_RHT_ONLY

#define SCD41_CMD_MEASURE_SINGLE_SHOT_RHT_ONLY   0x2196

◆ SCD41_CMD_PERFORM_FACTORY_RESET

#define SCD41_CMD_PERFORM_FACTORY_RESET   0x3632

◆ SCD41_CMD_PERFORM_FORCED_RECALIBRATION

#define SCD41_CMD_PERFORM_FORCED_RECALIBRATION   0x362F

◆ SCD41_CMD_PERFORM_SELF_TEST

#define SCD41_CMD_PERFORM_SELF_TEST   0x3639

◆ SCD41_CMD_PERSIST_SETTINGS

#define SCD41_CMD_PERSIST_SETTINGS   0x3615

◆ SCD41_CMD_POWER_DOWN

#define SCD41_CMD_POWER_DOWN   0x36E0

◆ SCD41_CMD_READ_MEASUREMENT

#define SCD41_CMD_READ_MEASUREMENT   0xEC05

◆ SCD41_CMD_REINIT

#define SCD41_CMD_REINIT   0x3646

◆ SCD41_CMD_SET_AMBIENT_PRESSURE

#define SCD41_CMD_SET_AMBIENT_PRESSURE   0xE000

◆ SCD41_CMD_SET_AUTOMATIC_SELF_CALIBRATION_ENABLED

#define SCD41_CMD_SET_AUTOMATIC_SELF_CALIBRATION_ENABLED   0x2416

◆ SCD41_CMD_SET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD

#define SCD41_CMD_SET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD   0x2445

◆ SCD41_CMD_SET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD

#define SCD41_CMD_SET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD   0x244E

◆ SCD41_CMD_SET_SENSOR_ALTITUDE

#define SCD41_CMD_SET_SENSOR_ALTITUDE   0x2427

◆ SCD41_CMD_SET_TEMPERATURE_OFFSET

#define SCD41_CMD_SET_TEMPERATURE_OFFSET   0x241D

◆ SCD41_CMD_START_LOW_POWER_PERIODIC_MEASUREMENT

#define SCD41_CMD_START_LOW_POWER_PERIODIC_MEASUREMENT   0x21AC

◆ SCD41_CMD_START_PERIODIC_MEASUREMENT

#define SCD41_CMD_START_PERIODIC_MEASUREMENT   0x21B1

◆ SCD41_CMD_START_ULTRA_LOW_POWER_PERIODIC_MEASUREMENT

#define SCD41_CMD_START_ULTRA_LOW_POWER_PERIODIC_MEASUREMENT   0x21A7

◆ SCD41_CMD_STOP_PERIODIC_MEASUREMENT

#define SCD41_CMD_STOP_PERIODIC_MEASUREMENT   0x3F86

◆ SCD41_CMD_WAKE_UP

#define SCD41_CMD_WAKE_UP   0x36F6

◆ SCD41_CO2_TARGET

#define SCD41_CO2_TARGET   400

◆ SCD41_MAXDLEN

#define SCD41_MAXDLEN   9

◆ SCD41_T_CAL

#define SCD41_T_CAL   400 /* scd41 400 ms for forced calibration */

◆ SCD41_T_FACTORY_RESET

#define SCD41_T_FACTORY_RESET   1200 /* scd41 1200 ms factory reset */

◆ SCD41_T_MEAS_SINGLE

#define SCD41_T_MEAS_SINGLE   5000 /* scd41 5 seconds measure single shot */

◆ SCD41_T_MEAS_SINGLE_RHT

#define SCD41_T_MEAS_SINGLE_RHT   50 /* scd41 50 ms measure single shot for rh and t only */

◆ SCD41_T_REINIT

#define SCD41_T_REINIT   20 /* scd41 20 ms reinitialisation */

◆ SCD41_T_SELF_TEST

#define SCD41_T_SELF_TEST   10000 /* scd41 10 seconds for self test */

◆ SCD41_T_STOP

#define SCD41_T_STOP   500 /* scd41 500 ms after stop periodic measurement */

◆ SCD41_T_TIMEOUT

#define SCD41_T_TIMEOUT   10000 /* scd41 10 seconds timeout waiting for data */

◆ SCD41_T_WAITPOLL

#define SCD41_T_WAITPOLL   100 /* scd41 100 ms interval for wait polls */

◆ SCD41_T_WAKEUP

#define SCD41_T_WAKEUP   20 /* scd41 20 ms wakeup time */

Enumeration Type Documentation

◆ hvac_status

Enumerator
HVAC_ST_OK 
HVAC_ST_WAITING 
HVAC_ST_FAIL 

Function Documentation

◆ MIKROSDK_HVAC_Acquire()

uint8_t MIKROSDK_HVAC_Acquire ( uint16_t *  co2content,
int16_t *  humidity,
int16_t *  temperature 
)

◆ MIKROSDK_HVAC_Initialise()

uint8_t MIKROSDK_HVAC_Initialise ( void  )

◆ MIKROSDK_HVAC_Reinitialise()

uint8_t MIKROSDK_HVAC_Reinitialise ( void  )

◆ MIKROSDK_HVAC_scd41_get_automatic_self_calibration_enabled()

uint8_t MIKROSDK_HVAC_scd41_get_automatic_self_calibration_enabled ( uint8_t *  enabled)

◆ MIKROSDK_HVAC_scd41_get_data_ready_status()

uint8_t MIKROSDK_HVAC_scd41_get_data_ready_status ( uint8_t *  ready)

◆ MIKROSDK_HVAC_scd41_get_sensor_altitude()

uint8_t MIKROSDK_HVAC_scd41_get_sensor_altitude ( uint16_t *  altitude)

◆ MIKROSDK_HVAC_scd41_get_serial_number()

uint8_t MIKROSDK_HVAC_scd41_get_serial_number ( uint16_t *  serial_number)

◆ MIKROSDK_HVAC_scd41_get_temperature_offset()

uint8_t MIKROSDK_HVAC_scd41_get_temperature_offset ( int16_t *  temp_offset)

◆ MIKROSDK_HVAC_scd41_measure_single_shot()

uint8_t MIKROSDK_HVAC_scd41_measure_single_shot ( void  )

◆ MIKROSDK_HVAC_scd41_measure_single_shot_rht_only()

uint8_t MIKROSDK_HVAC_scd41_measure_single_shot_rht_only ( void  )

◆ MIKROSDK_HVAC_scd41_perform_factory_reset()

uint8_t MIKROSDK_HVAC_scd41_perform_factory_reset ( void  )

◆ MIKROSDK_HVAC_scd41_perform_forced_calibration()

uint8_t MIKROSDK_HVAC_scd41_perform_forced_calibration ( void  )

◆ MIKROSDK_HVAC_scd41_perform_self_test()

uint8_t MIKROSDK_HVAC_scd41_perform_self_test ( void  )

◆ MIKROSDK_HVAC_scd41_persist_settings()

uint8_t MIKROSDK_HVAC_scd41_persist_settings ( void  )

◆ MIKROSDK_HVAC_scd41_power_down()

uint8_t MIKROSDK_HVAC_scd41_power_down ( void  )

◆ MIKROSDK_HVAC_scd41_read_measurement()

uint8_t MIKROSDK_HVAC_scd41_read_measurement ( uint16_t *  co2content,
int16_t *  temperature,
int16_t *  humitidity 
)

◆ MIKROSDK_HVAC_scd41_reinit()

uint8_t MIKROSDK_HVAC_scd41_reinit ( void  )

◆ MIKROSDK_HVAC_scd41_set_ambient_pressure()

uint8_t MIKROSDK_HVAC_scd41_set_ambient_pressure ( uint16_t  pressure)

◆ MIKROSDK_HVAC_scd41_set_automatic_self_calibration_enabled()

uint8_t MIKROSDK_HVAC_scd41_set_automatic_self_calibration_enabled ( uint8_t  enable)

◆ MIKROSDK_HVAC_scd41_set_sensor_altitude()

uint8_t MIKROSDK_HVAC_scd41_set_sensor_altitude ( uint16_t  altitude)

◆ MIKROSDK_HVAC_scd41_set_temperature_offset()

uint8_t MIKROSDK_HVAC_scd41_set_temperature_offset ( int16_t  temp_offset)

◆ MIKROSDK_HVAC_scd41_start_low_power_periodic_measurement()

uint8_t MIKROSDK_HVAC_scd41_start_low_power_periodic_measurement ( void  )

◆ MIKROSDK_HVAC_scd41_start_periodic_measurement()

uint8_t MIKROSDK_HVAC_scd41_start_periodic_measurement ( void  )

◆ MIKROSDK_HVAC_scd41_stop_periodic_measurement()

uint8_t MIKROSDK_HVAC_scd41_stop_periodic_measurement ( void  )

◆ MIKROSDK_HVAC_scd41_wake_up()

uint8_t MIKROSDK_HVAC_scd41_wake_up ( void  )