libnx  v4.2.2
ts.h
Go to the documentation of this file.
1 /**
2  * @file ts.h
3  * @brief Temperature measurement (ts) service IPC wrapper.
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../sf/service.h"
10 
11 /// Location
12 typedef enum {
13  TsLocation_Internal = 0, ///< TMP451 Internal: PCB
14  TsLocation_External = 1, ///< TMP451 External: SoC
15 } TsLocation;
16 
17 /// Initialize ts.
18 Result tsInitialize(void);
19 
20 /// Exit ts.
21 void tsExit(void);
22 
23 /// Gets the Service for ts.
25 
26 /**
27  * @brief Gets the min/max temperature for the specified \ref TsLocation.
28  * @param[in] location \ref TsLocation
29  * @param[out] min_temperature Output minimum temperature in Celsius.
30  * @param[out] max_temperature Output maximum temperature in Celsius.
31  */
32 Result tsGetTemperatureRange(TsLocation location, s32 *min_temperature, s32 *max_temperature);
33 
34 /**
35  * @brief Gets the temperature for the specified \ref TsLocation.
36  * @param[in] location \ref TsLocation
37  * @param[out] temperature Output temperature in Celsius.
38  */
39 Result tsGetTemperature(TsLocation location, s32 *temperature);
40 
41 /**
42  * @brief Gets the temperature for the specified \ref TsLocation, in MilliC. [1.0.0-13.2.1]
43  * @param[in] location \ref TsLocation
44  * @param[out] temperature Output temperature in MilliC.
45  */
46 Result tsGetTemperatureMilliC(TsLocation location, s32 *temperature);
47 
tsGetTemperature
Result tsGetTemperature(TsLocation location, s32 *temperature)
Gets the temperature for the specified TsLocation.
TsLocation_Internal
@ TsLocation_Internal
TMP451 Internal: PCB.
Definition: ts.h:13
tsGetTemperatureMilliC
Result tsGetTemperatureMilliC(TsLocation location, s32 *temperature)
Gets the temperature for the specified TsLocation, in MilliC.
s32
int32_t s32
32-bit signed integer.
Definition: types.h:27
tsGetTemperatureRange
Result tsGetTemperatureRange(TsLocation location, s32 *min_temperature, s32 *max_temperature)
Gets the min/max temperature for the specified TsLocation.
Result
u32 Result
Function error code result type.
Definition: types.h:44
tsExit
void tsExit(void)
Exit ts.
tsInitialize
Result tsInitialize(void)
Initialize ts.
tsGetServiceSession
Service * tsGetServiceSession(void)
Gets the Service for ts.
TsLocation_External
@ TsLocation_External
TMP451 External: SoC.
Definition: ts.h:14
Service
Service object structure.
Definition: service.h:13
TsLocation
TsLocation
Location.
Definition: ts.h:12