PTM services: Difference between revisions
No edit summary |
No edit summary |
||
(22 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
| 0 || [[#OpenController]] | | 0 || [[#OpenController]] | ||
|- | |- | ||
| 1 || [16.0.0+] | | 1 || [16.0.0+] GetRpm | ||
|} | |} | ||
== OpenController == | == OpenController == | ||
Takes an input [[#FanName]]. Returns an output [[#IController]]. | 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 21: | 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]] | ||
|} | |} | ||
=== 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 61: | Line 85: | ||
| 6 || [[#ReleaseControllerPowerSupply|ReleaseControllerPowerSupply]] | | 6 || [[#ReleaseControllerPowerSupply|ReleaseControllerPowerSupply]] | ||
|- | |- | ||
| 7 || [[# | | 7 || [[#OpenSession|OpenSession]] | ||
|- | |- | ||
| 8 || [[#EnableEnoughPowerChargeEmulation|EnableEnoughPowerChargeEmulation]] | | 8 || [[#EnableEnoughPowerChargeEmulation|EnableEnoughPowerChargeEmulation]] | ||
Line 84: | Line 108: | ||
|- | |- | ||
| 18 || [3.0.0+] [[#GetBatteryChargeCalibratedEvent|GetBatteryChargeCalibratedEvent]] | | 18 || [3.0.0+] [[#GetBatteryChargeCalibratedEvent|GetBatteryChargeCalibratedEvent]] | ||
|- | |||
| 19 || [18.0.0+] | |||
|- | |||
| 20 || [18.0.0+] | |||
|- | |||
| 21 || [19.0.0-19.0.1] | |||
|- | |||
| 22 || [19.0.0+] | |||
|- | |||
| 23 || [19.0.0+] | |||
|- | |||
| 24 || [20.0.0+] | |||
|} | |} | ||
Line 132: | Line 168: | ||
== GetBatteryAgePercentage == | == GetBatteryAgePercentage == | ||
No input. | No input. Returns an output double. | ||
== GetBatteryChargeInfoEvent == | == GetBatteryChargeInfoEvent == | ||
No input. | No input. Returns an output Event handle. | ||
== GetBatteryChargeInfoFields == | == GetBatteryChargeInfoFields == | ||
Line 141: | Line 177: | ||
== GetBatteryChargeCalibratedEvent == | == GetBatteryChargeCalibratedEvent == | ||
No input. | No input. Returns an output Event handle. | ||
== IPsmSession == | == IPsmSession == | ||
Line 159: | Line 195: | ||
|- | |- | ||
| 4 || [[#SetBatteryVoltageStateChangeEventEnabled|SetBatteryVoltageStateChangeEventEnabled]] | | 4 || [[#SetBatteryVoltageStateChangeEventEnabled|SetBatteryVoltageStateChangeEventEnabled]] | ||
|- | |||
| 5 || [20.0.0+] | |||
|} | |} | ||
Line 206: | Line 244: | ||
Takes an input [[#Vdd50State]]. No output. | 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 || | |||
|- | |||
| 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 = | = tc = | ||
Line 214: | Line 389: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || | | 0 || SetOperationMode | ||
|- | |- | ||
| 1 || [1.0.0-10.2.0] GetThermalEvent | | 1 || [1.0.0-10.2.0] GetThermalEvent | ||
Line 235: | Line 410: | ||
|- | |- | ||
| 10 || [11.0.0+] LoadAndApplySettings | | 10 || [11.0.0+] LoadAndApplySettings | ||
|- | |||
| 11 || [20.0.0+] | |||
|- | |||
| 12 || [20.0.0+] | |||
|- | |||
| 13 || [20.0.0+] | |||
|} | |} | ||
= ts = | = ts = | ||
This is "nn::ts::server::IMeasurementServer". | This is "nn::ts::server::IMeasurementServer". | ||
[18.0.0+] This is "nn::ts::server::ITsManager". | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 244: | Line 427: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || [[#GetTemperatureRange|GetTemperatureRange]] | | 0 || [1.0.0-16.1.0] [[#GetTemperatureRange|GetTemperatureRange]] | ||
|- | |- | ||
| 1 || [[#GetTemperature|GetTemperature]] | | 1 || [1.0.0-16.1.0] [[#GetTemperature|GetTemperature]] | ||
|- | |- | ||
| 2 || [1.0.0-13.2.1] [[#SetMeasurementMode|SetMeasurementMode]] | | 2 || [1.0.0-13.2.1] [[#SetMeasurementMode|SetMeasurementMode]] | ||
Line 256: | Line 439: | ||
== GetTemperatureRange == | == GetTemperatureRange == | ||
Takes an u8 [[#Location]] and | 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]] | 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 | Takes two input u8s [[#Location]] and '''MeasurementMode'''. No output. | ||
== GetTemperatureMilliC == | == GetTemperatureMilliC == | ||
Takes an u8 [[#Location]] | Takes an input u8 [[#Location]]. Returns an output s32. | ||
The output is the temperature in MilliC. | The output is the temperature in MilliC. | ||
== OpenSession == | == OpenSession == | ||
Takes | Takes an input [[#Location|DeviceCode]]. Returns an [[#ISession]]. | ||
== ISession == | == ISession == | ||
Line 285: | Line 468: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || | | 0 || GetTemperatureRange | ||
|- | |- | ||
| 1 || [8.0.0-13.2.1] | | 1 || [8.0.0-13.2.1] | ||
|- | |- | ||
| 2 || | | 2 || SetMeasurementMode | ||
|- | |- | ||
| 3 || [8.0.0-13.2.1] | | 3 || [8.0.0-13.2.1] | ||
|- | |- | ||
| 4 || [10.0.0+] | | 4 || [10.0.0+] GetTemperature | ||
|- | |||
| 5 || [17.0.0+] SetAlertThreshold | |||
|- | |||
| 6 || [17.0.0+] SetThermThreshold | |||
|- | |||
| 7 || [17.0.0+] GetTemperatureWithError | |||
|} | |} | ||
Line 323: | Line 512: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || [[#OpenSession]] | | 0 || [[#OpenSession_4|OpenSession]] | ||
|- | |- | ||
| 1 || [[#GetPerformanceMode]] | | 1 || [[#GetPerformanceMode]] | ||
Line 361: | Line 550: | ||
|- | |- | ||
| 7 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] | | 7 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] | ||
|- | |||
| 8 || [17.0.0+] GetCurrentPerformanceMode | |||
|} | |} | ||
Line 412: | Line 603: | ||
= 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". | ||
[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). | Each service represents a different priority from 0 (Highest/Thermal) to 9 (Lowest). The "fgm" service represents priority 8 (Default). | ||
Line 429: | Line 622: | ||
== 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 457: | Line 652: | ||
= 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 611: | Line 808: | ||
= BatteryChargeInfoFields = | = BatteryChargeInfoFields = | ||
This is a 0x40-byte struct. | This is "nn::psm::BatteryChargeInfoFields". This is a 0x40-byte struct. | ||
[17.0.0+] This is a 0x54-byte struct. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 617: | Line 816: | ||
! Offset || Size || Description | ! Offset || Size || Description | ||
|- | |- | ||
| 0x00 || 0x4 || | | 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_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+] | |||
|} | |||
== ChargerType == | |||
{| class="wikitable" border="1" | |||
|- | |- | ||
| | ! Value || Name | ||
|- | |- | ||
| | | 0 || ChargeDisable | ||
|- | |- | ||
| | | 1 || ChargeBattery | ||
|- | |- | ||
| | | 2 || Otg | ||
|} | |||
== HiZMode == | |||
{| class="wikitable" border="1" | |||
|- | |- | ||
| | ! Value || Name | ||
|- | |- | ||
| | | 0 || Disable | ||
|- | |- | ||
| | | 1 || Enable | ||
|} | |} | ||
== | == BatteryCharging == | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! Value || Name | ! Value || Name | ||
|- | |- | ||
| 0 || | | 0 || Disable | ||
|- | |- | ||
| 1 || | | 1 || Enable | ||
|} | |||
== FastBatteryCharging == | |||
{| class="wikitable" border="1" | |||
|- | |- | ||
| | ! Value || Name | ||
|- | |- | ||
| | | 0 || Disable | ||
|- | |||
| 1 || Enable | |||
|} | |||
== ControllerPowerSupply == | |||
{| class="wikitable" border="1" | |||
|- | |- | ||
| | ! Value || Name | ||
|- | |- | ||
| | | 0 || Disable | ||
|- | |- | ||
| | | 1 || Enable | ||
|} | |||
== OtgRequest == | |||
{| class="wikitable" border="1" | |||
|- | |- | ||
| | ! Value || Name | ||
|- | |- | ||
| | | 0 || Disable | ||
|- | |- | ||
| | | 1 || Enable | ||
|} | |} | ||
Line 679: | Line 926: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! Value || Name | ! Value || Name || DeviceCode | ||
|- | |- | ||
| 0 || Internal | | 0 || Internal || 0x41000001 | ||
|- | |- | ||
| 1 || External | | 1 || External || 0x41000002 | ||
|} | |} | ||
Line 894: | Line 1,141: | ||
|} | |} | ||
= | = AccessMode = | ||
This is "nn::ddsf::AccessMode". | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! | ! Name || Block | ||
|- | |- | ||
| | | 0 || None | ||
|- | |- | ||
| 1 || Read | |||
|- | |- | ||
| | | 2 || Write | ||
|- | |- | ||
| | | 3 || ReadWrite | ||
|- | |- | ||
| | | 4 || Shared | ||
|- | |- | ||
| | | 5 || WriteShared | ||
|- | |- | ||
| | | 6 || ReadWriteShared | ||
|} | |} | ||
[[Category:Services]] | [[Category:Services]] |