thermo30 2.1.0.0
|
API for configuring and manipulating Thermo 30 Click driver. More...
Modules | |
Thermo 30 Registers Settings | |
Settings for registers of Thermo 30 Click driver. | |
Thermo 30 MikroBUS Map | |
MikroBUS pin mapping of Thermo 30 Click driver. | |
Functions | |
void | thermo30_cfg_setup (thermo30_cfg_t *cfg) |
Thermo 30 configuration object setup function. More... | |
err_t | thermo30_init (thermo30_t *ctx, thermo30_cfg_t *cfg) |
Thermo 30 initialization function. More... | |
err_t | thermo30_default_cfg (thermo30_t *ctx) |
Thermo 30 default configuration function. More... | |
void | thermo30_set_rst_pin (thermo30_t *ctx, uint8_t pin_state) |
Thermo 30 set rst pin function. More... | |
void | thermo30_hw_reset (thermo30_t *ctx) |
Thermo 30 hw reset device function. More... | |
uint8_t | thermo30_get_alert_pin (thermo30_t *ctx) |
Thermo 30 get alert pin function. More... | |
err_t | thermo30_write_command (thermo30_t *ctx, uint16_t cmd) |
Thermo 30 write command function. More... | |
err_t | thermo30_read_command (thermo30_t *ctx, uint16_t cmd, uint16_t *data_out) |
Thermo 30 read command function. More... | |
err_t | thermo30_start_measurement (thermo30_t *ctx, uint16_t cmd) |
Thermo 30 start measurement function. More... | |
err_t | thermo30_stop_measurement (thermo30_t *ctx) |
Thermo 30 stop measurement function. More... | |
err_t | thermo30_read_status (thermo30_t *ctx, uint16_t *status_val) |
Thermo 30 read status function. More... | |
err_t | thermo30_read_temperature (thermo30_t *ctx, float *temperature) |
Thermo 30 read temperature function. More... | |
API for configuring and manipulating Thermo 30 Click driver.
void thermo30_cfg_setup | ( | thermo30_cfg_t * | cfg | ) |
Thermo 30 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See thermo30_cfg_t object definition for detailed explanation. |
err_t thermo30_default_cfg | ( | thermo30_t * | ctx | ) |
Thermo 30 default configuration function.
This function executes a default configuration of Thermo 30 click board.
[in] | ctx | : Click context object. See thermo30_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t thermo30_get_alert_pin | ( | thermo30_t * | ctx | ) |
Thermo 30 get alert pin function.
This function returns the alert pin logic state.
[in] | ctx | : Click context object. See thermo30_t object definition for detailed explanation. |
void thermo30_hw_reset | ( | thermo30_t * | ctx | ) |
Thermo 30 hw reset device function.
This function resets the device by toggling the RST pin.
[in] | ctx | : Click context object. See thermo30_t object definition for detailed explanation. |
err_t thermo30_init | ( | thermo30_t * | ctx, |
thermo30_cfg_t * | cfg | ||
) |
Thermo 30 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See thermo30_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See thermo30_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo30_read_command | ( | thermo30_t * | ctx, |
uint16_t | cmd, | ||
uint16_t * | data_out | ||
) |
Thermo 30 read command function.
This function writes a desired command word and then reads it's response word with CRC byte. If the read CRC byte matches internal CRC calculation the response word will be stored in data_out.
[in] | ctx | : Click context object. See thermo30_t object definition for detailed explanation. |
[in] | cmd | : Command word to be written. |
[out] | data_out | : Read response word. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo30_read_status | ( | thermo30_t * | ctx, |
uint16_t * | status_val | ||
) |
Thermo 30 read status function.
This function reads the status register.
[in] | ctx | : Click context object. See thermo30_t object definition for detailed explanation. |
[out] | status_val | : Status register data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo30_read_temperature | ( | thermo30_t * | ctx, |
float * | temperature | ||
) |
Thermo 30 read temperature function.
This function reads the temperature raw data measurements and converts it to degrees Celsius.
[in] | ctx | : Click context object. See thermo30_t object definition for detailed explanation. |
[out] | temperature | : Temperature measurements in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void thermo30_set_rst_pin | ( | thermo30_t * | ctx, |
uint8_t | pin_state | ||
) |
Thermo 30 set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See thermo30_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t thermo30_start_measurement | ( | thermo30_t * | ctx, |
uint16_t | cmd | ||
) |
Thermo 30 start measurement function.
This function starts the measurements by sending the specified command.
[in] | ctx | : Click context object. See thermo30_t object definition for detailed explanation. |
[in] | cmd | : Single-shot or periodic measurements command, refer to the commands list macros. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo30_stop_measurement | ( | thermo30_t * | ctx | ) |
Thermo 30 stop measurement function.
This function stops the measurements by sending the break command.
[in] | ctx | : Click context object. See thermo30_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t thermo30_write_command | ( | thermo30_t * | ctx, |
uint16_t | cmd | ||
) |
Thermo 30 write command function.
This function writes a desired command by using I2C serial interface.
[in] | ctx | : Click context object. See thermo30_t object definition for detailed explanation. |
[in] | cmd | : Command word to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.