2024-12-20 16:06:20 +08:00

16 lines
385 B
C

//
// Created by dell on 24-12-20.
//
#include "tmp112.h"
uint32_t tmp112a_get_raw_channel_result(void) {
uint16_t raw_value = 0;
uint8_t value[2] = {0};
// ldc1612_iic_read_16bits(CONVERTION_RESULT_REG_START + channel, value);
i2c_read_16bits(TMP112A_ADDR, 0x00, value);
raw_value = ((uint16_t) (value[0] << 4) | (value[1]>>4));
return (raw_value * 625);
}