Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
59 #define THERMO20_CMD_RESET 0x1E
60 #define THERMO20_CMD_READ_SERIAL_NUMBER 0x0A
61 #define THERMO20_CMD_CONVERSION 0x46
62 #define THERMO20_CMD_READ_ADC 0x00
81 #define THERMO20_SET_DEV_ADDR 0x40
99 #define THERMO20_MAP_MIKROBUS( cfg, mikrobus ) \
100 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
101 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
pin_name_t scl
Definition: thermo20.h:126
uint8_t slave_address
Definition: thermo20.h:116
thermo20_return_value_t
Thermo 20 Click return value data.
Definition: thermo20.h:139
Thermo 20 Click context object.
Definition: thermo20.h:111
float thermo20_get_temperature(thermo20_t *ctx)
Get temperature data function.
uint8_t i2c_address
Definition: thermo20.h:130
pin_name_t sda
Definition: thermo20.h:127
uint32_t i2c_speed
Definition: thermo20.h:129
void thermo20_soft_reset(thermo20_t *ctx)
Soft reset function.
@ THERMO20_OK
Definition: thermo20.h:140
Thermo 20 Click configuration object.
Definition: thermo20.h:125
err_t thermo20_generic_read(thermo20_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Thermo 20 I2C reading function.
@ THERMO20_ERROR
Definition: thermo20.h:141
uint16_t thermo20_read_adc(thermo20_t *ctx)
Read ADC data function.
uint32_t thermo20_get_serial_number(thermo20_t *ctx)
Get serial number function.
i2c_master_t i2c
Definition: thermo20.h:113
err_t thermo20_init(thermo20_t *ctx, thermo20_cfg_t *cfg)
Thermo 20 initialization 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_set_cmd(thermo20_t *ctx, uint8_t cmd)
Send command function.
void thermo20_cfg_setup(thermo20_cfg_t *cfg)
Thermo 20 configuration object setup function.
err_t thermo20_default_cfg(thermo20_t *ctx)
Thermo 20 default configuration function.
void thermo20_start_conversion(thermo20_t *ctx)
Start conversion function.