thermo19 2.0.0.0
thermo19.h File Reference

This file contains API for Thermo 19 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_one_wire.h"

Go to the source code of this file.

Data Structures

struct  thermo19_t
 Thermo 19 Click context object. More...
 
struct  thermo19_cfg_t
 Thermo 19 Click configuration object. More...
 

Macros

#define THERMO19_CMD_CONVERT_TEMPERATURE   0x44
 Thermo 19 commands list.
 
#define THERMO19_CMD_WRITE_SCRATCHPAD   0x4E
 
#define THERMO19_CMD_READ_SCRATCHPAD   0xBE
 
#define THERMO19_CMD_DETECT_ADDRESS   0x88
 
#define THERMO19_CMD_SELECT_ADDRESS   0x70
 
#define THERMO19_CONFIG_FORMAT_NORMAL   0x00
 Thermo 19 config register settings.
 
#define THERMO19_CONFIG_FORMAT_EXTEND   0x80
 
#define THERMO19_CONFIG_FORMAT_BIT_MASK   0x80
 
#define THERMO19_CONFIG_RESOLUTION_8BIT   0x00
 
#define THERMO19_CONFIG_RESOLUTION_9BIT   0x20
 
#define THERMO19_CONFIG_RESOLUTION_10BIT   0x40
 
#define THERMO19_CONFIG_RESOLUTION_12BIT   0x60
 
#define THERMO19_CONFIG_RESOLUTION_BIT_MASK   0x60
 
#define THERMO19_CONFIG_COMP_INT_COMPARATOR   0x00
 
#define THERMO19_CONFIG_COMP_INT_INTERRUPT   0x10
 
#define THERMO19_CONFIG_COMP_INT_BIT_MASK   0x10
 
#define THERMO19_CONFIG_FAULT_QUEUE_SINGLE   0x00
 
#define THERMO19_CONFIG_FAULT_QUEUE_MULTIPLE   0x08
 
#define THERMO19_CONFIG_FAULT_QUEUE_BIT_MASK   0x08
 
#define THERMO19_CONFIG_CONVERSION_RATE_0   0x00
 
#define THERMO19_CONFIG_CONVERSION_RATE_1_64   0x01
 
#define THERMO19_CONFIG_CONVERSION_RATE_1_32   0x02
 
#define THERMO19_CONFIG_CONVERSION_RATE_1_16   0x03
 
#define THERMO19_CONFIG_CONVERSION_RATE_1_4   0x04
 
#define THERMO19_CONFIG_CONVERSION_RATE_1_1   0x05
 
#define THERMO19_CONFIG_CONVERSION_RATE_4_1   0x06
 
#define THERMO19_CONFIG_CONVERSION_RATE_8_1   0x07
 
#define THERMO19_CONFIG_CONVERSION_RATE_BIT_MASK   0x07
 
#define THERMO19_STATUS_TH_FAULT_OCCURED   0x80
 Thermo 19 status register settings.
 
#define THERMO19_STATUS_TH_FAULT_NOT_OCCURED   0x00
 
#define THERMO19_STATUS_TH_FAULT_BIT_MASK   0x80
 
#define THERMO19_STATUS_TL_FAULT_OCCURED   0x40
 
#define THERMO19_STATUS_TL_FAULT_NOT_OCCURED   0x00
 
#define THERMO19_STATUS_TL_FAULT_BIT_MASK   0x40
 
#define THERMO19_STATUS_ADDRRESS_0   0x1A
 
#define THERMO19_STATUS_ADDRRESS_1   0x3A
 
#define THERMO19_STATUS_ADDRRESS_BIT_MASK   0x3F
 
#define THERMO19_ADDRESS_0   0x1A
 Thermo 19 address settings.
 
#define THERMO19_ADDRESS_1   0x3A
 
#define THERMO19_ADDRESS_ALL   0xFF
 
#define THERMO19_ADDRESS_BIT_MASK   0x3F
 
#define THERMO19_DATA_RESOLUTION   0.0625
 Thermo 19 temperature calculation values.
 
#define THERMO19_FAMILY_CODE   0x3B
 Thermo 19 family code value.
 
#define THERMO19_DEFAULT_CONFIG   ( THERMO19_CONFIG_RESOLUTION_12BIT | THERMO19_CONFIG_COMP_INT_INTERRUPT )
 Thermo 19 default config values.
 
#define THERMO19_DEFAULT_ADDRESS   THERMO19_ADDRESS_ALL
 
#define THERMO19_DEFAULT_TEMP_HIGH_ALARM   0xFFFF
 
#define THERMO19_DEFAULT_TEMP_LOW_ALARM   0x0000
 
#define THERMO19_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  thermo19_gpio_sel_t { THERMO19_GPIO_0 , THERMO19_GPIO_1 }
 Thermo 19 Click gpio selector. More...
 
enum  thermo19_return_value_t { THERMO19_OK = 0 , THERMO19_ERROR = -1 }
 Thermo 19 Click return value data. More...
 

Functions

void thermo19_cfg_setup (thermo19_cfg_t *cfg)
 Thermo 19 configuration object setup function.
 
void thermo19_gpio_selection (thermo19_cfg_t *cfg, thermo19_gpio_sel_t gpio_sel)
 Thermo 19 driver interface setup function.
 
err_t thermo19_init (thermo19_t *ctx, thermo19_cfg_t *cfg)
 Thermo 19 initialization function.
 
err_t thermo19_default_cfg (thermo19_t *ctx)
 Thermo 19 default configuration function.
 
err_t thermo19_check_communication (thermo19_t *ctx)
 Thermo 19 check communication function.
 
err_t thermo19_select_device (thermo19_t *ctx)
 Thermo 19 select device function.
 
err_t thermo19_start_measurement (thermo19_t *ctx)
 Thermo 19 start measurement function.
 
err_t thermo19_read_scratchpad (thermo19_t *ctx, uint8_t *scratchpad)
 Thermo 19 read scratchpad function.
 
err_t thermo19_write_scratchpad (thermo19_t *ctx, uint16_t temp_high, uint16_t temp_low, uint8_t config)
 Thermo 19 write scratchpad function.
 
err_t thermo19_read_temperature (thermo19_t *ctx, float *temperature)
 Thermo 19 read temperature function.
 
uint8_t thermo19_get_alert_pin (thermo19_t *ctx)
 Thermo 19 get alert pin function.
 

Detailed Description

This file contains API for Thermo 19 Click Driver.

Enumeration Type Documentation

◆ thermo19_gpio_sel_t

Thermo 19 Click gpio selector.

Selects gpio pin of Thermo 19 Click driver.

Enumerator
THERMO19_GPIO_0 

GPIO 0 pin.

THERMO19_GPIO_1 

GPIO 1 pin.

◆ thermo19_return_value_t

Thermo 19 Click return value data.

Predefined enum values for driver return values.

Enumerator
THERMO19_OK 
THERMO19_ERROR