thermo29 2.1.0.0
thermo29.h File Reference

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

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  thermo29_t
 Thermo 29 Click context object. More...
 
struct  thermo29_cfg_t
 Thermo 29 Click configuration object. More...
 

Macros

#define THERMO29_REG_TEMP_RESULT   0x00
 Thermo 29 register map.
 
#define THERMO29_REG_SLEW_RESULT   0x01
 
#define THERMO29_REG_ALERT_STATUS   0x02
 
#define THERMO29_REG_CONFIGURATION   0x03
 
#define THERMO29_REG_ALERT_ENABLE   0x04
 
#define THERMO29_REG_TLOW_LIMIT   0x05
 
#define THERMO29_REG_THIGH_LIMIT   0x06
 
#define THERMO29_REG_HYSTERESIS   0x07
 
#define THERMO29_REG_SLEW_LIMIT   0x08
 
#define THERMO29_REG_UNIQUE_ID1   0x09
 
#define THERMO29_REG_UNIQUE_ID2   0x0A
 
#define THERMO29_REG_UNIQUE_ID3   0x0B
 
#define THERMO29_REG_DEVICE_ID   0x0C
 
#define THERMO29_CONFIGURATION_RESETS   0x0100u
 Thermo 29 configuration register setting.
 
#define THERMO29_CONFIGURATION_AVG   0x0080u
 
#define THERMO29_CONFIGURATION_INT_COMP   0x0020u
 
#define THERMO29_CONFIGURATION_ONE_SHOT   0x0010u
 
#define THERMO29_CONFIGURATION_MODE_CONT   0x0000u
 
#define THERMO29_CONFIGURATION_MODE_SHDN   0x0008u
 
#define THERMO29_CONFIGURATION_MODE_MASK   0x0008u
 
#define THERMO29_CONFIGURATION_CONV_PER_6MS   0x0000u
 
#define THERMO29_CONFIGURATION_CONV_PER_31_25MS   0x0001u
 
#define THERMO29_CONFIGURATION_CONV_PER_62_5MS   0x0002u
 
#define THERMO29_CONFIGURATION_CONV_PER_125MS   0x0003u
 
#define THERMO29_CONFIGURATION_CONV_PER_250MS   0x0004u
 
#define THERMO29_CONFIGURATION_CONV_PER_500MS   0x0005u
 
#define THERMO29_CONFIGURATION_CONV_PER_1S   0x0006u
 
#define THERMO29_CONFIGURATION_CONV_PER_2S   0x0007u
 
#define THERMO29_CONFIGURATION_CONV_PER_MASK   0x0007u
 
#define THERMO29_ALERT_ENABLE_CRC   0x0010u
 Thermo 29 alert enable register setting.
 
#define THERMO29_ALERT_ENABLE_SLEW   0x0008u
 
#define THERMO29_ALERT_ENABLE_THIG   0x0004u
 
#define THERMO29_ALERT_ENABLE_TLOW   0x0002u
 
#define THERMO29_ALERT_ENABLE_DATA_READY   0x0001u
 
#define THERMO29_CRC_ENABLE   0x40
 Thermo 29 command word setting.
 
#define THERMO29_CRC_DATA_BLOCK_LEN_MASK   0x3C
 
#define THERMO29_AUTO_INCREMENT   0x02
 
#define THERMO29_READ_BIT   0x01
 
#define THERMO29_WRITE_BIT   0x00
 
#define THERMO29_DATA_LEN_MAX   10
 
#define THERMO29_TEMP_RESOLUTION   0.03125f
 Thermo 29 temperature calculation setting.
 
#define THERMO29_DEVICE_REV_MASK   0xF000u
 Thermo 29 device ID setting.
 
#define THERMO29_DEVICE_ID_MASK   0x0FFFu
 
#define THERMO29_DEVICE_ID   0x0126u
 
#define THERMO29_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define THERMO29_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define THERMO29_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  thermo29_return_value_t { THERMO29_OK = 0 , THERMO29_ERROR = -1 }
 Thermo 29 Click return value data. More...
 

Functions

void thermo29_cfg_setup (thermo29_cfg_t *cfg)
 Thermo 29 configuration object setup function.
 
err_t thermo29_init (thermo29_t *ctx, thermo29_cfg_t *cfg)
 Thermo 29 initialization function.
 
err_t thermo29_default_cfg (thermo29_t *ctx)
 Thermo 29 default configuration function.
 
err_t thermo29_write_register (thermo29_t *ctx, uint8_t reg, uint16_t data_in)
 Thermo 29 write register function.
 
err_t thermo29_read_register (thermo29_t *ctx, uint8_t reg, uint16_t *data_out)
 Thermo 29 read register function.
 
err_t thermo29_write_registers (thermo29_t *ctx, uint8_t reg, uint16_t *data_in, uint8_t len)
 Thermo 29 write registers function.
 
err_t thermo29_read_registers (thermo29_t *ctx, uint8_t reg, uint16_t *data_out, uint8_t len)
 Thermo 29 read registers function.
 
uint8_t thermo29_get_alert_pin (thermo29_t *ctx)
 Thermo 29 get alert pin function.
 
void thermo29_enable_crc (thermo29_t *ctx)
 Thermo 29 enable crc function.
 
void thermo29_disable_crc (thermo29_t *ctx)
 Thermo 29 disable crc function.
 
err_t thermo29_check_communication (thermo29_t *ctx)
 Thermo 29 check communication function.
 
err_t thermo29_read_unique_id (thermo29_t *ctx, uint16_t *unique_id)
 Thermo 29 read unique id function.
 
err_t thermo29_read_temperature (thermo29_t *ctx, float *temperature)
 Thermo 29 read temperature function.
 
err_t thermo29_clear_alert_status (thermo29_t *ctx)
 Thermo 29 clear alert status function.
 

Detailed Description

This file contains API for Thermo 29 Click Driver.

Enumeration Type Documentation

◆ thermo29_return_value_t

Thermo 29 Click return value data.

Predefined enum values for driver return values.

Enumerator
THERMO29_OK 
THERMO29_ERROR