thermo19
2.0.0.0
|
API for configuring and manipulating Thermo 19 Click driver. More...
Modules | |
Thermo 19 Commands List | |
List of commands of Thermo 19 Click driver. | |
Thermo 19 Settings | |
Settings of Thermo 19 Click driver. | |
Thermo 19 MikroBUS Map | |
MikroBUS pin mapping of Thermo 19 Click driver. | |
Functions | |
void | thermo19_cfg_setup (thermo19_cfg_t *cfg) |
Thermo 19 configuration object setup function. More... | |
void | thermo19_gpio_selection (thermo19_cfg_t *cfg, thermo19_gpio_sel_t gpio_sel) |
Thermo 19 driver interface setup function. More... | |
err_t | thermo19_init (thermo19_t *ctx, thermo19_cfg_t *cfg) |
Thermo 19 initialization function. More... | |
err_t | thermo19_default_cfg (thermo19_t *ctx) |
Thermo 19 default configuration function. More... | |
err_t | thermo19_check_communication (thermo19_t *ctx) |
Thermo 19 check communication function. More... | |
err_t | thermo19_select_device (thermo19_t *ctx) |
Thermo 19 select device function. More... | |
err_t | thermo19_start_measurement (thermo19_t *ctx) |
Thermo 19 start measurement function. More... | |
err_t | thermo19_read_scratchpad (thermo19_t *ctx, uint8_t *scratchpad) |
Thermo 19 read scratchpad function. More... | |
err_t | thermo19_write_scratchpad (thermo19_t *ctx, uint16_t temp_high, uint16_t temp_low, uint8_t config) |
Thermo 19 write scratchpad function. More... | |
err_t | thermo19_read_temperature (thermo19_t *ctx, float *temperature) |
Thermo 19 read temperature function. More... | |
uint8_t | thermo19_get_alert_pin (thermo19_t *ctx) |
Thermo 19 get alert pin function. More... | |
API for configuring and manipulating Thermo 19 Click driver.
void thermo19_cfg_setup | ( | thermo19_cfg_t * | cfg | ) |
Thermo 19 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See thermo19_cfg_t object definition for detailed explanation. |
err_t thermo19_check_communication | ( | thermo19_t * | ctx | ) |
Thermo 19 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 thermo19_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo19_default_cfg | ( | thermo19_t * | ctx | ) |
Thermo 19 default configuration function.
This function executes a default configuration of Thermo 19 click board.
[in] | ctx | : Click context object. See thermo19_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t thermo19_get_alert_pin | ( | thermo19_t * | ctx | ) |
Thermo 19 get alert pin function.
Reads the current input value of the ALT pin.
[in] | ctx | : Click context object. See thermo19_t object definition for detailed explanation. |
void thermo19_gpio_selection | ( | thermo19_cfg_t * | cfg, |
thermo19_gpio_sel_t | gpio_sel | ||
) |
Thermo 19 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 thermo19_cfg_t object definition for detailed explanation. |
[in] | gpio_sel | : GPIO pin selection. See thermo19_gpio_sel_t object definition for detailed explanation. |
err_t thermo19_init | ( | thermo19_t * | ctx, |
thermo19_cfg_t * | cfg | ||
) |
Thermo 19 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See thermo19_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See thermo19_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t thermo19_read_scratchpad | ( | thermo19_t * | ctx, |
uint8_t * | scratchpad | ||
) |
Thermo 19 read scratchpad function.
This function reads the scratchpad bytes.
[in] | ctx | : Click context object. See thermo19_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 thermo19_read_temperature | ( | thermo19_t * | ctx, |
float * | temperature | ||
) |
Thermo 19 read temperature function.
This function reads the temperature value in Celsius.
[in] | ctx | : Click context object. See thermo19_t object definition for detailed explanation. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo19_select_device | ( | thermo19_t * | ctx | ) |
Thermo 19 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 thermo19_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo19_start_measurement | ( | thermo19_t * | ctx | ) |
Thermo 19 start measurement function.
This function starts the measurement by sending an appropriate command for that.
[in] | ctx | : Click context object. See thermo19_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo19_write_scratchpad | ( | thermo19_t * | ctx, |
uint16_t | temp_high, | ||
uint16_t | temp_low, | ||
uint8_t | config | ||
) |
Thermo 19 write scratchpad function.
This function writes the temperature thresholds and configuration byte to the scratchpad.
[in] | ctx | : Click context object. See thermo19_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.