온도 adc 측정 추가

This commit is contained in:
geniushyun
2026-04-12 19:15:59 +09:00
parent 6ac0490263
commit 201f1bcff2
6 changed files with 160 additions and 3 deletions
+27
View File
@@ -0,0 +1,27 @@
/*******************************************************************************
* @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__ */