Go to the documentation of this file.
42 #ifdef PREINIT_SUPPORTED
46 #ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52 #include "drv_digital_out.h"
53 #include "drv_digital_in.h"
54 #include "drv_spi_master.h"
68 #define THERMO_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
70 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
71 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
72 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
79 #define THERMO_RETVAL uint8_t
81 #define THERMO_OK 0x00
82 #define THERMO_INIT_ERROR 0xFF
void thermo_cfg_setup(thermo_cfg_t *cfg)
Config Object Initialization function.
Click ctx object definition.
Definition: thermo.h:96
Click configuration structure definition.
Definition: thermo.h:110
pin_name_t mosi
Definition: thermo.h:114
pin_name_t cs
Definition: thermo.h:116
spi_master_chip_select_polarity_t cs_polarity
Definition: thermo.h:122
uint32_t spi_speed
Definition: thermo.h:120
pin_name_t miso
Definition: thermo.h:113
pin_name_t chip_select
Definition: thermo.h:102
uint32_t thermo_read_data(thermo_t *ctx)
Read data from sensor function.
uint8_t thermo_check_fault(thermo_t *ctx)
Check fault states function.
digital_out_t cs
Definition: thermo.h:97
spi_master_t spi
Definition: thermo.h:101
THERMO_RETVAL thermo_init(thermo_t *ctx, thermo_cfg_t *cfg)
Initialization function.
uint8_t thermo_short_circuited_gnd(thermo_t *ctx)
Check short-circuited to GND function.
uint8_t thermo_short_circuited_vcc(thermo_t *ctx)
Check short-circuited to Vcc function.
pin_name_t sck
Definition: thermo.h:115
uint8_t thermo_check_connections(thermo_t *ctx)
Check connections fault function.
#define THERMO_RETVAL
Definition: thermo.h:79
float thermo_get_temperature(thermo_t *ctx)
Get thermocouple temperature function.
float thermo_get_junction_temperature(thermo_t *ctx)
Get reference junction temperature function.
spi_master_mode_t spi_mode
Definition: thermo.h:121