Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
69 #define THERMO23_CMD_SOFT_RESET 0xB4
70 #define THERMO23_CMD_GLOBAL_INIT 0x8C
71 #define THERMO23_CMD_GLOBAL_ADDRESS_ASSIGN 0x90
72 #define THERMO23_CMD_GLOBAL_CLEAR_INT 0xA9
73 #define THERMO23_CMD_GLOBAL_WRITE_TEMP 0xF0
74 #define THERMO23_CMD_GLOBAL_WRITE_CONFIG 0xF2
75 #define THERMO23_CMD_GLOBAL_WRITE_TLOW 0xF4
76 #define THERMO23_CMD_GLOBAL_WRITE_THIGH 0xF6
77 #define THERMO23_CMD_GLOBAL_READ_TEMP 0xF1
78 #define THERMO23_CMD_GLOBAL_READ_CONFIG 0xF3
79 #define THERMO23_CMD_GLOBAL_READ_TLOW 0xF5
80 #define THERMO23_CMD_GLOBAL_READ_THIGH 0xF7
81 #define THERMO23_CMD_INDIVIDUAL_WRITE_BIT 0x00
82 #define THERMO23_CMD_INDIVIDUAL_READ_BIT 0x01
88 #define THERMO23_CALIBRATION_BYTE 0x55
94 #define THERMO23_TIMEOUT 5000
100 #define THERMO23_CONFIG_INT_EN 0x8000
101 #define THERMO23_CONFIG_CR_0p25HZ 0x0000
102 #define THERMO23_CONFIG_CR_1HZ 0x2000
103 #define THERMO23_CONFIG_CR_4HZ 0x4000
104 #define THERMO23_CONFIG_CR_8HZ 0x6000
105 #define THERMO23_CONFIG_FH 0x1000
106 #define THERMO23_CONFIG_FL 0x0800
107 #define THERMO23_CONFIG_LC 0x0400
108 #define THERMO23_CONFIG_MODE_SHUTDOWN 0x0000
109 #define THERMO23_CONFIG_MODE_ONE_SHOT 0x0100
110 #define THERMO23_CONFIG_MODE_CONTINUOUS 0x0200
111 #define THERMO23_CONFIG_ETM 0x0080
112 #define THERMO23_CONFIG_RESERVED_BITS 0x007F
118 #define THERMO23_TEMP_RESOLUTION 0.0625
125 #define DRV_BUFFER_SIZE 200
143 #define THERMO23_MAP_MIKROBUS( cfg, mikrobus ) \
144 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
145 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX );
err_t thermo23_init(thermo23_t *ctx, thermo23_cfg_t *cfg)
Thermo 23 initialization function.
void thermo23_cfg_setup(thermo23_cfg_t *cfg)
Thermo 23 configuration object setup function.
#define DRV_BUFFER_SIZE
Thermo 23 driver buffer size.
Definition: thermo23.h:125
uint32_t baud_rate
Definition: thermo23.h:178
@ THERMO23_ERROR
Definition: thermo23.h:193
uart_stop_bits_t stop_bit
Definition: thermo23.h:182
uart_parity_t parity_bit
Definition: thermo23.h:181
pin_name_t tx_pin
Definition: thermo23.h:175
uint16_t config
Definition: thermo23.h:163
Thermo 23 Click configuration object.
Definition: thermo23.h:172
err_t thermo23_write_command(thermo23_t *ctx, uint8_t cmd, uint16_t data_in)
Thermo 23 write command function.
err_t thermo23_read_command(thermo23_t *ctx, uint8_t cmd, uint16_t *data_out)
Thermo 23 read command function.
@ THERMO23_OK
Definition: thermo23.h:192
err_t thermo23_read_temperature(thermo23_t *ctx, float *temperature)
Thermo 23 read temperature function.
uart_t uart
Definition: thermo23.h:157
thermo23_return_value_t
Thermo 23 Click return value data.
Definition: thermo23.h:191
err_t thermo23_set_config(thermo23_t *ctx, uint16_t config)
Thermo 23 set config function.
err_t thermo23_default_cfg(thermo23_t *ctx)
Thermo 23 default configuration function.
pin_name_t rx_pin
Definition: thermo23.h:174
Thermo 23 Click context object.
Definition: thermo23.h:155
uart_data_bits_t data_bit
Definition: thermo23.h:180
bool uart_blocking
Definition: thermo23.h:179