Go to the documentation of this file.
38 #include "mikrosdk_version.h"
41 #if mikroSDK_GET_VERSION < 20800ul
42 #include "rcu_delays.h"
48 #include "drv_digital_out.h"
49 #include "drv_digital_in.h"
50 #include "drv_spi_master.h"
64 #define THERMO_MAP_MIKROBUS( cfg, mikrobus ) \
65 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
66 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
67 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
68 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
75 #define THERMO_RETVAL uint8_t
77 #define THERMO_OK 0x00
78 #define THERMO_INIT_ERROR 0xFF
void thermo_cfg_setup(thermo_cfg_t *cfg)
Config Object Initialization function.
Click ctx object definition.
Definition: thermo.h:92
Click configuration structure definition.
Definition: thermo.h:106
pin_name_t mosi
Definition: thermo.h:110
pin_name_t cs
Definition: thermo.h:112
spi_master_chip_select_polarity_t cs_polarity
Definition: thermo.h:118
uint32_t spi_speed
Definition: thermo.h:116
pin_name_t miso
Definition: thermo.h:109
pin_name_t chip_select
Definition: thermo.h:98
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:93
spi_master_t spi
Definition: thermo.h:97
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:111
uint8_t thermo_check_connections(thermo_t *ctx)
Check connections fault function.
#define THERMO_RETVAL
Definition: thermo.h:75
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:117