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"
78 #define THERMO21_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
79 #define THERMO21_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
97 #define THERMO21_MAP_MIKROBUS( cfg, mikrobus ) \
98 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
99 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
100 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
101 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS );
Thermo 21 Click context object.
Definition: thermo21.h:111
This file contains SPI specific macros, functions, etc.
pin_name_t chip_select
Definition: thermo21.h:114
err_t thermo21_generic_read(thermo21_t *ctx, uint8_t *data_out, uint8_t len)
Data reading function.
pin_name_t cs
Definition: thermo21.h:128
void thermo21_cfg_setup(thermo21_cfg_t *cfg)
Thermo 21 configuration object setup function.
Thermo 21 Click configuration object.
Definition: thermo21.h:123
thermo21_return_value_t
Thermo 21 Click return value data.
Definition: thermo21.h:142
pin_name_t sck
Definition: thermo21.h:127
uint32_t spi_speed
Definition: thermo21.h:131
spi_master_chip_select_polarity_t cs_polarity
Definition: thermo21.h:133
pin_name_t miso
Definition: thermo21.h:125
err_t thermo21_init(thermo21_t *ctx, thermo21_cfg_t *cfg)
Thermo 21 initialization function.
err_t thermo21_temperature_read(thermo21_t *ctx, float *data_out)
Temperature reading function.
spi_master_mode_t spi_mode
Definition: thermo21.h:132
@ THERMO21_OK
Definition: thermo21.h:143
pin_name_t mosi
Definition: thermo21.h:126
@ THERMO21_ERROR
Definition: thermo21.h:144
spi_master_t spi
Definition: thermo21.h:113