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_spi_master.h"
74#define THERMOK3_DUMMY_SIGN_BIT 0x80
75#define THERMOK3_OPEN_THERMOCOUPLE_BIT 0x04
76#define THERMOK3_DEVICE_ID_BIT 0x02
82#define THERMOK3_DATA_RESOLUTION 0x0FFFu
83#define THERMOK3_TEMP_RESOLUTION 0.25f
93#define THERMOK3_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
94#define THERMOK3_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
112#define THERMOK3_MAP_MIKROBUS( cfg, mikrobus ) \
113 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
114 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
115 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
116 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS );
err_t thermok3_init(thermok3_t *ctx, thermok3_cfg_t *cfg)
Thermo K 3 initialization function.
void thermok3_cfg_setup(thermok3_cfg_t *cfg)
Thermo K 3 configuration object setup function.
err_t thermok3_read_temperature(thermok3_t *ctx, float *temperature)
Thermo K 3 read temperature function.
err_t thermok3_read_data(thermok3_t *ctx, uint16_t *data_out)
Thermo K 3 read data function.
This file contains SPI specific macros, functions, etc.
Thermo K 3 Click configuration object.
Definition thermok3.h:139
spi_master_chip_select_polarity_t cs_polarity
Definition thermok3.h:149
pin_name_t sck
Definition thermok3.h:143
spi_master_mode_t spi_mode
Definition thermok3.h:148
pin_name_t mosi
Definition thermok3.h:142
uint32_t spi_speed
Definition thermok3.h:147
pin_name_t miso
Definition thermok3.h:141
pin_name_t cs
Definition thermok3.h:144
Thermo K 3 Click context object.
Definition thermok3.h:126
spi_master_t spi
Definition thermok3.h:128
pin_name_t chip_select
Definition thermok3.h:130
thermok3_return_value_t
Thermo K 3 Click return value data.
Definition thermok3.h:158
@ THERMOK3_OK
Definition thermok3.h:159
@ THERMOK3_ERROR
Definition thermok3.h:160
@ THERMOK3_OPEN_THERMOCOUPLE
Definition thermok3.h:161