Microchip® Advanced Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AT30TS Temperature Sensor Library

This module contains different routines that can be used for interfacing AT30TS series of Digital Temperature Sensors.

These devices are interfaced via an I2C/SMBus compatible interface.

Dependencies

This driver depends on the following modules: Two Wire-interface(TWI) for interfacing with a TWI Master.

HX8347A low level driver API

AT30TSxx Temperature Sensor API can be found here

Modules

 Quick Start Guide(s)
 In this section you can find a list of all Quick Start guides related to the AT30TS Temperature Sensor Library.
 
 AT30TS API listing
 

Data Structures

struct  _sensor_data
 
struct  _ts_device
 Information about a AT30TS device. More...
 

Macros

#define AT30TS_GENERAL_ERROR   (-1)
 
#define AT30TS_INVALID_EEPROM_ADDRESS   (-5)
 
#define AT30TS_INVALID_SIZE   (-6)
 
#define AT30TS_NVRBSY_BUSY   (-8)
 
#define AT30TS_OUT_OF_BOUNDS   (-7)
 
#define AT30TS_REG_LOCKED   (-4)
 
#define AT30TS_SUCCESS   (0)
 
#define AT30TS_TWI_READ_NACK   (-3)
 
#define AT30TS_TWI_WRITE_NACK   (-2)
 
#define CAPABIL_REG   0x00 /* !< Capability (R) Default = 0x00D7 */
 
#define CONFIG_REG   0x01 /* !< Vol Config (R/W) Default = N/A */
 
#define CONFIGUR_REG   0x01 /* !< Configuration (R/W) Default = 0x0000 */
 
#define CPY_NVOL_VOL_REG
 
#define CPY_VOL_NVOL_REG
 
#define DEV_ID_REG   0x07 /* !< Dev ID/Revision (R) Default = 0x8201 */
 
#define EEPROM_WP_ADDRESS   0x60 /* !< EEPROM's WP TWI-address */
 
#define MANF_ID_REG   0x06 /* !< Manufacturer ID (R) Default = 0x001F */
 
#define NV_CONFIG_REG   0x11 /* !< NonVol Config (R/W) Default = 0x0000 */
 
#define NV_THILIM_REG   0x13 /* !< NonVol Hi Lim (R/W) Default = 0x0500 */
 
#define NV_TLOLIM_REG   0x12 /* !< NonVol Lo Lim (R/W) Default = 0x04B0 */
 
#define NVRBSY   0x01 /* !< Nonvolatile Registers Busy */
 
#define PAGE_SIZE   0x10 /* !< EEPROM page size */
 
#define RLCK_MSK   0x02 /* !< Nonvolatile Register Lock */
 
#define RLCKDWN_MSK   0x04 /* !< Nonvolatile Register Lockdown */
 
#define SMBUS_TO_REG   0x22 /* !< SMBus Timeout (R/W) Default = 0x0000 */
 
#define TCOPYR
 
#define TCOPYW
 
#define TEMP_DATA_REG   0x05 /* !< Temperature Data (R) Default = N/A */
 
#define TEMPER_REG   0x00 /* !< Temperature Data (R) Default = 0x0000 */
 
#define THILIM_REG   0x03 /* !< Vol Hi Lim (R/W) Default = N/A */
 
#define TLOLIM_REG   0x02 /* !< Vol Lo Lim (R/W) Default = N/A */
 
#define TPROG   5 /* !< NV Register Program Time (ms), max */
 
#define TRIP_CRT_REG   0x04 /* !< Critical Alarm (R/W) Default = 0x0000 */
 
#define TRIP_LWR_REG   0x03 /* !< Lower Alarm (R/W) Default = 0x0000 */
 
#define TRIP_UPR_REG   0x02 /* !< Upper Alarm (R/W) Default = 0x0000 */
 

Typedefs

typedef enum config_options_002b config_options_002b_t
 
typedef enum config_options config_options_t
 
typedef enum device_type device_type_t
 
typedef enum nvconfig_options nvconfig_options_t
 
typedef enum opt_flag_002b opt_flag_002b_t
 
typedef enum opt_flag opt_flag_t
 
typedef struct _sensor_data sensor_data_t
 
typedef struct _ts_device ts_device_t
 Information about a AT30TS device. More...
 

Enumerations

enum  config_options {
  AT30TS7_SD_DISABLE = 0,
  AT30TS7_SD_ENABLE = 1,
  AT30TS7_CMP = 0,
  AT30TS7_INT = 1,
  AT30TS7_POL_ACTIVE_LOW = 0,
  AT30TS7_POL_ACTIVE_HIGH = 1,
  AT30TS7_FAULT1 = 0,
  AT30TS7_FAULT2 = 1,
  AT30TS7_FAULT4 = 2,
  AT30TS7_FAULT6 = 3,
  AT30TS7_RES09 = 0,
  AT30TS7_RES10 = 1,
  AT30TS7_RES11 = 2,
  AT30TS7_RES12 = 3,
  AT30TS7_OS_DISABLE = 0,
  AT30TS7_OS_ENABLE = 1
}
 Configuration Reg Options for the AT30TS7x/TSE7x. More...
 
enum  config_options_002b {
  AT30TS_002B_CONF_OPT_MODE_CMP = 0,
  AT30TS_002B_CONF_OPT_MODE_INT = 1,
  AT30TS_002B_CONF_OPT_POL_LOW = 0,
  AT30TS_002B_CONF_OPT_POL_HIGH = 1,
  AT30TS_002B_CONF_OPT_CRIT_ALL_ALM = 0,
  AT30TS_002B_CONF_OPT_CRIT_ALM_ONLY = 1,
  AT30TS_002B_CONF_OPT_EVTOUT_DIS = 0,
  AT30TS_002B_CONF_OPT_EVTOUT_EN = 1,
  AT30TS_002B_CONF_OPT_EVTSTS_DIS = 0,
  AT30TS_002B_CONF_OPT_EVTSTS_EN = 1,
  AT30TS_002B_CONF_OPT_EVTCLR_DIS = 0,
  AT30TS_002B_CONF_OPT_EVTCLR_EN = 1,
  AT30TS_002B_CONF_OPT_WINLOCK_DIS = 0,
  AT30TS_002B_CONF_OPT_WINLOCK_EN = 1,
  AT30TS_002B_CONF_OPT_CRTALML_DIS = 0,
  AT30TS_002B_CONF_OPT_CRTALML_EN = 0,
  AT30TS_002B_CONF_OPT_SHTDWN_EN = 0,
  AT30TS_002B_CONF_OPT_SHTDWN_DIS = 1,
  AT30TS_002B_CONF_OPT_HYSTENB_00C = 0,
  AT30TS_002B_CONF_OPT_HYSTENB_15C = 1,
  AT30TS_002B_CONF_OPT_HYSTENB_30C = 2,
  AT30TS_002B_CONF_OPT_HYSTENB_60C = 3
}
 Configuration Reg Options for the for AT30TSE002B device. More...
 
enum  data_types {
  pos,
  neg,
  cel,
  farh,
  raw
}
 Qualifier for the temperature reading. More...
 
enum  device_type {
  AT30TSE002B,
  AT30TS75,
  AT30TS750,
  AT30TSE752,
  AT30TSE754,
  AT30TSE758
}
 AT30TS Family device types. More...
 
enum  nvconfig_options {
  AT30TS7_RLCK_UNLOCK = 0,
  AT30TS7_RLCK_LOCK = 1,
  AT30TS7_RLCKDWN_UNLOCK = 0,
  AT30TS7_RLCKDWN_LOCK = 1,
  AT30TS7_NVSD_DISABLE = 0,
  AT30TS7_NVSD_ENABLE = 1,
  AT30TS7_NVCMP = 0,
  AT30TS7_NVINT = 1,
  AT30TS7_NVPOL_ACTIVE_LOW = 0,
  AT30TS7_NVPOL_ACTIVE_HIGH = 1,
  AT30TS7_NVFAULT1 = 0,
  AT30TS7_NVFAULT2 = 1,
  AT30TS7_NVFAULT4 = 2,
  AT30TS7_NVFAULT6 = 3,
  AT30TS7_NVRES09 = 0,
  AT30TS7_NVRES10 = 1,
  AT30TS7_NVRES11 = 2,
  AT30TS7_NVRES12 = 3
}
 Nonvolatile Configuration Reg Options. More...
 
enum  opt_flag {
  AT30TS_RES,
  AT30TS_FAULT,
  AT30TS_POL,
  AT30TS_CMP_INT_MODE,
  AT30TS_SD,
  AT30TS_OS,
  AT30TS_RLCK,
  AT30TS_RLCKDWN
}
 Configuration Options. More...
 
enum  opt_flag_002b {
  AT30TS_002B_CONFBIT_EVTMOD,
  AT30TS_002B_CONFBIT_EVTPOL,
  AT30TS_002B_CONFBIT_CRITEVT,
  AT30TS_002B_CONFBIT_EVTOUT,
  AT30TS_002B_CONFBIT_EVTSTS,
  AT30TS_002B_CONFBIT_EVTCLR,
  AT30TS_002B_CONFBIT_WINLOCK,
  AT30TS_002B_CONFBIT_CRTALML,
  AT30TS_002B_CONFBIT_SHTDWN,
  AT30TS_002B_CONFBIT_HYSTENB
}
 Configuration Reg Bits for the AT30TSE002B device. More...
 
enum  reg_type {
  vol,
  nonvol
}
 Register types in AT30TS device. More...
 

#define AT30TS_GENERAL_ERROR   (-1)
#define AT30TS_INVALID_EEPROM_ADDRESS   (-5)

Referenced by ts_read_eeprom(), and ts_write_eeprom().

#define AT30TS_INVALID_SIZE   (-6)

Referenced by ts_write_eeprom().

#define AT30TS_NVRBSY_BUSY   (-8)

Referenced by check_NVRBSY().

#define AT30TS_OUT_OF_BOUNDS   (-7)
#define AT30TS_REG_LOCKED   (-4)

Referenced by check_NVRBSY().

#define AT30TS_TWI_READ_NACK   (-3)

Referenced by ts_read_eeprom(), and ts_read_register().

#define CAPABIL_REG   0x00 /* !< Capability (R) Default = 0x00D7 */
#define CONFIG_REG   0x01 /* !< Vol Config (R/W) Default = N/A */
#define CONFIGUR_REG   0x01 /* !< Configuration (R/W) Default = 0x0000 */
#define CPY_NVOL_VOL_REG
Value:
0xB8 /* !< Copy Nonvolatile Registers to Volatile
* Registers */
#define CPY_VOL_NVOL_REG
Value:
0x48 /* !< Copy Volatile Registers to Nonvolatile
* Registers */
#define DEV_ID_REG   0x07 /* !< Dev ID/Revision (R) Default = 0x8201 */
#define EEPROM_WP_ADDRESS   0x60 /* !< EEPROM's WP TWI-address */
#define MANF_ID_REG   0x06 /* !< Manufacturer ID (R) Default = 0x001F */
#define NV_CONFIG_REG   0x11 /* !< NonVol Config (R/W) Default = 0x0000 */
#define NV_THILIM_REG   0x13 /* !< NonVol Hi Lim (R/W) Default = 0x0500 */
#define NV_TLOLIM_REG   0x12 /* !< NonVol Lo Lim (R/W) Default = 0x04B0 */
#define NVRBSY   0x01 /* !< Nonvolatile Registers Busy */

Referenced by check_NVRBSY().

#define PAGE_SIZE   0x10 /* !< EEPROM page size */

Referenced by ts_write_eeprom(), and ts_write_memory().

#define RLCK_MSK   0x02 /* !< Nonvolatile Register Lock */

Referenced by check_NVRBSY().

#define RLCKDWN_MSK   0x04 /* !< Nonvolatile Register Lockdown */

Referenced by check_NVRBSY().

#define SMBUS_TO_REG   0x22 /* !< SMBus Timeout (R/W) Default = 0x0000 */
#define TCOPYR
Value:
200 /* !< Nonvolatile to Volatile Reg Copy Time
* (us), max */
#define TCOPYW
Value:
5 /* !< Volatile to Nonvolatile Reg Copy Time (ms),
* max */
#define TEMP_DATA_REG   0x05 /* !< Temperature Data (R) Default = N/A */

Referenced by read_temperature().

#define TEMPER_REG   0x00 /* !< Temperature Data (R) Default = 0x0000 */

Referenced by read_temperature().

#define THILIM_REG   0x03 /* !< Vol Hi Lim (R/W) Default = N/A */
#define TLOLIM_REG   0x02 /* !< Vol Lo Lim (R/W) Default = N/A */
#define TPROG   5 /* !< NV Register Program Time (ms), max */
#define TRIP_CRT_REG   0x04 /* !< Critical Alarm (R/W) Default = 0x0000 */
#define TRIP_LWR_REG   0x03 /* !< Lower Alarm (R/W) Default = 0x0000 */
#define TRIP_UPR_REG   0x02 /* !< Upper Alarm (R/W) Default = 0x0000 */

typedef enum device_type device_type_t
typedef enum opt_flag opt_flag_t
typedef struct _sensor_data sensor_data_t
typedef struct _ts_device ts_device_t

Information about a AT30TS device.

Configuration Reg Options for the AT30TS7x/TSE7x.

Enumerator
AT30TS7_SD_DISABLE 
AT30TS7_SD_ENABLE 
AT30TS7_CMP 
AT30TS7_INT 
AT30TS7_POL_ACTIVE_LOW 
AT30TS7_POL_ACTIVE_HIGH 
AT30TS7_FAULT1 
AT30TS7_FAULT2 
AT30TS7_FAULT4 
AT30TS7_FAULT6 
AT30TS7_RES09 
AT30TS7_RES10 
AT30TS7_RES11 
AT30TS7_RES12 
AT30TS7_OS_DISABLE 
AT30TS7_OS_ENABLE 

Configuration Reg Options for the for AT30TSE002B device.

Enumerator
AT30TS_002B_CONF_OPT_MODE_CMP 
AT30TS_002B_CONF_OPT_MODE_INT 
AT30TS_002B_CONF_OPT_POL_LOW 
AT30TS_002B_CONF_OPT_POL_HIGH 
AT30TS_002B_CONF_OPT_CRIT_ALL_ALM 
AT30TS_002B_CONF_OPT_CRIT_ALM_ONLY 
AT30TS_002B_CONF_OPT_EVTOUT_DIS 
AT30TS_002B_CONF_OPT_EVTOUT_EN 
AT30TS_002B_CONF_OPT_EVTSTS_DIS 
AT30TS_002B_CONF_OPT_EVTSTS_EN 
AT30TS_002B_CONF_OPT_EVTCLR_DIS 
AT30TS_002B_CONF_OPT_EVTCLR_EN 
AT30TS_002B_CONF_OPT_WINLOCK_DIS 
AT30TS_002B_CONF_OPT_WINLOCK_EN 
AT30TS_002B_CONF_OPT_CRTALML_DIS 
AT30TS_002B_CONF_OPT_CRTALML_EN 
AT30TS_002B_CONF_OPT_SHTDWN_EN 
AT30TS_002B_CONF_OPT_SHTDWN_DIS 
AT30TS_002B_CONF_OPT_HYSTENB_00C 
AT30TS_002B_CONF_OPT_HYSTENB_15C 
AT30TS_002B_CONF_OPT_HYSTENB_30C 
AT30TS_002B_CONF_OPT_HYSTENB_60C 
enum data_types

Qualifier for the temperature reading.

Enumerator
pos 
neg 
cel 
farh 
raw 

AT30TS Family device types.

Enumerator
AT30TSE002B 
AT30TS75 
AT30TS750 
AT30TSE752 
AT30TSE754 
AT30TSE758 

Nonvolatile Configuration Reg Options.

Enumerator
AT30TS7_RLCK_UNLOCK 
AT30TS7_RLCK_LOCK 
AT30TS7_RLCKDWN_UNLOCK 
AT30TS7_RLCKDWN_LOCK 
AT30TS7_NVSD_DISABLE 
AT30TS7_NVSD_ENABLE 
AT30TS7_NVCMP 
AT30TS7_NVINT 
AT30TS7_NVPOL_ACTIVE_LOW 
AT30TS7_NVPOL_ACTIVE_HIGH 
AT30TS7_NVFAULT1 
AT30TS7_NVFAULT2 
AT30TS7_NVFAULT4 
AT30TS7_NVFAULT6 
AT30TS7_NVRES09 
AT30TS7_NVRES10 
AT30TS7_NVRES11 
AT30TS7_NVRES12 
enum opt_flag

Configuration Options.

Enumerator
AT30TS_RES 
AT30TS_FAULT 
AT30TS_POL 
AT30TS_CMP_INT_MODE 
AT30TS_SD 
AT30TS_OS 
AT30TS_RLCK 
AT30TS_RLCKDWN 

Configuration Reg Bits for the AT30TSE002B device.

Enumerator
AT30TS_002B_CONFBIT_EVTMOD 
AT30TS_002B_CONFBIT_EVTPOL 
AT30TS_002B_CONFBIT_CRITEVT 
AT30TS_002B_CONFBIT_EVTOUT 
AT30TS_002B_CONFBIT_EVTSTS 
AT30TS_002B_CONFBIT_EVTCLR 
AT30TS_002B_CONFBIT_WINLOCK 
AT30TS_002B_CONFBIT_CRTALML 
AT30TS_002B_CONFBIT_SHTDWN 
AT30TS_002B_CONFBIT_HYSTENB 
enum reg_type

Register types in AT30TS device.

Enumerator
vol 
nonvol