38 #include "drv_digital_out.h" 39 #include "drv_digital_in.h" 40 #include "drv_spi_master.h" 54 #define THERMO_MAP_MIKROBUS( cfg, mikrobus ) \ 55 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \ 56 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \ 57 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \ 58 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ) 65 #define THERMO_RETVAL uint8_t 67 #define THERMO_OK 0x00 68 #define THERMO_INIT_ERROR 0xFF uint8_t thermo_check_fault(thermo_t *ctx)
Check fault states function.
pin_name_t mosi
Definition: thermo.h:97
float thermo_get_temperature(thermo_t *ctx)
Get thermocouple temperature function.
#define THERMO_RETVAL
Definition: thermo.h:65
uint8_t thermo_short_circuited_vcc(thermo_t *ctx)
Check short-circuited to Vcc function.
uint8_t thermo_short_circuited_gnd(thermo_t *ctx)
Check short-circuited to GND function.
uint8_t thermo_check_connections(thermo_t *ctx)
Check connections fault function.
void thermo_cfg_setup(thermo_cfg_t *cfg)
Config Object Initialization function.
uint32_t thermo_read_data(thermo_t *ctx)
Read data from sensor function.
float thermo_get_junction_temperature(thermo_t *ctx)
Get reference junction temperature function.
Click ctx object definition.
Definition: thermo.h:81
pin_name_t sck
Definition: thermo.h:98
hal_spi_mode_t spi_mode
Definition: thermo.h:104
Click configuration structure definition.
Definition: thermo.h:92
THERMO_RETVAL thermo_init(thermo_t *ctx, thermo_cfg_t *cfg)
Initialization function.
hal_spi_speed_t spi_speed
Definition: thermo.h:103
pin_name_t cs
Definition: thermo.h:99
pin_name_t miso
Definition: thermo.h:96
spi_master_t spi
Definition: thermo.h:85