thermo18 2.0.0.0
|
API for configuring and manipulating Thermo 18 Click driver. More...
Topics | |
Thermo 18 Registers List | |
List of registers of Thermo 18 Click driver. | |
Thermo 18 Registers Settings | |
Settings for registers of Thermo 18 Click driver. | |
Thermo 18 MikroBUS Map | |
MikroBUS pin mapping of Thermo 18 Click driver. | |
Functions | |
void | thermo18_cfg_setup (thermo18_cfg_t *cfg) |
Thermo 18 configuration object setup function. | |
err_t | thermo18_init (thermo18_t *ctx, thermo18_cfg_t *cfg) |
Thermo 18 initialization function. | |
err_t | thermo18_default_cfg (thermo18_t *ctx) |
Thermo 18 default configuration function. | |
err_t | thermo18_generic_write (thermo18_t *ctx, uint8_t reg, uint8_t tx_data) |
Thermo 18 I2C writing function. | |
err_t | thermo18_generic_read (thermo18_t *ctx, uint8_t reg, uint8_t *rx_data) |
Thermo 18 I2C reading function. | |
err_t | thermo18_read_temperature (thermo18_t *ctx, float *temperature) |
Reads and calculates temperature value. | |
err_t | thermo18_reset (thermo18_t *ctx) |
Resets device. | |
uint8_t | thermo18_get_interrupt (thermo18_t *ctx) |
Get interrput status. | |
err_t | thermo18_set_temperature_threshold (thermo18_t *ctx, uint8_t threshold_reg, float threshold_limit) |
Sets temperature threshold. | |
API for configuring and manipulating Thermo 18 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void thermo18_cfg_setup | ( | thermo18_cfg_t * | cfg | ) |
Thermo 18 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See thermo18_cfg_t object definition for detailed explanation. |
err_t thermo18_default_cfg | ( | thermo18_t * | ctx | ) |
Thermo 18 default configuration function.
This function executes a default configuration of Thermo 18 click board.
[in] | ctx | : Click context object. See thermo18_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t thermo18_generic_read | ( | thermo18_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_data ) |
Thermo 18 I2C reading function.
This function reads a data byte from the selected register.
[in] | ctx | : Click context object. See thermo18_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | rx_data | : Output read data. |
0
- Success, -1
- Error.err_t thermo18_generic_write | ( | thermo18_t * | ctx, |
uint8_t | reg, | ||
uint8_t | tx_data ) |
Thermo 18 I2C writing function.
This function writes a data byte to the selected register.
[in] | ctx | : Click context object. See thermo18_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | tx_data | : Data to be written. |
0
- Success, -1
- Error.uint8_t thermo18_get_interrupt | ( | thermo18_t * | ctx | ) |
Get interrput status.
Reads interrupt pin state.
[in] | ctx | : Click context object. See thermo18_t object definition for detailed explanation. |
err_t thermo18_init | ( | thermo18_t * | ctx, |
thermo18_cfg_t * | cfg ) |
Thermo 18 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See thermo18_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See thermo18_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t thermo18_read_temperature | ( | thermo18_t * | ctx, |
float * | temperature ) |
Reads and calculates temperature value.
Reads data registers and calculates temperature value in degrees Celsius.
[in] | ctx | : Click context object. See thermo18_t object definition for detailed explanation. |
[out] | temperature | : Output temperature data in degC. |
0
- Success, -1
- Error.err_t thermo18_reset | ( | thermo18_t * | ctx | ) |
Resets device.
Sends commands to reset device and clears it, when resets is done.
[in] | ctx | : Click context object. See thermo18_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t thermo18_set_temperature_threshold | ( | thermo18_t * | ctx, |
uint8_t | threshold_reg, | ||
float | threshold_limit ) |
Sets temperature threshold.
Calculates and sets undertemperature thresholds or overtemperature threshold.
[in] | ctx | : Click context object. See thermo18_t object definition for detailed explanation. |
[in] | threshold_reg | : Can be THERMO18_REG_T_H_LIMIT or THERMO18_REG_T_L_LIMIT. |
[in] | threshold_limit | : Temperature threshold to set. |
0
- Success, -1
- Error.