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 THERMO25_MODE_CONTINUOUS 0x00
75 #define THERMO25_MODE_SHUTDOWN 0xFF
81 #define THERMO25_DEVICE_ID 0x900F
87 #define THERMO25_DATA_RESOLUTION 0.03125f
97 #define THERMO25_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
98 #define THERMO25_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
116 #define THERMO25_MAP_MIKROBUS( cfg, mikrobus ) \
117 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
118 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
119 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
120 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS );
pin_name_t chip_select
Definition: thermo25.h:134
pin_name_t miso
Definition: thermo25.h:147
err_t thermo25_set_mode(thermo25_t *ctx, uint8_t mode)
Thermo 25 set mode function.
spi_master_t spi
Definition: thermo25.h:132
This file contains SPI specific macros, functions, etc.
uint32_t spi_speed
Definition: thermo25.h:153
err_t thermo25_read_temperature(thermo25_t *ctx, float *temperature)
Thermo 25 read temperature function.
spi_master_chip_select_polarity_t cs_polarity
Definition: thermo25.h:155
spi_master_mode_t spi_mode
Definition: thermo25.h:154
err_t thermo25_read_data(thermo25_t *ctx, uint16_t *data_out)
Thermo 25 read data function.
pin_name_t mosi
Definition: thermo25.h:148
void thermo25_cfg_setup(thermo25_cfg_t *cfg)
Thermo 25 configuration object setup function.
Thermo 25 Click configuration object.
Definition: thermo25.h:145
@ THERMO25_ERROR
Definition: thermo25.h:166
err_t thermo25_init(thermo25_t *ctx, thermo25_cfg_t *cfg)
Thermo 25 initialization function.
Thermo 25 Click context object.
Definition: thermo25.h:130
thermo25_return_value_t
Thermo 25 Click return value data.
Definition: thermo25.h:164
err_t thermo25_check_communication(thermo25_t *ctx)
Thermo 25 check communication function.
@ THERMO25_OK
Definition: thermo25.h:165
uint8_t dev_mode
Definition: thermo25.h:136
pin_name_t cs
Definition: thermo25.h:150
pin_name_t sck
Definition: thermo25.h:149