libnx  v4.8.0
apm.h
Go to the documentation of this file.
1 /**
2  * @file apm.h
3  * @brief Performance management (apm) service IPC wrapper. This is used internally by applet with __nx_applet_PerformanceConfiguration, however if you prefer non-init/exit can be used manually. See also: https://switchbrew.org/wiki/PTM_services#apm:am
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../sf/service.h"
10 
11 /// PerformanceMode
12 typedef enum {
13  ApmPerformanceMode_Invalid = -1, ///< Invalid
14  ApmPerformanceMode_Normal = 0, ///< Normal
15  ApmPerformanceMode_Boost = 1, ///< Boost
17 
18 /// CpuBoostMode. With \ref appletSetCpuBoostMode, only values 0/1 are available. This allows using higher clock rates.
19 typedef enum {
20  ApmCpuBoostMode_Normal = 0, ///< Default, boost-mode disabled.
21  ApmCpuBoostMode_FastLoad = 1, ///< Boost CPU. Additionally, throttle GPU to minimum. Use performance configurations 0x92220009 (Docked) and 0x9222000A (Handheld), or 0x9222000B and 0x9222000C.
22  ApmCpuBoostMode_Type2 = 2, ///< Conserve power. Only throttle GPU to minimum. Use performance configurations 0x9222000B and 0x9222000C.
24 
25 /// Initialize apm. Used automatically by \ref appletInitialize with AppletType_Application.
27 
28 /// Exit apm. Used automatically by \ref appletExit with AppletType_Application.
29 void apmExit(void);
30 
31 /// Gets the Service object for the actual apm service session.
33 
34 /// Gets the Service object for ISession.
36 
37 /**
38  * @brief Gets the current ApmPerformanceMode.
39  * @param[out] out_performanceMode ApmPerformanceMode
40  */
42 
43 /**
44  * @brief Sets the PerformanceConfiguration for the specified PerformanceMode.
45  * @param[in] PerformanceMode \ref ApmPerformanceMode
46  * @param[in] PerformanceConfiguration PerformanceConfiguration
47  */
48 Result apmSetPerformanceConfiguration(ApmPerformanceMode PerformanceMode, u32 PerformanceConfiguration);
49 
50 /**
51  * @brief Gets the PerformanceConfiguration for the specified PerformanceMode.
52  * @param[in] PerformanceMode \ref ApmPerformanceMode
53  * @param[out] PerformanceConfiguration PerformanceConfiguration
54  */
55 Result apmGetPerformanceConfiguration(ApmPerformanceMode PerformanceMode, u32 *PerformanceConfiguration);
Result apmSetPerformanceConfiguration(ApmPerformanceMode PerformanceMode, u32 PerformanceConfiguration)
Sets the PerformanceConfiguration for the specified PerformanceMode.
ApmPerformanceMode
PerformanceMode.
Definition: apm.h:12
@ ApmPerformanceMode_Boost
Boost.
Definition: apm.h:15
@ ApmPerformanceMode_Invalid
Invalid.
Definition: apm.h:13
@ ApmPerformanceMode_Normal
Normal.
Definition: apm.h:14
ApmCpuBoostMode
CpuBoostMode. With appletSetCpuBoostMode, only values 0/1 are available. This allows using higher clo...
Definition: apm.h:19
@ ApmCpuBoostMode_Normal
Default, boost-mode disabled.
Definition: apm.h:20
@ ApmCpuBoostMode_FastLoad
Boost CPU. Additionally, throttle GPU to minimum. Use performance configurations 0x92220009 (Docked) ...
Definition: apm.h:21
@ ApmCpuBoostMode_Type2
Conserve power. Only throttle GPU to minimum. Use performance configurations 0x9222000B and 0x9222000...
Definition: apm.h:22
Service * apmGetServiceSession(void)
Gets the Service object for the actual apm service session.
Result apmInitialize(void)
Initialize apm. Used automatically by appletInitialize with AppletType_Application.
Result apmGetPerformanceMode(ApmPerformanceMode *out_performanceMode)
Gets the current ApmPerformanceMode.
Result apmGetPerformanceConfiguration(ApmPerformanceMode PerformanceMode, u32 *PerformanceConfiguration)
Gets the PerformanceConfiguration for the specified PerformanceMode.
void apmExit(void)
Exit apm. Used automatically by appletExit with AppletType_Application.
Service * apmGetServiceSession_Session(void)
Gets the Service object for ISession.
Service object structure.
Definition: service.h:14
u32 Result
Function error code result type.
Definition: types.h:44
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21