Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_spi_master.h"
60 #define THERMOK3_DUMMY_SIGN_BIT 0x80
61 #define THERMOK3_OPEN_THERMOCOUPLE_BIT 0x04
62 #define THERMOK3_DEVICE_ID_BIT 0x02
68 #define THERMOK3_DATA_RESOLUTION 0x0FFFu
69 #define THERMOK3_TEMP_RESOLUTION 0.25f
79 #define THERMOK3_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
80 #define THERMOK3_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
98 #define THERMOK3_MAP_MIKROBUS( cfg, mikrobus ) \
99 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
100 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
101 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
102 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS );
spi_master_mode_t spi_mode
Definition: thermok3.h:134
spi_master_t spi
Definition: thermok3.h:114
This file contains SPI specific macros, functions, etc.
spi_master_chip_select_polarity_t cs_polarity
Definition: thermok3.h:135
void thermok3_cfg_setup(thermok3_cfg_t *cfg)
Thermo K 3 configuration object setup function.
pin_name_t miso
Definition: thermok3.h:127
uint32_t spi_speed
Definition: thermok3.h:133
@ THERMOK3_OPEN_THERMOCOUPLE
Definition: thermok3.h:147
pin_name_t cs
Definition: thermok3.h:130
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:128
thermok3_return_value_t
Thermo K 3 Click return value data.
Definition: thermok3.h:144
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:112
pin_name_t sck
Definition: thermok3.h:129
@ THERMOK3_ERROR
Definition: thermok3.h:146
pin_name_t chip_select
Definition: thermok3.h:116
err_t thermok3_read_temperature(thermok3_t *ctx, float *temperature)
Thermo K 3 read temperature function.
@ THERMOK3_OK
Definition: thermok3.h:145
Thermo K 3 Click configuration object.
Definition: thermok3.h:125