thermostat4  2.0.0.0
Modules | Functions
Thermostat 4 Click Driver

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

Modules

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

Functions

void thermostat4_cfg_setup (thermostat4_cfg_t *cfg)
 Thermostat 4 configuration object setup function. More...
 
err_t thermostat4_init (thermostat4_t *ctx, thermostat4_cfg_t *cfg)
 Thermostat 4 initialization function. More...
 
void thermostat4_generic_transfer (thermostat4_t *ctx, uint8_t *data_in, uint16_t wr_len, uint8_t *data_out, uint16_t rd_len)
 Generic transfer function. More...
 
void thermostat4_relay_ctrl (thermostat4_t *ctx, uint8_t state)
 Relay Control. More...
 
void thermostat4_rst_pin_ctrl (thermostat4_t *ctx, uint8_t state)
 Sets reset pin state. More...
 
uint8_t thermostat4_hot_alert_state (thermostat4_t *ctx)
 Hot temperature ALERT. More...
 
uint8_t thermostat4_warm_alert_state (thermostat4_t *ctx)
 Warm temperature ALERT. More...
 
void thermostat4_set_warm_hysteresis (thermostat4_t *ctx, uint8_t hyst_data)
 Hysteresis on the Warm channel. More...
 
void thermostat4_new_cfg_upload (thermostat4_t *ctx)
 Reset module and upload new configuration on the Warm channel. More...
 

Detailed Description

API for configuring and manipulating Thermostat 4 Click driver.

Function Documentation

◆ thermostat4_cfg_setup()

void thermostat4_cfg_setup ( thermostat4_cfg_t cfg)

Thermostat 4 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ thermostat4_generic_transfer()

void thermostat4_generic_transfer ( thermostat4_t ctx,
uint8_t *  data_in,
uint16_t  wr_len,
uint8_t *  data_out,
uint16_t  rd_len 
)

Generic transfer function.

Generic SPI transfer, for sending and receiving packages.

Parameters
[in]ctx: Click context object. See thermostat4_t object definition for detailed explanation.
[in]data_in: Write data buffer.
[in]wr_len: Number of byte in write data buffer.
[out]data_out: Read data buffer.
[in]rd_len: Number of byte in read data buffer.
Returns
Nothing.

◆ thermostat4_hot_alert_state()

uint8_t thermostat4_hot_alert_state ( thermostat4_t ctx)

Hot temperature ALERT.

This function read state from OA pin.

Parameters
[in]ctx: Click context object. See thermostat4_t object definition for detailed explanation.
Returns
Alert( 0 - ON or 1 - OFF state ).

◆ thermostat4_init()

err_t thermostat4_init ( thermostat4_t ctx,
thermostat4_cfg_t cfg 
)

Thermostat 4 initialization function.

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

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

◆ thermostat4_new_cfg_upload()

void thermostat4_new_cfg_upload ( thermostat4_t ctx)

Reset module and upload new configuration on the Warm channel.

This function reset module and upload new configuration on the Warm channel.

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

◆ thermostat4_relay_ctrl()

void thermostat4_relay_ctrl ( thermostat4_t ctx,
uint8_t  state 
)

Relay Control.

This function write desired state on RLY pin.

Parameters
[in]ctx: Click context object. See thermostat4_t object definition for detailed explanation.
[in]state: Relay ( ON or OFF state ).
Returns
Nothing.

◆ thermostat4_rst_pin_ctrl()

void thermostat4_rst_pin_ctrl ( thermostat4_t ctx,
uint8_t  state 
)

Sets reset pin state.

This function write desired state om RST pin.

Parameters
[in]ctx: Click context object. See thermostat4_t object definition for detailed explanation.
stateReset ( 1 - ON or 0 - OFF state ).
Returns
Nothing.

◆ thermostat4_set_warm_hysteresis()

void thermostat4_set_warm_hysteresis ( thermostat4_t ctx,
uint8_t  hyst_data 
)

Hysteresis on the Warm channel.

This function write hysteresis data.

Parameters
[in]ctx: Click context object. See thermostat4_t object definition for detailed explanation.
[in]hyst_data: Potentiometer data 0 - 255.
Returns
Nothing.

◆ thermostat4_warm_alert_state()

uint8_t thermostat4_warm_alert_state ( thermostat4_t ctx)

Warm temperature ALERT.

This function read state from OB pin.

Parameters
[in]ctx: Click context object. See thermostat4_t object definition for detailed explanation.
Returns
Alert( 0 - ON or 1 - OFF state ).