42#define TI_TMP112_CR_0_25Hz (0 << 6)
43#define TI_TMP112_CR_1Hz (1 << 6)
44#define TI_TMP112_CR_4Hz (2 << 6)
45#define TI_TMP112_CR_8Hz (3 << 6)
46#define TI_TMP112_EM_NORMAL (0 << 4)
47#define TI_TMP112_EM_EXTENDED (1 << 4)
48#define TI_TMP112_SD_ON (0 << 8)
49#define TI_TMP112_SD_SHUTDOWN (1 << 8)
50#define TI_TMP112_TM_COMPARATOR (0 << 9)
51#define TI_TMP112_TM_INTERRUPT (1 << 9)
52#define TI_TMP112_POL_ALERT_LOW (0 << 10)
53#define TI_TMP112_POL_ALERT_HIGH (1 << 10)
54#define TI_TMP112_FQL_1 (0 << 11)
55#define TI_TMP112_FQL_2 (1 << 11)
56#define TI_TMP112_FQL_4 (2 << 11)
57#define TI_TMP112_FQL_6 (3 << 11)
62#define TI_TMP112_GET_TEMP (I2C_DEV_IO_CONTROL + 0)
63#define TI_TMP112_GET_TEMP_RAW (I2C_DEV_IO_CONTROL + 1)
64#define TI_TMP112_SET_CONFIG (I2C_DEV_IO_CONTROL + 2)
65#define TI_TMP112_SET_LOW_TEMP (I2C_DEV_IO_CONTROL + 3)
66#define TI_TMP112_SET_HIGH_TEMP (I2C_DEV_IO_CONTROL + 4)
71int i2c_dev_register_ti_tmp112(
const char* bus_path,
84ti_tmp112_get_temperature(
int fd,
int* temp)
86 return ioctl(fd, TI_TMP112_GET_TEMP, temp);
96ti_tmp112_get_temperature_raw(
int fd,
unsigned int* temp)
98 return ioctl(fd, TI_TMP112_GET_TEMP_RAW, temp);
105ti_tmp112_adc_set_config(
int fd, uint16_t
config)
107 return ioctl(fd, TI_TMP112_SET_CONFIG, (
void *)(uintptr_t)
config);
114ti_tmp112_set_low_temperator(
int fd, uint16_t temp)
116 return ioctl(fd, TI_TMP112_SET_LOW_TEMP, (
void *)(uintptr_t) temp);
123ti_tmp112_adc_set_high_threshold(
int fd, uint16_t level)
125 return ioctl(fd, TI_TMP112_SET_HIGH_TEMP, (
void *)(uintptr_t) level);
Inter-Integrated Circuit (I2C) Driver API.
Definition: deflate.c:114