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 );
err_t thermo25_init(thermo25_t *ctx, thermo25_cfg_t *cfg)
Thermo 25 initialization function.
err_t thermo25_check_communication(thermo25_t *ctx)
Thermo 25 check communication function.
err_t thermo25_read_data(thermo25_t *ctx, uint16_t *data_out)
Thermo 25 read data function.
void thermo25_cfg_setup(thermo25_cfg_t *cfg)
Thermo 25 configuration object setup function.
err_t thermo25_set_mode(thermo25_t *ctx, uint8_t mode)
Thermo 25 set mode function.
err_t thermo25_read_temperature(thermo25_t *ctx, float *temperature)
Thermo 25 read temperature function.
This file contains SPI specific macros, functions, etc.
Thermo 25 Click configuration object.
Definition thermo25.h:145
spi_master_chip_select_polarity_t cs_polarity
Definition thermo25.h:155
pin_name_t sck
Definition thermo25.h:149
spi_master_mode_t spi_mode
Definition thermo25.h:154
pin_name_t mosi
Definition thermo25.h:148
uint32_t spi_speed
Definition thermo25.h:153
pin_name_t miso
Definition thermo25.h:147
pin_name_t cs
Definition thermo25.h:150
Thermo 25 Click context object.
Definition thermo25.h:130
spi_master_t spi
Definition thermo25.h:132
uint8_t dev_mode
Definition thermo25.h:136
pin_name_t chip_select
Definition thermo25.h:134
thermo25_return_value_t
Thermo 25 Click return value data.
Definition thermo25.h:164
@ THERMO25_OK
Definition thermo25.h:165
@ THERMO25_ERROR
Definition thermo25.h:166