hvac 2.0.0.0
HVAC Click Driver

API for configuring and manipulating HVAC Click driver. More...

Topics

 HVAC Registers Settings
 Settings for registers of HVAC Click driver.
 
 HVAC MikroBUS Map
 MikroBUS pin mapping of HVAC Click driver.
 

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

API for configuring and manipulating HVAC Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ hvac_cfg_setup()

void hvac_cfg_setup ( hvac_cfg_t * cfg)

HVAC configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See hvac_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ hvac_generic_read()

err_t hvac_generic_read ( hvac_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

HVAC I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ hvac_generic_write()

err_t hvac_generic_write ( hvac_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

HVAC I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ hvac_init()

err_t hvac_init ( hvac_t * ctx,
hvac_cfg_t * cfg )

HVAC initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See hvac_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ hvac_scd40_get_feature_set_version()

void hvac_scd40_get_feature_set_version ( hvac_t * ctx,
feature_data_t * f_data )

SCD40 get feature set version function.

The function get feature set version value of the SCD40 CO2, RH and T Sensor on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]f_data: Pointer to the memory location where structure data be stored.
Returns
Nothing.

◆ hvac_scd40_get_serial_number()

void hvac_scd40_get_serial_number ( hvac_t * ctx,
uint16_t * serial_number )

SCD40 get serial number function.

The function get serial number value of the SCD40 CO2, RH and T Sensor on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]serial_number: Pointer to the memory location where serial numbe value be stored.
Returns
Nothing.

◆ hvac_scd40_get_temperature_offset()

float hvac_scd40_get_temperature_offset ( hvac_t * ctx)

SCD40 get temperature offset function.

The function get temperature offset value of the SCD40 CO2, RH and T Sensor on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
Returns
Float temperature offset value ( degree Celsius ).

◆ hvac_scd40_read_data()

err_t hvac_scd40_read_data ( hvac_t * ctx,
uint16_t reg,
uint16_t * rx_data )

SCD40 generic read data function.

The function read a 16-bit data from the targeted 16-bit register address of the SCD40 CO2, RH and T Sensor on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]reg: 16-bit register address.
[out]rx_data: Pointer to the memory location where 16-bit read data be stored.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ hvac_scd40_read_measurement()

void hvac_scd40_read_measurement ( hvac_t * ctx,
measuremen_data_t * m_data )

SCD40 read measurement function.

The function read sensor measurement data of the SCD40 CO2, RH and T Sensor on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]m_data: Pointer to the memory location where structure data be stored.
Returns
Nothing.

◆ hvac_scd40_send_cmd()

void hvac_scd40_send_cmd ( hvac_t * ctx,
uint16_t cmd )

SCD40 send command function.

The function send command to the SCD40 CO2, RH and T Sensor on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]cmd: 16-bit command.
Returns
Nothing.

◆ hvac_scd40_set_temperature_offset()

void hvac_scd40_set_temperature_offset ( hvac_t * ctx,
float temp_offset )

SCD40 set temperature offset function.

The function set temperature offset value of the SCD40 CO2, RH and T Sensor on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]temp_offset: Float temperature offset value ( degree Celsius ).
Returns
Nothing.

◆ hvac_scd40_write_data()

err_t hvac_scd40_write_data ( hvac_t * ctx,
uint16_t reg,
uint16_t tx_data )

SCD40 generic write data function.

The function writes a 16-bit data to the targeted 16-bit register address of the SCD40 CO2, RH and T Sensor on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]reg: 16-bit register address.
[in]tx_data: 16-bit data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ hvac_sps30_device_reset()

void hvac_sps30_device_reset ( hvac_t * ctx)

SPS30 set device reset function.

The function set set device reset of the SPS30 Particulate Matter Sensor for Air Quality Monitoring and Control on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
Returns
Nothing.

◆ hvac_sps30_get_ready_flag()

uint8_t hvac_sps30_get_ready_flag ( hvac_t * ctx)

SPS30 get ready flag function.

The function get new data ready flag of the SPS30 Particulate Matter Sensor for Air Quality Monitoring and Control on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
Returns
  • 0 - No new data,
  • 1 - Data ready.
See #err_t definition for detailed explanation.

◆ hvac_sps30_i2c_read_data()

err_t hvac_sps30_i2c_read_data ( hvac_t * ctx,
uint16_t reg,
uint16_t * rx_data )

SPS30 generic read data function.

The function read a 16-bit data from the targeted 16-bit register address of the SPS30 Particulate Matter Sensor for Air Quality Monitoring and Control on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]reg: 16-bit register address.
[out]rx_data: Pointer to the memory location where 16-bit read data be stored.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ hvac_sps30_i2c_write_data()

err_t hvac_sps30_i2c_write_data ( hvac_t * ctx,
uint16_t reg,
uint16_t tx_data )

SPS30 generic write data function.

The function writes a 16-bit data to the targeted 16-bit register address of the SPS30 Particulate Matter Sensor for Air Quality Monitoring and Control on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[in]reg: 16-bit register address.
[in]tx_data: 16-bit data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ hvac_sps30_read_measured_data()

void hvac_sps30_read_measured_data ( hvac_t * ctx,
mass_and_num_cnt_data_t * m_n_c_data )

SPS30 read measured data function.

The functionread measured data of the SPS30 Particulate Matter Sensor for Air Quality Monitoring and Control on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
[out]m_n_c_data: Pointer to the memory location where structure data be stored.
Returns
Nothing.

◆ hvac_sps30_start_measurement()

void hvac_sps30_start_measurement ( hvac_t * ctx)

SPS30 start measurement command function.

The function set starts the measurement mode of the SPS30 Particulate Matter Sensor for Air Quality Monitoring and Control on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
Returns
Nothing.

◆ hvac_sps30_stop_measurement()

void hvac_sps30_stop_measurement ( hvac_t * ctx)

SPS30 stop measurement command function.

The function set stop the measurement mode of the SPS30 Particulate Matter Sensor for Air Quality Monitoring and Control on the HVAC click board.

Parameters
[in]ctx: Click context object. See hvac_t object definition for detailed explanation.
Returns
Nothing.