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_capability (sensor_data_t *sensor_data) |
uint8_t | read_config (sensor_data_t *data) |
Read nonvolatile config register. More... | |
uint8_t | read_devid (sensor_data_t *sensor_data) |
uint8_t | read_manfid (sensor_data_t *sensor_data) |
uint8_t | read_nvconfig (sensor_data_t *data) |
Read nonvolatile config register. More... | |
uint8_t | read_nvthigh (sensor_data_t *data) |
Read nonvolatile tHIGH limit register. More... | |
uint8_t | read_nvtlow (sensor_data_t *data) |
Read nonvolatile tLOW limit register. More... | |
uint8_t | read_smbus (sensor_data_t *sensor_data) |
uint8_t | read_tcrit (sensor_data_t *sensor_data) |
int8_t | read_temperature (sensor_data_t *data) |
Read temperature register. More... | |
uint8_t | read_temperature_high (sensor_data_t *data) |
Read tHIGH limit register. More... | |
uint8_t | read_temperature_low (sensor_data_t *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 (void) |
Copy nonvolatile registers to volatile registers. More... | |
int8_t | ts75_copy_vol_nonvol_register (void) |
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 *ibuf) |
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_tcrit (uint8_t sign, uint8_t itemp, uint16_t ftemp) |
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... | |
void attach_device | ( | uint8_t | device_addr, |
device_type_t | type | ||
) |
attach_device, initialize epprom variable associcated with device
device_addr | device address register offset address |
type | device type |
References AT30TS75, AT30TS750, AT30TSE002B, AT30TSE752, AT30TSE754, AT30TSE758, _ts_device::device_type, _ts_device::eeprom_size, and _ts_device::ts_reg_addr.
int8_t check_NVRBSY | ( | void | ) |
Checks at30ts75 NVRBSY, RLCKDWN and RCLK bits.
References AT30TS_NVRBSY_BUSY, AT30TS_REG_LOCKED, at30ts_status, AT30TS_SUCCESS, CONFIG_REG, NV_CONFIG_REG, NVRBSY, RLCK_MSK, RLCKDWN_MSK, ts_read_register(), and TWI_SUCCESS.
Referenced by ts75_copy_nonvol_vol_register(), ts75_copy_vol_nonvol_register(), and ts_write_register().
void parse_temp_reading | ( | sensor_data_t * | sensor_data | ) |
References sensor_data_t::temperature.
uint8_t read_capability | ( | sensor_data_t * | sensor_data | ) |
uint8_t read_config | ( | sensor_data_t * | sensor_data | ) |
Read nonvolatile config register.
*sensor_data | Where to store the retrieved data |
References at30ts_iobuf, at30ts_status, buftoval, CONFIG_REG, CONFIGUR_REG, ts_read_register(), and sensor_data_t::value.
uint8_t read_devid | ( | sensor_data_t * | sensor_data | ) |
uint8_t read_manfid | ( | sensor_data_t * | sensor_data | ) |
uint8_t read_nvconfig | ( | sensor_data_t * | sensor_data | ) |
Read nonvolatile config register.
*sensor_data | Where to store the retrieved data |
References at30ts_iobuf, at30ts_status, buftoval, NV_CONFIG_REG, ts_read_register(), and sensor_data_t::value.
uint8_t read_nvthigh | ( | sensor_data_t * | sensor_data | ) |
Read nonvolatile tHIGH limit register.
*sensor_data | Where to store the retrieved data |
References at30ts_iobuf, at30ts_status, buftoval, NV_THILIM_REG, and ts_read_register().
uint8_t read_nvtlow | ( | sensor_data_t * | sensor_data | ) |
Read nonvolatile tLOW limit register.
*sensor_data | Where to store the retrieved data |
References at30ts_iobuf, at30ts_status, buftoval, NV_TLOLIM_REG, and ts_read_register().
uint8_t read_smbus | ( | sensor_data_t * | sensor_data | ) |
uint8_t read_tcrit | ( | sensor_data_t * | sensor_data | ) |
int8_t read_temperature | ( | sensor_data_t * | sensor_data | ) |
Read temperature register.
*sensor_data | Where to store the retrieved data |
References at30ts_status, AT30TS_TWI_WRITE_NACK, TEMP_DATA_REG, TEMPER_REG, sensor_data_t::temperature, ts_read_register(), and TWI_SUCCESS.
uint8_t read_temperature_high | ( | sensor_data_t * | sensor_data | ) |
Read tHIGH limit register.
*sensor_data | Where to store the retrieved data |
References at30ts_iobuf, at30ts_status, buftoval, THILIM_REG, TRIP_UPR_REG, and ts_read_register().
uint8_t read_temperature_low | ( | sensor_data_t * | sensor_data | ) |
Read tLOW limit register.
*sensor_data | Where to store the retrieved data |
References at30ts_iobuf, at30ts_status, buftoval, TLOLIM_REG, TRIP_LWR_REG, and ts_read_register().
uint8_t set_config_option | ( | sensor_data_t * | data, |
opt_flag_t | flag, | ||
config_options_t | opt | ||
) |
Set Configuration Options.
data | Sensor data type, holds sensor information |
flag | Defines which option to change |
opt | Option(s) settings |
References AT30TS_002B_CONFBIT_CRITEVT, AT30TS_002B_CONFBIT_CRTALML, AT30TS_002B_CONFBIT_EVTCLR, AT30TS_002B_CONFBIT_EVTMOD, AT30TS_002B_CONFBIT_EVTOUT, AT30TS_002B_CONFBIT_EVTPOL, AT30TS_002B_CONFBIT_EVTSTS, AT30TS_002B_CONFBIT_HYSTENB, AT30TS_002B_CONFBIT_SHTDWN, AT30TS_002B_CONFBIT_WINLOCK, AT30TS_CMP_INT_MODE, AT30TS_FAULT, at30ts_iobuf, AT30TS_OS, AT30TS_POL, AT30TS_RES, AT30TS_RLCK, AT30TS_RLCKDWN, AT30TS_SD, at30ts_status, buftoval, CONFIG_REG, CONFIGUR_REG, ts_read_register(), sensor_data_t::value, and write_config().
uint8_t set_nvconfig_option | ( | sensor_data_t * | data, |
opt_flag_t | flag, | ||
nvconfig_options_t | opt | ||
) |
Set bit(s) in nonvolatile configuration register.
References AT30TS_CMP_INT_MODE, AT30TS_FAULT, at30ts_iobuf, AT30TS_OS, AT30TS_POL, AT30TS_RES, AT30TS_RLCK, AT30TS_RLCKDWN, AT30TS_SD, buftoval, NV_CONFIG_REG, ts_read_register(), sensor_data_t::value, and write_config().
int8_t ts75_copy_nonvol_vol_register | ( | void | ) |
Copy nonvolatile registers to volatile registers.
References twi_package_t::addr_length, at30ts_status, AT30TS_SUCCESS, AT30TS_TWI_WRITE_NACK, twi_package_t::buffer, check_NVRBSY(), twi_package_t::chip, copy_nonvol_vol_register, twi_package_t::length, _ts_device::ts_reg_addr, TWI_SUCCESS, and twi_write().
int8_t ts75_copy_vol_nonvol_register | ( | void | ) |
Copy volatile registers to nonvolatile registers.
References twi_package_t::addr_length, at30ts_status, AT30TS_SUCCESS, AT30TS_TWI_WRITE_NACK, twi_package_t::buffer, check_NVRBSY(), twi_package_t::chip, copy_vol_nonvol_register, twi_package_t::length, _ts_device::ts_reg_addr, TWI_SUCCESS, and twi_write().
int8_t ts75_probe_nonvol_register | ( | uint8_t | device_addr | ) |
Probe at30ts75 nonvolatile configuration register.
device_addr | at30ts75 device address |
References twi_package_t::addr_length, at30ts_status, AT30TS_TWI_WRITE_NACK, twi_package_t::buffer, twi_package_t::chip, twi_package_t::length, nv_config, TWI_SUCCESS, and twi_write().
int8_t ts_ack_polling | ( | uint8_t | addr | ) |
ACK polling function.
addr | device address to ACK poll |
References AT30TS_SUCCESS, AT30TS_TWI_WRITE_NACK, twi_probe_device(), and TWI_SUCCESS.
Referenced by ts_write_eeprom().
void ts_construct_eeprom_address | ( | twi_package_t * | packet, |
uint16_t | address | ||
) |
Constructs an eeprom address.
[in,out] | packet | pointer to packet structure |
[in] | address | eeprom address |
References AT30TSE002B, AT30TSE752, AT30TSE754, AT30TSE758, twi_package_t::chip, _ts_device::device_type, and _ts_device::ts_reg_addr.
Referenced by ts_read_eeprom(), and ts_write_eeprom().
int8_t ts_read_eeprom | ( | uint16_t | address, |
uint16_t | size, | ||
uint8_t * | buf | ||
) |
Read EEPROM.
address | Data word address |
size | Size of the data to read |
*buf | Where to store the data |
References twi_package_t::addr, twi_package_t::addr_length, AT30TS_INVALID_EEPROM_ADDRESS, at30ts_status, AT30TS_TWI_READ_NACK, AT30TS_TWI_WRITE_NACK, twi_package_t::buffer, _ts_device::eeprom_size, twi_package_t::length, ts_construct_eeprom_address(), twi_read(), TWI_SUCCESS, and twi_write().
int8_t ts_read_register | ( | const uint8_t | pointer_reg, |
uint8_t * | buf | ||
) |
Read at30ts75xx configuration register.
pointer_reg | register offset address |
*buf | store temperature data |
References twi_package_t::addr_length, AT30TS_TWI_READ_NACK, AT30TS_TWI_WRITE_NACK, twi_package_t::buffer, twi_package_t::chip, twi_package_t::length, _ts_device::ts_reg_addr, twi_read(), TWI_SUCCESS, and twi_write().
Referenced by check_NVRBSY(), read_config(), read_nvconfig(), read_nvthigh(), read_nvtlow(), read_temperature(), read_temperature_high(), read_temperature_low(), set_config_option(), and set_nvconfig_option().
int8_t ts_write_eeprom | ( | uint16_t | address, |
uint16_t | size, | ||
uint8_t * | buf | ||
) |
Write EEPROM.
address | Data word address |
size | Size of the data to write |
*buf | Data to be written |
References twi_package_t::addr, twi_package_t::addr_length, AT30TS_INVALID_EEPROM_ADDRESS, AT30TS_INVALID_SIZE, at30ts_status, AT30TS_TWI_WRITE_NACK, twi_package_t::buffer, twi_package_t::chip, data, _ts_device::eeprom_size, twi_package_t::length, PAGE_SIZE, ts_ack_polling(), ts_construct_eeprom_address(), TWI_SUCCESS, and twi_write().
Referenced by ts_write_memory().
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)
address | Data word address |
size | Size of the data to write |
*buf | Data to be written |
References at30ts_status, PAGE_SIZE, ts_write_eeprom(), and TWI_SUCCESS.
int8_t ts_write_register | ( | uint8_t * | obuf | ) |
Write configuration register.
*obuf | Package information and data |
References twi_package_t::addr_length, AT30TS750, at30ts_status, AT30TS_SUCCESS, AT30TS_TWI_WRITE_NACK, AT30TSE758, twi_package_t::buffer, check_NVRBSY(), twi_package_t::chip, _ts_device::device_type, twi_package_t::length, NV_CONFIG_REG, NV_THILIM_REG, NV_TLOLIM_REG, _ts_device::ts_reg_addr, TWI_SUCCESS, and twi_write().
Referenced by write_config(), write_nvconfig(), write_nvthigh(), write_nvtlow(), write_temperature_high(), and write_temperature_low().
uint8_t twi_probe_device | ( | uint8_t | addr | ) |
References twi_package_t::addr, twi_package_t::addr_length, twi_package_t::buffer, twi_package_t::chip, twi_package_t::length, and twi_master_write().
Referenced by ts_ack_polling().
uint8_t twi_read | ( | twi_package_t * | packet | ) |
References twi_master_read().
Referenced by ts_read_eeprom(), and ts_read_register().
uint8_t twi_write | ( | twi_package_t * | packet | ) |
uint8_t write_config | ( | uint16_t | val | ) |
Write configuration register.
val | Data to be written |
References at30ts_iobuf, CONFIG_REG, CONFIGUR_REG, ts_write_register(), and valtobuf.
Referenced by set_config_option(), and set_nvconfig_option().
uint8_t write_nvconfig | ( | uint16_t | val | ) |
Write nonvolatile configuration register.
val | Data to be written |
References at30ts_iobuf, NV_CONFIG_REG, ts_write_register(), and valtobuf.
uint8_t write_nvthigh | ( | uint8_t | sign, |
uint8_t | itemp, | ||
uint16_t | ftemp | ||
) |
Write nonvolatile tHIGH limit register.
val | Data to be written |
References at30ts_iobuf, neg, NV_THILIM_REG, ts_write_register(), and valtobuf.
uint8_t write_nvtlow | ( | uint8_t | sign, |
uint8_t | itemp, | ||
uint16_t | ftemp | ||
) |
Write nonvolatile tLOW limit register.
val | Data to be written |
References at30ts_iobuf, neg, NV_TLOLIM_REG, ts_write_register(), and valtobuf.
uint8_t write_tcrit | ( | uint8_t | sign, |
uint8_t | itemp, | ||
uint16_t | ftemp | ||
) |
uint8_t write_temperature_high | ( | uint8_t | sign, |
uint8_t | itemp, | ||
uint16_t | ftemp | ||
) |
Write tHIGH limit register.
sign | temperature sign, used for conversion |
itemp | Integer data part to be written |
ftemp | Fractional data to be written |
References at30ts_iobuf, neg, THILIM_REG, TRIP_UPR_REG, ts_write_register(), and valtobuf.
uint8_t write_temperature_low | ( | uint8_t | sign, |
uint8_t | itemp, | ||
uint16_t | ftemp | ||
) |
Write tLOW limit register.
sign | temperature sign, used for conversion |
itemp | Integer data part to be written |
ftemp | Fractional data to be written |
References at30ts_iobuf, neg, TLOLIM_REG, TRIP_LWR_REG, ts_write_register(), and valtobuf.