thermo2 2.0.0.0
|
API for configuring and manipulating Thermo 2 Click driver. More...
Topics | |
Thermo 2 Commands List | |
List of commands of Thermo 2 Click driver. | |
Thermo 2 Settings | |
Settings of Thermo 2 Click driver. | |
Thermo 2 MikroBUS Map | |
MikroBUS pin mapping of Thermo 2 Click driver. | |
Functions | |
void | thermo2_cfg_setup (thermo2_cfg_t *cfg) |
Thermo 2 configuration object setup function. | |
void | thermo2_gpio_selection (thermo2_cfg_t *cfg, thermo2_gpio_sel_t gpio_sel) |
Thermo 2 driver interface setup function. | |
err_t | thermo2_init (thermo2_t *ctx, thermo2_cfg_t *cfg) |
Thermo 2 initialization function. | |
err_t | thermo2_default_cfg (thermo2_t *ctx) |
Thermo 2 default configuration function. | |
err_t | thermo2_check_communication (thermo2_t *ctx) |
Thermo 2 check communication function. | |
err_t | thermo2_select_device (thermo2_t *ctx) |
Thermo 2 select device function. | |
err_t | thermo2_start_measurement (thermo2_t *ctx) |
Thermo 2 start measurement function. | |
err_t | thermo2_read_scratchpad (thermo2_t *ctx, uint8_t *scratchpad) |
Thermo 2 read scratchpad function. | |
err_t | thermo2_write_scratchpad (thermo2_t *ctx, uint8_t temp_high, uint8_t temp_low, uint8_t config) |
Thermo 2 write scratchpad function. | |
err_t | thermo2_read_temperature (thermo2_t *ctx, float *temperature) |
Thermo 2 read temperature function. | |
API for configuring and manipulating Thermo 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 thermo2_cfg_setup | ( | thermo2_cfg_t * | cfg | ) |
Thermo 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See thermo2_cfg_t object definition for detailed explanation. |
err_t thermo2_check_communication | ( | thermo2_t * | ctx | ) |
Thermo 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 thermo2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo2_default_cfg | ( | thermo2_t * | ctx | ) |
Thermo 2 default configuration function.
This function executes a default configuration of Thermo 2 click board.
[in] | ctx | : Click context object. See thermo2_t object definition for detailed explanation. |
0
- Success, -1
- Error.void thermo2_gpio_selection | ( | thermo2_cfg_t * | cfg, |
thermo2_gpio_sel_t | gpio_sel ) |
Thermo 2 driver interface setup function.
This function sets a communication GPIO pin which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See thermo2_cfg_t object definition for detailed explanation. |
[in] | gpio_sel | : GPIO pin selection. See thermo2_gpio_sel_t object definition for detailed explanation. |
err_t thermo2_init | ( | thermo2_t * | ctx, |
thermo2_cfg_t * | cfg ) |
Thermo 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See thermo2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See thermo2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t thermo2_read_scratchpad | ( | thermo2_t * | ctx, |
uint8_t * | scratchpad ) |
Thermo 2 read scratchpad function.
This function reads the scratchpad bytes.
[in] | ctx | : Click context object. See thermo2_t object definition for detailed explanation. |
[out] | scratchpad | : Scratchpad [5-bytes] of device with the address set in ctx->config. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo2_read_temperature | ( | thermo2_t * | ctx, |
float * | temperature ) |
Thermo 2 read temperature function.
This function reads the temperature value in Celsius.
[in] | ctx | : Click context object. See thermo2_t object definition for detailed explanation. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo2_select_device | ( | thermo2_t * | ctx | ) |
Thermo 2 select device function.
This function selects the device by performing a skip or match ROM commands depending on the address value set in the configuration byte.
[in] | ctx | : Click context object. See thermo2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo2_start_measurement | ( | thermo2_t * | ctx | ) |
Thermo 2 start measurement function.
This function starts the measurement by sending an appropriate command for that.
[in] | ctx | : Click context object. See thermo2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo2_write_scratchpad | ( | thermo2_t * | ctx, |
uint8_t | temp_high, | ||
uint8_t | temp_low, | ||
uint8_t | config ) |
Thermo 2 write scratchpad function.
This function writes the temperature thresholds and configuration byte to the scratchpad.
[in] | ctx | : Click context object. See thermo2_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.