39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define THERMO20_CMD_RESET 0x1E
74#define THERMO20_CMD_READ_SERIAL_NUMBER 0x0A
75#define THERMO20_CMD_CONVERSION 0x46
76#define THERMO20_CMD_READ_ADC 0x00
95#define THERMO20_SET_DEV_ADDR 0x40
113#define THERMO20_MAP_MIKROBUS( cfg, mikrobus ) \
114 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
115 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
uint16_t thermo20_read_adc(thermo20_t *ctx)
Read ADC data function.
void thermo20_start_conversion(thermo20_t *ctx)
Start conversion function.
void thermo20_cfg_setup(thermo20_cfg_t *cfg)
Thermo 20 configuration object setup 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_generic_write(thermo20_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
Thermo 20 I2C writing function.
uint32_t thermo20_get_serial_number(thermo20_t *ctx)
Get serial number function.
void thermo20_soft_reset(thermo20_t *ctx)
Soft reset 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_set_cmd(thermo20_t *ctx, uint8_t cmd)
Send command function.
float thermo20_get_temperature(thermo20_t *ctx)
Get temperature data function.
Thermo 20 Click configuration object.
Definition thermo20.h:139
uint32_t i2c_speed
Definition thermo20.h:143
pin_name_t scl
Definition thermo20.h:140
pin_name_t sda
Definition thermo20.h:141
uint8_t i2c_address
Definition thermo20.h:144
Thermo 20 Click context object.
Definition thermo20.h:125
i2c_master_t i2c
Definition thermo20.h:127
uint8_t slave_address
Definition thermo20.h:130
thermo20_return_value_t
Thermo 20 Click return value data.
Definition thermo20.h:153
@ THERMO20_ERROR
Definition thermo20.h:155
@ THERMO20_OK
Definition thermo20.h:154