23 #define TI_TMP112_CR_0_25Hz (0 << 6) 24 #define TI_TMP112_CR_1Hz (1 << 6) 25 #define TI_TMP112_CR_4Hz (2 << 6) 26 #define TI_TMP112_CR_8Hz (3 << 6) 27 #define TI_TMP112_EM_NORMAL (0 << 4) 28 #define TI_TMP112_EM_EXTENDED (1 << 4) 29 #define TI_TMP112_SD_ON (0 << 8) 30 #define TI_TMP112_SD_SHUTDOWN (1 << 8) 31 #define TI_TMP112_TM_COMPARATOR (0 << 9) 32 #define TI_TMP112_TM_INTERRUPT (1 << 9) 33 #define TI_TMP112_POL_ALERT_LOW (0 << 10) 34 #define TI_TMP112_POL_ALERT_HIGH (1 << 10) 35 #define TI_TMP112_FQL_1 (0 << 11) 36 #define TI_TMP112_FQL_2 (1 << 11) 37 #define TI_TMP112_FQL_4 (2 << 11) 38 #define TI_TMP112_FQL_6 (3 << 11) 43 #define TI_TMP112_GET_TEMP (I2C_DEV_IO_CONTROL + 0) 44 #define TI_TMP112_GET_TEMP_RAW (I2C_DEV_IO_CONTROL + 1) 45 #define TI_TMP112_SET_CONFIG (I2C_DEV_IO_CONTROL + 2) 46 #define TI_TMP112_SET_LOW_TEMP (I2C_DEV_IO_CONTROL + 3) 47 #define TI_TMP112_SET_HIGH_TEMP (I2C_DEV_IO_CONTROL + 4) 52 int i2c_dev_register_ti_tmp112(
const char* bus_path,
65 ti_tmp112_get_temperature(
int fd,
int* temp)
67 return ioctl(fd, TI_TMP112_GET_TEMP, temp);
77 ti_tmp112_get_temperature_raw(
int fd,
unsigned int* temp)
79 return ioctl(fd, TI_TMP112_GET_TEMP_RAW, temp);
86 ti_tmp112_adc_set_config(
int fd, uint16_t
config)
88 return ioctl(fd, TI_TMP112_SET_CONFIG, (
void *)(uintptr_t)
config);
95 ti_tmp112_set_low_temperator(
int fd, uint16_t temp)
97 return ioctl(fd, TI_TMP112_SET_LOW_TEMP, (
void *)(uintptr_t) temp);
104 ti_tmp112_adc_set_high_threshold(
int fd, uint16_t level)
106 return ioctl(fd, TI_TMP112_SET_HIGH_TEMP, (
void *)(uintptr_t) level);
Definition: deflate.c:115
Inter-Integrated Circuit (I2C) Driver API.