온도 측정 커맨드 변경

- 기존 mso?: Piezo TX/RX 전원 관리하지 않고 온도 측정만 담당
- 변경 mst?: Piezo TX/RX Active -> TMP235 온도 측정 -> Piezo TX/RX Sleep 자체 처리
This commit is contained in:
2026-04-16 14:08:51 +09:00
parent 01bdbf7cfe
commit 6e890b87d8
3 changed files with 26 additions and 6 deletions

View File

@@ -39,7 +39,7 @@ static const CmdEntry m_cmd_table[] = {
/* C. Sensor measurement */
{ "msn?", true, Cmd_msn },
{ "mso?", true, Cmd_mso },
{ "mst?", true, Cmd_mst },
{ "msp?", true, Cmd_msp },
{ "msi?", true, Cmd_msi },

View File

@@ -26,15 +26,35 @@ int Cmd_msn(const ParsedCmd *cmd)
}
/*==============================================================================
* mso? -> rso: TMP235-Q1 temperature sensor measurement
* mst? -> rso: Temperature with piezo power cycle
*
* Request: [TAG 4B "mso?"] [CRC 2B]
* Response: rso: + temperature (sent from tmp235_q1.c callback)
* Request: [TAG 4B "mst?"] [CRC 2B]
* Response: [TAG 4B "rso:"] [temp_x100 2B BE] [CRC 2B]
*
* TMP235 shares the piezo TX/RX power rail. This command handles the full
* sequence: power ON -> measure -> power OFF, so the caller doesn't need
* to send mpa?/mpb? separately.
* Response is sent from the TMP235 SAADC callback (tmp235_voltage_handler).
*============================================================================*/
int Cmd_mso(const ParsedCmd *cmd)
int Cmd_mst(const ParsedCmd *cmd)
{
uint32_t timeout_cnt;
(void)cmd;
if (!dr_piezo_is_power_on())
{
dr_piezo_power_on();
}
tmp235_saadc_done = false;
tmp235_voltage_level_meas();
for (timeout_cnt = 0; !tmp235_saadc_done && timeout_cnt < 100; timeout_cnt++)
{
dr_sd_delay_ms(1);
}
dr_piezo_power_off();
return 1;
}

View File

@@ -7,7 +7,7 @@
#include "parser.h"
int Cmd_msn(const ParsedCmd *cmd); /* msn? -> rsn: battery ADC measurement */
int Cmd_mso(const ParsedCmd *cmd); /* mso? -> rso: TMP235 temperature reading */
int Cmd_mst(const ParsedCmd *cmd); /* mst? -> rso: TMP235 with piezo power cycle */
int Cmd_msp(const ParsedCmd *cmd); /* msp? -> rsp: IMU 6-axis single read */
int Cmd_msi(const ParsedCmd *cmd); /* msi? -> rsi: IMU streaming start */