Files
VesiScan-Basic_Zephyr/src/drivers/temperature/tmp235.h
T
2026-04-12 19:15:59 +09:00

28 lines
714 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*******************************************************************************
* @file tmp235.h
* @brief TMP235-Q1 온도 센서 드라이버 (Zephyr SAADC, AIN3 = P0.05)
*
* 출력 공식: V = 500mV + 10mV/°C × T
* → T(°C) = (V_mV - 500) / 10
* → T(°Cx100) = (V_mV - 500) × 10
******************************************************************************/
#ifndef TMP235_H__
#define TMP235_H__
#include <stdint.h>
/**
* @brief 온도 센서 초기화 — ADC 채널 설정
* @return 0 성공, 음수 에러
*/
int temp_init(void);
/**
* @brief 온도 1회 측정
* @return 온도 (°C × 100), 에러 시 INT16_MIN
*/
int16_t temp_read_cdeg(void);
#endif /* TMP235_H__ */