The connection between the MCU and the AT30TSE75x is based on the I2C-interface.
More...
The connection between the MCU and the AT30TSE75x is based on the I2C-interface.
There are 3 versions of this IC, with either 2/4/8 Kb of EEPROM.
|
file | at30tse75x.h |
| Driver for the AT30TSE75x temperature sensor with serial EEPROM.
|
|
|
int | at30tse75x_init (at30tse75x_t *dev, i2c_t i2c, uint8_t addr) |
| Initialize a AT30TSE75x device.
|
|
int | at30tse75x_save_config (const at30tse75x_t *dev) |
| Save configuration register to non-volatile backup register.
|
|
int | at30tse75x_restore_config (const at30tse75x_t *dev) |
| Restore configuration register from non-volatile backup register.
|
|
int | at30tse75x_get_config (const at30tse75x_t *dev, uint8_t *data) |
| Get content of configuration register.
|
|
int | at30tse75x_set_config (const at30tse75x_t *dev, uint8_t data) |
| Set content of configuration register.
|
|
int | at30tse75x_set_resolution (const at30tse75x_t *dev, at30tse75x_resolution_t resolution) |
| Set temperature resolution.
|
|
int | at30tse75x_set_mode (const at30tse75x_t *dev, at30tse75x_mode_t mode) |
| Set operation mode.
|
|
int | at30tse75x_set_alarm_polarity (const at30tse75x_t *dev, at30tse75x_alarm_polatity_t polarity) |
| Set polarity of ALERT pin.
|
|
int | at30tse75x_set_fault_tolerance (const at30tse75x_t *dev, at30tse75x_fault_tolerance_t tolerance) |
| Set tolerance to outlying measurements.
|
|
int | at30tse75x_set_limit_low (const at30tse75x_t *dev, int8_t t_low) |
| Set T_Low limit.
|
|
int | at30tse75x_set_limit_high (const at30tse75x_t *dev, int8_t t_high) |
| Set T_High limit.
|
|
int | at30tse75x_get_temperature (const at30tse75x_t *dev, float *temperature) |
| Get measured temperature.
|
|
|
enum | at30tse75x_resolution_t { AT30TSE75X_RESOLUTION_9BIT = 0
, AT30TSE75X_RESOLUTION_10BIT = 1
, AT30TSE75X_RESOLUTION_11BIT = 2
, AT30TSE75X_RESOLUTION_12BIT = 3
} |
| Temperature resolution. More...
|
|
enum | at30tse75x_mode_t { AT30TSE75X_MODE_COMPARATOR
, AT30TSE75X_MODE_INTERRUPT
, AT30TSE75X_MODE_ONE_SHOT
} |
| Operation mode. More...
|
|
enum | at30tse75x_fault_tolerance_t { AT30TSE75X_ALARM_AFTER_1 = 0
, AT30TSE75X_ALARM_AFTER_2 = 1
, AT30TSE75X_ALARM_AFTER_4 = 2
, AT30TSE75X_ALARM_AFTER_6 = 3
} |
| After how many limit exceeding measurements the ALERT pin is set. More...
|
|
enum | at30tse75x_alarm_polatity_t { AT30TSE75X_ALARM_ACTIVE_LOW
, AT30TSE75X_ALARM_ACTIVE_HIGH
} |
| Polarity of the ALERT pin. More...
|
|
◆ AT30TSE75X_BUS_FREE_TIME_US
#define AT30TSE75X_BUS_FREE_TIME_US (1U) |
◆ AT30TSE75X_CMD__GENERAL_CALL_RELATCH
#define AT30TSE75X_CMD__GENERAL_CALL_RELATCH (0x04) |
◆ AT30TSE75X_CMD__GENERAL_CALL_RESET
#define AT30TSE75X_CMD__GENERAL_CALL_RESET (0x06) |
◆ AT30TSE75X_CMD__RESTORE_FROM_NVRAM
#define AT30TSE75X_CMD__RESTORE_FROM_NVRAM (0xb8) |
◆ AT30TSE75X_CMD__SAVE_TO_NVRAM
#define AT30TSE75X_CMD__SAVE_TO_NVRAM (0x48) |
◆ AT30TSE75X_CONFIG__ALARM_MODE_BIT
#define AT30TSE75X_CONFIG__ALARM_MODE_BIT (1 << 1) |
◆ AT30TSE75X_CONFIG__ALERT_POL_BIT
#define AT30TSE75X_CONFIG__ALERT_POL_BIT (1 << 2) |
◆ AT30TSE75X_CONFIG__FTQ_MASK
#define AT30TSE75X_CONFIG__FTQ_MASK (0x18) |
◆ AT30TSE75X_CONFIG__FTQ_SHIFT
#define AT30TSE75X_CONFIG__FTQ_SHIFT (3) |
◆ AT30TSE75X_CONFIG__OS_BIT
#define AT30TSE75X_CONFIG__OS_BIT (1 << 7) |
◆ AT30TSE75X_CONFIG__RESOLUTION_MASK
#define AT30TSE75X_CONFIG__RESOLUTION_MASK (0x60) |
◆ AT30TSE75X_CONFIG__RESOLUTION_SHIFT
#define AT30TSE75X_CONFIG__RESOLUTION_SHIFT (5) |
◆ AT30TSE75X_CONFIG__SHUTDOWN_BIT
#define AT30TSE75X_CONFIG__SHUTDOWN_BIT (1 << 0) |
◆ AT30TSE75X_EEPROM_ADDR
#define AT30TSE75X_EEPROM_ADDR (0x50) |
◆ AT30TSE75X_FRACTIONAL_BASE
#define AT30TSE75X_FRACTIONAL_BASE (0.0625f) |
◆ AT30TSE75X_FRACTIONAL_MASK
#define AT30TSE75X_FRACTIONAL_MASK (0xf000) |
◆ AT30TSE75X_FRACTIONAL_SHIFT
#define AT30TSE75X_FRACTIONAL_SHIFT (12) |
◆ AT30TSE75X_INTEGER_MASK
#define AT30TSE75X_INTEGER_MASK (0x00ff) |
◆ AT30TSE75X_INTEGER_SHIFT
#define AT30TSE75X_INTEGER_SHIFT (0) |
◆ AT30TSE75X_REG__CONFIG
#define AT30TSE75X_REG__CONFIG (0x01) |
◆ AT30TSE75X_REG__LIMIT_HIGH
#define AT30TSE75X_REG__LIMIT_HIGH (0x03) |
◆ AT30TSE75X_REG__LIMIT_LOW
#define AT30TSE75X_REG__LIMIT_LOW (0x02) |
◆ AT30TSE75X_REG__NV_CONFIG
#define AT30TSE75X_REG__NV_CONFIG (0x11) |
◆ AT30TSE75X_REG__NV_LIMIR_HIGH
#define AT30TSE75X_REG__NV_LIMIR_HIGH (0x13) |
◆ AT30TSE75X_REG__NV_LIMIT_LOW
#define AT30TSE75X_REG__NV_LIMIT_LOW (0x12) |
◆ AT30TSE75X_REG__TEMPERATURE
#define AT30TSE75X_REG__TEMPERATURE (0x00) |
◆ AT30TSE75X_TEMP_ADDR
#define AT30TSE75X_TEMP_ADDR (0x48) |
◆ at30tse75x_alarm_polatity_t
◆ at30tse75x_fault_tolerance_t
After how many limit exceeding measurements the ALERT pin is set.
Definition at line 134 of file at30tse75x.h.
◆ at30tse75x_mode_t
Operation mode.
The device can run in continuous or one-shot mode. While in one-shot mode it is effectively shutdown and only wakes up to perform a single measurement. When in comparator or interrupt mode, the device samples continuously the temperature and sets the ALERT pin according to the chosen mode.
Definition at line 125 of file at30tse75x.h.
◆ at30tse75x_resolution_t
◆ at30tse75x_get_config()
int at30tse75x_get_config |
( |
const at30tse75x_t * |
dev, |
|
|
uint8_t * |
data |
|
) |
| |
Get content of configuration register.
- Parameters
-
[in] | dev | device descriptor |
[out] | data | buffer where config register will be written to |
- Returns
- 0 on success
-
-1 on error
◆ at30tse75x_get_temperature()
int at30tse75x_get_temperature |
( |
const at30tse75x_t * |
dev, |
|
|
float * |
temperature |
|
) |
| |
Get measured temperature.
- Parameters
-
[in] | dev | device descriptor |
[out] | temperature | float buffer where temperature will be written to |
- Returns
- 0 on success
-
-1 on error
◆ at30tse75x_init()
Initialize a AT30TSE75x device.
- Parameters
-
[out] | dev | device descriptor |
[in] | i2c | I2C bus the device is connected to |
[in] | addr | I2C address of the device |
The valid address range is 0x48 - 0x4f depending on the configuration of the address pins A0-A2.
- Returns
- 0 on success
-
-1 on error
-
-2 on invalid address
◆ at30tse75x_restore_config()
Restore configuration register from non-volatile backup register.
- Parameters
-
- Returns
- 0 on success
-
-1 on error
◆ at30tse75x_save_config()
Save configuration register to non-volatile backup register.
- Parameters
-
- Returns
- 0 on success
-
-1 on error
◆ at30tse75x_set_alarm_polarity()
Set polarity of ALERT pin.
- Parameters
-
[in] | dev | device descriptor |
[in] | polarity | polarity of ALERT pin |
- Returns
- 0 on success
-
-1 on device error
-
-2 on bad user input
◆ at30tse75x_set_config()
int at30tse75x_set_config |
( |
const at30tse75x_t * |
dev, |
|
|
uint8_t |
data |
|
) |
| |
Set content of configuration register.
- Parameters
-
[in] | dev | device descriptor |
[in] | data | new value for configuration register |
- Returns
- 0 on success
-
-1 on error
◆ at30tse75x_set_fault_tolerance()
Set tolerance to outlying measurements.
- Parameters
-
[in] | dev | device descriptor |
[in] | tolerance | tolerance |
- Returns
- 0 on success
-
-1 on device error
-
-2 on bad user input
◆ at30tse75x_set_limit_high()
int at30tse75x_set_limit_high |
( |
const at30tse75x_t * |
dev, |
|
|
int8_t |
t_high |
|
) |
| |
Set T_High limit.
- Parameters
-
[in] | dev | device descriptor |
[in] | t_high | upper temperature limit |
- Returns
- 0 on success
-
-1 on error
◆ at30tse75x_set_limit_low()
int at30tse75x_set_limit_low |
( |
const at30tse75x_t * |
dev, |
|
|
int8_t |
t_low |
|
) |
| |
Set T_Low limit.
- Parameters
-
[in] | dev | device descriptor |
[in] | t_low | lower temperature limit |
- Returns
- 0 on success
-
-1 on device error
-
-2 on bad user input
◆ at30tse75x_set_mode()
Set operation mode.
- Parameters
-
[in] | dev | device descriptor |
[in] | mode | operation mode |
- Returns
- 0 on success
-
-1 on device error
-
-2 on bad user input
◆ at30tse75x_set_resolution()
Set temperature resolution.
- Parameters
-
[in] | dev | device descriptor |
[in] | resolution | temperature resolution |
- Returns
- 0 on success
-
-1 on error
-
-2 on bad user input