thermostat5  2.1.0.0
Modules | Functions
Thermostat 5 Click Driver

API for configuring and manipulating Thermostat 5 Click driver. More...

Modules

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

Functions

void thermostat5_cfg_setup (thermostat5_cfg_t *cfg)
 Thermostat 5 configuration object setup function. More...
 
void thermostat5_drv_interface_sel (thermostat5_cfg_t *cfg, thermostat5_drv_t drv_sel)
 Thermostat 5 driver interface setup function. More...
 
err_t thermostat5_init (thermostat5_t *ctx, thermostat5_cfg_t *cfg)
 Thermostat 5 initialization function. More...
 
err_t thermostat5_read_raw_adc (thermostat5_t *ctx, uint16_t *raw_adc)
 Thermostat 5 read raw ADC value function. More...
 
err_t thermostat5_read_voltage (thermostat5_t *ctx, float *voltage)
 Thermostat 5 read voltage level function. More...
 
err_t thermostat5_set_vref (thermostat5_t *ctx, float vref)
 Thermostat 5 set vref function. More...
 
err_t thermostat5_get_temperature (thermostat5_t *ctx, float *temperature)
 Thermostat 5 get temperature function. More...
 
void thermostat5_set_relay (thermostat5_t *ctx, uint8_t state)
 Thermostat 5 set relay function. More...
 

Detailed Description

API for configuring and manipulating Thermostat 5 Click driver.

Function Documentation

◆ thermostat5_cfg_setup()

void thermostat5_cfg_setup ( thermostat5_cfg_t cfg)

Thermostat 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ thermostat5_drv_interface_sel()

void thermostat5_drv_interface_sel ( thermostat5_cfg_t cfg,
thermostat5_drv_t  drv_sel 
)

Thermostat 5 driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See thermostat5_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See thermostat5_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be called before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ thermostat5_get_temperature()

err_t thermostat5_get_temperature ( thermostat5_t ctx,
float *  temperature 
)

Thermostat 5 get temperature function.

This function reads and calculates temperature in degrees Celsius [degC] using NTC thermistors.

Parameters
[in]ctx: Click context object. See thermostat5_t object definition for detailed explanation.
[out]temperature: Temperature [degC].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermostat5_init()

err_t thermostat5_init ( thermostat5_t ctx,
thermostat5_cfg_t cfg 
)

Thermostat 5 initialization function.

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

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

◆ thermostat5_read_raw_adc()

err_t thermostat5_read_raw_adc ( thermostat5_t ctx,
uint16_t *  raw_adc 
)

Thermostat 5 read raw ADC value function.

This function reads raw ADC value.

Parameters
[in]ctx: Click context object. See thermostat5_t object definition for detailed explanation.
[out]raw_adc: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermostat5_read_voltage()

err_t thermostat5_read_voltage ( thermostat5_t ctx,
float *  voltage 
)

Thermostat 5 read voltage level function.

This function reads raw ADC value and converts it to proportional voltage level.

Parameters
[in]ctx: Click context object. See thermostat5_t object definition for detailed explanation.
[out]voltage: Output voltage level [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered reference voltage.

◆ thermostat5_set_relay()

void thermostat5_set_relay ( thermostat5_t ctx,
uint8_t  state 
)

Thermostat 5 set relay function.

This function controls the relay by setting the state of the ON (PWM) pin.

Parameters
[in]ctx: Click context object. See thermostat5_t object definition for detailed explanation.
[out]state: Relay ON/OFF state.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermostat5_set_vref()

err_t thermostat5_set_vref ( thermostat5_t ctx,
float  vref 
)

Thermostat 5 set vref function.

This function sets the voltage reference for Thermostat 5 click driver.

Parameters
[in]ctx: Click context object. See thermostat5_t object definition for detailed explanation.
[in]vref: Reference voltage (volts).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The default voltage reference set with thermostat5_init is 3.3V.