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 THERMOSTAT3_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 ); \
69 cfg.rly = MIKROBUS( mikrobus, MIKROBUS_PWM)
76 #define THERMOSTAT_RETVAL uint8_t
78 #define THERMOSTAT_OK 0x00
79 #define THERMOSTAT_INIT_ERROR 0xFF
86 #define THERMOSTAT3_RELAY_ON 0x01
87 #define THERMOSTAT3_RELAY_OFF 0x00
94 #define THERMOSTAT3_TEMP_IN_CELSIUS 0x00
95 #define THERMOSTAT3_TEMP_IN_FAHRENHEIT 0x02
96 #define THERMOSTAT3_TEMP_IN_KELVIN 0x01
103 #define THERMOSTAT3_FAULT_ACTIVE_FLAG 0x08
104 #define THERMOSTAT3_FAULT_SCV_FLAG 0x04
105 #define THERMOSTAT3_FAULT_SCG_FLAG 0x02
106 #define THERMOSTAT3_FAULT_OC_FLAG 0x01
107 #define THERMOSTAT3_FAULT_ALL_FLAG 0x00
275 #endif // _THERMOSTAT_H_
pin_name_t cs
Definition: thermostat3.h:156
pin_name_t chip_select
Definition: thermostat3.h:137
uint8_t fault_flag
Definition: thermostat3.h:140
void thermostat3_process(thermostat3_t *ctx, temp_vals_t *tmp)
Thermostat Process Read data.
#define THERMOSTAT_RETVAL
Definition: thermostat3.h:76
Click configuration structure definition.
Definition: thermostat3.h:150
uint8_t fault_value_cfg
Definition: thermostat3.h:170
float internal_temp
Definition: thermostat3.h:176
float thermocouple_temp
Definition: thermostat3.h:177
uint8_t fault_status
Definition: thermostat3.h:142
void thermostat3_relay_control(thermostat3_t *ctx, uint8_t relay_pos)
Relay Control.
void thermostat3_cfg_setup(thermostat3_cfg_t *cfg)
Config Object Initialization function.
uint8_t f_error
Definition: thermostat3.h:141
pin_name_t rly
Definition: thermostat3.h:160
uint8_t fault_value
Definition: thermostat3.h:178
uint8_t relay_flag
Definition: thermostat3.h:139
pin_name_t miso
Definition: thermostat3.h:153
digital_out_t cs
Definition: thermostat3.h:132
spi_master_chip_select_polarity_t cs_polarity
Definition: thermostat3.h:166
spi_master_t spi
Definition: thermostat3.h:136
void thermostat3_generic_read(thermostat3_t *ctx, uint8_t *read_buff)
uint8_t thermostat3_get_fault_data(temp_vals_t *tmp, uint8_t err)
Fault data value.
uint8_t spi_mode
Definition: thermostat3.h:165
pin_name_t mosi
Definition: thermostat3.h:154
THERMOSTAT_RETVAL thermostat3_init(thermostat3_t *ctx, thermostat3_cfg_t *cfg)
Initialization function.
float thermostat3_get_thermocouple_temperature(temp_vals_t *tmp, uint8_t temp_in)
Thermocouple Temperature (K probe)
Click ctx object definition.
Definition: thermostat3.h:128
float thermocouple_temp_cfg
Definition: thermostat3.h:169
digital_out_t rly
Definition: thermostat3.h:131
float internal_temp_cfg
Definition: thermostat3.h:168
uint32_t spi_speed
Definition: thermostat3.h:164
pin_name_t sck
Definition: thermostat3.h:155
Definition: thermostat3.h:175
float thermostat3_get_internal_temperature(temp_vals_t *tmp, uint8_t temp_in)
Junction (Internal) Temperature.