generated from hulk/gd32e23x_template
Organize files
This commit is contained in:
15
src/tmp112.c
Normal file
15
src/tmp112.c
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// 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);
|
||||
}
|
||||
Reference in New Issue
Block a user