tempprobe 2.0.0.0
tempprobe.h File Reference

This file contains API for Temp Probe 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  tempprobe_t
 Temp Probe Click context object. More...
 
struct  tempprobe_cfg_t
 Temp Probe Click configuration object. More...
 

Macros

#define TEMPPROBE_REG_COMM_STATUS   0x0000
 Temp Probe description register.
 
#define TEMPPROBE_REG_THERMO_K_CONV_RES   0x0024
 
#define TEMPPROBE_REG_PN_JUNCTION_CONV_RES   0x0030
 
#define TEMPPROBE_REG_EEPROM_KEY   0x00B0
 
#define TEMPPROBE_REG_EEPROM_READ_RES_CODE   0x00D0
 
#define TEMPPROBE_REG_GLOBAL_CONFIG   0x00F0
 
#define TEMPPROBE_REG_MEAS_MULTIPLE_CHANN_MASK   0x00F4
 
#define TEMPPROBE_REG_EEPROM_STATUS   0x00F9
 
#define TEMPPROBE_REG_MUX_CONFIG_DELAY   0x00FF
 
#define TEMPPROBE_REG_THERMO_K_ASSIGN_DATA   0x0214
 
#define TEMPPROBE_REG_PN_JUNCTION_ASSIGN_DATA   0x0220
 
#define TEMPPROBE_REG_CUSTOM_SENS_TABLE_DATA   0x0250
 
#define TEMPPROBE_TYPE_J_THERMOCOUPLE   0x08000000ul
 Temp Probe type setting.
 
#define TEMPPROBE_TYPE_K_THERMOCOUPLE   0x10000000ul
 
#define TEMPPROBE_TYPE_E_THERMOCOUPLE   0x18000000ul
 
#define TEMPPROBE_TYPE_N_THERMOCOUPLE   0x20000000ul
 
#define TEMPPROBE_TYPE_R_THERMOCOUPLE   0x28000000ul
 
#define TEMPPROBE_TYPE_S_THERMOCOUPLE   0x30000000ul
 
#define TEMPPROBE_TYPE_T_THERMOCOUPLE   0x38000000ul
 
#define TEMPPROBE_TYPE_B_THERMOCOUPLE   0x40000000ul
 
#define TEMPPROBE_CUSTOM_THERMOCOUPLE   0x48000000ul
 
#define TEMPPROBE_CH1_COLD_JUNCTION   0x00400000ul
 Temp Probe cold junction setting.
 
#define TEMPPROBE_CH2_COLD_JUNCTION   0x00800000ul
 
#define TEMPPROBE_CH3_COLD_JUNCTION   0x00C00000ul
 
#define TEMPPROBE_CH4_COLD_JUNCTION   0x01000000ul
 
#define TEMPPROBE_CH5_COLD_JUNCTION   0x01400000ul
 
#define TEMPPROBE_CH6_COLD_JUNCTION   0x01800000ul
 
#define TEMPPROBE_CH7_COLD_JUNCTION   0x01C00000ul
 
#define TEMPPROBE_CH8_COLD_JUNCTION   0x02000000ul
 
#define TEMPPROBE_CH9_COLD_JUNCTION   0x02400000ul
 
#define TEMPPROBE_CH10_COLD_JUNCTION   0x02800000ul
 
#define TEMPPROBE_NO_COLD_JUNCTION   0x00000000ul
 
#define TEMPPROBE_DIFF_EXTERNAL_CURR   0x00000000ul
 Temp Probe open-circuit current setting.
 
#define TEMPPROBE_DIFF_10MICROA_CURR   0x00100000ul
 
#define TEMPPROBE_DIFF_100MICROA_CURR   0x00140000ul
 
#define TEMPPROBE_DIFF_500MICROA_CURR   0x00180000ul
 
#define TEMPPROBE_DIFF_1MILIA_CURR   0x001C0000ul
 
#define TEMPPROBE_SINGLE_ENDED_EXT_CURR   0x00200000ul
 
#define TEMPPROBE_SINGLE_ENDED_10MICROA_CURR   0x00300000ul
 
#define TEMPPROBE_SINGLE_ENDED_100MICROA_CURR   0x00340000ul
 
#define TEMPPROBE_SINGLE_ENDED_500MICROA_CURR   0x00380000ul
 
#define TEMPPROBE_SINGLE_ENDED_1MILIA_CURR   0x003C0000ul
 
#define TEMPPROBE_SENSE_RES_CH2_CH1   0x00800000ul
 Temp Probe open-circuit current setting.
 
#define TEMPPROBE_SENSE_RES_CH3_CH2   0x00C00000ul
 
#define TEMPPROBE_SENSE_RES_CH4_CH3   0x01000000ul
 
#define TEMPPROBE_SENSE_RES_CH5_CH4   0x01400000ul
 
#define TEMPPROBE_SENSE_RES_CH6_CH5   0x01800000ul
 
#define TEMPPROBE_SENSE_RES_CH7_CH6   0x01C00000ul
 
#define TEMPPROBE_SENSE_RES_CH8_CH7   0x02000000ul
 
#define TEMPPROBE_SENSE_RES_CH9_CH8   0x02400000ul
 
#define TEMPPROBE_SENSE_RES_CH10_CH9   0x02800000ul
 
#define TEMPPROBE_2_WIRE_GND_EXT   0x00000000ul
 Temp Probe RTD sensor configuration setting.
 
#define TEMPPROBE_2_WIRE_GND_INT   0x00040000ul
 
#define TEMPPROBE_3_WIRE_GND_EXT   0x00100000ul
 
#define TEMPPROBE_3_WIRE_GND_INT   0x00140000ul
 
#define TEMPPROBE_4_WIRE_GND_EXT   0x00200000ul
 
#define TEMPPROBE_4_WIRE_GND_INT   0x00240000ul
 
#define TEMPPROBE_4_WIRE_CURR_ROT   0x00280000ul
 
#define TEMPPROBE_4_WIRE_KELVIN_RSENSE_GND_EXT   0x00300000ul
 
#define TEMPPROBE_4_WIRE_KELVIN_RSENSE_GND_INT   0x00340000ul
 
#define TEMPPROBE_4_WIRE_KELVIN_RSENSE_CURR_ROT   0x00380000ul
 
#define TEMPPROBE_EXTERNAL_CURR   0x00000000ul
 Temp Probe current setting.
 
#define TEMPPROBE_5MICROA_CURR   0x00004000ul
 
#define TEMPPROBE_10MICROA_CURR   0x00008000ul
 
#define TEMPPROBE_25MICROA_CURR   0x0000C000ul
 
#define TEMPPROBE_50MICROA_CURR   0x00010000ul
 
#define TEMPPROBE_100MICROA_CURR   0x00014000ul
 
#define TEMPPROBE_250MICROA_CURR   0x00018000ul
 
#define TEMPPROBE_500MICROA_CURR   0x0001C000ul
 
#define TEMPPROBE_1MILIA_CURR   0x00020000ul
 
#define TEMPPROBE_EUROPEAN_CURVE   0x00000000ul
 Temp Probe curve setting.
 
#define TEMPPROBE_AMERICAN_CURVE   0x00001000ul
 
#define TEMPPROBE_JAPANESE_CURVE   0x00002000ul
 
#define TEMPPROBE_ITS_90_CURVE   0x00003000ul
 
#define TEMPPROBE_OTHERS_CURVES   0x00000000ul
 
#define TEMPPROBE_SENSE_RESISTOR   0xE8000000ul
 Temp Probe sense resistor setting.
 
#define TEMPPROBE_SENSE_RES_2K   0x001F4000ul
 
#define TEMPPROBE_SENSE_RES_10K2   0x009C40CDul
 
#define TEMPPROBE_SENSE_RES_1K   0x000FA933ul
 
#define TEMPPROBE_DIODE   0xE0000000ul
 Temp Probe diode setting.
 
#define TEMPPROBE_DIRECT_ADC   0xF0000000ul
 
#define TEMPPROBE_ANALOG_TEMP_SENS   0xF8000000ul
 
#define TEMPPROBE_DIODE_SNGL_END   0x04000000ul
 
#define TEMPPROBE_DIODE_DIFF   0x00000000ul
 
#define TEMPPROBE_DIODE_2_READ   0x00000000ul
 
#define TEMPPROBE_DIODE_3_READ   0x02000000ul
 
#define TEMPPROBE_DIODE_AVRG_ON   0x01000000ul
 
#define TEMPPROBE_START_CONV   0x80
 Temp Probe EEPROM setting.
 
#define TEMPPROBE_INITIATE_SLEEP   0x97
 
#define TEMPPROBE_READ_EEPROM   0x96
 
#define TEMPPROBE_WRITE_EEPROM   0x95
 
#define TEMPPROBE_FILTER_FREQ_55HZ   0x00
 Temp Probe measurement setting.
 
#define TEMPPROBE_FILTER_FREQ_60HZ   0x01
 
#define TEMPPROBE_FILTER_FREQ_50HZ   0x02
 
#define TEMPPROBE_CELSIUS   0x00
 
#define TEMPPROBE_FAHRENHEIT   0x04
 
#define TEMPPROBE_3_WIRE_RTD_KELVIN_CURR   0x10
 
#define TEMPPROBE_2_WIRE_RTD_KELVIN_CURR   0x20
 
#define TEMPPROBE_THERMISTOR_KELVIN_CURR   0x40
 
#define TEMPPROBE_CH10_MASK   0x00000200ul
 Temp Probe channel mask setting.
 
#define TEMPPROBE_CH9_MASK   0x00000100ul
 
#define TEMPPROBE_CH8_MASK   0x00000080ul
 
#define TEMPPROBE_CH7_MASK   0x00000040ul
 
#define TEMPPROBE_CH6_MASK   0x00000020ul
 
#define TEMPPROBE_CH5_MASK   0x00000010ul
 
#define TEMPPROBE_CH4_MASK   0x00000008ul
 
#define TEMPPROBE_CH3_MASK   0x00000004ul
 
#define TEMPPROBE_CH2_MASK   0x00000002ul
 
#define TEMPPROBE_CH1_MASK   0x00000001ul
 
#define TEMPPROBE_NO_CHANN_MASK   0x00000000ul
 
#define TEMPPROBE_ALL_CHANN_MASK   0x000003FFul
 
#define TEMPPROBE_EEPROM_KEY   0xA53C0F5Aul
 
#define TEMPPROBE_SPI_READ_INSTR   0x03
 Temp Probe spi instructions setting.
 
#define TEMPPROBE_SPI_WRITE_INSTR   0x02
 
#define TEMPPROBE_REG_ADDR_ERROR   0x01
 Temp Probe error states setting.
 
#define TEMPPROBE_NUM_BYTES_ERROR   0x02
 
#define TEMPPROBE_NO_ERROR   0x00
 
#define TEMPPROBE_BUSY_STATE   0x02
 
#define TEMPPROBE_NO_BUSY_STATE   0x01
 
#define TEMPPROBE_EEPROM_READ_PASS   0x00
 
#define TEMPPROBE_EEPROM_READ_FAIL   0xFF
 
#define TEMPPROBE_CHANN_SEL_ERROR   0xFF
 
#define TEMPPROBE_PN_JUNCTION_DEF_CFG   0xE5000000
 
#define TEMPPROBE_GLOBAL_CONFIG_DEF_CFG   0x00000072
 
#define TEMPPROBE_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define TEMPPROBE_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define TEMPPROBE_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  tempprobe_return_value_t { TEMPPROBE_OK = 0 , TEMPPROBE_ERROR = -1 }
 Temp Probe Click return value data. More...
 

Functions

void tempprobe_cfg_setup (tempprobe_cfg_t *cfg)
 Temp Probe configuration object setup function.
 
err_t tempprobe_init (tempprobe_t *ctx, tempprobe_cfg_t *cfg)
 Temp Probe initialization function.
 
err_t tempprobe_default_cfg (tempprobe_t *ctx)
 Temp Probe default configuration function.
 
err_t tempprobe_write_byte (tempprobe_t *ctx, uint16_t reg_addr, uint8_t data_in)
 Byte Write function.
 
err_t tempprobe_write_dword (tempprobe_t *ctx, uint16_t reg_addr, uint32_t data_in)
 Word Write function.
 
err_t tempprobe_read_bytes (tempprobe_t *ctx, uint16_t reg_addr, uint8_t *data_out, uint8_t n_bytes)
 Byte Read function.
 
err_t tempprobe_read_dword (tempprobe_t *ctx, uint16_t reg_addr, uint32_t *data_out)
 Word Read function.
 
uint8_t tempprobe_check_busy (tempprobe_t *ctx)
 Busy Check function.
 
void tempprobe_reset (tempprobe_t *ctx)
 Reset function.
 
uint8_t tempprobe_write_eeprom_data (tempprobe_t *ctx)
 EEPROM Write function.
 
uint8_t tempprobe_read_eeprom_data (tempprobe_t *ctx)
 EEPROM Read function.
 
uint8_t tempprobe_read_temp (tempprobe_t *ctx, uint16_t sel_channel, float *data_out)
 Temperature Read function.
 

Detailed Description

This file contains API for Temp Probe Click Driver.

Enumeration Type Documentation

◆ tempprobe_return_value_t

Temp Probe Click return value data.

Predefined enum values for driver return values.

Enumerator
TEMPPROBE_OK 
TEMPPROBE_ERROR