Atmel Software Framework

at30ts.c File Reference

Management of the AT30TS Temperature Sensor component.

This file contains definitions and services related to the features of the AT30TS Temperature Sensor.

Copyright (C) 2015 Atmel Corporation. All rights reserved.

#include "at30ts.h"

Macros

#define buftoval(val, buf)
 
#define valtobuf(val, buf)
 

Functions

void attach_device (uint8_t device_addr, device_type_t type)
 attach_device, initialize epprom variable associcated with device More...
 
int8_t check_NVRBSY (void)
 Checks at30ts75 NVRBSY, RLCKDWN and RCLK bits. More...
 
void parse_temp_reading (sensor_data_t *sensor_data)
 
uint8_t read_config (sensor_data_t *sensor_data)
 Read nonvolatile config register. More...
 
uint8_t read_nvconfig (sensor_data_t *sensor_data)
 Read nonvolatile config register. More...
 
uint8_t read_nvthigh (sensor_data_t *sensor_data)
 Read nonvolatile tHIGH limit register. More...
 
uint8_t read_nvtlow (sensor_data_t *sensor_data)
 Read nonvolatile tLOW limit register. More...
 
int8_t read_temperature (sensor_data_t *sensor_data)
 Read temperature register. More...
 
uint8_t read_temperature_high (sensor_data_t *sensor_data)
 Read tHIGH limit register. More...
 
uint8_t read_temperature_low (sensor_data_t *sensor_data)
 Read tLOW limit register. More...
 
uint8_t set_config_option (sensor_data_t *data, opt_flag_t flag, config_options_t opt)
 Set Configuration Options. More...
 
uint8_t set_nvconfig_option (sensor_data_t *data, opt_flag_t flag, nvconfig_options_t opt)
 Set bit(s) in nonvolatile configuration register. More...
 
int8_t ts75_copy_nonvol_vol_register ()
 Copy nonvolatile registers to volatile registers. More...
 
int8_t ts75_copy_vol_nonvol_register ()
 Copy volatile registers to nonvolatile registers. More...
 
int8_t ts75_probe_nonvol_register (uint8_t device_addr)
 Probe at30ts75 nonvolatile configuration register. More...
 
int8_t ts_ack_polling (uint8_t addr)
 ACK polling function. More...
 
void ts_construct_eeprom_address (twi_package_t *packet, uint16_t address)
 Constructs an eeprom address. More...
 
int8_t ts_read_eeprom (uint16_t address, uint16_t size, uint8_t *buf)
 Read EEPROM. More...
 
int8_t ts_read_register (const uint8_t pointer_reg, uint8_t *buf)
 Read at30ts75xx configuration register. More...
 
int8_t ts_write_eeprom (uint16_t address, uint16_t size, uint8_t *buf)
 Write EEPROM. More...
 
uint8_t ts_write_memory (uint16_t address, uint16_t size, uint8_t *buf)
 Write memory, this function manages writing data beyond a pages size (16 bytes) More...
 
int8_t ts_write_register (uint8_t *obuf)
 Write configuration register. More...
 
uint8_t twi_probe_device (uint8_t addr)
 
uint8_t twi_read (twi_package_t *packet)
 
uint8_t twi_write (twi_package_t *packet)
 
uint8_t write_config (uint16_t val)
 Write configuration register. More...
 
uint8_t write_nvconfig (uint16_t val)
 Write nonvolatile configuration register. More...
 
uint8_t write_nvthigh (uint8_t sign, uint8_t itemp, uint16_t ftemp)
 Write nonvolatile tHIGH limit register. More...
 
uint8_t write_nvtlow (uint8_t sign, uint8_t itemp, uint16_t ftemp)
 Write nonvolatile tLOW limit register. More...
 
uint8_t write_temperature_high (uint8_t sign, uint8_t itemp, uint16_t ftemp)
 Write tHIGH limit register. More...
 
uint8_t write_temperature_low (uint8_t sign, uint8_t itemp, uint16_t ftemp)
 Write tLOW limit register. More...
 

Variables

static ts_device_t at30ts_attached_device
 
static uint8_t at30ts_iobuf [3]
 
static uint8_t at30ts_status
 
const uint8_t copy_nonvol_vol_register [] = { CPY_NVOL_VOL_REG }
 
const uint8_t copy_vol_nonvol_register [] = { CPY_VOL_NVOL_REG }
 
const uint8_t nv_config [] = { NV_CONFIG_REG }
 

#define buftoval (   val,
  buf 
)
Value:
{ (val) = (at30ts_iobuf[0]); \
(val) <<= 8; \
(val) |= (at30ts_iobuf[1]); }
static uint8_t at30ts_iobuf[3]
Definition: at30ts.c:55

Referenced by read_config(), read_nvconfig(), read_nvthigh(), read_nvtlow(), read_temperature_high(), read_temperature_low(), set_config_option(), and set_nvconfig_option().

#define valtobuf (   val,
  buf 
)
Value:
{ buf[2] = (val) & 0xFF; \
buf[1] = ((val) >> 8) & 0xFF; }

Referenced by write_config(), write_nvconfig(), write_nvthigh(), write_nvtlow(), write_temperature_high(), and write_temperature_low().

ts_device_t at30ts_attached_device
static
const uint8_t copy_nonvol_vol_register[] = { CPY_NVOL_VOL_REG }
const uint8_t copy_vol_nonvol_register[] = { CPY_VOL_NVOL_REG }
const uint8_t nv_config[] = { NV_CONFIG_REG }