thermo20 2.0.0.0
|
API for configuring and manipulating Thermo 20 Click driver. More...
Topics | |
Thermo 20 Registers List | |
List of registers of Thermo 20 Click driver. | |
Thermo 20 Registers Settings | |
Settings for registers of Thermo 20 Click driver. | |
Thermo 20 MikroBUS Map | |
MikroBUS pin mapping of Thermo 20 Click driver. | |
Functions | |
void | thermo20_cfg_setup (thermo20_cfg_t *cfg) |
Thermo 20 configuration object setup function. | |
err_t | thermo20_init (thermo20_t *ctx, thermo20_cfg_t *cfg) |
Thermo 20 initialization function. | |
err_t | thermo20_default_cfg (thermo20_t *ctx) |
Thermo 20 default configuration function. | |
err_t | thermo20_generic_write (thermo20_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Thermo 20 I2C writing function. | |
err_t | thermo20_generic_read (thermo20_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Thermo 20 I2C reading function. | |
err_t | thermo20_set_cmd (thermo20_t *ctx, uint8_t cmd) |
Send command function. | |
void | thermo20_soft_reset (thermo20_t *ctx) |
Soft reset function. | |
void | thermo20_start_conversion (thermo20_t *ctx) |
Start conversion function. | |
uint16_t | thermo20_read_adc (thermo20_t *ctx) |
Read ADC data function. | |
float | thermo20_get_temperature (thermo20_t *ctx) |
Get temperature data function. | |
uint32_t | thermo20_get_serial_number (thermo20_t *ctx) |
Get serial number function. | |
API for configuring and manipulating Thermo 20 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void thermo20_cfg_setup | ( | thermo20_cfg_t * | cfg | ) |
Thermo 20 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See thermo20_cfg_t object definition for detailed explanation. |
err_t thermo20_default_cfg | ( | thermo20_t * | ctx | ) |
Thermo 20 default configuration function.
This function executes a default configuration of Thermo 20 click board.
[in] | ctx | : Click context object. See thermo20_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t thermo20_generic_read | ( | thermo20_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Thermo 20 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See thermo20_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t thermo20_generic_write | ( | thermo20_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Thermo 20 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See thermo20_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.uint32_t thermo20_get_serial_number | ( | thermo20_t * | ctx | ) |
Get serial number function.
The function get the serial number of the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.
[in] | ctx | : Click context object. See thermo20_t object definition for detailed explanation. |
float thermo20_get_temperature | ( | thermo20_t * | ctx | ) |
Get temperature data function.
The function get temperature value in degree Celsius of the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.
[in] | ctx | : Click context object. See thermo20_t object definition for detailed explanation. |
err_t thermo20_init | ( | thermo20_t * | ctx, |
thermo20_cfg_t * | cfg ) |
Thermo 20 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See thermo20_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See thermo20_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint16_t thermo20_read_adc | ( | thermo20_t * | ctx | ) |
Read ADC data function.
The function 16-bit temperature reprinting ADC result of the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.
[in] | ctx | : Click context object. See thermo20_t object definition for detailed explanation. |
err_t thermo20_set_cmd | ( | thermo20_t * | ctx, |
uint8_t | cmd ) |
Send command function.
The function send the desired command to the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.
[in] | ctx | : Click context object. See thermo20_t object definition for detailed explanation. |
[in] | cmd | Commands byte. See #thermo20_reg defgroup for detailed explanation. * |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void thermo20_soft_reset | ( | thermo20_t * | ctx | ) |
Soft reset function.
The function is performed by a software reset of the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.
[in] | ctx | : Click context object. See thermo20_t object definition for detailed explanation. |
void thermo20_start_conversion | ( | thermo20_t * | ctx | ) |
Start conversion function.
The function set conversion a single temperature conversion of the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.
[in] | ctx | : Click context object. See thermo20_t object definition for detailed explanation. |