libnx/nx/include/switch/services/ts.h
CTCaer d7e6207708 ts: Add temperature location comments
Avert some confusion about the locations.
HOS uses TMP451 IC's internal thermistor for PCB temp readings and external is connected to a thermistor to SoC's package temp pins, so SoC temp readings.
2020-03-11 16:05:21 +01:00

48 lines
1.3 KiB
C

/**
* @file ts.h
* @brief Temperature measurement (ts) service IPC wrapper.
* @author yellows8
* @copyright libnx Authors
*/
#pragma once
#include "../types.h"
#include "../sf/service.h"
/// Location
typedef enum {
TsLocation_Internal = 0, ///< TMP451 Internal: PCB
TsLocation_External = 1, ///< TMP451 External: SoC
} TsLocation;
/// Initialize ts.
Result tsInitialize(void);
/// Exit ts.
void tsExit(void);
/// Gets the Service for ts.
Service* tsGetServiceSession(void);
/**
* @brief Gets the min/max temperature for the specified \ref TsLocation.
* @param[in] location \ref TsLocation
* @param[out] min_temperature Output minimum temperature in Celsius.
* @param[out] max_temperature Output maximum temperature in Celsius.
*/
Result tsGetTemperatureRange(TsLocation location, s32 *min_temperature, s32 *max_temperature);
/**
* @brief Gets the temperature for the specified \ref TsLocation.
* @param[in] location \ref TsLocation
* @param[out] temperature Output temperature in Celsius.
*/
Result tsGetTemperature(TsLocation location, s32 *temperature);
/**
* @brief Gets the temperature for the specified \ref TsLocation, in MilliC.
* @param[in] location \ref TsLocation
* @param[out] temperature Output temperature in MilliC.
*/
Result tsGetTemperatureMilliC(TsLocation location, s32 *temperature);