1 #ifndef RUUVI_INTERFACE_TMP117_H
2 #define RUUVI_INTERFACE_TMP117_H
45 #define TMP117_REG_TEMP_RESULT (0x00U)
46 #define TMP117_REG_CONFIGURATION (0x01U)
47 #define TMP117_REG_THIGH_LIMIT (0x02U)
48 #define TMP117_REG_TLOW_LIMIT (0x03U)
49 #define TMP117_REG_EEPROM_UL (0x04U)
50 #define TMP117_REG_EEPROM1 (0x05U)
51 #define TMP117_REG_EEPROM2 (0x06U)
52 #define TMP117_REG_TEMP_OFFSET (0x07U)
53 #define TMP117_REG_EEPROM3 (0x08U)
54 #define TMP117_REG_DEVICE_ID (0x0FU)
56 #define TMP117_MASK_RESET (0x0002U)
57 #define TMP117_MASK_ID (0x01FFU)
58 #define TMP117_MASK_OS (0x0060U)
59 #define TMP117_MASK_MODE (0x0C00U)
60 #define TMP117_MASK_CC (0x0380U)
62 #define TMP117_VALUE_ID (0x0117U)
64 #define TMP117_POS_OS (5U)
65 #define TMP117_VALUE_OS_1 (0x00U << TMP117_POS_OS)
66 #define TMP117_VALUE_OS_8 (0x01U << TMP117_POS_OS)
67 #define TMP117_VALUE_OS_32 (0x02U << TMP117_POS_OS)
68 #define TMP117_VALUE_OS_64 (0x03U << TMP117_POS_OS)
70 #define TMP117_POS_CC (7U)
71 #define TMP117_VALUE_CC_16_MS (0x00U << TMP117_POS_CC)
72 #define TMP117_VALUE_CC_125_MS (0x01U << TMP117_POS_CC)
73 #define TMP117_VALUE_CC_250_MS (0x02U << TMP117_POS_CC)
74 #define TMP117_VALUE_CC_500_MS (0x03U << TMP117_POS_CC)
75 #define TMP117_VALUE_CC_1000_MS (0x04U << TMP117_POS_CC)
76 #define TMP117_VALUE_CC_4000_MS (0x05U << TMP117_POS_CC)
77 #define TMP117_VALUE_CC_8000_MS (0x06U << TMP117_POS_CC)
78 #define TMP117_VALUE_CC_16000_MS (0x07U << TMP117_POS_CC)
80 #define TMP117_POS_MODE (10U)
81 #define TMP117_VALUE_MODE_SLEEP (0x01U << TMP117_POS_MODE)
82 #define TMP117_VALUE_MODE_SINGLE (0x03U << TMP117_POS_MODE)
83 #define TMP117_VALUE_MODE_CONT (0x00U << TMP117_POS_MODE)
85 #define TMP117_POS_DRDY (13U)
86 #define TMP117_MASK_DRDY (1U << TMP117_POS_DRDY)
88 #define TMP117_VALUE_TEMP_NA (0x8000U)
89 #define TMP117_OS_1_TSAMPLE_MS (16U)
90 #define TMP117_OS_8_TSAMPLE_MS (125U)
91 #define TMP117_OS_32_TSAMPLE_MS (500U)
92 #define TMP117_OS_64_TSAMPLE_MS (1000U)
95 #define TMP117_CC_RESET_DELAY_MS (4U)
99 environmental_sensor,
rd_bus_t bus, uint8_t handle);
102 environmental_sensor,
rd_bus_t bus, uint8_t handle);
uint32_t rd_status_t
bitfield for representing errors
rd_bus_t
Type of bus sensor uses.
rd_status_t ri_tmp117_resolution_set(uint8_t *resolution)
rd_sensor_setup_fp
rd_status_t ri_tmp117_dsp_get(uint8_t *dsp, uint8_t *parameter)
rd_sensor_dsp_fp
rd_status_t ri_tmp117_data_get(rd_sensor_data_t *const data)
rd_sensor_data_fp
rd_status_t ri_tmp117_resolution_get(uint8_t *resolution)
rd_sensor_setup_fp
rd_status_t ri_tmp117_uninit(rd_sensor_t *sensor, rd_bus_t bus, uint8_t handle)
rd_sensor_init_fp
rd_status_t ri_tmp117_scale_get(uint8_t *scale)
rd_sensor_setup_fp
rd_status_t ri_tmp117_samplerate_get(uint8_t *samplerate)
rd_sensor_setup_fp
rd_status_t ri_tmp117_scale_set(uint8_t *scale)
rd_sensor_setup_fp
rd_status_t ri_tmp117_mode_set(uint8_t *mode)
rd_sensor_setup_fp
rd_status_t ri_tmp117_dsp_set(uint8_t *dsp, uint8_t *parameter)
rd_sensor_dsp_fp
rd_status_t ri_tmp117_mode_get(uint8_t *mode)
rd_sensor_setup_fp
rd_status_t ri_tmp117_samplerate_set(uint8_t *samplerate)
rd_sensor_setup_fp
rd_status_t ri_tmp117_init(rd_sensor_t *environmental_sensor, rd_bus_t bus, uint8_t handle)
rd_sensor_init_fp
Ruuvi error codes and error check function.
Ruuvi sensor interface Lifecycle: Beta
Generic sensor data struct.
Interface to sensor. Some sensors can implement additional functions. The additional functions are de...