thermostat2 2.0.0.0
|
API for configuring and manipulating Thermostat 2 Click driver. More...
Topics | |
Thermostat 2 Commands List | |
List of commands of Thermostat 2 Click driver. | |
Thermostat 2 Settings | |
Settings of Thermostat 2 Click driver. | |
Thermostat 2 MikroBUS Map | |
MikroBUS pin mapping of Thermostat 2 Click driver. | |
Functions | |
void | thermostat2_cfg_setup (thermostat2_cfg_t *cfg) |
Thermostat 2 configuration object setup function. | |
err_t | thermostat2_init (thermostat2_t *ctx, thermostat2_cfg_t *cfg) |
Thermostat 2 initialization function. | |
err_t | thermostat2_default_cfg (thermostat2_t *ctx) |
Thermostat 2 default configuration function. | |
err_t | thermostat2_check_communication (thermostat2_t *ctx) |
Thermostat 2 check communication function. | |
err_t | thermostat2_read_scratchpad (thermostat2_t *ctx, uint8_t *scratchpad) |
Thermostat 2 read scratchpad function. | |
err_t | thermostat2_write_scratchpad (thermostat2_t *ctx, uint8_t temp_high, uint8_t temp_low, uint8_t config) |
Thermostat 2 write scratchpad function. | |
err_t | thermostat2_start_measurement (thermostat2_t *ctx) |
Thermostat 2 start measurement function. | |
void | thermostat2_relay_state (thermostat2_t *ctx, uint8_t state) |
Thermostat 2 relay state function. | |
err_t | thermostat2_read_temperature (thermostat2_t *ctx, float *temperature) |
Thermostat 2 read temperature function. | |
API for configuring and manipulating Thermostat 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void thermostat2_cfg_setup | ( | thermostat2_cfg_t * | cfg | ) |
Thermostat 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See thermostat2_cfg_t object definition for detailed explanation. |
err_t thermostat2_check_communication | ( | thermostat2_t * | ctx | ) |
Thermostat 2 check communication function.
This function checks the communication by reading the ROM address twice and comparing the two results, as well as verifying the family code byte.
[in] | ctx | : Click context object. See thermostat2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermostat2_default_cfg | ( | thermostat2_t * | ctx | ) |
Thermostat 2 default configuration function.
This function executes a default configuration of Thermostat 2 click board.
[in] | ctx | : Click context object. See thermostat2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t thermostat2_init | ( | thermostat2_t * | ctx, |
thermostat2_cfg_t * | cfg ) |
Thermostat 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See thermostat2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See thermostat2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t thermostat2_read_scratchpad | ( | thermostat2_t * | ctx, |
uint8_t * | scratchpad ) |
Thermostat 2 read scratchpad function.
This function reads a desired number of scratchpad bytes using One Wire communication protocol.
[in] | ctx | : Click context object. See thermostat2_t object definition for detailed explanation. |
[out] | scratchpad | : Output read scratchpad. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermostat2_read_temperature | ( | thermostat2_t * | ctx, |
float * | temperature ) |
Thermostat 2 read temperature function.
This function reads the temperature value in Celsius.
[in] | ctx | : Click context object. See thermostat2_t object definition for detailed explanation. |
[out] | temperature | : Pointing to the address where to store temperature. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void thermostat2_relay_state | ( | thermostat2_t * | ctx, |
uint8_t | state ) |
Thermostat 2 relay state function.
This function turns the relay on/off.
[in] | ctx | : Click context object. See thermostat2_t object definition for detailed explanation. |
[in] | state | : On/off state of the relay. |
err_t thermostat2_start_measurement | ( | thermostat2_t * | ctx | ) |
Thermostat 2 start measurement function.
This function starts the measurement by sending an appropriate command for that.
[in] | ctx | : Click context object. See thermostat2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermostat2_write_scratchpad | ( | thermostat2_t * | ctx, |
uint8_t | temp_high, | ||
uint8_t | temp_low, | ||
uint8_t | config ) |
Thermostat 2 write scratchpad function.
This function writes the temperature thresholds and configuration byte to the scratchpad.
[in] | ctx | : Click context object. See thermostat2_t object definition for detailed explanation. |
[in] | temp_high | : Temperature high limit. |
[in] | temp_low | : Temperature low limit. |
[in] | config | : Configuration byte. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.