Difference between revisions of "PTM services"

From Nintendo Switch Brew
Jump to navigation Jump to search
 
(33 intermediate revisions by 3 users not shown)
Line 6: Line 6:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || OpenController
+
| 0 || [[#OpenController]]
 +
|-
 +
| 1 || [16.0.0+] GetRpm
 
|}
 
|}
 +
 +
== OpenController ==
 +
Takes an input [[#FanName]]. Returns an output [[#IController]].
 +
 +
[7.0.0+] Now takes an input [[Bus_services#GpioPadName|DeviceCode]] instead of an input [[#FanName]].
  
 
== IController ==
 
== IController ==
Line 16: Line 23:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || SetRotationSpeedLevel
+
| 0 || [[#SetRotationSpeedLevel]]
 
|-
 
|-
| 1 || SetRotationSpeedLevelByDiff
+
| 1 || [7.0.0+] [[#GetRotationSpeedLevel]] ([1.0.0-6.2.0] [[#SetRotationSpeedLevelByDiff]])
 
|-
 
|-
| 2 || GetRotationSpeedLevel
+
| 2 || [7.0.0+] [[#GetActualRotationSpeedLevel]] ([1.0.0-6.2.0] [[#GetRotationSpeedLevel]])
 
|-
 
|-
| 3 || SetRotationRate
+
| 3 || [7.0.0+] [[#EnableFan]] ([1.0.0-6.2.0] [[#SetRotationRate]])
 
|-
 
|-
| 4 || GetRotationRate
+
| 4 || [7.0.0+] [[#DisableFan]] ([1.0.0-6.2.0] [[#GetRotationRate]])
 
|-
 
|-
| 5 || [1.0.0-6.2.0] EnableFan
+
| 5 || [1.0.0-6.2.0] [[#EnableFan]]
 
|-
 
|-
| 6 || [1.0.0-6.2.0] DisableFan
+
| 6 || [1.0.0-6.2.0] [[#DisableFan]]
 
|-
 
|-
| 7 || [1.0.0-6.2.0] GetActualRotationSpeedLevel
+
| 7 || [1.0.0-6.2.0] [[#GetActualRotationSpeedLevel]]
 
|}
 
|}
  
[7.0.0+] SetRotationSpeedLevelByDiff/SetRotationRate no longer takes any input. GetRotationRate no longer returns output. These were presumably replaced with new cmds?
+
=== SetRotationSpeedLevel ===
 +
Takes an input float. No output.
 +
 
 +
=== SetRotationSpeedLevelByDiff ===
 +
Takes an input float. Returns an output float.
 +
 
 +
=== GetRotationSpeedLevel ===
 +
No input. Returns an output float.
 +
 
 +
=== SetRotationRate ===
 +
Takes an input float. No output.
 +
 
 +
=== GetRotationRate ===
 +
No input. Returns an output float.
 +
 
 +
=== EnableFan ===
 +
No input/output.
 +
 
 +
=== DisableFan ===
 +
No input/output.
 +
 
 +
=== GetActualRotationSpeedLevel ===
 +
No input. Returns an output float.
  
 
= psm =
 
= psm =
Line 42: Line 71:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || [[#GetBatteryChargePercentage]]
+
| 0 || [[#GetBatteryChargePercentage|GetBatteryChargePercentage]]
 +
|-
 +
| 1 || [[#GetChargerType|GetChargerType]]
 +
|-
 +
| 2 || [[#EnableBatteryCharging|EnableBatteryCharging]]
 +
|-
 +
| 3 || [[#DisableBatteryCharging|DisableBatteryCharging]]
 +
|-
 +
| 4 || [[#IsBatteryChargingEnabled|IsBatteryChargingEnabled]]
 
|-
 
|-
| 1 || [[#GetChargerType]]
+
| 5 || [[#AcquireControllerPowerSupply|AcquireControllerPowerSupply]]
 
|-
 
|-
| 2 || [[#EnableBatteryCharging]]
+
| 6 || [[#ReleaseControllerPowerSupply|ReleaseControllerPowerSupply]]
 
|-
 
|-
| 3 || [[#DisableBatteryCharging]]
+
| 7 || [[#OpenSession|OpenSession]]
 
|-
 
|-
| 4 || [[#IsBatteryChargingEnabled]]
+
| 8 || [[#EnableEnoughPowerChargeEmulation|EnableEnoughPowerChargeEmulation]]
 
|-
 
|-
| 5 || [[#AcquireControllerPowerSupply]]
+
| 9 || [[#DisableEnoughPowerChargeEmulation|DisableEnoughPowerChargeEmulation]]
 
|-
 
|-
| 6 || [[#ReleaseControllerPowerSupply]]
+
| 10 || [[#EnableFastBatteryCharging|EnableFastBatteryCharging]]
 
|-
 
|-
| 7 || [[#OpenSession]]
+
| 11 || [[#DisableFastBatteryCharging|DisableFastBatteryCharging]]
 
|-
 
|-
| 8 || [[#EnableEnoughPowerChargeEmulation]]
+
| 12 || [[#GetBatteryVoltageState|GetBatteryVoltageState]]
 
|-
 
|-
| 9 || [[#DisableEnoughPowerChargeEmulation]]
+
| 13 || [[#GetRawBatteryChargePercentage|GetRawBatteryChargePercentage]]
 
|-
 
|-
| 10 || [[#EnableFastBatteryCharging]]
+
| 14 || [[#IsEnoughPowerSupplied|IsEnoughPowerSupplied]]
 
|-
 
|-
| 11 || [[#DisableFastBatteryCharging]]
+
| 15 || [[#GetBatteryAgePercentage|GetBatteryAgePercentage]]
 
|-
 
|-
| 12 || [[#GetBatteryVoltageState]]
+
| 16 || [[#GetBatteryChargeInfoEvent|GetBatteryChargeInfoEvent]]
 
|-
 
|-
| 13 || [[#GetRawBatteryChargePercentage]]
+
| 17 || [[#GetBatteryChargeInfoFields|GetBatteryChargeInfoFields]]
 
|-
 
|-
| 14 || [[#IsEnoughPowerSupplied]]
+
| 18 || [3.0.0+] [[#GetBatteryChargeCalibratedEvent|GetBatteryChargeCalibratedEvent]]
 
|-
 
|-
| 15 || [[#GetBatteryAgePercentage]]
+
| 19 || [18.0.0+]  
 
|-
 
|-
| 16 || [[#GetBatteryChargeInfoEvent]]
+
| 20 || [18.0.0+]
 
|-
 
|-
| 17 || [[#GetBatteryChargeInfoFields]]
+
| 21 || [19.0.0+]
 
|-
 
|-
| 18 || [3.0.0+] GetBatteryChargeCalibratedEvent
+
| 22 || [19.0.0+]
 +
|-
 +
| 23 || [19.0.0+]
 
|}
 
|}
  
 
== GetBatteryChargePercentage ==
 
== GetBatteryChargePercentage ==
No input, returns an output u32.
+
No input. Returns an output u32.
  
 
== GetChargerType ==
 
== GetChargerType ==
No input, returns an output u32.
+
No input. Returns an output [[#ChargerType|ChargerType]].
  
 
== EnableBatteryCharging ==
 
== EnableBatteryCharging ==
Line 94: Line 133:
  
 
== IsBatteryChargingEnabled ==
 
== IsBatteryChargingEnabled ==
No input, returns an output u8.
+
No input. Returns an output bool.
  
 
== AcquireControllerPowerSupply ==
 
== AcquireControllerPowerSupply ==
Line 103: Line 142:
  
 
== OpenSession ==
 
== OpenSession ==
No input, returns an output [[#IPsmSession]].
+
No input. Returns an output [[#IPsmSession]].
  
 
== EnableEnoughPowerChargeEmulation ==
 
== EnableEnoughPowerChargeEmulation ==
Line 118: Line 157:
  
 
== GetBatteryVoltageState ==
 
== GetBatteryVoltageState ==
No input, returns an output u32.
+
No input. Returns an output [[#BatteryVoltageState|BatteryVoltageState]].
  
 
== GetRawBatteryChargePercentage ==
 
== GetRawBatteryChargePercentage ==
No input, returns an output double.
+
No input. Returns an output double.
  
 
== IsEnoughPowerSupplied ==
 
== IsEnoughPowerSupplied ==
No input, returns an output bool.
+
No input. Returns an output bool.
  
 
== GetBatteryAgePercentage ==
 
== GetBatteryAgePercentage ==
No input, returns an output double.
+
No input. Returns an output double.
  
 
== GetBatteryChargeInfoEvent ==
 
== GetBatteryChargeInfoEvent ==
No input, returns an output Event handle.
+
No input. Returns an output Event handle.
  
 
== GetBatteryChargeInfoFields ==
 
== GetBatteryChargeInfoFields ==
No input, returns an output 0x40-byte struct:
+
No input. Returns an output [[#BatteryChargeInfoFields|BatteryChargeInfoFields]].
 +
 
 +
== GetBatteryChargeCalibratedEvent ==
 +
No input. Returns an output Event handle.
 +
 
 +
== IPsmSession ==
 +
This is "nn::psm::IPsmSession".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || [[#BindStateChangeEvent|BindStateChangeEvent]]
 +
|-
 +
| 1 || [[#UnbindStateChangeEvent|UnbindStateChangeEvent]]
 +
|-
 +
| 2 || [[#SetChargerTypeChangeEventEnabled|SetChargerTypeChangeEventEnabled]]
 +
|-
 +
| 3 || [[#SetPowerSupplyChangeEventEnabled|SetPowerSupplyChangeEventEnabled]]
 +
|-
 +
| 4 || [[#SetBatteryVoltageStateChangeEventEnabled|SetBatteryVoltageStateChangeEventEnabled]]
 +
|}
 +
 
 +
=== BindStateChangeEvent ===
 +
No input. Returns an output Event handle with EventClearMode=0.
 +
 
 +
=== UnbindStateChangeEvent ===
 +
No input/output.
 +
 
 +
=== SetChargerTypeChangeEventEnabled ===
 +
Takes an input bool. No output.
 +
 
 +
=== SetPowerSupplyChangeEventEnabled ===
 +
Takes an input bool. No output.
 +
 
 +
=== SetBatteryVoltageStateChangeEventEnabled ===
 +
Takes an input bool. No output.
 +
 
 +
= psm:manu =
 +
This is "nn::psm::IPsmManufactureServer".
 +
 
 +
This service is not present in retail units.
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Description
+
! Cmd || Name
 +
|-
 +
| 0 || [[#EnableVdd50StateControl|EnableVdd50StateControl]]
 +
|-
 +
| 1 || [[#DisableVdd50StateControl|DisableVdd50StateControl]]
 +
|-
 +
| 2 || [[#SetVdd50State|SetVdd50State]]
 +
|}
 +
 
 +
== EnableVdd50StateControl ==
 +
Unofficial name.
 +
 
 +
No input/output.
 +
 
 +
== DisableVdd50StateControl ==
 +
Unofficial name.
 +
 
 +
No input/output.
 +
 
 +
== SetVdd50State ==
 +
Unofficial name.
 +
 
 +
Takes an input [[#Vdd50State]]. No output.
 +
 
 +
= powctl =
 +
This is "nn::powctl::IPowctlManager".
 +
 
 +
This service is not present in retail units.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || [[#OpenSession_3|OpenSession]]
 +
|}
 +
 
 +
== OpenSession ==
 +
Takes a '''DeviceCode''' and an input [[#AccessMode]]. Returns an [[#IPowctlSession]].
 +
 
 +
== IPowctlSession ==
 +
This is "nn::powctl::IPowctlSession".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || GetAlertEvent
 +
|-
 +
| 1 || SetAlertEnabled
 +
|-
 +
| 2 || GetAlertStatus
 +
|-
 +
| 3 || ClearAlertStatus
 +
|-
 +
| 4 ||
 +
|-
 +
| 5 ||
 +
|-
 +
| 6 ||
 +
|-
 +
| 7 ||
 +
|-
 +
| 8 ||
 +
|-
 +
| 9 ||
 +
|-
 +
| 10 ||
 +
|-
 +
| 11 || GetChargeType
 +
|-
 +
| 12 || SetChargeType
 +
|-
 +
| 13 || SetChargeCurrentLimitInMilliAmpere
 +
|-
 +
| 14 || GetChargeVoltageLimitInMilliVolt
 +
|-
 +
| 15 || SetChargeVoltageLimitInMilliVolt
 +
|-
 +
| 16 || SetChargeConfig
 +
|-
 +
| 17 || GetHiZ
 +
|-
 +
| 18 || SetHiZ
 +
|-
 +
| 19 || GetAverageChargeCurrentInMilliAmpere
 +
|-
 +
| 20 || GetChargeCurrentInMilliAmpere
 +
|-
 +
| 21 ||
 +
|-
 +
| 22 ||  
 
|-
 
|-
| 0x00 || 0x4 || u32. Input (Sink) current limit in mA
+
| 23 ||  
 
|-
 
|-
| 0x04 || 0x4 || u32. Output (Source/Vbus/OTG) current limit in mA
+
| 24 ||  
 
|-
 
|-
| 0x08 || 0x4 || u32. Battery charging current limit in mA
+
| 25 || GetParameter
 
|-
 
|-
| 0x0C || 0x4 || u32. Battery charging voltage limit in mV
+
| 26 || SetParameter
 
|-
 
|-
| 0x10 || 0x4 || enum, same as power-role? Always 1 except when OTG where it becomes 2
+
| 27 ||  
 
|-
 
|-
| 0x14 || 0x4 || Possibly a bit field
+
| 28 ||  
 
|-
 
|-
| 0x18 || 0x4 || u32. Charging limits state based on battery temperature
+
| 29 ||  
 
|-
 
|-
| 0x1C || 0x4 || u32. Battery Temperature (milli C)
+
| 30 ||  
 
|-
 
|-
| 0x20 || 0x4 || u32. Capacity now per cent-mille (i.e. 100% = 100000 pcm)
+
| 31 ||  
 
|-
 
|-
| 0x24 || 0x4 || u32. Voltage avg in mV
+
| 32 ||  
 
|-
 
|-
| 0x28 || 0x4 || u32. Battery age (capacity full / capacity design) per cent-mille (i.e. 100% = 100000 pcm)
+
| 33 ||  
 
|-
 
|-
| 0x2C || 0x4 || enum. Power role (0: Unknown, 1: Sink, 2: Source)
+
| 34 ||  
 
|-
 
|-
| 0x30 || 0x4 || enum. [[#Charger_Type]]
+
| 35 ||  
 
|-
 
|-
| 0x34 || 0x4 || u32. Charger voltage limit in mV
+
| 36 ||  
 
|-
 
|-
| 0x38 || 0x4 || u32. Charger current limit in mA
+
| 37 ||  
 
|-
 
|-
| 0x3C || 0x4 || Bit field (bit0: potentially no hub, bit8: Joy-con charging, bit12: OTG)
+
| 38 ||  
 
|-
 
|-
|}
+
| 39 ||  
 
 
=== Charger Type ===
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Value || Name
+
| 40 || GetAverageBatteryVoltageInMilliVolt
 
|-
 
|-
| 0 || Unknown
+
| 41 || SetBatteryVoltageAlertMinInMilliVolt
 
|-
 
|-
| 1 || PD
+
| 42 || SetBatteryVoltageAlertMaxInMilliVolt
 
|-
 
|-
| 2 || Type-C 1.5A
+
| 43 || GetWatchdogTimerEnabled
 
|-
 
|-
| 3 || Type-C 3.0A
+
| 44 || SetWatchdogTimerEnabled
 
|-
 
|-
| 4 || DCP
+
| 45 || SetWatchdogTimerPeriod
 
|-
 
|-
| 5 || CDP
+
| 46 || ResetWatchdogTimer
 
|-
 
|-
| 6 || SDP
+
| 47 ||  
 
|-
 
|-
| 7 || Apple 500mA
+
| 48 ||  
 
|-
 
|-
| 8 || Apple 1000mA
+
| 49 || GetBatteryVoltageInMilliVolt
 
|-
 
|-
| 9 || Apple 2000mA
+
| 50 || GetAverageVoltageTimeConstant
|}
 
 
 
== IPsmSession ==
 
This is "nn::psm::IPsmSession".
 
 
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Cmd || Name
+
| 51 || GetChargeCurrentLimitInMilliAmpere
 
|-
 
|-
| 0 || [[#BindStateChangeEvent]]
+
| 52 ||  
 
|-
 
|-
| 1 || [[#UnbindStateChangeEvent]]
+
| 53 ||  
 
|-
 
|-
| 2 || [[#SetChargerTypeChangeEventEnabled]]
+
| 54 || GetVfOcvInMilliVolt
 
|-
 
|-
| 3 || [[#SetPowerSupplyChangeEventEnabled]]
+
| 55 ||  
 
|-
 
|-
| 4 || [[#SetBatteryVoltageStateChangeEventEnabled]]
+
| 56 ||  
 
|}
 
|}
 
=== BindStateChangeEvent ===
 
No input, returns an output event with autoclear disabled.
 
 
=== UnbindStateChangeEvent ===
 
No input/output.
 
 
=== SetChargerTypeChangeEventEnabled ===
 
Takes an input u8 bool, no output.
 
 
=== SetPowerSupplyChangeEventEnabled ===
 
Takes an input u8 bool, no output.
 
 
=== SetBatteryVoltageStateChangeEventEnabled ===
 
Takes an input u8 bool, no output.
 
  
 
= tc =
 
= tc =
Line 239: Line 385:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || SetOperatingMode
+
| 0 || SetOperationMode
 
|-
 
|-
 
| 1 || [1.0.0-10.2.0] GetThermalEvent
 
| 1 || [1.0.0-10.2.0] GetThermalEvent
Line 265: Line 411:
 
This is "nn::ts::server::IMeasurementServer".
 
This is "nn::ts::server::IMeasurementServer".
  
{| class="wikitable" border="1"
+
[18.0.0+] This is "nn::ts::server::ITsManager".
|-
 
! Cmd || Name
 
|-
 
| 0 || [[#GetTemperatureRange]]
 
|-
 
| 1 || [[#GetTemperature]]
 
|-
 
| 2 || [[#SetMeasurementMode]]
 
|-
 
| 3 || [[#GetTemperatureMilliC]]
 
|-
 
| 4 || [8.0.0+] ? (Takes a total of 4-bytes of input, returns an [[#IUnknown0]])
 
|}
 
 
 
== IUnknown0 ==
 
Added with [8.0.0+].
 
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 287: Line 417:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 ||  
+
| 0 || [1.0.0-16.1.0] [[#GetTemperatureRange|GetTemperatureRange]]
 
|-
 
|-
| 1 ||  
+
| 1 || [1.0.0-16.1.0] [[#GetTemperature|GetTemperature]]
 
|-
 
|-
| 2 ||  
+
| 2 || [1.0.0-13.2.1] [[#SetMeasurementMode|SetMeasurementMode]]
 
|-
 
|-
| 3 ||  
+
| 3 || [1.0.0-13.2.1] [[#GetTemperatureMilliC|GetTemperatureMilliC]]
 
|-
 
|-
| 4 || [10.0.0+]
+
| 4 || [8.0.0+] [[#OpenSession_2|OpenSession]]
 
|}
 
|}
  
 
== GetTemperatureRange ==
 
== GetTemperatureRange ==
Takes an u8 [[#Location]] and returns an s32 minimum temperature + s32 maximum temperature.
+
Takes an input u8 [[#Location]]. Returns two s32s '''MinimumTemperature''' and '''MaximumTemperature'''.
  
 
The returned temperature values are in Celsius.
 
The returned temperature values are in Celsius.
  
 
== GetTemperature ==
 
== GetTemperature ==
Takes an u8 [[#Location]] and returns an output s32.
+
Takes an input u8 [[#Location]]. Returns an output s32.
  
 
The output is the temperature in Celsius.
 
The output is the temperature in Celsius.
  
 
== SetMeasurementMode ==
 
== SetMeasurementMode ==
Takes an u8 [[#Location]] and an u8 MeasurementMode, no output.
+
Takes two input u8s [[#Location]] and '''MeasurementMode'''. No output.
  
 
== GetTemperatureMilliC ==
 
== GetTemperatureMilliC ==
Takes an u8 [[#Location]] and returns an output s32.
+
Takes an input u8 [[#Location]]. Returns an output s32.
  
 
The output is the temperature in MilliC.
 
The output is the temperature in MilliC.
  
== Location ==
+
== OpenSession ==
 +
Takes an input [[#Location|DeviceCode]]. Returns an [[#ISession]].
 +
 
 +
== ISession ==
 +
This is "nn::ts::server::ISession".
 +
 
 +
This was added with [8.0.0+].
 +
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Value || Name
+
! Cmd || Name
 +
|-
 +
| 0 || GetTemperatureRange
 +
|-
 +
| 1 || [8.0.0-13.2.1]
 +
|-
 +
| 2 || SetMeasurementMode
 +
|-
 +
| 3 || [8.0.0-13.2.1]
 +
|-
 +
| 4 || [10.0.0+] GetTemperature
 +
|-
 +
| 5 || [17.0.0+] SetAlertThreshold
 
|-
 
|-
| 0 || Internal
+
| 6 || [17.0.0+] SetThermThreshold
 
|-
 
|-
| 1 || External
+
| 7 || [17.0.0+] GetTemperatureWithError
 
|}
 
|}
  
Line 353: Line 502:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || [[#OpenSession]]
+
| 0 || [[#OpenSession_4|OpenSession]]
 
|-
 
|-
| 1 || GetPerformanceMode
+
| 1 || [[#GetPerformanceMode]]
 
|-
 
|-
 
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
 
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
Line 361: Line 510:
  
 
== OpenSession ==
 
== OpenSession ==
Returns an [[#ISession]].
+
No input. Returns an output [[#ISession]].
 +
 
 +
== GetPerformanceMode ==
 +
No input. Returns an output [[#PerformanceMode]].
  
 
== IsCpuOverclockEnabled ==
 
== IsCpuOverclockEnabled ==
No input, returns an output u8 bool.
+
No input. Returns an output bool.
  
 
= apm:sys =
 
= apm:sys =
Line 373: Line 525:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || RequestPerformanceMode
+
| 0 || [[#RequestPerformanceMode]]
 
|-
 
|-
| 1 || GetPerformanceEvent
+
| 1 || [[#GetPerformanceEvent]]
 
|-
 
|-
| 2 || GetThrottlingState
+
| 2 || [[#GetThrottlingState]]
 
|-
 
|-
| 3 || GetLastThrottlingState
+
| 3 || [[#GetLastThrottlingState]]
 
|-
 
|-
| 4 || ClearLastThrottlingState
+
| 4 || [[#ClearLastThrottlingState]]
 
|-
 
|-
| 5 || [5.0.0+] LoadAndApplySettings
+
| 5 || [5.0.0+] [[#LoadAndApplySettings]]
 
|-
 
|-
 
| 6 || [7.0.0+] [[#SetCpuBoostMode]]
 
| 6 || [7.0.0+] [[#SetCpuBoostMode]]
 
|-
 
|-
 
| 7 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]
 
| 7 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]
 +
|-
 +
| 8 || [17.0.0+] GetCurrentPerformanceMode
 
|}
 
|}
 +
 +
== RequestPerformanceMode ==
 +
Takes an input [[#PerformanceMode]]. No output.
  
 
== GetPerformanceEvent ==
 
== GetPerformanceEvent ==
Returns an [[#ISession]].
+
Takes an input [[#EventTarget]]. Returns an Event handle with EventClearMode 0.
 +
 
 +
== GetThrottlingState ==
 +
No input. Returns an output [[#ThrottlingState]].
 +
 
 +
== GetLastThrottlingState ==
 +
No input. Returns an output [[#ThrottlingState]].
 +
 
 +
== ClearLastThrottlingState ==
 +
No input/output.
 +
 
 +
== LoadAndApplySettings ==
 +
No input/output.
  
 
== SetCpuBoostMode ==
 
== SetCpuBoostMode ==
Takes an u32 [[#CpuBoostMode]].
+
Takes an input [[#CpuBoostMode]]. No output.
 
 
=== CpuBoostMode ===
 
{| class="wikitable" border="1"
 
|-
 
! Mode || Description
 
|-
 
| 0 || Disabled.
 
|-
 
| 1 || Boost CPU. Additionally, throttle GPU to minimum.
 
Use [[#PerformanceConfiguration|performance configurations]] 0x92220009 and 0x9222000A, or 0x9222000B and 0x9222000C.
 
|-
 
| 2 || Conserve power. Only throttle GPU to minimum.
 
Use [[#PerformanceConfiguration|performance configurations]] 0x9222000B and 0x9222000C.
 
|}
 
  
 
== GetCurrentPerformanceConfiguration ==
 
== GetCurrentPerformanceConfiguration ==
Returns the currently active [[#PerformanceConfiguration]] (default value is 0x00020003).
+
No input. Returns an output [[#PerformanceConfiguration]] (default value is 0x00020003).
  
 
= ISession =
 
= ISession =
Line 420: Line 575:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || SetPerformanceConfiguration
+
| 0 || [[#SetPerformanceConfiguration]]
 
|-
 
|-
| 1 || GetPerformanceConfiguration
+
| 1 || [[#GetPerformanceConfiguration]]
 
|-
 
|-
 
| 2 || [8.0.0+] [[#SetCpuOverclockEnabled]]
 
| 2 || [8.0.0+] [[#SetCpuOverclockEnabled]]
Line 428: Line 583:
  
 
== SetPerformanceConfiguration ==
 
== SetPerformanceConfiguration ==
Takes an u32 [[#PerformanceMode]] and an u32 [[#PerformanceConfiguration]].
+
Takes an input [[#PerformanceMode]] and an input [[#PerformanceConfiguration]]. No output.
  
 
== GetPerformanceConfiguration ==
 
== GetPerformanceConfiguration ==
Takes an u32 [[#PerformanceMode]] and returns an output u32 [[#PerformanceConfiguration]].
+
Takes an input [[#PerformanceMode]]. Returns an output [[#PerformanceConfiguration]].
  
 
== SetCpuOverclockEnabled ==
 
== SetCpuOverclockEnabled ==
Takes an input u8 bool, no output.
+
Takes an input bool. No output.
 
 
== PerformanceMode ==
 
{| class="wikitable" border="1"
 
|-
 
! Value || Name
 
|-
 
| 0 || Normal
 
|-
 
| 1 || Boost
 
|}
 
 
 
== PerformanceConfiguration ==
 
{| class="wikitable" border="1"
 
|-
 
! Value || CPU clock || GPU clock || Memory clock
 
|-
 
| 0x00010000 || 1020.0 || 384.0 || 1600.0
 
|-
 
| 0x00010001 || 1020.0 || 768.0 || 1600.0
 
|-
 
| 0x00010002 || 1224.0 || 691.2 || 1600.0
 
|-
 
| 0x00020000 || 1020.0 || 230.4 || 1600.0
 
|-
 
| 0x00020001 || 1020.0 || 307.2 || 1600.0
 
|-
 
| 0x00020002 || 1224.0 || 230.4 || 1600.0
 
|-
 
| 0x00020003 || 1020.0 || 307.2 || 1331.2
 
|-
 
| 0x00020004 || 1020.0 || 384.0 || 1331.2
 
|-
 
| 0x00020005 || 1020.0 || 307.2 || 1065.6
 
|-
 
| 0x00020006 || 1020.0 || 384.0 || 1065.6
 
|-
 
| 0x92220007 || 1020.0  || 460.8 || 1600.0
 
|-
 
| 0x92220008 || 1020.0 || 460.8 || 1331.2
 
|-
 
| [7.0.0+] 0x92220009 || 1785.0 || 76.8 || 1600.0
 
|-
 
| [7.0.0+] 0x9222000A || 1785.0 || 76.8 || 1331.2
 
|-
 
| [7.0.0+] 0x9222000B || 1020.0 || 76.8 || 1600.0
 
|-
 
| [7.0.0+] 0x9222000C || 1020.0 || 76.8 || 1331.2
 
|}
 
 
 
Clocks are all in MHz.
 
 
 
Configurations 0x10001 and 0x20000 are only available while docked. Configurations 0x10002 and 0x20002 are only available for SDEV units.
 
  
 
= fgm, fgm:0, fgm:1, fgm:2, fgm:3, fgm:4, fgm:5, fgm:6, fgm:7, fgm:9 =
 
= fgm, fgm:0, fgm:1, fgm:2, fgm:3, fgm:4, fgm:5, fgm:6, fgm:7, fgm:9 =
 
These are "nn::fgm::sf::ISession".
 
These are "nn::fgm::sf::ISession".
  
Each service represents a different priority from 0 to 9. The "fgm" service represents priority 8 (default).
+
[19.0.0+] These are "nn::fgm::ISession".
 +
 
 +
Each service represents a different priority from 0 (Highest/Thermal) to 9 (Lowest). The "fgm" service represents priority 8 (Default).
  
 
[2.0.0+] Only "fgm", "fgm:0" and "fgm:9" are now valid.
 
[2.0.0+] Only "fgm", "fgm:0" and "fgm:9" are now valid.
Line 503: Line 608:
  
 
== Initialize ==
 
== Initialize ==
No input. Returns an [[#IRequest]].
+
No input. Returns an output [[#IRequest]].
  
 
== IRequest ==
 
== IRequest ==
 
This is "nn::fgm::sf::IRequest".
 
This is "nn::fgm::sf::IRequest".
 +
 +
[19.0.0+] This is "nn::fgm::IRequest".
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 522: Line 629:
  
 
=== Initialize ===
 
=== Initialize ===
Takes a PID-descriptor, a [[#Module]] and an u64. Returns an Event handle with EventClearMode 0.
+
Takes a PID-descriptor, a [[#Module|ModuleId]] and a reserved input u64. Returns an Event handle with EventClearMode 0.
  
 
=== Set ===
 
=== Set ===
Takes 2 u32s '''ClockMinRate''' and '''ClockMaxRate'''. No output.
+
Takes 2 u32s '''ClockRateMin''' and '''ClockRateMax'''. No output.
  
 
=== Get ===
 
=== Get ===
No input. Returns an u32 '''ClockRate'''.
+
No input. Returns an u32 '''ClockRateActual'''.
  
 
=== Cancel ===
 
=== Cancel ===
Line 535: Line 642:
 
= fgm:dbg =
 
= fgm:dbg =
 
This is "nn::fgm::sf::IDebugger".
 
This is "nn::fgm::sf::IDebugger".
 +
 +
This was removed with [17.0.0].
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 540: Line 649:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || Initialize
+
| 0 || [[#Initialize_3|Initialize]]
 
|-
 
|-
| 1 || Read
+
| 1 || [[#Read|Read]]
 
|-
 
|-
| 2 || Cancel
+
| 2 || [[#Cancel_2|Cancel]]
 
|}
 
|}
 +
 +
== Initialize ==
 +
Takes the current process handle (0xFFFF8001) and an input u64 '''MemorySize'''. Returns an Event handle with EventClearMode 0.
 +
 +
== Read ==
 +
Takes a type-0x6 output buffer of [[#DebugEntry|DebugEntry]]. Returns three output s32s '''NumberReadOut''', '''NumberLostOut''' and '''NumberRemainingOut'''.
 +
 +
== Cancel ==
 +
No input/output.
  
 
= lbl =
 
= lbl =
This is "nn::lbl::detail::ILblController". This was moved from [[Backlight_services|lbl]] with [10.0.0+]. With [11.0.0+] this was moved into [[Display_services|vi]].
+
This is "nn::lbl::detail::ILblController".
 +
 
 +
[10.0.0+] This was moved from [[Backlight_services|lbl]].
 +
 
 +
[11.0.0+] this was moved into [[Display_services|vi]].
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 586: Line 708:
 
| 15 || SetAmbientLightSensorValue
 
| 15 || SetAmbientLightSensorValue
 
|-
 
|-
| 16 || [[#GetAmbientLightSensorValue]]
+
| 16 || GetAmbientLightSensorValue
 
|-
 
|-
 
| 17 || SetBrightnessReflectionDelayLevel
 
| 17 || SetBrightnessReflectionDelayLevel
Line 606: Line 728:
 
| 25 || [3.0.0+] GetCurrentBrightnessSettingForVrMode
 
| 25 || [3.0.0+] GetCurrentBrightnessSettingForVrMode
 
|-
 
|-
| 26 || [3.0.0+] [[#EnableVrMode]]
+
| 26 || [3.0.0+] EnableVrMode
 
|-
 
|-
| 27 || [3.0.0+] [[#DisableVrMode]]
+
| 27 || [3.0.0+] DisableVrMode
 
|-
 
|-
| 28 || [3.0.0+] [[#IsVrModeEnabled]]
+
| 28 || [3.0.0+] IsVrModeEnabled
 
|-
 
|-
 
| 29 || [7.0.0+] IsAutoBrightnessControlSupported
 
| 29 || [7.0.0+] IsAutoBrightnessControlSupported
 
|}
 
|}
  
== Ambient Light Sensor Notes ==
+
= FanName=
The BH1730 outputs 2 values. Visible light and IR light. This is then calculated through an algorithm that checks for Gain, Measurement time, filter qualities and ouputs lux (max correct measurement of 100K lux).
+
This is "nn::fan::FanName".
The default values are Gain 64x and ITIME of 38 (256 - 218). This allows for a max lux value of 17972 lux when visible light value is maximum and IR light is 0. When both of them are on their limit, the output is 1192 lux.
+
 
The sensor is fully configurable.
+
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name
 +
|-
 +
| 0 || Unknown
 +
|-
 +
| 1 || Cpu
 +
|}
 +
 
 +
= ChargerType =
 +
This is "nn::psm::ChargerType".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name
 +
|-
 +
| 0 || Unconnected
 +
|-
 +
| 1 || EnoughPower
 +
|-
 +
| 2 || LowPower
 +
|-
 +
| 3 || NotSupported
 +
|}
 +
 
 +
= Vdd50State =
 +
This is "nn::psm::Vdd50State".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name
 +
|-
 +
| 0 || Unknown
 +
|-
 +
| 1 || Vdd50AOffVdd50BOff
 +
|-
 +
| 2 || Vdd50AOnVdd50BOff
 +
|-
 +
| 3 || Vdd50AOffVdd50BOn
 +
|}
 +
 
 +
= BatteryVoltageState =
 +
This is "nn::psm::BatteryVoltageState".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name
 +
|-
 +
| 0 || ShutdownRequired
 +
|-
 +
| 1 || SleepRequired
 +
|-
 +
| 2 || BoostPerformanceModeProhibited
 +
|-
 +
| 3 || Good
 +
|}
 +
 
 +
= BatteryChargeInfoFields =
 +
This is "nn::psm::BatteryChargeInfoFields". This is a 0x40-byte struct.
 +
 
 +
[17.0.0+] This is a 0x54-byte struct.
  
== GetAmbientLightSensorValue ==
 
No input. Before 5.x, outputs lux in float. (5.0.0+) Returns an output struct:
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x4 || bOverLimit. (u32) Equals to 1 if visible or IR light data is over 65534.
+
| 0x00 || 0x4 || InputCurrentLimit (input/sink current limit in mA)
 +
|-
 +
| 0x04 || 0x4 || BoostModeCurrentLimit (output/source/vbus/OTG current limit in mA)
 +
|-
 +
| 0x08 || 0x4 || FastChargeCurrentLimit (battery charging current limit in mA)
 +
|-
 +
| 0x0C || 0x4 || ChargeVoltageLimit (battery charging voltage limit in mV)
 
|-
 
|-
| 0x4 || 0x4 || fLux. (float) Value in lux from the ambient light sensor.
+
| 0x10 || 0x4 || [[#ChargerType_2|ChargerType]]
 +
|-
 +
| 0x14 || 0x1 || [[#HiZMode|HiZMode]]
 +
|-
 +
| 0x15 || 0x1 || [[#BatteryCharging|BatteryCharging]]
 +
|-
 +
| 0x16 || 0x2 || Reserved
 +
|-
 +
| 0x18 || 0x4 || [[#Vdd50State|Vdd50State]]
 +
|-
 +
| 0x1C || 0x4 || TemperatureCelsius (battery temperature in milli C)
 +
|-
 +
| 0x20 || 0x4 || BatteryChargePercentage (capacity now per cent-mille, i.e. 100% = 100000 pcm)
 +
|-
 +
| 0x24 || 0x4 || BatteryChargeMilliVoltage (voltage avg in mV)
 +
|-
 +
| 0x28 || 0x4 || BatteryAgePercentage (battery age capacity full/capacity design per cent-mille, i.e. 100% = 100000 pcm)
 +
|-
 +
| 0x2C || 0x4 || [[USB_services#UsbPowerRole|UsbPowerRole]]
 +
|-
 +
| 0x30 || 0x4 || [[USB_services#UsbChargerType|UsbChargerType]]
 +
|-
 +
| 0x34 || 0x4 || ChargerInputVoltageLimit (charger voltage limit in mV)
 +
|-
 +
| 0x38 || 0x4 || ChargerInputCurrentLimit (charger current limit in mA)
 +
|-
 +
| 0x3C || 0x1 || [[#FastBatteryCharging|FastBatteryCharging]]
 +
|-
 +
| 0x3D || 0x1 || [[#ControllerPowerSupply|ControllerPowerSupply]]
 +
|-
 +
| 0x3E || 0x1 || [[#OtgRequest|OtgRequest]]
 +
|-
 +
| 0x3F || 0x1 || Reserved
 +
|-
 +
| 0x40 || 0x14 || [17.0.0+]
 
|}
 
|}
Note: if bOverLimit=1 and the default ALS configuration is used, the measurement of fLux should not be considered and the actual max value depends on the type of light. Ranges from 12.5K - 17.5K.
 
  
== GetCurrentBrightnessSetting ==
+
== ChargerType ==
No input. Returns an output u32 int of the current backlight level.
+
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name
 +
|-
 +
| 0 || ChargeDisable
 +
|-
 +
| 1 || ChargeBattery
 +
|-
 +
| 2 || Otg
 +
|}
  
== GetBrightnessSettingAppliedToBacklight ==
+
== HiZMode ==
No input. Returns an output u32 int of the backlight level computed from the ambient light sensor.
+
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name
 +
|-
 +
| 0 || Disable
 +
|-
 +
| 1 || Enable
 +
|}
  
== IsAutoBrightnessControlEnabled ==
+
== BatteryCharging ==
No input. Returns an output u8 bool indicating whether auto brightness is enabled.
+
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name
 +
|-
 +
| 0 || Disable
 +
|-
 +
| 1 || Enable
 +
|}
  
== EnableVrMode ==
+
== FastBatteryCharging ==
No input/output. Used by [[AM_services#SetVrModeEnabled]].
+
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name
 +
|-
 +
| 0 || Disable
 +
|-
 +
| 1 || Enable
 +
|}
  
Sets a global state field to 0x1.
+
== ControllerPowerSupply ==
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name
 +
|-
 +
| 0 || Disable
 +
|-
 +
| 1 || Enable
 +
|}
  
== DisableVrMode ==
+
== OtgRequest ==
No input/output. Used by [[AM_services#SetVrModeEnabled]].
+
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name
 +
|-
 +
| 0 || Disable
 +
|-
 +
| 1 || Enable
 +
|}
  
Sets the global state field used by [[#EnableVrMode]] to 0x0.
+
= Location =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name || DeviceCode
 +
|-
 +
| 0 || Internal || 0x41000001
 +
|-
 +
| 1 || External || 0x41000002
 +
|}
  
== IsVrModeEnabled ==
+
= CpuBoostMode =
No input. Returns an output u8 bool set by the above commands.
+
This is "nn::apm::CpuBoostMode".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Description
 +
|-
 +
| 0 || Disabled.
 +
|-
 +
| 1 || Boost CPU. Additionally, throttle GPU to minimum.
 +
Use [[#PerformanceConfiguration|performance configurations]] 0x92220009 and 0x9222000A, or 0x9222000B and 0x9222000C.
 +
|-
 +
| 2 || Conserve power. Only throttle GPU to minimum.
 +
Use [[#PerformanceConfiguration|performance configurations]] 0x9222000B and 0x9222000C.
 +
|}
 +
 
 +
= PerformanceMode =
 +
This is "nn::apm::PerformanceMode".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Description
 +
|-
 +
| -1 || Invalid
 +
|-
 +
| 0 || Normal
 +
|-
 +
| 1 || Boost
 +
|}
 +
 
 +
= PerformanceConfiguration =
 +
This is "nn::apm::PerformanceConfiguration".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Description || CPU clock (MHz) || GPU clock (MHz) || Memory clock (MHz)
 +
|-
 +
| 0x00000000 || Invalid || 0 || 0 || 0
 +
|-
 +
| 0x00010000 || Cpu1020MhzGpu384Mhz || 1020.0 || 384.0 || 1600.0
 +
|-
 +
| 0x00010001 || Cpu1020MhzGpu768Mhz || 1020.0 || 768.0 || 1600.0
 +
|-
 +
| 0x00010002 || Cpu1224MhzGpu691Mhz || 1224.0 || 691.2 || 1600.0
 +
|-
 +
| 0x00020000 || Cpu1020MhzGpu230Mhz|| 1020.0 || 230.4 || 1600.0
 +
|-
 +
| 0x00020001 || Cpu1020MhzGpu307Mhz || 1020.0 || 307.2 || 1600.0
 +
|-
 +
| 0x00020002 || Cpu1224MhzGpu230Mhz || 1224.0 || 230.4 || 1600.0
 +
|-
 +
| 0x00020003 || Cpu1020MhzGpu307MhzEmc1331Mhz || 1020.0 || 307.2 || 1331.2
 +
|-
 +
| 0x00020004 || Cpu1020MhzGpu384MhzEmc1331Mhz || 1020.0 || 384.0 || 1331.2
 +
|-
 +
| 0x00020005 || Cpu1020MhzGpu307MhzEmc1065Mhz || 1020.0 || 307.2 || 1065.6
 +
|-
 +
| 0x00020006 || Cpu1020MhzGpu384MhzEmc1065Mhz || 1020.0 || 384.0 || 1065.6
 +
|-
 +
| 0x92220007 || Cpu1020MhzGpu460MhzEmc1600Mhz || 1020.0 || 460.8 || 1600.0
 +
|-
 +
| 0x92220008 || Cpu1020MhzGpu460MhzEmc1331Mhz || 1020.0 || 460.8 || 1331.2
 +
|-
 +
| [7.0.0+] 0x92220009 || Cpu1785MhzGpu76MhzEmc1600Mhz || 1785.0 || 76.8 || 1600.0
 +
|-
 +
| [7.0.0+] 0x9222000A || Cpu1785MhzGpu76MhzEmc1331Mhz || 1785.0 || 76.8 || 1331.2
 +
|-
 +
| [7.0.0+] 0x9222000B || Cpu1020MhzGpu76MhzEmc1600Mhz || 1020.0 || 76.8 || 1600.0
 +
|-
 +
| [7.0.0+] 0x9222000C || Cpu1020MhzGpu76MhzEmc1331Mhz || 1020.0 || 76.8 || 1331.2
 +
|}
 +
 
 +
Configurations 0x10001 and 0x20000 are only available while docked. Configurations 0x10002 and 0x20002 are only available for SDEV units.
 +
 
 +
= EventTarget =
 +
This is "nn::apm::EventTarget".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Description
 +
|-
 +
| 0 || PerformanceModeChanged
 +
|-
 +
| 1 || SleepRequiredByLowVoltage
 +
|-
 +
| 2 || [7.0.0+] PerformanceConfigurationChanged
 +
|}
 +
 
 +
= ThrottlingState =
 +
This is "nn::apm::ThrottlingState".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || DurationNanoSeconds
 +
|-
 +
| 0x8 || 0x4 || ThrottlingRateCpuDividend
 +
|-
 +
| 0xC || 0x4 || ThrottlingRateCpuDivisor
 +
|-
 +
| 0x10 || 0x4 || ThrottlingRateGpuDividend
 +
|-
 +
| 0x14 || 0x4 || ThrottlingRateGpuDivisor
 +
|-
 +
| 0x18 || 0x4 || ThrottleStatus
 +
|-
 +
| 0x1C || 0x4 || CpuPSkipStatus
 +
|-
 +
| 0x20 || 0x4 || GpuPSkipStatus
 +
|-
 +
| 0x24 || 0x1 || Enabled
 +
|-
 +
| 0x25 || 0x1 || Invoked
 +
|-
 +
| 0x26 || 0x2 || Reserved
 +
|}
  
 
= Module =
 
= Module =
Line 661: Line 1,048:
 
! Name || Block
 
! Name || Block
 
|-
 
|-
| 0 || CPU
+
| 0 || Cpu
 
|-
 
|-
| 1 || GPU
+
| 1 || Gpu
 
|-
 
|-
| 2 || EMC
+
| 2 || Emc
 
|-
 
|-
| 3 || SCLK
+
| 3 || SysBus
 
|-
 
|-
| 4 || MSELECT
+
| 4 || Mselect
 
|-
 
|-
| 5 || NVDEC
+
| 5 || Nvdec
 
|-
 
|-
| 6 || NVENC
+
| 6 || Nvenc
 
|-
 
|-
| 7 || NVJPG
+
| 7 || Nvjpg
 +
|-
 +
| 8 || Test
 
|}
 
|}
  
= Settings =
+
= EventId =
 +
This is "nn::fgm::EventId".
 +
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Key || Size || Notes
+
! Name || Block
 
|-
 
|-
| background_download_stress_testing_storage || strlen || "sdcard", "builtin", "system".
+
| 0 || Set
 
|-
 
|-
| battery_draining_enabled || 1 || ?
+
| 1 || Unset
 
|-
 
|-
| fs_access_log_mode || strlen || "log", "sdcard", "log+sdcard", "off".
+
| 2 || Completion
 +
|}
 +
 
 +
= DebugEntry =
 +
This is "nn::fgm::DebugEntry".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| fs_speed_emulation_mode || strlen || "faster", "slower", "random", "off".
+
! Offset || Size || Description
 
|-
 
|-
| host_romfs_redirection_target || strlen || "builtin", "off".
+
| 0x0 || 0x4 || [[#EventId|EventId]]
 
|-
 
|-
| idle_time_detect_mode || strlen || "on", "off".
+
| 0x4 || 0x4 || [[#Module|ModuleId]]
 
|-
 
|-
| initial_tick_value || strlen || "7days", "14days", "30days", "90days", "hex": ?.
+
| 0x8 || 0x8 || Timestamp
 
|-
 
|-
| memory_mode || strlen || "auto", "4GB", "6GB".
+
| 0x10 || 0x40 || [[#RequestEntry|RequestEntry]] (EventId = Set), empty (EventId = Unset) or [[#CompletionEntry|CompletionEntry]] (EventId = Completion)
 +
|}
 +
 
 +
= RequestEntry =
 +
This is "nn::fgm::RequestEntry".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| needs_update_vulnerability_policy || strlen || "default": ?, "force_true": ?, "force_false": ?.
+
! Offset || Size || Description
 
|-
 
|-
| operation_mode_policy || strlen || "auto": ?, "handheld", "console".
+
| 0x0 || 0x8 || ProcessId
 
|-
 
|-
| performance_mode_policy || strlen || "auto": use boost mode when docked. "normal": never use boost mode. "boost": always use boost mode (SDEV only).
+
| 0x8 || 0x4 || Priority
 
|-
 
|-
| screenshot_target || strlen || "screenshot": ?, "physical": ?.
+
| 0xC || 0x4 || ClockRateMin
 
|-
 
|-
| sdev_cpu_overclock_enabled || 1 || SDEV only. Used to allow access to 1224MHz CPU mode.
+
| 0x10 || 0x4 || ClockRateMax
 +
|-
 +
| 0x14 || 0x2C || Reserved
 +
|}
 +
 
 +
= CompletionEntry =
 +
This is "nn::fgm::CompletionEntry".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || ClockRateMin
 +
|-
 +
| 0x4 || 0x4 || ClockRateMax
 +
|-
 +
| 0x8 || 0x4 || ClockRateActual
 +
|-
 +
| 0xC || 0x34 || Reserved
 +
|}
 +
 
 +
= AccessMode =
 +
This is "nn::ddsf::AccessMode".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Name || Block
 +
|-
 +
| 0 || None
 +
|-
 +
| 1 || Read
 
|-
 
|-
| sdev_throttling_additional_delay_us || 4 || SDEV only.
+
| 2 || Write
 
|-
 
|-
| sdev_throttling_additional_delay_enabled || 1 || SDEV only.
+
| 3 || ReadWrite
 
|-
 
|-
| sleep_mode || strlen || "default": ?, "pseudo": ?.
+
| 4 || Shared
 
|-
 
|-
| throttling_for_smpd_enabled || 1 || Not used as of 3.0.
+
| 5 || WriteShared
 
|-
 
|-
| throttling_for_undock_enabled || 1 || Not used as of 3.0.
+
| 6 || ReadWriteShared
 
|}
 
|}
  
 
[[Category:Services]]
 
[[Category:Services]]

Latest revision as of 16:35, 21 October 2024

fan

This is "nn::fan::detail::IManager".

Cmd Name
0 #OpenController
1 [16.0.0+] GetRpm

OpenController

Takes an input #FanName. Returns an output #IController.

[7.0.0+] Now takes an input DeviceCode instead of an input #FanName.

IController

This is "nn::fan::detail::IController".

Cmd Name
0 #SetRotationSpeedLevel
1 [7.0.0+] #GetRotationSpeedLevel ([1.0.0-6.2.0] #SetRotationSpeedLevelByDiff)
2 [7.0.0+] #GetActualRotationSpeedLevel ([1.0.0-6.2.0] #GetRotationSpeedLevel)
3 [7.0.0+] #EnableFan ([1.0.0-6.2.0] #SetRotationRate)
4 [7.0.0+] #DisableFan ([1.0.0-6.2.0] #GetRotationRate)
5 [1.0.0-6.2.0] #EnableFan
6 [1.0.0-6.2.0] #DisableFan
7 [1.0.0-6.2.0] #GetActualRotationSpeedLevel

SetRotationSpeedLevel

Takes an input float. No output.

SetRotationSpeedLevelByDiff

Takes an input float. Returns an output float.

GetRotationSpeedLevel

No input. Returns an output float.

SetRotationRate

Takes an input float. No output.

GetRotationRate

No input. Returns an output float.

EnableFan

No input/output.

DisableFan

No input/output.

GetActualRotationSpeedLevel

No input. Returns an output float.

psm

This is "nn::psm::IPsmServer".

Cmd Name
0 GetBatteryChargePercentage
1 GetChargerType
2 EnableBatteryCharging
3 DisableBatteryCharging
4 IsBatteryChargingEnabled
5 AcquireControllerPowerSupply
6 ReleaseControllerPowerSupply
7 OpenSession
8 EnableEnoughPowerChargeEmulation
9 DisableEnoughPowerChargeEmulation
10 EnableFastBatteryCharging
11 DisableFastBatteryCharging
12 GetBatteryVoltageState
13 GetRawBatteryChargePercentage
14 IsEnoughPowerSupplied
15 GetBatteryAgePercentage
16 GetBatteryChargeInfoEvent
17 GetBatteryChargeInfoFields
18 [3.0.0+] GetBatteryChargeCalibratedEvent
19 [18.0.0+]
20 [18.0.0+]
21 [19.0.0+]
22 [19.0.0+]
23 [19.0.0+]

GetBatteryChargePercentage

No input. Returns an output u32.

GetChargerType

No input. Returns an output ChargerType.

EnableBatteryCharging

No input/output.

DisableBatteryCharging

No input/output.

IsBatteryChargingEnabled

No input. Returns an output bool.

AcquireControllerPowerSupply

No input/output.

ReleaseControllerPowerSupply

No input/output.

OpenSession

No input. Returns an output #IPsmSession.

EnableEnoughPowerChargeEmulation

No input/output.

DisableEnoughPowerChargeEmulation

No input/output.

EnableFastBatteryCharging

No input/output.

DisableFastBatteryCharging

No input/output.

GetBatteryVoltageState

No input. Returns an output BatteryVoltageState.

GetRawBatteryChargePercentage

No input. Returns an output double.

IsEnoughPowerSupplied

No input. Returns an output bool.

GetBatteryAgePercentage

No input. Returns an output double.

GetBatteryChargeInfoEvent

No input. Returns an output Event handle.

GetBatteryChargeInfoFields

No input. Returns an output BatteryChargeInfoFields.

GetBatteryChargeCalibratedEvent

No input. Returns an output Event handle.

IPsmSession

This is "nn::psm::IPsmSession".

Cmd Name
0 BindStateChangeEvent
1 UnbindStateChangeEvent
2 SetChargerTypeChangeEventEnabled
3 SetPowerSupplyChangeEventEnabled
4 SetBatteryVoltageStateChangeEventEnabled

BindStateChangeEvent

No input. Returns an output Event handle with EventClearMode=0.

UnbindStateChangeEvent

No input/output.

SetChargerTypeChangeEventEnabled

Takes an input bool. No output.

SetPowerSupplyChangeEventEnabled

Takes an input bool. No output.

SetBatteryVoltageStateChangeEventEnabled

Takes an input bool. No output.

psm:manu

This is "nn::psm::IPsmManufactureServer".

This service is not present in retail units.

Cmd Name
0 EnableVdd50StateControl
1 DisableVdd50StateControl
2 SetVdd50State

EnableVdd50StateControl

Unofficial name.

No input/output.

DisableVdd50StateControl

Unofficial name.

No input/output.

SetVdd50State

Unofficial name.

Takes an input #Vdd50State. No output.

powctl

This is "nn::powctl::IPowctlManager".

This service is not present in retail units.

Cmd Name
0 OpenSession

OpenSession

Takes a DeviceCode and an input #AccessMode. Returns an #IPowctlSession.

IPowctlSession

This is "nn::powctl::IPowctlSession".

Cmd Name
0 GetAlertEvent
1 SetAlertEnabled
2 GetAlertStatus
3 ClearAlertStatus
4
5
6
7
8
9
10
11 GetChargeType
12 SetChargeType
13 SetChargeCurrentLimitInMilliAmpere
14 GetChargeVoltageLimitInMilliVolt
15 SetChargeVoltageLimitInMilliVolt
16 SetChargeConfig
17 GetHiZ
18 SetHiZ
19 GetAverageChargeCurrentInMilliAmpere
20 GetChargeCurrentInMilliAmpere
21
22
23
24
25 GetParameter
26 SetParameter
27
28
29
30
31
32
33
34
35
36
37
38
39
40 GetAverageBatteryVoltageInMilliVolt
41 SetBatteryVoltageAlertMinInMilliVolt
42 SetBatteryVoltageAlertMaxInMilliVolt
43 GetWatchdogTimerEnabled
44 SetWatchdogTimerEnabled
45 SetWatchdogTimerPeriod
46 ResetWatchdogTimer
47
48
49 GetBatteryVoltageInMilliVolt
50 GetAverageVoltageTimeConstant
51 GetChargeCurrentLimitInMilliAmpere
52
53
54 GetVfOcvInMilliVolt
55
56

tc

This is "nn::tc::IManager".

Cmd Name
0 SetOperationMode
1 [1.0.0-10.2.0] GetThermalEvent
2 IsActionAllowed
3 EnableVirtualTemperature
4 DisableVirtualTemperature
5 SetVirtualTemperature
6 EnableFanControl
7 DisableFanControl
8 IsFanControlEnabled
9 [5.0.0+] GetSkinTemperatureMilliC
10 [11.0.0+] LoadAndApplySettings

ts

This is "nn::ts::server::IMeasurementServer".

[18.0.0+] This is "nn::ts::server::ITsManager".

Cmd Name
0 [1.0.0-16.1.0] GetTemperatureRange
1 [1.0.0-16.1.0] GetTemperature
2 [1.0.0-13.2.1] SetMeasurementMode
3 [1.0.0-13.2.1] GetTemperatureMilliC
4 [8.0.0+] OpenSession

GetTemperatureRange

Takes an input u8 #Location. Returns two s32s MinimumTemperature and MaximumTemperature.

The returned temperature values are in Celsius.

GetTemperature

Takes an input u8 #Location. Returns an output s32.

The output is the temperature in Celsius.

SetMeasurementMode

Takes two input u8s #Location and MeasurementMode. No output.

GetTemperatureMilliC

Takes an input u8 #Location. Returns an output s32.

The output is the temperature in MilliC.

OpenSession

Takes an input DeviceCode. Returns an #ISession.

ISession

This is "nn::ts::server::ISession".

This was added with [8.0.0+].

Cmd Name
0 GetTemperatureRange
1 [8.0.0-13.2.1]
2 SetMeasurementMode
3 [8.0.0-13.2.1]
4 [10.0.0+] GetTemperature
5 [17.0.0+] SetAlertThreshold
6 [17.0.0+] SetThermThreshold
7 [17.0.0+] GetTemperatureWithError

pcm

This is "nn::pcm::IManager".

[4.0.0+] This service was moved to nvdbgsvc and is only available to SDEV units.

Cmd Name
0 IsSupported
1 ReadCurrentPower
2 [4.0.0+] IsServiceEnabled
3 [4.0.0+] ReadCurrentVoltage

apm:am

This is "nn::apm::IManager".

This was added with [8.0.0+] and replaces the old apm service.

Cmd Name
0 OpenSession
1 #GetPerformanceMode
6 [7.0.0+] #IsCpuOverclockEnabled

OpenSession

No input. Returns an output #ISession.

GetPerformanceMode

No input. Returns an output #PerformanceMode.

IsCpuOverclockEnabled

No input. Returns an output bool.

apm:sys

This is "nn::apm::ISystemManager".

Cmd Name
0 #RequestPerformanceMode
1 #GetPerformanceEvent
2 #GetThrottlingState
3 #GetLastThrottlingState
4 #ClearLastThrottlingState
5 [5.0.0+] #LoadAndApplySettings
6 [7.0.0+] #SetCpuBoostMode
7 [7.0.0+] #GetCurrentPerformanceConfiguration
8 [17.0.0+] GetCurrentPerformanceMode

RequestPerformanceMode

Takes an input #PerformanceMode. No output.

GetPerformanceEvent

Takes an input #EventTarget. Returns an Event handle with EventClearMode 0.

GetThrottlingState

No input. Returns an output #ThrottlingState.

GetLastThrottlingState

No input. Returns an output #ThrottlingState.

ClearLastThrottlingState

No input/output.

LoadAndApplySettings

No input/output.

SetCpuBoostMode

Takes an input #CpuBoostMode. No output.

GetCurrentPerformanceConfiguration

No input. Returns an output #PerformanceConfiguration (default value is 0x00020003).

ISession

This is "nn::apm::ISession".

Cmd Name
0 #SetPerformanceConfiguration
1 #GetPerformanceConfiguration
2 [8.0.0+] #SetCpuOverclockEnabled

SetPerformanceConfiguration

Takes an input #PerformanceMode and an input #PerformanceConfiguration. No output.

GetPerformanceConfiguration

Takes an input #PerformanceMode. Returns an output #PerformanceConfiguration.

SetCpuOverclockEnabled

Takes an input bool. No output.

fgm, fgm:0, fgm:1, fgm:2, fgm:3, fgm:4, fgm:5, fgm:6, fgm:7, fgm:9

These are "nn::fgm::sf::ISession".

[19.0.0+] These are "nn::fgm::ISession".

Each service represents a different priority from 0 (Highest/Thermal) to 9 (Lowest). The "fgm" service represents priority 8 (Default).

[2.0.0+] Only "fgm", "fgm:0" and "fgm:9" are now valid.

Cmd Name
0 #Initialize

Initialize

No input. Returns an output #IRequest.

IRequest

This is "nn::fgm::sf::IRequest".

[19.0.0+] This is "nn::fgm::IRequest".

Cmd Name
0 Initialize
1 Set
2 Get
3 Cancel

Initialize

Takes a PID-descriptor, a ModuleId and a reserved input u64. Returns an Event handle with EventClearMode 0.

Set

Takes 2 u32s ClockRateMin and ClockRateMax. No output.

Get

No input. Returns an u32 ClockRateActual.

Cancel

No input/output.

fgm:dbg

This is "nn::fgm::sf::IDebugger".

This was removed with [17.0.0].

Cmd Name
0 Initialize
1 Read
2 Cancel

Initialize

Takes the current process handle (0xFFFF8001) and an input u64 MemorySize. Returns an Event handle with EventClearMode 0.

Read

Takes a type-0x6 output buffer of DebugEntry. Returns three output s32s NumberReadOut, NumberLostOut and NumberRemainingOut.

Cancel

No input/output.

lbl

This is "nn::lbl::detail::ILblController".

[10.0.0+] This was moved from lbl.

[11.0.0+] this was moved into vi.

Cmd Name
0 SaveCurrentSetting
1 LoadCurrentSetting
2 SetCurrentBrightnessSetting
3 GetCurrentBrightnessSetting
4 ApplyCurrentBrightnessSettingToBacklight
5 GetBrightnessSettingAppliedToBacklight
6 SwitchBacklightOn
7 SwitchBacklightOff
8 GetBacklightSwitchStatus
9 EnableDimming
10 DisableDimming
11 IsDimmingEnabled
12 EnableAutoBrightnessControl
13 DisableAutoBrightnessControl
14 IsAutoBrightnessControlEnabled
15 SetAmbientLightSensorValue
16 GetAmbientLightSensorValue
17 SetBrightnessReflectionDelayLevel
18 GetBrightnessReflectionDelayLevel
19 SetCurrentBrightnessMapping
20 GetCurrentBrightnessMapping
21 SetCurrentAmbientLightSensorMapping
22 GetCurrentAmbientLightSensorMapping
23 [3.0.0+] IsAmbientLightSensorAvailable
24 [3.0.0+] SetCurrentBrightnessSettingForVrMode
25 [3.0.0+] GetCurrentBrightnessSettingForVrMode
26 [3.0.0+] EnableVrMode
27 [3.0.0+] DisableVrMode
28 [3.0.0+] IsVrModeEnabled
29 [7.0.0+] IsAutoBrightnessControlSupported

FanName

This is "nn::fan::FanName".

Value Name
0 Unknown
1 Cpu

ChargerType

This is "nn::psm::ChargerType".

Value Name
0 Unconnected
1 EnoughPower
2 LowPower
3 NotSupported

Vdd50State

This is "nn::psm::Vdd50State".

Value Name
0 Unknown
1 Vdd50AOffVdd50BOff
2 Vdd50AOnVdd50BOff
3 Vdd50AOffVdd50BOn

BatteryVoltageState

This is "nn::psm::BatteryVoltageState".

Value Name
0 ShutdownRequired
1 SleepRequired
2 BoostPerformanceModeProhibited
3 Good

BatteryChargeInfoFields

This is "nn::psm::BatteryChargeInfoFields". This is a 0x40-byte struct.

[17.0.0+] This is a 0x54-byte struct.

Offset Size Description
0x00 0x4 InputCurrentLimit (input/sink current limit in mA)
0x04 0x4 BoostModeCurrentLimit (output/source/vbus/OTG current limit in mA)
0x08 0x4 FastChargeCurrentLimit (battery charging current limit in mA)
0x0C 0x4 ChargeVoltageLimit (battery charging voltage limit in mV)
0x10 0x4 ChargerType
0x14 0x1 HiZMode
0x15 0x1 BatteryCharging
0x16 0x2 Reserved
0x18 0x4 Vdd50State
0x1C 0x4 TemperatureCelsius (battery temperature in milli C)
0x20 0x4 BatteryChargePercentage (capacity now per cent-mille, i.e. 100% = 100000 pcm)
0x24 0x4 BatteryChargeMilliVoltage (voltage avg in mV)
0x28 0x4 BatteryAgePercentage (battery age capacity full/capacity design per cent-mille, i.e. 100% = 100000 pcm)
0x2C 0x4 UsbPowerRole
0x30 0x4 UsbChargerType
0x34 0x4 ChargerInputVoltageLimit (charger voltage limit in mV)
0x38 0x4 ChargerInputCurrentLimit (charger current limit in mA)
0x3C 0x1 FastBatteryCharging
0x3D 0x1 ControllerPowerSupply
0x3E 0x1 OtgRequest
0x3F 0x1 Reserved
0x40 0x14 [17.0.0+]

ChargerType

Value Name
0 ChargeDisable
1 ChargeBattery
2 Otg

HiZMode

Value Name
0 Disable
1 Enable

BatteryCharging

Value Name
0 Disable
1 Enable

FastBatteryCharging

Value Name
0 Disable
1 Enable

ControllerPowerSupply

Value Name
0 Disable
1 Enable

OtgRequest

Value Name
0 Disable
1 Enable

Location

Value Name DeviceCode
0 Internal 0x41000001
1 External 0x41000002

CpuBoostMode

This is "nn::apm::CpuBoostMode".

Value Description
0 Disabled.
1 Boost CPU. Additionally, throttle GPU to minimum.

Use performance configurations 0x92220009 and 0x9222000A, or 0x9222000B and 0x9222000C.

2 Conserve power. Only throttle GPU to minimum.

Use performance configurations 0x9222000B and 0x9222000C.

PerformanceMode

This is "nn::apm::PerformanceMode".

Value Description
-1 Invalid
0 Normal
1 Boost

PerformanceConfiguration

This is "nn::apm::PerformanceConfiguration".

Value Description CPU clock (MHz) GPU clock (MHz) Memory clock (MHz)
0x00000000 Invalid 0 0 0
0x00010000 Cpu1020MhzGpu384Mhz 1020.0 384.0 1600.0
0x00010001 Cpu1020MhzGpu768Mhz 1020.0 768.0 1600.0
0x00010002 Cpu1224MhzGpu691Mhz 1224.0 691.2 1600.0
0x00020000 Cpu1020MhzGpu230Mhz 1020.0 230.4 1600.0
0x00020001 Cpu1020MhzGpu307Mhz 1020.0 307.2 1600.0
0x00020002 Cpu1224MhzGpu230Mhz 1224.0 230.4 1600.0
0x00020003 Cpu1020MhzGpu307MhzEmc1331Mhz 1020.0 307.2 1331.2
0x00020004 Cpu1020MhzGpu384MhzEmc1331Mhz 1020.0 384.0 1331.2
0x00020005 Cpu1020MhzGpu307MhzEmc1065Mhz 1020.0 307.2 1065.6
0x00020006 Cpu1020MhzGpu384MhzEmc1065Mhz 1020.0 384.0 1065.6
0x92220007 Cpu1020MhzGpu460MhzEmc1600Mhz 1020.0 460.8 1600.0
0x92220008 Cpu1020MhzGpu460MhzEmc1331Mhz 1020.0 460.8 1331.2
[7.0.0+] 0x92220009 Cpu1785MhzGpu76MhzEmc1600Mhz 1785.0 76.8 1600.0
[7.0.0+] 0x9222000A Cpu1785MhzGpu76MhzEmc1331Mhz 1785.0 76.8 1331.2
[7.0.0+] 0x9222000B Cpu1020MhzGpu76MhzEmc1600Mhz 1020.0 76.8 1600.0
[7.0.0+] 0x9222000C Cpu1020MhzGpu76MhzEmc1331Mhz 1020.0 76.8 1331.2

Configurations 0x10001 and 0x20000 are only available while docked. Configurations 0x10002 and 0x20002 are only available for SDEV units.

EventTarget

This is "nn::apm::EventTarget".

Value Description
0 PerformanceModeChanged
1 SleepRequiredByLowVoltage
2 [7.0.0+] PerformanceConfigurationChanged

ThrottlingState

This is "nn::apm::ThrottlingState".

Offset Size Description
0x0 0x8 DurationNanoSeconds
0x8 0x4 ThrottlingRateCpuDividend
0xC 0x4 ThrottlingRateCpuDivisor
0x10 0x4 ThrottlingRateGpuDividend
0x14 0x4 ThrottlingRateGpuDivisor
0x18 0x4 ThrottleStatus
0x1C 0x4 CpuPSkipStatus
0x20 0x4 GpuPSkipStatus
0x24 0x1 Enabled
0x25 0x1 Invoked
0x26 0x2 Reserved

Module

This is "nn::fgm::Module".

Name Block
0 Cpu
1 Gpu
2 Emc
3 SysBus
4 Mselect
5 Nvdec
6 Nvenc
7 Nvjpg
8 Test

EventId

This is "nn::fgm::EventId".

Name Block
0 Set
1 Unset
2 Completion

DebugEntry

This is "nn::fgm::DebugEntry".

Offset Size Description
0x0 0x4 EventId
0x4 0x4 ModuleId
0x8 0x8 Timestamp
0x10 0x40 RequestEntry (EventId = Set), empty (EventId = Unset) or CompletionEntry (EventId = Completion)

RequestEntry

This is "nn::fgm::RequestEntry".

Offset Size Description
0x0 0x8 ProcessId
0x8 0x4 Priority
0xC 0x4 ClockRateMin
0x10 0x4 ClockRateMax
0x14 0x2C Reserved

CompletionEntry

This is "nn::fgm::CompletionEntry".

Offset Size Description
0x0 0x4 ClockRateMin
0x4 0x4 ClockRateMax
0x8 0x4 ClockRateActual
0xC 0x34 Reserved

AccessMode

This is "nn::ddsf::AccessMode".

Name Block
0 None
1 Read
2 Write
3 ReadWrite
4 Shared
5 WriteShared
6 ReadWriteShared