Go to the documentation of this file.
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 );
spi_master_mode_t spi_mode
Definition: thermok3.h:148
spi_master_t spi
Definition: thermok3.h:128
This file contains SPI specific macros, functions, etc.
spi_master_chip_select_polarity_t cs_polarity
Definition: thermok3.h:149
void thermok3_cfg_setup(thermok3_cfg_t *cfg)
Thermo K 3 configuration object setup function.
pin_name_t miso
Definition: thermok3.h:141
uint32_t spi_speed
Definition: thermok3.h:147
@ THERMOK3_OPEN_THERMOCOUPLE
Definition: thermok3.h:161
pin_name_t cs
Definition: thermok3.h:144
err_t thermok3_read_data(thermok3_t *ctx, uint16_t *data_out)
Thermo K 3 read data function.
pin_name_t mosi
Definition: thermok3.h:142
thermok3_return_value_t
Thermo K 3 Click return value data.
Definition: thermok3.h:158
err_t thermok3_init(thermok3_t *ctx, thermok3_cfg_t *cfg)
Thermo K 3 initialization function.
Thermo K 3 Click context object.
Definition: thermok3.h:126
pin_name_t sck
Definition: thermok3.h:143
@ THERMOK3_ERROR
Definition: thermok3.h:160
pin_name_t chip_select
Definition: thermok3.h:130
err_t thermok3_read_temperature(thermok3_t *ctx, float *temperature)
Thermo K 3 read temperature function.
@ THERMOK3_OK
Definition: thermok3.h:159
Thermo K 3 Click configuration object.
Definition: thermok3.h:139