Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_spi_master.h"
74 #define THERMO21_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
75 #define THERMO21_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
93 #define THERMO21_MAP_MIKROBUS( cfg, mikrobus ) \
94 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
95 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
96 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
97 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS );
Thermo 21 Click context object.
Definition: thermo21.h:107
This file contains SPI specific macros, functions, etc.
pin_name_t chip_select
Definition: thermo21.h:110
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:124
void thermo21_cfg_setup(thermo21_cfg_t *cfg)
Thermo 21 configuration object setup function.
Thermo 21 Click configuration object.
Definition: thermo21.h:119
thermo21_return_value_t
Thermo 21 Click return value data.
Definition: thermo21.h:138
pin_name_t sck
Definition: thermo21.h:123
uint32_t spi_speed
Definition: thermo21.h:127
spi_master_chip_select_polarity_t cs_polarity
Definition: thermo21.h:129
pin_name_t miso
Definition: thermo21.h:121
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:128
@ THERMO21_OK
Definition: thermo21.h:139
pin_name_t mosi
Definition: thermo21.h:122
@ THERMO21_ERROR
Definition: thermo21.h:140
spi_master_t spi
Definition: thermo21.h:109