1 /* 2 * Copyright (c) 2020 Laird Connectivity 3 * Copyright (c) 2019 Electronut Labs 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 #ifndef _SI7055_H 9 #define _SI7055_H 10 11 /* Si7055 register addresses */ 12 #define SI7055_MEAS_TEMP_MASTER_MODE 0xE3 13 #define SI7055_MEAS_TEMP_NO_MASTER_MODE 0xF3 14 #define SI7055_RESET 0xFE 15 #define SI7055_READ_ID_LOW_0 0xFA 16 #define SI7055_READ_ID_LOW_1 0x0F 17 #define SI7055_READ_ID_HIGH_0 0xFC 18 #define SI7055_READ_ID_HIGH_1 0xC9 19 #define SI7055_FIRMWARE_0 0x84 20 #define SI7055_FIRMWARE_1 0xB8 21 /* Si7055 temperature conversion factors and constants */ 22 #define SI7055_CONV_FACTOR_1 17572 23 #define SI7055_CONV_FACTOR_2 4685 24 #define SI7055_MULTIPLIER 10000 25 #define SI7055_DIVIDER 1000000 26 /* Si7055 buffer sizes and locations */ 27 #define SI7055_TEMPERATURE_READ_NO_CHECKSUM_SIZE 0x02 28 #define SI7055_TEMPERATURE_READ_WITH_CHECKSUM_SIZE 0x03 29 #define SI7055_TEMPERATURE_DATA_BYTE_0 0x0 30 #define SI7055_TEMPERATURE_DATA_BYTE_1 0x1 31 /* Si7055 Checksum constants */ 32 #define SI7055_CRC_POLY 0x31 33 #define SI7055_CRC_SIZE sizeof(uint8_t) 34 #define SI7055_CRC_INIT 0x0 35 #define SI7055_DATA_SIZE (sizeof(uint8_t) * 2) 36 37 #endif /* _SI7055_H */ 38