Go to the documentation of this file.
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
void thermo_cfg_setup(thermo_cfg_t *cfg)
Config Object Initialization function.
Click ctx object definition.
Definition: thermo.h:82
Click configuration structure definition.
Definition: thermo.h:96
pin_name_t mosi
Definition: thermo.h:100
pin_name_t cs
Definition: thermo.h:102
spi_master_chip_select_polarity_t cs_polarity
Definition: thermo.h:108
uint32_t spi_speed
Definition: thermo.h:106
pin_name_t miso
Definition: thermo.h:99
pin_name_t chip_select
Definition: thermo.h:88
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:83
spi_master_t spi
Definition: thermo.h:87
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:101
uint8_t thermo_check_connections(thermo_t *ctx)
Check connections fault function.
#define THERMO_RETVAL
Definition: thermo.h:65
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:107