Difference between revisions of "Bus services"

From Nintendo Switch Brew
Jump to navigation Jump to search
(68 intermediate revisions by 5 users not shown)
Line 12: Line 12:
 
| 2 || [[#OpenSessionForTest]]
 
| 2 || [[#OpenSessionForTest]]
 
|-
 
|-
| 3 || [1.0.0-6.2.0] IsWakeEventActive  
+
| 3 || [1.0.0-6.2.0] [[#IsWakeEventActive]]
 
|-
 
|-
 
| 4 || [1.0.0-6.2.0] GetWakeEventActiveFlagSet
 
| 4 || [1.0.0-6.2.0] GetWakeEventActiveFlagSet
Line 18: Line 18:
 
| 5 || [1.0.0-6.2.0] SetWakeEventActiveFlagSetForDebug
 
| 5 || [1.0.0-6.2.0] SetWakeEventActiveFlagSetForDebug
 
|-
 
|-
| 6 || SetWakePinDebugMode
+
| 6 || [[#SetWakePinDebugMode]]
 
|-
 
|-
 
| 7 || [5.0.0+] [[#OpenSession2]]
 
| 7 || [5.0.0+] [[#OpenSession2]]
 
|-
 
|-
| 8 || [5.0.0+] IsWakeEventActive2
+
| 8 || [5.0.0+] [[#IsWakeEventActive2]]
 
|-
 
|-
 
| 9 || [5.0.0+] SetWakeEventActiveFlagSetForDebug2
 
| 9 || [5.0.0+] SetWakeEventActiveFlagSetForDebug2
 
|-
 
|-
| 10 || [6.0.0+]
+
| 10 || [6.0.0+] [[#SetRetryValues]]
 
|}
 
|}
  
== Known Devices ==
+
== OpenSessionForDev ==
{| class="wikitable sortable" border="1"
+
Takes a raw [[#GpioPadDescriptor]] and returns an [[#IPadSession]].
 +
 
 +
== OpenSession ==
 +
Same as [[#OpenSessionForDev]] except it takes a [[#GpioPadName]] which is then converted to a [[#GpioPadDescriptor]]. Returns an [[#IPadSession]].
 +
 
 +
== OpenSessionForTest ==
 +
Same as [[#OpenSession]] but panics on failure.
 +
 
 +
== IsWakeEventActive ==
 +
Takes a [[#GpioPadName]] and returns a bool.
 +
 
 +
== SetWakePinDebugMode ==
 +
Takes an u32 '''WakePinDebugMode'''. No output.
 +
 
 +
== OpenSession2 ==
 +
Same as [[#OpenSession]] but takes a [[#GpioPadName|DeviceCode]] and an u32.
 +
 
 +
== IsWakeEventActive2 ==
 +
Same as [[#IsWakeEventActive]] but takes a [[#GpioPadName|DeviceCode]].
 +
 
 +
== SetRetryValues ==
 +
Stubbed. Returns 0.
 +
 
 +
== IPadSession ==
 +
This is "nn::gpio::IPadSession".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
! GpioPadName || GpioPadDescriptor || DeviceCode || Tegra (port, pin) || Usage || Direction || Used by
+
! Cmd || Name
 
|-
 
|-
| 0x01 || 0xCC || 0x33000002 || Z, 4 || Audio Codec (ALC5639) Power (CODEC_LDO_EN_TEMP) || Out || [[Audio services]], [[Fatal services]]
+
| 0 || SetDirection
 
|-
 
|-
| 0x02 || 0x24 || 0x3C000001 || E, 4 || SDCard Power (POW_SD_EN) || Out || [[PCV services]]
+
| 1 || GetDirection
 
|-
 
|-
| 0x03 || 0x3C || 0x37000002 || H, 4 || Bluetooth Reset (BT_RST_PH4) || Out || [[Bluetooth Driver services]]
+
| 2 || SetInterruptMode
 
|-
 
|-
| 0x04 || 0xDA || 0xC9000402 || BB, 2 || Secondary Boot Device Configration (RAM_CODE3) || In ||  
+
| 3 || GetInterruptMode
 
|-
 
|-
| 0x05 || 0xDB || 0x3C000402 || BB, 3 || GcAsic Reset (GC_RST) || Out || [[Filesystem services]]
+
| 4 || SetInterruptEnable
 
|-
 
|-
| 0x06 || 0xDC || 0x33000003 || BB, 4 || Audio Codec (ALC5639) Alert (CODEC_ALERT) || In || [[Audio services]]
+
| 5 || GetInterruptEnable
 
|-
 
|-
| 0x07 || 0x25 || 0x3C000401 || E, 5 || GcAsic Power (POW_GC) || Out ||
+
| 6 || GetInterruptStatus
 
|-
 
|-
| 0x08 || 0x90 || 0x350000CA || S, 0 || Debug Pad Detect (DEBUG_CONTROLLER_DET) || In || [[HID services]]
+
| 7 || ClearInterruptStatus
 
|-
 
|-
| 0x09 || 0x91 || 0x39000407 || S, 1 || Battery Charge Status (BATT_CHG_STATUS) || In ||
+
| 8 || SetValue
 
|-
 
|-
| 0x0A || 0x96 || 0x39000003 || S, 6 || Charger IC (BQ24193) Charge Enable (BATT_CHG_ENABLE_N) || Out || [[PTM services]]
+
| 9 || GetValue
 
|-
 
|-
| 0x0B || 0x97 || 0x3D000002 || S, 7 || Fan Tachometer (FAN_TACH) || In ||
+
| 10 || BindInterrupt
 
|-
 
|-
| 0x0C || 0x26 || 0x3500040B || E, 6 || Joy-Con(L) IsAttached (insertion, Joy-Con pin 5/console TX, pulled low on insert?) (EXTCON_DET_S) || In || [[HID services]]
+
| 11 || UnbindInterrupt
 
|-
 
|-
| 0x0D || 0x05 || 0x39000401 || A, 5 || Fan Power (normal) (VDD50A_EN) || Out || [[PTM services]]
+
| 12 || SetDebounceEnabled
 
|-
 
|-
| 0x0E || 0x78 || 0xCA000402 || P, 0 || SDEV Coax Select (SDEV_COAX_SEL_1) || In ||
+
| 13 || GetDebounceEnabled
 
|-
 
|-
| 0x0F || 0x93 || 0x3C000403 || S, 3 || GcAsic Card Detect (GC_CD) || In || [[Filesystem services]]
+
| 14 || SetDebounceTime
 
|-
 
|-
| 0x10 || 0x7D || 0xC900040B || P, 5 || PROD_TYPE_0 || In ||
+
| 15 || GetDebounceTime
 
|-
 
|-
| 0x11 || 0x7C || 0xC900040C || P, 4 || PROD_TYPE_1 || In ||
+
| 16 || [4.0.0+] SetValueForSleepState
 
|-
 
|-
| 0x12 || 0x7B || 0xC900040D || P, 3 || PROD_TYPE_2 || In ||
+
| 17 || [6.0.0+] GetValueForSleepState
 +
|}
 +
 
 +
= i2c, i2c:pcv =
 +
This is "nn::i2c::IManager".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x13 || 0x7A || 0xC900040E || P, 2 || PROD_TYPE_3 || In ||
+
! Cmd || Name
 
|-
 
|-
| 0x14 || 0xBC || 0x3E000002 || X, 4 || Temperature Sensor (TEMP_ALERT) || In ||
+
| 0 || [[#OpenSessionForDev_2|OpenSessionForDev]]
 
|-
 
|-
| 0x15 || 0xAE || 0x33000004 || V, 6 || Audio Codec (ALC5639) Headphone Detect (CODEC_HP_DET_IRQ) || In || [[Audio services]]
+
| 1 || [[#OpenSession_2|OpenSession]]
 
|-
 
|-
| 0x16 || 0xBA || 0x35000041 || X, 2 || MOTION_INT_PX2 || In ||
+
| 2 || [1.0.0-5.1.0] [[#HasDevice|HasDevice]]
 
|-
 
|-
| 0x17 || 0xB9 || 0x35000036 || X, 1 || TouchPanel IRQ (TP_IRQ) (unused - polled instead) || In || [[HID services]]
+
| 3 || [1.0.0-5.1.0] [[#HasDeviceForDev|HasDeviceForDev]]
 
|-
 
|-
| 0x18 || 0xBD || 0x35000001 || X, 5 || Power Button (BUTTON_POWER_ON_PX5) || In ||
+
| 4 || [6.0.0+] [[#OpenSession2_2|OpenSession2]]
 +
|}
 +
 
 +
== OpenSessionForDev ==
 +
Takes an u32 '''port''', an u16 '''addr''', an '''AddressingMode''' (1 for 10-bit, 0 otherwise) and a '''SpeedMode''' (400000 or 100000). Returns an [[#II2cSession]].
 +
 
 +
== OpenSession ==
 +
Takes an [[#I2cDevice]] and returns an [[#II2cSession]].
 +
 
 +
== HasDevice ==
 +
Takes an [[#I2cDevice]] and returns true if the device exists or false otherwise.
 +
 
 +
== HasDeviceForDev ==
 +
Takes an u32 '''port''', an u16 '''addr''', an '''AddressingMode''' (1 for 10-bit, 0 otherwise) and a '''SpeedMode''' (400000 or 100000). Returns true if the device exists or false otherwise.
 +
 
 +
== OpenSession2 ==
 +
Same as [[#OpenSession_2|OpenSession]] but takes a [[#I2cDevice|DeviceCode]].
 +
 
 +
== II2cSession ==
 +
This is "nn::i2c::ISession".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x19 || 0xBE || 0x35000002 || X, 6 || Volume Up (BUTTON_VOL_UP_PX6) || In || [[Boot2]], [[Audio services]]
+
! Cmd || Name
 
|-
 
|-
| 0x1A || 0xBF || 0x35000003 || X, 7 || Volume Down (BUTTON_VOL_DOWN_PX7) || In || [[Boot2]], [[Audio services]]
+
| 0 || [1.0.0-5.1.0] Send
 
|-
 
|-
| 0x1B || 0xC0 || 0x39000034 || Y, 0 || Fuel Gauge IC (MAX17050) IRQ (BATT_MGIC_IRQ) || In || [[PTM services]]
+
| 1 || [1.0.0-5.1.0] Receive
 
|-
 
|-
| 0x1C || 0xC1 || 0x35000004 || Y, 1 || Recovery Mode Key (BUTTON_HOME_PY1) || In ||
+
| 2 || [1.0.0-5.1.0] ExecuteCommandList
 
|-
 
|-
| 0x1D || 0xA9 || 0x3400003E || V, 1 || Backlight Enable (LCD_BL_EN_PV1) || Out || [[NV services]], [[Backlight services]]
+
| 10 || [[#SendAuto]]
 
|-
 
|-
| 0x1E || 0xAA || 0x34000033 || V, 2 || Backlight Reset (LCD_RST_PV2) || Out || [[NV services]]
+
| 11 || ReceiveAuto
 
|-
 
|-
| 0x1F || 0x55 || 0x040000CC || K, 5 || USB-PD Controller (RHOM BM92T30MWV) VCONN Power (PD_VCONN_EN) || Out || [[PTM services]], [[USB services]]
+
| 12 || [[#ExecuteCommandListAuto]]
 
|-
 
|-
| 0x20 || 0xAD || 0x040000CA || V, 5 || USB-PD Controller (RHOM BM92T30MWV) Reset (PD_RST) || Out || [[USB services]]
+
| 13 || [6.0.0+] [[#SetRetryValues]]
 +
|}
 +
 
 +
== SendAuto ==
 +
Takes bytes to write in either a static buffer or a receive buffer, returns an error code for success.
 +
 
 +
== ExecuteCommandListAuto ==
 +
Takes a command list from either a static buffer or a receive buffer, returns data in either a static (or recieve?) buffer.
 +
 
 +
=== Commands ===
 +
* 0x40 [u8 len] <bytes> - Write bytes to device
 +
* 0xC1 [u8 len] - Receive bytes from device
 +
 
 +
== SetRetryValues ==
 +
Takes 2 u32s '''MaxRetries''' and '''RetryDelay'''. Returns 0.
 +
 
 +
= uart =
 +
This is "nn::uart::IManager".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x21 || 0xC8 || 0x39000002 || Z, 0 || Charger IC (BQ24193) IRQ (BQ24193_IRQ) || In || [[PTM services]]
+
! Cmd || Name
 
|-
 
|-
| 0x22 || 0xCA || 0xCA000401 || Z, 2 || SDEV Coax Select (SDEV_COAX_SEL_0) || In ||
+
| 0 || [[#HasPort]]
 
|-
 
|-
| 0x23 || 0xCB || 0x3C000003 || Z, 3 || SDCard Write Protect (SD_WP) || In ||
+
| 1 || [[#HasPortForDev]]
 
|-
 
|-
| 0x24 || 0x4F || 0x35000035 || J, 7 || TouchPanel Reset (TP_RST) || Out || [[HID services]]
+
| 2 || [[#IsSupportedBaudRate]]
 
|-
 
|-
| 0x25 || 0x50 || 0x37000401 || K, 0 || BT_GPIO_2 || In ||
+
| 3 || [[#IsSupportedBaudRateForDev]]
 
|-
 
|-
| 0x26 || 0x51 || 0x37000402 || K, 1 || BT_GPIO_3 || In ||
+
| 4 || [[#IsSupportedFlowControlMode]]
 
|-
 
|-
| 0x27 || 0x52 || 0x37000403 || K, 2 || BT_GPIO_4 || In ||
+
| 5 || [[#IsSupportedFlowControlModeForDev]]
 
|-
 
|-
| 0x28 || 0x54 || 0x040000CB || K, 4 || USB-PD Controller (RHOM BM92T30MWV) IRQ (PD_IRQ) || In || [[USB services]]
+
| 6 || [[#CreatePortSession]]
 
|-
 
|-
| 0x29 || 0x56 || 0x3E000003 || K, 6 || POW_VCPU_INT || In ||
+
| 7 || [[#IsSupportedPortEvent]]
 
|-
 
|-
| 0x2A || 0x57 || 0x3E000004 || K, 7 || MAX77621_GPU_INT || In ||
+
| 8 || [[#IsSupportedPortEventForDev]]
 
|-
 
|-
| 0x2B || 0x53 || 0x35000402 || K, 3 || Joy-Con(R) Charge Detect (EXTCON_CHG_U) || Out || [[HID services]]
+
| 9 || [7.0.0+] [[#IsSupportedDevice]]
 +
|-
 +
| 10 || [7.0.0+] [[#IsSupportedDeviceForDev]]
 +
|}
 +
 
 +
== HasPort ==
 +
Takes an [[#UartPort]]. Returns a boolean success value.
 +
 
 +
== HasPortForDev ==
 +
Takes an [[#UartPortForDev]]. Returns a boolean success value.
 +
 
 +
== IsSupportedBaudRate ==
 +
Takes an [[#UartPort]] and an u32 '''BaudRate'''. Returns a boolean success value.
 +
 
 +
Supported baud rates are 57600, 115200, 1000000 and 3000000.
 +
 
 +
== IsSupportedBaudRateForDev ==
 +
Takes an [[#UartPortForDev]] and an u32 '''BaudRate'''. Returns a boolean success value.
 +
 
 +
Supported baud rates are 57600, 115200, 1000000 and 3000000.
 +
 
 +
== IsSupportedFlowControlMode ==
 +
Takes an [[#UartPort]] and an u32 '''FlowControlMode'''. Returns a boolean success value.
 +
 
 +
Supported modes are 0 (RTS) and 1 (CTS).
 +
 
 +
== IsSupportedFlowControlModeForDev ==
 +
Takes an [[#UartPortForDev]] and an u32 '''FlowControlMode'''. Returns a boolean success value.
 +
 
 +
Supported modes are 0 (RTS) and 1 (CTS).
 +
 
 +
== CreatePortSession ==
 +
No input. Returns an [[#IPortSession]].
 +
 
 +
== IsSupportedPortEvent ==
 +
Takes an [[#UartPort]] and an u32 '''PortEvent'''. Returns a boolean success value.
 +
 
 +
Supported events are 0 (data), 1 (break), 2 (unknown) and 3 (unknown).
 +
 
 +
== IsSupportedPortEventForDev ==
 +
Takes an [[#UartPortForDev]] and an u32 '''PortEvent'''. Returns a boolean success value.
 +
 
 +
Supported events are 0 (data), 1 (break), 2 (unknown) and 3 (unknown).
 +
 
 +
== IsSupportedDevice ==
 +
Takes an [[#UartPort]] and an u32 '''Device'''. Returns a boolean success value.
 +
 
 +
Supported devices are 0 (Bluetooth) for UART-D, 0 (Joy-Con(R)) for UART-B, 0 (Joy-Con(L)) and 1 (MCU) for UART-C.
 +
 
 +
== IsSupportedDeviceForDev ==
 +
Takes an [[#UartPortForDev]] and an u32 '''Device'''. Returns a boolean success value.
 +
 
 +
Supported devices are 0 (Bluetooth) for UART-D, 0 (Joy-Con(R)) for UART-B, 0 (Joy-Con(L)) and 1 (MCU) for UART-C.
 +
 
 +
== IPortSession ==
 +
This is "nn::uart::IPortSession".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x2C || 0xE3 || 0x3500040C || CC, 3 || Joy-Con(L) Charge Detect (EXTCON_CHG_S) || Out || [[HID services]]
+
! Cmd || Name
 
|-
 
|-
| 0x2D || 0x38 || 0x38000003 || H, 0 || WIFI_RF_DISABLE || Out ||
+
| 0 || [[#OpenPort]]
 
|-
 
|-
| 0x2E || 0x39 || 0x38000002 || H, 1 || WiFi Reset (WIFI_RST_PH1) || Out || [[WLAN services]], [[PCIe services]]
+
| 1 || [[#OpenPortForDev]]
 
|-
 
|-
| 0x2F || 0x3B || 0x37000003 || H, 3 || AP_WAKE_BT_PH3 || Out || [[Bluetooth Driver services]]
+
| 2 || GetWritableLength
 
|-
 
|-
| 0x30 || 0x3D || 0x37000004 || H, 5 || BT_WAKE_AP || In ||
+
| 3 || Send
 
|-
 
|-
| 0x31 || 0x3F || 0x37000404 || H, 7 || BT_GPIO_5 || Out ||
+
| 4 || GetReadableLength
 
|-
 
|-
| 0x32 || 0x40 || 0x34000034 || I, 0 || Backlight +5V (LCD_VDD_P_EN) || Out || [[NV services]]
+
| 5 || Receive
 
|-
 
|-
| 0x33 || 0x41 || 0x34000035 || I, 1 || Backlight -5V (LCD_VDD_N_EN) || Out || [[NV services]]
+
| 6 || BindPortEvent
 
|-
 
|-
| 0x34 || 0x3E || 0x35000401 || H, 6 || Joy-Con(R) IsAttached (insertion, Joy-Con pin 5/console TX, pulled low on insert?) (EXTCON_DET_U) || In || [[HID services]]
+
| 7 || UnbindPortEvent
 +
|}
 +
 
 +
=== OpenPort ===
 +
Takes an [[#UartPort]], 3 u32s, 2 copy handles and 4 u8s (each padded to u32). Returns a boolean success value.
 +
 
 +
[7.0.0+] Now takes an additional u64.
 +
 
 +
=== OpenPortForDev ===
 +
Takes an [[#UartPortForDev]], 3 u32s, 2 copy handles and 4 u8s (each padded to u32). Returns a boolean success value.
 +
 
 +
[7.0.0+] Now takes an additional u64.
 +
 
 +
= pwm =
 +
This is "nn::pwm::IManager".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x35 || 0xE2 || 0xC9000401 || CC, 2 || Secondary Boot Device Configration (RAM_CODE2) || In ||
+
! Cmd || Name
 
|-
 
|-
| 0x36 || 0xE4 || 0x39000402 || CC, 4 || Fan Power (high) (VDD50B_EN) || Out || [[PTM services]]
+
| 0 || OpenSessionForDev
 
|-
 
|-
| 0x37 || 0x3A || 0x38000004 || H, 2 || WIFI_WAKE_HOST || In ||
+
| 1 || OpenSession
 
|-
 
|-
| 0x38 || 0xC9 || 0x3C000002 || Z, 1 || SDCard Card Detect (SD_CD) || In || [[Filesystem services]]
+
| 2 || [6.0.0+] [[#OpenSession2_3|OpenSession2]]
 +
|}
 +
 
 +
== OpenSession2 ==
 +
Takes a [[#ChannelName|DeviceCode]] and returns an [[#IChannelSession]].
 +
 
 +
== IChannelSession ==
 +
This is "nn::pwm::IChannelSession".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x39 || 0x4D || 0x39000404 || J, 5 || Charger IC (BQ24193) OTG Charge Select (OTG_FET_1) || Out || [[PTM services]], [[USB services]]
+
! Cmd || Name
 
|-
 
|-
| 0x3A || 0x58 || 0x39000405 || L, 0 || Charger IC (BQ24193) OTG Charge Select (OTG_FET_2) || Out || [[PTM services]], [[USB services]]
+
| 0 || SetPeriod
 
|-
 
|-
| 0x3B || 0x3E || 0x35000403 || H, 6 || Joy-Con(R) Wake Detect (EXTCON_DET_U) || In ||
+
| 1 || GetPeriod
 
|-
 
|-
| 0x3C || 0x26 || 0x3500040D || E, 6 || Joy-Con(L) Wake Detect (EXTCON_DET_S) || In ||
+
| 2 || SetDuty
 
|-
 
|-
| 0x3D || -1 || 0x39000406 || || || ||
+
| 3 || GetDuty
 
|-
 
|-
| 0x3E || 0x33 || 0x35000404 || G, 3 || Joy-Con(R) CTS (checked low) (EXT_UART2_CTS) || In || [[HID services]]
+
| 4 || SetEnabled
 
|-
 
|-
| 0x3F || 0x1C || 0x3500040E || D, 4 || Joy-Con(L) CTS (checked low) (EXT_UART3_CTS) || In || [[HID services]]
+
| 5 || GetEnabled
 
|-
 
|-
| 0x40 || 0xD9 || 0x39000408 || BB, 1 || 5V Step-Down Regulator Power (5V_STEPDOWN_EN) || Out || (SDEV only)
+
| 6 || [6.0.0+] SetScale
 
|-
 
|-
| 0x41 || 0x0C || 0x04000401 || B, 4 || USB Root Port 2 Over Current (USB_B2_OC) || In || [[USB services]] (SDEV only)
+
| 7 || [6.0.0+] GetScale
 +
|}
 +
 
 +
= pinmux =
 +
This is "nn::pinmux::IManager".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x42 || 0x0D || 0x39000409 || B, 5 || 5V Step-Down Regulator Power Good Flag (5V_STEPDOWN_PG) || In || (SDEV only)
+
! Cmd || Name
 
|-
 
|-
| 0x43 || 0x21 || 0x04000402 || E, 1 || USB Power (USB_A_EN) || Out || [[USB services]] (SDEV only)
+
| 0 || [[#OpenSession_3|OpenSession]]
 +
|}
 +
 
 +
== OpenSession ==
 +
Takes an [[#AssignablePinGroupName]] or an [[#AssignablePinGroupNameForHardwareTest]] and returns an [[#ISession|ISession]].
 +
 
 +
== ISession ==
 +
This is "nn::pinmux::ISession".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x44 || 0x27 || 0x04000403 || E, 7 || USB Power Flag (USB_A_FLAG) || In || [[USB services]] (SDEV only)
+
! Cmd || Name
 
|-
 
|-
| 0x45 || 0x92 || 0x04000404 || S, 2 || USB Root Port 3 Over Current (USB_B3_OC) || In || [[USB services]] (SDEV only)
+
| 0 || [[#SetPinAssignment]]
 
|-
 
|-
| 0x46 || 0x95 || 0x04000405 || S, 5 || USB Root Port 3 Power (USB_B3_EN) || Out || [[USB services]] (SDEV only)
+
| 1 || [[#GetPinAssignment]]
 
|-
 
|-
| 0x47 || 0x98 || 0x04000406 || T, 0 || USB Root Port 2 Power (USB_B2_EN) || Out || [[USB services]] (SDEV only)
+
| 2 || [[#SetPinAssignmentForHardwareTest]]
 +
|}
 +
 
 +
=== SetPinAssignment ===
 +
Takes an u32 '''PinAssignment'''. No output.
 +
 
 +
=== GetPinAssignment ===
 +
No input. Returns an u32 '''PinAssignment'''.
 +
 
 +
=== SetPinAssignmentForHardwareTest ===
 +
Takes an u32 '''PinAssignmentForHardwareTest'''. No output.
 +
 
 +
= sasbus =
 +
This is "nn::sasbus::IManager".
 +
 
 +
This was added with [3.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x48 || 0x10 || 0x34000004 || C, 0 || HDMI 5V (HDMI_5V_EN) || Out || [2.0.0+] [[NV services]] (SDEV only)
+
! Cmd || Name
 
|-
 
|-
| 0x49 || 0x11 || 0x04000407 || C, 1 || USB Root Port 1 Power (USB_B1_EN) || Out || [[USB services]] (SDEV only)
+
| 0 || [[#OpenSession_4|OpenSession]]
 +
|}
 +
 
 +
== OpenSession ==
 +
Takes a [[#SasbusPort]] and returns an [[#ISession_2|ISession]].
 +
 
 +
== ISession ==
 +
This is "nn::sasbus::ISession".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x4A || 0x12 || 0x34000005 || C, 2 || HDMI/Power Delivery Switch (HDMI_PD_TR_EN) || Out || [[NV services]] (SDEV only)
+
! Cmd || Name
 
|-
 
|-
| 0x4B || 0x42 || 0x3D000003 || I, 2 || Fan Enable (FAN_EN) || Out || [[PTM services]]
+
| 0 || [[#Write]]
 
|-
 
|-
| 0x4C || 0xE6 || 0x04000408 || CC, 6 || USB Root Port 1 Over Current (USB_B1_OC) || In || [[USB services]] (SDEV only)
+
| 1 || [[#Read]]
 
|-
 
|-
| [2.0.0+] 0x4D || 0xAC || 0x3D000001 || V, 4 || Fan Pulse-Width Modulation Control (PWM_FAN) || Out || [[PTM services]]
+
| 2 || [[#StartPeriodicReceiveMode]]
 
|-
 
|-
| [2.0.0+] 0x4E || 0xE1 || 0x34000006 || CC, 1 || HDMI Hot Plug Detect (HDMI_INT_DP_HPD_PCC1) || In || [[NV services]] (SDEV only)
+
| 3 || [[#StopPeriodicReceiveMode]]
 +
|}
 +
 
 +
=== Write ===
 +
Takes a type-0x21 input buffer and an u8 '''SpiCommand'''. No output.
 +
 
 +
=== Read ===
 +
Takes a type-0x22 output buffer and an u8 '''SpiCommand'''. No output.
 +
 
 +
=== StartPeriodicReceiveMode ===
 +
Takes an u8 '''SpiCommand''' (padded to u32), an u32, two u64s and a copy handle. No output.
 +
 
 +
=== StopPeriodicReceiveMode ===
 +
No input/output.
 +
 
 +
= led =
 +
This is "nn::led::detail::IManager".
 +
 
 +
This was added with [8.1.1+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| [5.0.0+] 0x4F || 0x56 || 0x3E000003 || K, 6 || MAX77812_IRQ || ||
+
! Cmd || Name
 
|-
 
|-
| [6.0.0+] 0x50 || 0x20 || 0xCA000001 || E, 0 || || ||
+
| 0 || [[#OpenController]]
 +
|}
 +
 
 +
== OpenController ==
 +
Takes a '''DeviceCode''' (which must be 0x35000065) and returns an [[#IController]] session for it.
 +
 
 +
== IController ==
 +
This is "nn::led::detail::IController".
 +
 
 +
This was added with [8.1.1+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| [6.0.0+] 0x51 || 0x21 || 0xCA000002 || E, 1 || || ||
+
! Cmd || Name
 
|-
 
|-
| [6.0.0+] 0x52 || 0x22 || 0xCA000003 || E, 2 || || ||
+
| 0 ||  
 
|-
 
|-
| [6.0.0+] 0x53 || 0x23 || 0xCA000004 || E, 3 || || ||
+
| 1 ||  
 
|-
 
|-
| [6.0.0+] 0x54 || 0x4C || 0x36000004 || J, 4 || NFC_IRQ || ||
+
| 2 ||  
 
|-
 
|-
| [6.0.0+] 0x55 || 0x57 || 0x36000003 || K, 7 || NFC_RST || ||
+
| 3 ||  
 
|-
 
|-
| [6.0.0+] 0x56 || 0x94 || 0x35000415 || S, 4 || MCU_IRQ || ||
+
| 4 ||
 
|-
 
|-
| [6.0.0+] 0x57 || 0x98 || 0x35000416 || T, 0 || MCU_BOOT || ||
+
| 5 ||
 
|-
 
|-
| [6.0.0+] 0x58 || 0x99 || 0x35000417 || T, 1 || MCU_RST || ||
+
| 6 ||
 
|-
 
|-
| [6.0.0+] 0x59 || 0xBB || 0x39000403 || X, 3 || Fan Power (5V3) (VDD5V3_EN) || || [[PTM services]]
+
| 7 ||
 
|-
 
|-
| [6.0.0+] 0x5A || 0xE5 || 0x35000418 || CC, 5 || MCU_POR || ||
+
| 8 ||
 
|-
 
|-
| [6.0.0+] 0x5B || 0xAB || 0x35000005 || V, 3 || || ||
+
| 9 ||
 
|-
 
|-
| [6.0.0+] 0x5C || 0x4E || 0x36000002 || J, 6 || || ||
+
| 10 ||
 
|-
 
|-
| [7.0.0+] - || 0x32 || 0x35000406 || G, 2 || Joy-Con(R) RTS || ||
+
| 11 ||
 
|-
 
|-
| [7.0.0+] - || 0x1B || 0x35000410 || D, 3 || Joy-Con(L) RTS || ||
+
| 12 ||
 
|-
 
|-
| [7.0.0+] - || 0x17 || 0x3500041B || ||  || ||
+
| 13 ||
 
|-
 
|-
| [7.0.0+] - || 0x18 || 0x3500041C || ||  || ||
+
| 14 ||
 
|-
 
|-
| [7.0.0+] - || 0x15 || 0x3500041D || ||  || ||
+
| 15 ||
 
|-
 
|-
| [7.0.0+] - || 0x16 || 0x3500041E || ||  || ||
+
| 16 ||
 
|-
 
|-
| [8.0.0+] - || 0x27 || 0x35000415 || S, 4 || MCU_IRQ (duplicate) || ||
+
| 17 ||
|}
 
 
 
== GpioPadDescriptor ==
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Bits || Description
+
| 18 ||
 
|-
 
|-
| 7-5 || Controller index
+
| 19 ||
 
|-
 
|-
| 4-3 || Port index
+
| 20 ||
 
|-
 
|-
| 2-0 || Pin number
+
| 21 || [8.1.1-9.2.0]
 
|}
 
|}
  
== OpenSessionForDev ==
+
= GpioPadName =
Takes a raw [[#GpioPadDescriptor]] and returns a [[#IPadSession]] session for it.
+
This is "nn::gpio::GpioPadName".
  
== OpenSession ==
+
{| class="wikitable sortable" border="1"
Same thing as [[#OpenSessionForDev]] except it takes a '''GpioPadName''' which is then converted to a [[#GpioPadDescriptor]]. Returns an [[#IPadSession]] session.
+
|-
 
+
! Name || [[#GpioPadDescriptor|GpioPadDescriptor]] || DeviceCode || Tegra (port, pin) || Usage || Direction || Used by (services) || Used by (hardware)
== OpenSessionForTest ==
+
|-
Same as [[#OpenSession]] but panics on failure.
+
| 0x01 || 0xCC || 0x33000002 || Z, 4 || Audio Codec (ALC5639) Power (CODEC_LDO_EN_TEMP) || Out || [[Audio services]], [[Fatal services]] || Icosa, Hoag, Iowa, Unknown
 
+
|-
== OpenSession2 ==
+
| 0x02 || 0x24 || 0x3C000001 || E, 4 || SDCard Power (POW_SD_EN) || Out || [[PCV services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
Same as [[#OpenSession]] but takes a '''DeviceCode''' instead of a '''GpioPadName''' and an u32 '''DeviceUnk'''.
+
|-
 
+
| 0x03 || 0x3C || 0x37000002 || H, 4 || Bluetooth Reset (BT_RST_PH4) || Out || [[Bluetooth Driver services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
== IPadSession ==
+
|-
This is "nn::gpio::IPadSession".
+
| 0x04 || 0xDA || 0xC9000402 || BB, 2 || Secondary Boot Device Configration (RAM_CODE3) || In || || Icosa, Iowa
 
+
|-
{| class="wikitable" border="1"
+
| 0x05 || 0xDB || 0x3C000402 || BB, 3 || Gamecard Reset (GC_RST) || Out || [[Filesystem services]] || Icosa, Copper, Hoag, Iowa, Unknown
 +
|-
 +
| 0x06 || 0xDC || 0x33000003 || BB, 4 || Audio Codec (ALC5639) Alert (CODEC_ALERT) || In || [[Audio services]] || Icosa, Hoag, Iowa, Unknown
 +
|-
 +
| 0x07 || 0x25 || 0x3C000401 || E, 5 || Gamecard Power (POW_GC) || Out || || Icosa, Copper
 +
|-
 +
| 0x08 || 0x90 || 0x350000CA || S, 0 || Debug Pad Detect (DEBUG_CONTROLLER_DET) || In || [[HID services]] || Icosa, Iowa
 +
|-
 +
| 0x09 || 0x91 || 0x39000407 || S, 1 || Battery Charge Status (BATT_CHG_STATUS) || In || || Icosa, Hoag, Iowa, Unknown
 +
|-
 +
| 0x0A || 0x96 || 0x39000003 || S, 6 || Charger IC (BQ24193) Charge Enable (BATT_CHG_ENABLE_N) || Out || [[PTM services]] || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
! Cmd || Name
+
| 0x0B || 0x97 || 0x3D000002 || S, 7 || Fan Tachometer (FAN_TACH) || In || || Icosa, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 0 || SetDirection
+
| 0x0C || 0x26 || 0x3500040B || E, 6 || Joy-Con(L) IsAttached (insertion, Joy-Con pin 5/console TX, pulled low on insert) (EXTCON_DET_S) || In || [[HID services]], [[AM services]] || Icosa, Iowa, Unknown
 
|-
 
|-
| 1 || GetDirection
+
| 0x0D || 0x05 || 0x39000401 || A, 5 || Fan and Joy-Con Rails Power (Battery - BQ24193 5V) (VDD50A_EN) || Out || [[PTM services]] || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| 2 || SetInterruptMode
+
| 0x0E || 0x78 || 0xCA000402 || P, 0 || SDEV Coax Select (SDEV_COAX_SEL_1) || In || || Icosa, Iowa
 
|-
 
|-
| 3 || GetInterruptMode
+
| 0x0F || 0x93 || 0x3C000403 || S, 3 || Gamecard Card Detect (GC_CD) || In || [[Filesystem services]], [[AM services]] || Icosa, Copper, Hoag, Iowa, Unknown
 
|-
 
|-
| 4 || SetInterruptEnable
+
| 0x10 || 0x7D || 0xC900040B || P, 5 || PROD_TYPE_0 || In || || Icosa, Copper, Iowa
 
|-
 
|-
| 5 || GetInterruptEnable
+
| 0x11 || 0x7C || 0xC900040C || P, 4 || PROD_TYPE_1 || In || || Icosa, Copper, Iowa
 
|-
 
|-
| 6 || GetInterruptStatus
+
| 0x12 || 0x7B || 0xC900040D || P, 3 || PROD_TYPE_2 || In || || Icosa, Copper, Iowa
 
|-
 
|-
| 7 || ClearInterruptStatus
+
| 0x13 || 0x7A || 0xC900040E || P, 2 || PROD_TYPE_3 || In || || Icosa, Copper, Iowa
 
|-
 
|-
| 8 || SetValue
+
| 0x14 || 0xBC || 0x3E000002 || X, 4 || Temperature Sensor (TEMP_ALERT) || In || || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 9 || GetValue
+
| 0x15 || 0xAE || 0x33000004 || V, 6 || Audio Codec (ALC5639) Headphone Detect (CODEC_HP_DET_IRQ) || In || [[Audio services]] || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| 10 || BindInterrupt
+
| 0x16 || 0xBA || 0x35000041 || X, 2 || MOTION_INT_PX2 || In || || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| 11 || UnbindInterrupt
+
| 0x17 || 0xB9 || 0x35000036 || X, 1 || TouchPanel IRQ (TP_IRQ) || In || [[HID services]] || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| 12 || SetDebounceEnabled
+
| 0x18 || 0xBD || 0x35000001 || X, 5 || Power Button (BUTTON_POWER_ON_PX5) || In || || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 13 || GetDebounceEnabled
+
| 0x19 || 0xBE || 0x35000002 || X, 6 || Volume Up (BUTTON_VOL_UP_PX6) || In || [[Boot2]], [[Audio services]], [[Fatal services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 14 || SetDebounceTime
+
| 0x1A || 0xBF || 0x35000003 || X, 7 || Volume Down (BUTTON_VOL_DOWN_PX7) || In || [[Boot2]], [[Audio services]] || Icosa, Copper, Hoag, Iowa, Calcio , Unknown
 
|-
 
|-
| 15 || GetDebounceTime
+
| 0x1B || 0xC0 || 0x39000034 || Y, 0 || Fuel Gauge IC (MAX17050) IRQ (BATT_MGIC_IRQ) || In || [[PTM services]], [[AM services]] || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| 16 || [4.0.0+] SetValueForSleepState
+
| 0x1C || 0xC1 || 0x35000004 || Y, 1 || Recovery Mode Key (BUTTON_HOME_PY1) || In || || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 17 || [6.0.0+] GetValueForSleepState
+
| 0x1D || 0xA9 || 0x3400003E || V, 1 || Backlight Enable (LCD_BL_EN_PV1) || Out || [[NV services]], [[Backlight services]] || Icosa, Hoag, Iowa
|}
 
 
 
= i2c, i2c:pcv =
 
This is "nn::i2c::IManager".
 
 
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Cmd || Name
+
| 0x1E || 0xAA || 0x34000033 || V, 2 || Backlight Reset (LCD_RST_PV2) || Out || [[NV services]] || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| 0 || [[#OpenSessionForDev_2|OpenSessionForDev]]
+
| 0x1F || 0x55 || 0x040000CC || K, 5 || USB-PD Controller (RHOM BM92T30MWV) VCONN Power (PD_VCONN_EN) || Out || [[PTM services]], [[USB services]] || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| 1 || [[#OpenSession_2|OpenSession]]
+
| 0x20 || 0xAD || 0x040000CA || V, 5 || USB-PD Controller (RHOM BM92T30MWV) Reset (PD_RST) || Out || [[USB services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| [1.0.0-5.1.0] 2 || [[#HasDevice|HasDevice]]
+
| 0x21 || 0xC8 || 0x39000002 || Z, 0 || Charger IC (BQ24193) IRQ (BQ24193_IRQ) || In || [[PTM services]], [[AM services]] || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| [1.0.0-5.1.0] 3 || [[#HasDeviceForDev|HasDeviceForDev]]
+
| 0x22 || 0xCA || 0xCA000401 || Z, 2 || SDEV Coax Select (SDEV_COAX_SEL_0) || In || || Icosa, Iowa
 
|-
 
|-
| 4 || [6.0.0+] [[#OpenSession2_2|OpenSession2]]
+
| 0x23 || 0xCB || 0x3C000003 || Z, 3 || SDCard Write Protect (SD_WP) || In || || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
|}
 
 
 
== Known Devices ==
 
{| class="wikitable sortable" border="1"
 
 
|-
 
|-
! Name || DeviceCode || Port:Addr || Is10bit || Speed || Max Retries || Retry Delay || Usage || Used by
+
| 0x24 || 0x4F || 0x35000035 || J, 7 || TouchPanel Reset (TP_RST) || Out || [[HID services]] || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| 0 || 0x350000C9 || 0:52 || N || 100000 || 0 ||       0 || DebugPadDriver || [[HID services]], [[PCV services]]
+
| 0x25 || 0x50 || 0x37000401 || K, 0 || BT_GPIO_2 || In || || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 1 || 0x35000033 || 2:49 || N || 400000 || 0 ||       0 || TouchPanel || [[HID services]], [[PCV services]]
+
| 0x26 || 0x51 || 0x37000402 || K, 1 || BT_GPIO_3 || In || || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 2 || 0x3E000001 || 0:4c || N || 100000 || 0 ||       0 || Temperature Sensor (TMP451 or NCT72) || [[PTM services]], [[PCV services]]
+
| 0x27 || 0x52 || 0x37000403 || K, 2 || BT_GPIO_4 || In || || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 3 || 0x3E000001 || 0:4c || N || 100000 || 0 ||      0 || Temperature Sensor (TMP451 or NCT72) (duplicate) || [[PTM services]], [[PCV services]]
+
| 0x28 || 0x54 || 0x040000CB || K, 4 || USB-PD Controller (RHOM BM92T30MWV) IRQ (PD_IRQ) || In || [[USB services]], [[AM services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 4 || 0x33000001 || 0:1c || N || 100000 || 0 ||       0 || Audio Codec (ALC5639) || [[Audio services]], [[Fatal services]], [[PCV services]]
+
| 0x29 || 0x56 || 0x3E000003 || K, 6 || POW_VCPU_INT || In || || Icosa, Copper, Unknown
 
|-
 
|-
| 5 || 0x3B000001 || 4:68 || N || 400000 || 3 || 5000000 || PMIC RTC (max77620_rtc0), max77620_irq0 || [[PCV services]]
+
| 0x2A || 0x57 || 0x3E000004 || K, 7 || MAX77621_GPU_INT || In || || Icosa, Copper
 
|-
 
|-
| 6 || 0x3A000001 || 4:3c || N || 400000 || 3 || 5000000 || PMIC (MAX77620), max77620_irq0 || [[PCV services]]
+
| 0x2B || 0x53 || 0x35000402 || K, 3 || Joy-Con(R) Charge (EXTCON_CHG_U) || Out || [[HID services]] || Icosa, Iowa, Unknown
 
|-
 
|-
| 7 || 0x3A000003 || 4:1b || N || 400000 || 3 || 5000000 || Sub-PMIC for CPU (max77621_cpu) || [[PCV services]]
+
| 0x2C || 0xE3 || 0x3500040C || CC, 3 || Joy-Con(L) Charge (EXTCON_CHG_S) || Out || [[HID services]] || Icosa, Iowa, Unknown
 
|-
 
|-
| 8 || 0x3A000004 || 4:1c || N || 400000 || 3 || 5000000 || Sub-PMIC for GPU (max77621_gpu) || [[PCV services]]
+
| 0x2D || 0x38 || 0x38000003 || H, 0 || WIFI_RF_DISABLE || Out || || Icosa, Copper, Hoag, Iowa, Calcio
 
|-
 
|-
| 9 || 0x39000001 || 0:6b || N || 100000 || 3 || 5000000 || Charger IC (BQ24193) || [[PTM services]]
+
| 0x2E || 0x39 || 0x38000002 || H, 1 || WiFi Reset (WIFI_RST_PH1) || Out || [[WLAN services]], [[PCIe services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 10 || 0x39000033 || 0:36 || N || 100000 || 3 || 5000000 || Fuel Gauge IC (MAX17050) || [[PTM services]], [[PCV services]]
+
| 0x2F || 0x3B || 0x37000003 || H, 3 || AP_WAKE_BT_PH3 || Out || [[Bluetooth Driver services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 11 || 0x040000C9 || 0:18 || N || 100000 || 3 || 5000000 || USB-PD controller (RHOM BM92T30MWV) || [[USB services]], [[PCV services]]
+
| 0x30 || 0x3D || 0x37000004 || H, 5 || BT_WAKE_AP || In || [[AM services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 12 || 0x3F000401 || 1:40 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VDD15V0-HB) || Factory testing, [[PCV services]]
+
| 0x31 || 0x3F || 0x37000404 || H, 7 || BT_GPIO_5 || Out || || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 13 || 0x3F000001 || 1:41 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VSYS-CPU-DS) || Factory testing, [[PCV services]]
+
| 0x32 || 0x40 || 0x34000034 || I, 0 || Backlight +5V (LCD_VDD_P_EN) || Out || [[NV services]] || Icosa, Hoag, Iowa
 
|-
 
|-
| 14 || 0x3F000002 || 1:44 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VSYS-GPU-DS) || Factory testing, [[PCV services]]
+
| 0x33 || 0x41 || 0x34000035 || I, 1 || Backlight -5V (LCD_VDD_N_EN) || Out || [[NV services]] || Icosa, Hoag, Iowa
 
|-
 
|-
| 15 || 0x3F000003 || 1:45 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VSYS-DDR-DS) || Factory testing, [[PCV services]]
+
| 0x34 || 0x3E || 0x35000401 || H, 6 || Joy-Con(R) IsAttached (insertion, Joy-Con pin 5/console TX, pulled low on insert) (EXTCON_DET_U) || In || [[HID services]], [[AM services]] || Icosa, Iowa, Unknown
 
|-
 
|-
| 16 || 0x3F000402 || 1:46 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VSYS-AP) || Factory testing, [[PCV services]]
+
| 0x35 || 0xE2 || 0xC9000401 || CC, 2 || Secondary Boot Device Configration (RAM_CODE2) || In || || Icosa, Iowa
 
|-
 
|-
| 17 || 0x3F000403 || 1:47 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VSYS-BL-DS) || Factory testing, [[PCV services]]
+
| 0x36 || 0xE4 || 0x39000402 || CC, 4 || Fan and Joy-Con Rails Power (USB 5V) (VDD50B_EN) || Out || [[PTM services]] || Icosa, Iowa
 
|-
 
|-
| 18 || 0x35000047 || 1:29 || N || 400000 || 3 || 5000000 || Ambient Light Sensor (BH1730) || [[Backlight services]], [[PCV services]]
+
| 0x37 || 0x3A || 0x38000004 || H, 2 || WIFI_WAKE_HOST || In || [[AM services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 19 || 0x3F000404 || 1:48 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_CORE) || Factory testing, [[PCV services]]
+
| 0x38 || 0xC9 || 0x3C000002 || Z, 1 || SDCard Card Detect (SD_CD) || In || [[Filesystem services]], [[AM services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 20 || 0x3F000405 || 1:49 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_Soc-1V8) || Factory testing, [[PCV services]]
+
| 0x39 || 0x4D || 0x39000404 || J, 5 || Charger IC (BQ24193) OTG Charge Select (OTG_FET_1) || Out || [[PTM services]], [[USB services]] || Icosa, Iowa
 
|-
 
|-
| 21 || 0x3F000406 || 1:4a || N || 400000 || 3 || 5000000 || Power Monitor (ina226_LPDDR4-1V8) || Factory testing, [[PCV services]]
+
| 0x3A || 0x58 || 0x39000405 || L, 0 || Charger IC (BQ24193) OTG Charge Select (OTG_FET_2) || Out || [[PTM services]], [[USB services]] || Icosa, Iowa
 
|-
 
|-
| 22 || 0x3F000407 || 1:4b || N || 400000 || 3 || 5000000 || Power Monitor (ina226_REG1V32) || Factory testing, [[PCV services]]
+
| 0x3B || 0x3E || 0x35000403 || H, 6 || Joy-Con(R) Wake Detect (EXTCON_DET_U) || In || || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| 23 || 0x3F000408 || 1:4d || N || 400000 || 3 || 5000000 || Power Monitor (ina226_VDD3V3-SYS) || Factory testing, [[PCV services]]
+
| 0x3C || 0x26 || 0x3500040D || E, 6 || Joy-Con(L) Wake Detect (EXTCON_DET_S) || In || || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| [2.0.0+] 24 || 0x34000001 || 3:50 || N || 100000 || 0 ||       0 || HDMI DDC || [[NV services]], [[PCV services]]
+
| 0x3D || -1 || 0x39000406 || || || || ||  
 
|-
 
|-
| [2.0.0+] 25 || 0x34000002 || 3:54 || N || 100000 || 0 ||      0 || HDMI SCDC || [[NV services]], [[PCV services]]
+
| 0x3E || 0x33 || 0x35000404 || G, 3 || Joy-Con(R) CTS (checked low) (EXT_UART2_CTS) || In || [[HID services]], [[AM services]] ||
 
|-
 
|-
| [2.0.0+] 26 || 0x34000003 || 3:3a || N || 100000 || 0 ||      0 || HDMI HDCP || [[NV services]], [[PCV services]]
+
| 0x3F || 0x1C || 0x3500040E || D, 4 || Joy-Con(L) CTS (checked low) (EXT_UART3_CTS) || In || [[HID services]], [[AM services]] ||
 
|-
 
|-
| [4.0.0+] 27 || 0x3A000005 || 4:a4 || N || 400000 || 0 ||       0 || Fan (Fan53528) || [[PCV services]]
+
| 0x40 || 0xD9 || 0x39000408 || BB, 1 || 5V Step-Down Regulator Power (5V_STEPDOWN_EN) || Out || || Copper
 
|-
 
|-
| [4.0.0+] 28 || 0x3A000002 || 4:31 || N || 400000 || 0 ||      0 || PMIC (Max77812) || [[PCV services]]
+
| 0x41 || 0x0C || 0x04000401 || B, 4 || USB Root Port 2 Over Current (USB_B2_OC) || In || [[USB services]] || Copper
 
|-
 
|-
| [4.0.0+] 29 || 0x3A000002 || 4:33 || N || 400000 || 0 ||       0 || PMIC (Max77812) || [[PCV services]]
+
| 0x42 || 0x0D || 0x39000409 || B, 5 || 5V Step-Down Regulator Power Good Flag (5V_STEPDOWN_PG) || In || || Copper
 
|-
 
|-
| [4.0.0+] 30 || 0x3F000409 || 1:4e || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VDD-DDR-0V6) || Factory testing, [[PCV services]]  
+
| 0x43 || 0x21 || 0x04000402 || E, 1 || USB Power (USB_A_EN) || Out || [[USB services]] || Copper
 
|-
 
|-
| [8.0.0+] 31 || 0x36000001 || 1:08 || N || 400000 || 3 || 5000000 || || [[PCV services]]
+
| 0x44 || 0x27 || 0x04000403 || E, 7 || USB Power Flag (USB_A_FLAG) || In || [[USB services]] || Copper
|}
 
 
 
== OpenSessionForDev ==
 
Takes an u32 '''port''', an u16 '''addr''', an '''AddressingMode''' (1 for 10-bit, 0 otherwise) and a '''SpeedMode''' (400000 or 100000). Returns a [[#II2cSession]] session.
 
 
 
== OpenSession ==
 
Takes an '''I2cDevice''' and returns a [[#II2cSession]] session for it.
 
 
 
== HasDevice ==
 
Takes an '''I2cDevice''' and returns true if the device exists or false otherwise.
 
 
 
== HasDeviceForDev ==
 
Takes an u32 '''port''', an u16 '''addr''', an '''AddressingMode''' (1 for 10-bit, 0 otherwise) and a '''SpeedMode''' (400000 or 100000). Returns true if the device exists or false otherwise.
 
 
 
== OpenSession2 ==
 
Same as [[#OpenSession_2|OpenSession]] but takes a '''DeviceCode''' instead of a '''I2cDevice'''.
 
 
 
== II2cSession ==
 
This is "nn::i2c::ISession".
 
 
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Cmd || Name
+
| 0x45 || 0x92 || 0x04000404 || S, 2 || USB Root Port 3 Over Current (USB_B3_OC) || In || [[USB services]] || Copper
 
|-
 
|-
| [1.0.0-5.1.0] 0 || Send
+
| 0x46 || 0x95 || 0x04000405 || S, 5 || USB Root Port 3 Power (USB_B3_EN) || Out || [[USB services]] || Copper
 
|-
 
|-
| [1.0.0-5.1.0] 1 || Receive
+
| 0x47 || 0x98 || 0x04000406 || T, 0 || USB Root Port 2 Power (USB_B2_EN) || Out || [[USB services]] || Copper
 
|-
 
|-
| [1.0.0-5.1.0] 2 || ExecuteCommandList
+
| 0x48 || 0x10 || 0x34000004 || C, 0 || HDMI 5V (HDMI_5V_EN) || Out || [[NV services]] || Copper, Calcio
 
|-
 
|-
| 10 || [[#SendAuto]]
+
| 0x49 || 0x11 || 0x04000407 || C, 1 || USB Root Port 1 Power (USB_B1_EN) || Out || [[USB services]] || Copper, Calcio
 
|-
 
|-
| 11 || ReceiveAuto
+
| 0x4A || 0x12 || 0x34000005 || C, 2 || HDMI/Power Delivery Switch (HDMI_PD_TR_EN) || Out || [[NV services]] || Copper, Calcio
 
|-
 
|-
| 12 || [[#ExecuteCommandListAuto]]
+
| 0x4B || 0x42 || 0x3D000003 || I, 2 || Fan Enable (FAN_EN) || Out || [[PTM services]] || Copper
 
|-
 
|-
| 13 || [6.0.0+]
+
| 0x4C || 0xE6 || 0x04000408 || CC, 6 || USB Root Port 1 Over Current (USB_B1_OC) || In || [[USB services]] || Copper, Calcio
|}
 
 
 
== SendAuto ==
 
Takes bytes to write in either a static buffer or a receive buffer, returns an error code for success
 
 
 
== ExecuteCommandListAuto ==
 
Takes a command list from either a static buffer or a receive buffer, returns data in either a static (or recieve?) buffer.
 
 
 
=== Commands ===
 
* 0x40 [u8 len] <bytes> - Write bytes to device
 
* 0xC1 [u8 len] - Receive bytes from device
 
 
 
= uart =
 
This is "nn::uart::IManager".
 
 
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Cmd || Name
+
| [2.0.0+] 0x4D || 0xAC || 0x3D000001 || V, 4 || Pulse-Width Modulation Fan Control (PWM_FAN) || Out || [[PTM services]] || Copper
 
|-
 
|-
| 0 || [[#DoesUartExist]]
+
| [2.0.0+] 0x4E || 0xE1 || 0x34000006 || CC, 1 || HDMI Hot Plug Detect (HDMI_INT_DP_HPD_PCC1) || In || [[NV services]] || Copper, Calcio
 
|-
 
|-
| 1 || DoesUartExistForTest
+
| [5.0.0+] 0x4F || 0x56 || 0x3E000003 || K, 6 || MAX77812_IRQ || In || || Hoag, Iowa, Calcio
 
|-
 
|-
| 2 || [[#IsUartBaudrateValid]]
+
| [6.0.0+] 0x50 || 0x20 || 0xCA000001 || E, 0 || || Out || || Hoag, Calcio, Unknown
 
|-
 
|-
| 3 || IsUartBaudrateValidForTest
+
| [6.0.0+] 0x51 || 0x21 || 0xCA000002 || E, 1 || || Out || || Hoag, Calcio, Unknown
 
|-
 
|-
| 4 || [[#IsSomethingUartValid]]
+
| [6.0.0+] 0x52 || 0x22 || 0xCA000003 || E, 2 || || Out || || Hoag, Calcio, Unknown
 
|-
 
|-
| 5 || IsSomethingUartValidForTest
+
| [6.0.0+] 0x53 || 0x23 || 0xCA000004 || E, 3 || || Out || || Hoag, Calcio, Unknown
 
|-
 
|-
| 6 || [[#GetSession]]
+
| [6.0.0+] 0x54 || 0x4C || 0x36000004 || J, 4 || NFC_IRQ || In || [[NFC services]] || Hoag
 
|-
 
|-
| 7 || IsSomethingUartValid2
+
| [6.0.0+] 0x55 || 0x57 || 0x36000003 || K, 7 || NFC_RST || Out || [[NFC services]] || Hoag
 
|-
 
|-
| 8 || IsSomethingUartValid2ForTest
+
| [6.0.0+] 0x56 || 0x27 ([6.0.0-8.0.0] 0x94) || 0x35000415 || S, 4 || MCU_IRQ || In || || Hoag
 
|-
 
|-
| 9 || [7.0.0+] IsSomethingUartValid3
+
| [6.0.0+] 0x57 || 0x98 || 0x35000416 || T, 0 || MCU_BOOT || Out || [[HID services]] || Hoag
 
|-
 
|-
| 10 || [7.0.0+] IsSomethingUartValid3ForTest
+
| [6.0.0+] 0x58 || 0x99 || 0x35000417 || T, 1 || MCU_RST || Out || [[HID services]] || Hoag
|}
 
 
 
== DoesUartExist ==
 
Takes a u32 [[#UartPort]] and returns boolean success value
 
 
 
== IsUartBaudrateValid ==
 
Takes a u32 [[#UartPort]] and a u32 baudrate and returns boolean success value
 
 
 
== IsSomethingUartValid ==
 
Takes a u32 [[#UartPort]] and returns boolean success value
 
 
 
== GetSession ==
 
Takes a u32 [[#UartPort]] and returns an [[#IPortSession]]
 
 
 
== UartPort ==
 
{| class="wikitable sortable" border="1"
 
 
|-
 
|-
! Name || Port || Usage
+
| [6.0.0+] 0x59 || 0xBB || 0x39000403 || X, 3 || Fan Power (5V3) (VDD5V3_EN) || Out || [[PTM services]] || Hoag, Iowa, Unknown
 
|-
 
|-
| 1 || UART-D || Bluetooth
+
| [6.0.0+] 0x5A || 0xE5 || 0x35000418 || CC, 5 || MCU_POR || Out || [[HID services]] || Hoag
 
|-
 
|-
| 2 || UART-B || Joy-Con(R)
+
| [6.0.0+] 0x5B || 0xAB || 0x35000005 || V, 3 || SioH Input (LCD_GPIO1_PV3)|| In || [[HID services]], [[AM services]] || Hoag
 
|-
 
|-
| 3 || UART-C || Joy-Con(L)
+
| [6.0.0+] 0x5C || 0x4E || 0x36000002 || J, 6 || NFC_EN || Out || [[NFC services]] || Hoag
|}
 
 
 
== IPortSession ==
 
This is "nn::uart::IPortSession".
 
 
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Cmd || Name
+
| [7.0.0+] - || 0x32 || 0x35000406 || G, 2 || Joy-Con(R) RTS (EXT_UART2_RTS) || In || ||  
 
|-
 
|-
| 0 || OpenSession
+
| [7.0.0+] - || 0x1B || 0x35000410 || D, 3 || Joy-Con(L) RTS (EXT_UART3_RTS) || In || ||  
 
|-
 
|-
| 1 || OpenSessionForTest
+
| [7.0.0+] - || 0x17 || 0x3500041B || C, 7 || || In || || Hoag
 
|-
 
|-
| 2 ||
+
| [7.0.0+] - || 0x18 || 0x3500041C || D, 0 || || In || || Hoag
 
|-
 
|-
| 3 ||
+
| [7.0.0+] - || 0x15 || 0x3500041D || C, 5 || || In || || Hoag
 
|-
 
|-
| 4 ||
+
| [7.0.0+] - || 0x16 || 0x3500041E || C, 6 || || In || || Hoag
 
|-
 
|-
| 5 ||
+
| [10.0.0+] - || 0xC5 || 0x35000065 || Y, 5 || || Out || || Hoag
 
|-
 
|-
| 6 ||
+
| [10.0.0+] - || 0x29 || 0x04000409 || F, 1 || || Out || || Calcio
 
|-
 
|-
| 7 ||
+
| [10.0.0+] - || 0x38 || 0x34000401 || H, 0 || || In || || Unknown
 
|}
 
|}
  
[7.0.0+] OpenSession/OpenSessionForTest now takes an additional 0x8-bytes of input.
+
= GpioPadDescriptor =
 
 
=== Port Mapping ===
 
OpenSession translates user IDs to to the [[#UartPort]] index.
 
 
 
OpenSessionForTest takes the port index verbatim.
 
 
 
= pwm =
 
This is "nn::pwm::IManager".
 
 
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Bits || Description
 
|-
 
|-
| 0 || OpenSessionForDev
+
| 7-5 || Controller index
 
|-
 
|-
| 1 || OpenSession
+
| 4-3 || Port index
 
|-
 
|-
| 2 || [6.0.0+]
+
| 2-0 || Pin number
 
|}
 
|}
  
== Known Channels ==
+
= I2cDevice =
 +
This is "nn::i2c::I2cDevice".
 +
 
 
{| class="wikitable sortable" border="1"
 
{| class="wikitable sortable" border="1"
 
|-
 
|-
! Name || Interface || Usage || Used by
+
! Name || DeviceCode || Port:Addr || Is10bit || Speed || Max Retries || Retry Delay || Usage || Used by (services) || Used by (hardware)
 
|-
 
|-
| 1 || PWM Channel 1 || Fan || [[PTM services]]
+
| 0 || 0x350000C9 || 0:52 || N || 100000 || 0 ||      0 || DebugPadDriver || [[HID services]] || Icosa, Iowa, Unknown
 
|-
 
|-
| 2 || PWM Channel 0 || Backlight || [[Backlight services]], [[NV services]]
+
|  1 || 0x35000033 || 2:49 || N || 400000 || 0 ||       0 || TouchPanel || [[HID services]] || Icosa, Hoag, Iowa, Unknown
 
|-
 
|-
| 3 || PMC Blinker || ||
+
| 2 || 0x3E000001 || 0:4C || N || 100000 || 0 ||      0 || Temperature Sensor (TMP451 or NCT72) || [[PTM services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
|}
+
|-
 
+
3 || 0x3E000001 || 0:4C || N || 100000 || 0 ||      0 || Temperature Sensor (TMP451 or NCT72) (duplicate) || [[PTM services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
== IChannelSession ==
+
|-
This is "nn::pwm::IChannelSession".
+
|  4 || 0x33000001 || 0:1C || N || 100000 || 0 ||      0 || Audio Codec (ALC5639) || [[Audio services]], [[Fatal services]] || Icosa, Hoag, Iowa, Unknown
 
+
|-
{| class="wikitable" border="1"
+
|  5 || 0x3B000001 || 4:68 || N || 400000 || 3 || 5000000 || PMIC RTC (max77620_rtc0), max77620_irq0 || [[PCV services]] || Icosa, Copper
 +
|-
 +
|  6 || 0x3A000001 || 4:3C || N || 400000 || 3 || 5000000 || PMIC (MAX77620), max77620_irq0 || [[PCV services]] || Icosa, Copper
 +
|-
 +
|  7 || 0x3A000003 || 4:1B || N || 400000 || 3 || 5000000 || Sub-PMIC for CPU (max77621_cpu) || [[PCV services]] || Icosa, Copper
 +
|-
 +
|  8 || 0x3A000004 || 4:1C || N || 400000 || 3 || 5000000 || Sub-PMIC for GPU (max77621_gpu) || [[PCV services]] || Icosa, Copper
 +
|-
 +
|  9 || 0x39000001 || 0:6B || N || 100000 || 3 || 5000000 || Charger IC (BQ24193) || [[PTM services]] || Icosa, Hoag, Iowa, Unknown
 +
|-
 +
| 10 || 0x39000033 || 0:36 || N || 100000 || 3 || 5000000 || Fuel Gauge IC (MAX17050) || [[PTM services]], [[PCV services]] || Icosa, Hoag, Iowa, Unknown
 +
|-
 +
| 11 || 0x040000C9 || 0:18 || N || 100000 || 3 || 5000000 || USB-PD controller (RHOM BM92T30MWV) || [[USB services]] || Icosa, Copper, Hoag, Iowa, Calcio, Unknown
 +
|-
 +
| 12 || 0x3F000401 || 1:40 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VDD15V0-HB) || nvdbgsvc || Factory
 +
|-
 +
| 13 || 0x3F000001 || 1:41 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VSYS-CPU-DS or SdevMariko_ina226_VDD_CPU_AP) || nvdbgsvc || Factory
 +
|-
 +
| 14 || 0x3F000002 || 1:44 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VSYS-GPU-DS or SdevMariko_ina226_VDD_GPU_AP) || nvdbgsvc || Factory
 +
|-
 +
| 15 || 0x3F000003 || 1:45 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VSYS-DDR-DS or SdevMariko_ina226_V_VDD-DDR_1V1-PMIC) || nvdbgsvc || Factory
 +
|-
 +
| 16 || 0x3F000402 || 1:46 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VSYS-AP) || nvdbgsvc || Factory
 +
|-
 +
| 17 || 0x3F000403 || 1:47 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VSYS-BL-DS) || nvdbgsvc || Factory
 +
|-
 +
| 18 || 0x35000047 || 1:29 || N || 400000 || 3 || 5000000 || Ambient Light Sensor (BH1730) || [[Backlight services]] || Icosa, Hoag, Iowa, Unknown
 +
|-
 +
| 19 || 0x3F000404 || 1:48 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_SYS-CORE or SdevMariko_ina226_V_VDD-CORE-AP) || nvdbgsvc || Factory
 +
|-
 +
| 20 || 0x3F000405 || 1:49 || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_SOC-1V8 or SdevMariko_ina226_V_VDD_SOC-1V8) || nvdbgsvc || Factory
 +
|-
 +
| 21 || 0x3F000406 || 1:4A || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_LPDDR-1V8 or SdevMariko_ina226_V_VDD_1V8) || nvdbgsvc || Factory
 +
|-
 +
| 22 || 0x3F000407 || 1:4B || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_REG-1V32) || nvdbgsvc || Factory
 
|-
 
|-
! Cmd || Name
+
| 23 || 0x3F000408 || 1:4D || N || 400000 || 3 || 5000000 || Power Monitor (ina226_V_VDD-3V3-SYS) || nvdbgsvc || Factory
 
|-
 
|-
| 0 || SetPeriod
+
| [2.0.0+] 24 || 0x34000001 || 3:50 || N || 100000 || 0 ||      0 || HDMI DDC || [[NV services]] || Copper, Calcio
 
|-
 
|-
| 1 || GetPeriod
+
| [2.0.0+] 25 || 0x34000002 || 3:54 || N || 100000 || 0 ||      0 || HDMI SCDC || [[NV services]] || Copper, Calcio
 
|-
 
|-
| 2 || SetDuty
+
| [2.0.0+] 26 || 0x34000003 || 3:3A || N || 100000 || 0 ||      0 || HDMI HDCP || [[NV services]] || Copper, Calcio
 
|-
 
|-
| 3 || GetDuty
+
| [4.0.0+] 27 || 0x3A000005 || 4:52 ([4.0.0-8.0.0] 4:A4) || N || 400000 || 0 ||      0 || Buck Regulator (FAN53528) || || Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 4 || SetEnabled
+
| [4.0.0+] 28 || 0x3A000002 || 4:31 ([8.0.0-9.2.0] 4:33, [4.0.0-8.0.0] 4:31) || N || 400000 || 0 ||      0 || PMIC (MAX77812) || [[PCV services]] || Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 5 || GetEnabled
+
| [4.0.0+] 29 || 0x3A000006 ([4.0.0-9.2.0] 0x3A000002) || 4:33 ([4.0.0-8.0.0] 4:31) || N || 400000 || 0 ||      0 || PMIC (MAX77812) || [[PCV services]] || Hoag, Iowa, Calcio, Unknown
 
|-
 
|-
| 6 || [6.0.0+]
+
| [4.0.0+] 30 || 0x3F000409 || 1:4E || N || 400000 || 3 || 5000000 || Power Monitor (SdevMariko_ina226_V_VDD_DDR_0V6) || nvdbgsvc || Factory
 
|-
 
|-
| 7 || [6.0.0+]
+
| [8.0.0+] 31 || 0x36000001 || 1:08 || N || 400000 || 3 || 5000000 || NFC IC || [[NFC services]] || Hoag
 
|}
 
|}
  
= pinmux =
+
= UartPort =
This is "nn::pinmux::IManager".
+
{| class="wikitable sortable" border="1"
 +
|-
 +
! Name || DeviceCode (internal) || DeviceCode (mapped) || Port || Usage
 +
|-
 +
| 0 || 0x03000001 || || UART-A || Invalid
 +
|-
 +
| 1 || 0x03000004 || 0x37000001 || UART-D || Bluetooth
 +
|-
 +
| 2 || 0x03000002 || 0x35000405 || UART-B || Joy-Con(R)
 +
|-
 +
| 3 || 0x03000003 || 0x3500040F || UART-C || Joy-Con(L)
 +
|-
 +
| 4 || 0x03000003 || 0x35000419 || UART-C || MCU
 +
|}
  
{| class="wikitable" border="1"
+
= UartPortForDev =
 +
{| class="wikitable sortable" border="1"
 +
|-
 +
! Name || DeviceCode (internal) || DeviceCode (mapped) || Port || Usage
 +
|-
 +
| 0 || 0x03000001 || || UART-A || Invalid
 +
|-
 +
| 1 || 0x03000002 || 0x35000405 || UART-B || Joy-Con(R)
 
|-
 
|-
! Cmd || Name
+
| 2 || 0x03000003 || 0x3500040F || UART-C || Joy-Con(L)
 
|-
 
|-
| 0 || OpenSession
+
| 3 || 0x03000004 || 0x37000001 || UART-D || Bluetooth
 
|}
 
|}
  
== ISession ==
+
= ChannelName =
This is "nn::pinmux::ISession".
+
This is "nn::pwm::ChannelName".
  
{| class="wikitable" border="1"
+
{| class="wikitable sortable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Name || DeviceCode || Interface || Usage || Used by
 
|-
 
|-
| 0 || SetPinAssignment
+
| 1 || 0x3D000001 || PWM Channel 1 || Fan || [[PTM_services#fan|PTM services]]
 
|-
 
|-
| 1 || GetPinAssignment
+
| 2 || 0x3400003D || PWM Channel 0 || Backlight || [[Backlight services]], [[NV services]]
 
|-
 
|-
| 2 || SetPinAssignmentForHardwareTest
+
| 3 || 0x35000065 || PMC LED Soft Blink || Led || [[Bus services#led|Bus services]]
 
|}
 
|}
  
= sasbus =
+
= AssignablePinGroupName =
This is "nn::sasbus::IManager".
+
This is "nn::pinmux::AssignablePinGroupName".
  
{| class="wikitable" border="1"
+
{| class="wikitable sortable" border="1"
 +
|-
 +
! Name || Usage
 +
|-
 +
| 0 || GPIO(G, 0) and GPIO(G, 3)
 +
|-
 +
| 1 || GPIO(D, 1) and GPIO(D, 4)
 +
|-
 +
| 2 || Sdmmc1Clk or GPIO(M, 0), GPIO(M, 1), GPIO(M, 2), GPIO(M, 3), GPIO(M, 4) and GPIO(M, 5)
 
|-
 
|-
! Cmd || Name
+
| 3 || GPIO(V, 4)
 
|-
 
|-
| 0 || OpenSession
+
| 100 || Invalid
 
|}
 
|}
  
== ISession ==
+
= AssignablePinGroupNameForHardwareTest =
This is "nn::sasbus::ISession".
+
This is "nn::pinmux::AssignablePinGroupNameForHardwareTest".
  
{| class="wikitable" border="1"
+
{| class="wikitable sortable" border="1"
 +
|-
 +
! Name || Usage
 +
|-
 +
| 0 || Invalid
 +
|-
 +
| 1 || Invalid
 
|-
 
|-
! Cmd || Name
+
| 2 || Invalid
 
|-
 
|-
| 0 ||  
+
| 3 || Invalid
 
|-
 
|-
| 1 ||  
+
| 100 || Uart4Tx, Uart4Rx, Uart4Rts and Uart4Cts
 +
|}
 +
 
 +
= SasbusPort =
 +
{| class="wikitable sortable" border="1"
 
|-
 
|-
| 2 ||  
+
! Name || DeviceCode || Port || Usage
 
|-
 
|-
| 3 ||  
+
| 0 || 0x3500003D || SPI4 || Joy-Con
 
|}
 
|}
  
 
[[Category:Services]]
 
[[Category:Services]]

Revision as of 19:52, 15 April 2020

gpio

This is "nn::gpio::IManager".

Cmd Name
0 #OpenSessionForDev
1 #OpenSession
2 #OpenSessionForTest
3 [1.0.0-6.2.0] #IsWakeEventActive
4 [1.0.0-6.2.0] GetWakeEventActiveFlagSet
5 [1.0.0-6.2.0] SetWakeEventActiveFlagSetForDebug
6 #SetWakePinDebugMode
7 [5.0.0+] #OpenSession2
8 [5.0.0+] #IsWakeEventActive2
9 [5.0.0+] SetWakeEventActiveFlagSetForDebug2
10 [6.0.0+] #SetRetryValues

OpenSessionForDev

Takes a raw #GpioPadDescriptor and returns an #IPadSession.

OpenSession

Same as #OpenSessionForDev except it takes a #GpioPadName which is then converted to a #GpioPadDescriptor. Returns an #IPadSession.

OpenSessionForTest

Same as #OpenSession but panics on failure.

IsWakeEventActive

Takes a #GpioPadName and returns a bool.

SetWakePinDebugMode

Takes an u32 WakePinDebugMode. No output.

OpenSession2

Same as #OpenSession but takes a DeviceCode and an u32.

IsWakeEventActive2

Same as #IsWakeEventActive but takes a DeviceCode.

SetRetryValues

Stubbed. Returns 0.

IPadSession

This is "nn::gpio::IPadSession".

Cmd Name
0 SetDirection
1 GetDirection
2 SetInterruptMode
3 GetInterruptMode
4 SetInterruptEnable
5 GetInterruptEnable
6 GetInterruptStatus
7 ClearInterruptStatus
8 SetValue
9 GetValue
10 BindInterrupt
11 UnbindInterrupt
12 SetDebounceEnabled
13 GetDebounceEnabled
14 SetDebounceTime
15 GetDebounceTime
16 [4.0.0+] SetValueForSleepState
17 [6.0.0+] GetValueForSleepState

i2c, i2c:pcv

This is "nn::i2c::IManager".

Cmd Name
0 OpenSessionForDev
1 OpenSession
2 [1.0.0-5.1.0] HasDevice
3 [1.0.0-5.1.0] HasDeviceForDev
4 [6.0.0+] OpenSession2

OpenSessionForDev

Takes an u32 port, an u16 addr, an AddressingMode (1 for 10-bit, 0 otherwise) and a SpeedMode (400000 or 100000). Returns an #II2cSession.

OpenSession

Takes an #I2cDevice and returns an #II2cSession.

HasDevice

Takes an #I2cDevice and returns true if the device exists or false otherwise.

HasDeviceForDev

Takes an u32 port, an u16 addr, an AddressingMode (1 for 10-bit, 0 otherwise) and a SpeedMode (400000 or 100000). Returns true if the device exists or false otherwise.

OpenSession2

Same as OpenSession but takes a DeviceCode.

II2cSession

This is "nn::i2c::ISession".

Cmd Name
0 [1.0.0-5.1.0] Send
1 [1.0.0-5.1.0] Receive
2 [1.0.0-5.1.0] ExecuteCommandList
10 #SendAuto
11 ReceiveAuto
12 #ExecuteCommandListAuto
13 [6.0.0+] #SetRetryValues

SendAuto

Takes bytes to write in either a static buffer or a receive buffer, returns an error code for success.

ExecuteCommandListAuto

Takes a command list from either a static buffer or a receive buffer, returns data in either a static (or recieve?) buffer.

Commands

  • 0x40 [u8 len] <bytes> - Write bytes to device
  • 0xC1 [u8 len] - Receive bytes from device

SetRetryValues

Takes 2 u32s MaxRetries and RetryDelay. Returns 0.

uart

This is "nn::uart::IManager".

Cmd Name
0 #HasPort
1 #HasPortForDev
2 #IsSupportedBaudRate
3 #IsSupportedBaudRateForDev
4 #IsSupportedFlowControlMode
5 #IsSupportedFlowControlModeForDev
6 #CreatePortSession
7 #IsSupportedPortEvent
8 #IsSupportedPortEventForDev
9 [7.0.0+] #IsSupportedDevice
10 [7.0.0+] #IsSupportedDeviceForDev

HasPort

Takes an #UartPort. Returns a boolean success value.

HasPortForDev

Takes an #UartPortForDev. Returns a boolean success value.

IsSupportedBaudRate

Takes an #UartPort and an u32 BaudRate. Returns a boolean success value.

Supported baud rates are 57600, 115200, 1000000 and 3000000.

IsSupportedBaudRateForDev

Takes an #UartPortForDev and an u32 BaudRate. Returns a boolean success value.

Supported baud rates are 57600, 115200, 1000000 and 3000000.

IsSupportedFlowControlMode

Takes an #UartPort and an u32 FlowControlMode. Returns a boolean success value.

Supported modes are 0 (RTS) and 1 (CTS).

IsSupportedFlowControlModeForDev

Takes an #UartPortForDev and an u32 FlowControlMode. Returns a boolean success value.

Supported modes are 0 (RTS) and 1 (CTS).

CreatePortSession

No input. Returns an #IPortSession.

IsSupportedPortEvent

Takes an #UartPort and an u32 PortEvent. Returns a boolean success value.

Supported events are 0 (data), 1 (break), 2 (unknown) and 3 (unknown).

IsSupportedPortEventForDev

Takes an #UartPortForDev and an u32 PortEvent. Returns a boolean success value.

Supported events are 0 (data), 1 (break), 2 (unknown) and 3 (unknown).

IsSupportedDevice

Takes an #UartPort and an u32 Device. Returns a boolean success value.

Supported devices are 0 (Bluetooth) for UART-D, 0 (Joy-Con(R)) for UART-B, 0 (Joy-Con(L)) and 1 (MCU) for UART-C.

IsSupportedDeviceForDev

Takes an #UartPortForDev and an u32 Device. Returns a boolean success value.

Supported devices are 0 (Bluetooth) for UART-D, 0 (Joy-Con(R)) for UART-B, 0 (Joy-Con(L)) and 1 (MCU) for UART-C.

IPortSession

This is "nn::uart::IPortSession".

Cmd Name
0 #OpenPort
1 #OpenPortForDev
2 GetWritableLength
3 Send
4 GetReadableLength
5 Receive
6 BindPortEvent
7 UnbindPortEvent

OpenPort

Takes an #UartPort, 3 u32s, 2 copy handles and 4 u8s (each padded to u32). Returns a boolean success value.

[7.0.0+] Now takes an additional u64.

OpenPortForDev

Takes an #UartPortForDev, 3 u32s, 2 copy handles and 4 u8s (each padded to u32). Returns a boolean success value.

[7.0.0+] Now takes an additional u64.

pwm

This is "nn::pwm::IManager".

Cmd Name
0 OpenSessionForDev
1 OpenSession
2 [6.0.0+] OpenSession2

OpenSession2

Takes a DeviceCode and returns an #IChannelSession.

IChannelSession

This is "nn::pwm::IChannelSession".

Cmd Name
0 SetPeriod
1 GetPeriod
2 SetDuty
3 GetDuty
4 SetEnabled
5 GetEnabled
6 [6.0.0+] SetScale
7 [6.0.0+] GetScale

pinmux

This is "nn::pinmux::IManager".

Cmd Name
0 OpenSession

OpenSession

Takes an #AssignablePinGroupName or an #AssignablePinGroupNameForHardwareTest and returns an ISession.

ISession

This is "nn::pinmux::ISession".

Cmd Name
0 #SetPinAssignment
1 #GetPinAssignment
2 #SetPinAssignmentForHardwareTest

SetPinAssignment

Takes an u32 PinAssignment. No output.

GetPinAssignment

No input. Returns an u32 PinAssignment.

SetPinAssignmentForHardwareTest

Takes an u32 PinAssignmentForHardwareTest. No output.

sasbus

This is "nn::sasbus::IManager".

This was added with [3.0.0+].

Cmd Name
0 OpenSession

OpenSession

Takes a #SasbusPort and returns an ISession.

ISession

This is "nn::sasbus::ISession".

Cmd Name
0 #Write
1 #Read
2 #StartPeriodicReceiveMode
3 #StopPeriodicReceiveMode

Write

Takes a type-0x21 input buffer and an u8 SpiCommand. No output.

Read

Takes a type-0x22 output buffer and an u8 SpiCommand. No output.

StartPeriodicReceiveMode

Takes an u8 SpiCommand (padded to u32), an u32, two u64s and a copy handle. No output.

StopPeriodicReceiveMode

No input/output.

led

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

This was added with [8.1.1+].

Cmd Name
0 #OpenController

OpenController

Takes a DeviceCode (which must be 0x35000065) and returns an #IController session for it.

IController

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

This was added with [8.1.1+].

Cmd Name
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 [8.1.1-9.2.0]

GpioPadName

This is "nn::gpio::GpioPadName".

Name GpioPadDescriptor DeviceCode Tegra (port, pin) Usage Direction Used by (services) Used by (hardware)
0x01 0xCC 0x33000002 Z, 4 Audio Codec (ALC5639) Power (CODEC_LDO_EN_TEMP) Out Audio services, Fatal services Icosa, Hoag, Iowa, Unknown
0x02 0x24 0x3C000001 E, 4 SDCard Power (POW_SD_EN) Out PCV services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x03 0x3C 0x37000002 H, 4 Bluetooth Reset (BT_RST_PH4) Out Bluetooth Driver services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x04 0xDA 0xC9000402 BB, 2 Secondary Boot Device Configration (RAM_CODE3) In Icosa, Iowa
0x05 0xDB 0x3C000402 BB, 3 Gamecard Reset (GC_RST) Out Filesystem services Icosa, Copper, Hoag, Iowa, Unknown
0x06 0xDC 0x33000003 BB, 4 Audio Codec (ALC5639) Alert (CODEC_ALERT) In Audio services Icosa, Hoag, Iowa, Unknown
0x07 0x25 0x3C000401 E, 5 Gamecard Power (POW_GC) Out Icosa, Copper
0x08 0x90 0x350000CA S, 0 Debug Pad Detect (DEBUG_CONTROLLER_DET) In HID services Icosa, Iowa
0x09 0x91 0x39000407 S, 1 Battery Charge Status (BATT_CHG_STATUS) In Icosa, Hoag, Iowa, Unknown
0x0A 0x96 0x39000003 S, 6 Charger IC (BQ24193) Charge Enable (BATT_CHG_ENABLE_N) Out PTM services Icosa, Hoag, Iowa, Unknown
0x0B 0x97 0x3D000002 S, 7 Fan Tachometer (FAN_TACH) In Icosa, Hoag, Iowa, Calcio, Unknown
0x0C 0x26 0x3500040B E, 6 Joy-Con(L) IsAttached (insertion, Joy-Con pin 5/console TX, pulled low on insert) (EXTCON_DET_S) In HID services, AM services Icosa, Iowa, Unknown
0x0D 0x05 0x39000401 A, 5 Fan and Joy-Con Rails Power (Battery - BQ24193 5V) (VDD50A_EN) Out PTM services Icosa, Hoag, Iowa, Unknown
0x0E 0x78 0xCA000402 P, 0 SDEV Coax Select (SDEV_COAX_SEL_1) In Icosa, Iowa
0x0F 0x93 0x3C000403 S, 3 Gamecard Card Detect (GC_CD) In Filesystem services, AM services Icosa, Copper, Hoag, Iowa, Unknown
0x10 0x7D 0xC900040B P, 5 PROD_TYPE_0 In Icosa, Copper, Iowa
0x11 0x7C 0xC900040C P, 4 PROD_TYPE_1 In Icosa, Copper, Iowa
0x12 0x7B 0xC900040D P, 3 PROD_TYPE_2 In Icosa, Copper, Iowa
0x13 0x7A 0xC900040E P, 2 PROD_TYPE_3 In Icosa, Copper, Iowa
0x14 0xBC 0x3E000002 X, 4 Temperature Sensor (TEMP_ALERT) In Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x15 0xAE 0x33000004 V, 6 Audio Codec (ALC5639) Headphone Detect (CODEC_HP_DET_IRQ) In Audio services Icosa, Hoag, Iowa, Unknown
0x16 0xBA 0x35000041 X, 2 MOTION_INT_PX2 In Icosa, Hoag, Iowa, Unknown
0x17 0xB9 0x35000036 X, 1 TouchPanel IRQ (TP_IRQ) In HID services Icosa, Hoag, Iowa, Unknown
0x18 0xBD 0x35000001 X, 5 Power Button (BUTTON_POWER_ON_PX5) In Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x19 0xBE 0x35000002 X, 6 Volume Up (BUTTON_VOL_UP_PX6) In Boot2, Audio services, Fatal services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x1A 0xBF 0x35000003 X, 7 Volume Down (BUTTON_VOL_DOWN_PX7) In Boot2, Audio services Icosa, Copper, Hoag, Iowa, Calcio , Unknown
0x1B 0xC0 0x39000034 Y, 0 Fuel Gauge IC (MAX17050) IRQ (BATT_MGIC_IRQ) In PTM services, AM services Icosa, Hoag, Iowa, Unknown
0x1C 0xC1 0x35000004 Y, 1 Recovery Mode Key (BUTTON_HOME_PY1) In Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x1D 0xA9 0x3400003E V, 1 Backlight Enable (LCD_BL_EN_PV1) Out NV services, Backlight services Icosa, Hoag, Iowa
0x1E 0xAA 0x34000033 V, 2 Backlight Reset (LCD_RST_PV2) Out NV services Icosa, Hoag, Iowa, Unknown
0x1F 0x55 0x040000CC K, 5 USB-PD Controller (RHOM BM92T30MWV) VCONN Power (PD_VCONN_EN) Out PTM services, USB services Icosa, Hoag, Iowa, Unknown
0x20 0xAD 0x040000CA V, 5 USB-PD Controller (RHOM BM92T30MWV) Reset (PD_RST) Out USB services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x21 0xC8 0x39000002 Z, 0 Charger IC (BQ24193) IRQ (BQ24193_IRQ) In PTM services, AM services Icosa, Hoag, Iowa, Unknown
0x22 0xCA 0xCA000401 Z, 2 SDEV Coax Select (SDEV_COAX_SEL_0) In Icosa, Iowa
0x23 0xCB 0x3C000003 Z, 3 SDCard Write Protect (SD_WP) In Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x24 0x4F 0x35000035 J, 7 TouchPanel Reset (TP_RST) Out HID services Icosa, Hoag, Iowa, Unknown
0x25 0x50 0x37000401 K, 0 BT_GPIO_2 In Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x26 0x51 0x37000402 K, 1 BT_GPIO_3 In Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x27 0x52 0x37000403 K, 2 BT_GPIO_4 In Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x28 0x54 0x040000CB K, 4 USB-PD Controller (RHOM BM92T30MWV) IRQ (PD_IRQ) In USB services, AM services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x29 0x56 0x3E000003 K, 6 POW_VCPU_INT In Icosa, Copper, Unknown
0x2A 0x57 0x3E000004 K, 7 MAX77621_GPU_INT In Icosa, Copper
0x2B 0x53 0x35000402 K, 3 Joy-Con(R) Charge (EXTCON_CHG_U) Out HID services Icosa, Iowa, Unknown
0x2C 0xE3 0x3500040C CC, 3 Joy-Con(L) Charge (EXTCON_CHG_S) Out HID services Icosa, Iowa, Unknown
0x2D 0x38 0x38000003 H, 0 WIFI_RF_DISABLE Out Icosa, Copper, Hoag, Iowa, Calcio
0x2E 0x39 0x38000002 H, 1 WiFi Reset (WIFI_RST_PH1) Out WLAN services, PCIe services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x2F 0x3B 0x37000003 H, 3 AP_WAKE_BT_PH3 Out Bluetooth Driver services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x30 0x3D 0x37000004 H, 5 BT_WAKE_AP In AM services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x31 0x3F 0x37000404 H, 7 BT_GPIO_5 Out Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x32 0x40 0x34000034 I, 0 Backlight +5V (LCD_VDD_P_EN) Out NV services Icosa, Hoag, Iowa
0x33 0x41 0x34000035 I, 1 Backlight -5V (LCD_VDD_N_EN) Out NV services Icosa, Hoag, Iowa
0x34 0x3E 0x35000401 H, 6 Joy-Con(R) IsAttached (insertion, Joy-Con pin 5/console TX, pulled low on insert) (EXTCON_DET_U) In HID services, AM services Icosa, Iowa, Unknown
0x35 0xE2 0xC9000401 CC, 2 Secondary Boot Device Configration (RAM_CODE2) In Icosa, Iowa
0x36 0xE4 0x39000402 CC, 4 Fan and Joy-Con Rails Power (USB 5V) (VDD50B_EN) Out PTM services Icosa, Iowa
0x37 0x3A 0x38000004 H, 2 WIFI_WAKE_HOST In AM services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x38 0xC9 0x3C000002 Z, 1 SDCard Card Detect (SD_CD) In Filesystem services, AM services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
0x39 0x4D 0x39000404 J, 5 Charger IC (BQ24193) OTG Charge Select (OTG_FET_1) Out PTM services, USB services Icosa, Iowa
0x3A 0x58 0x39000405 L, 0 Charger IC (BQ24193) OTG Charge Select (OTG_FET_2) Out PTM services, USB services Icosa, Iowa
0x3B 0x3E 0x35000403 H, 6 Joy-Con(R) Wake Detect (EXTCON_DET_U) In Icosa, Hoag, Iowa, Unknown
0x3C 0x26 0x3500040D E, 6 Joy-Con(L) Wake Detect (EXTCON_DET_S) In Icosa, Hoag, Iowa, Unknown
0x3D -1 0x39000406
0x3E 0x33 0x35000404 G, 3 Joy-Con(R) CTS (checked low) (EXT_UART2_CTS) In HID services, AM services
0x3F 0x1C 0x3500040E D, 4 Joy-Con(L) CTS (checked low) (EXT_UART3_CTS) In HID services, AM services
0x40 0xD9 0x39000408 BB, 1 5V Step-Down Regulator Power (5V_STEPDOWN_EN) Out Copper
0x41 0x0C 0x04000401 B, 4 USB Root Port 2 Over Current (USB_B2_OC) In USB services Copper
0x42 0x0D 0x39000409 B, 5 5V Step-Down Regulator Power Good Flag (5V_STEPDOWN_PG) In Copper
0x43 0x21 0x04000402 E, 1 USB Power (USB_A_EN) Out USB services Copper
0x44 0x27 0x04000403 E, 7 USB Power Flag (USB_A_FLAG) In USB services Copper
0x45 0x92 0x04000404 S, 2 USB Root Port 3 Over Current (USB_B3_OC) In USB services Copper
0x46 0x95 0x04000405 S, 5 USB Root Port 3 Power (USB_B3_EN) Out USB services Copper
0x47 0x98 0x04000406 T, 0 USB Root Port 2 Power (USB_B2_EN) Out USB services Copper
0x48 0x10 0x34000004 C, 0 HDMI 5V (HDMI_5V_EN) Out NV services Copper, Calcio
0x49 0x11 0x04000407 C, 1 USB Root Port 1 Power (USB_B1_EN) Out USB services Copper, Calcio
0x4A 0x12 0x34000005 C, 2 HDMI/Power Delivery Switch (HDMI_PD_TR_EN) Out NV services Copper, Calcio
0x4B 0x42 0x3D000003 I, 2 Fan Enable (FAN_EN) Out PTM services Copper
0x4C 0xE6 0x04000408 CC, 6 USB Root Port 1 Over Current (USB_B1_OC) In USB services Copper, Calcio
[2.0.0+] 0x4D 0xAC 0x3D000001 V, 4 Pulse-Width Modulation Fan Control (PWM_FAN) Out PTM services Copper
[2.0.0+] 0x4E 0xE1 0x34000006 CC, 1 HDMI Hot Plug Detect (HDMI_INT_DP_HPD_PCC1) In NV services Copper, Calcio
[5.0.0+] 0x4F 0x56 0x3E000003 K, 6 MAX77812_IRQ In Hoag, Iowa, Calcio
[6.0.0+] 0x50 0x20 0xCA000001 E, 0 Out Hoag, Calcio, Unknown
[6.0.0+] 0x51 0x21 0xCA000002 E, 1 Out Hoag, Calcio, Unknown
[6.0.0+] 0x52 0x22 0xCA000003 E, 2 Out Hoag, Calcio, Unknown
[6.0.0+] 0x53 0x23 0xCA000004 E, 3 Out Hoag, Calcio, Unknown
[6.0.0+] 0x54 0x4C 0x36000004 J, 4 NFC_IRQ In NFC services Hoag
[6.0.0+] 0x55 0x57 0x36000003 K, 7 NFC_RST Out NFC services Hoag
[6.0.0+] 0x56 0x27 ([6.0.0-8.0.0] 0x94) 0x35000415 S, 4 MCU_IRQ In Hoag
[6.0.0+] 0x57 0x98 0x35000416 T, 0 MCU_BOOT Out HID services Hoag
[6.0.0+] 0x58 0x99 0x35000417 T, 1 MCU_RST Out HID services Hoag
[6.0.0+] 0x59 0xBB 0x39000403 X, 3 Fan Power (5V3) (VDD5V3_EN) Out PTM services Hoag, Iowa, Unknown
[6.0.0+] 0x5A 0xE5 0x35000418 CC, 5 MCU_POR Out HID services Hoag
[6.0.0+] 0x5B 0xAB 0x35000005 V, 3 SioH Input (LCD_GPIO1_PV3) In HID services, AM services Hoag
[6.0.0+] 0x5C 0x4E 0x36000002 J, 6 NFC_EN Out NFC services Hoag
[7.0.0+] - 0x32 0x35000406 G, 2 Joy-Con(R) RTS (EXT_UART2_RTS) In
[7.0.0+] - 0x1B 0x35000410 D, 3 Joy-Con(L) RTS (EXT_UART3_RTS) In
[7.0.0+] - 0x17 0x3500041B C, 7 In Hoag
[7.0.0+] - 0x18 0x3500041C D, 0 In Hoag
[7.0.0+] - 0x15 0x3500041D C, 5 In Hoag
[7.0.0+] - 0x16 0x3500041E C, 6 In Hoag
[10.0.0+] - 0xC5 0x35000065 Y, 5 Out Hoag
[10.0.0+] - 0x29 0x04000409 F, 1 Out Calcio
[10.0.0+] - 0x38 0x34000401 H, 0 In Unknown

GpioPadDescriptor

Bits Description
7-5 Controller index
4-3 Port index
2-0 Pin number

I2cDevice

This is "nn::i2c::I2cDevice".

Name DeviceCode Port:Addr Is10bit Speed Max Retries Retry Delay Usage Used by (services) Used by (hardware)
0 0x350000C9 0:52 N 100000 0 0 DebugPadDriver HID services Icosa, Iowa, Unknown
1 0x35000033 2:49 N 400000 0 0 TouchPanel HID services Icosa, Hoag, Iowa, Unknown
2 0x3E000001 0:4C N 100000 0 0 Temperature Sensor (TMP451 or NCT72) PTM services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
3 0x3E000001 0:4C N 100000 0 0 Temperature Sensor (TMP451 or NCT72) (duplicate) PTM services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
4 0x33000001 0:1C N 100000 0 0 Audio Codec (ALC5639) Audio services, Fatal services Icosa, Hoag, Iowa, Unknown
5 0x3B000001 4:68 N 400000 3 5000000 PMIC RTC (max77620_rtc0), max77620_irq0 PCV services Icosa, Copper
6 0x3A000001 4:3C N 400000 3 5000000 PMIC (MAX77620), max77620_irq0 PCV services Icosa, Copper
7 0x3A000003 4:1B N 400000 3 5000000 Sub-PMIC for CPU (max77621_cpu) PCV services Icosa, Copper
8 0x3A000004 4:1C N 400000 3 5000000 Sub-PMIC for GPU (max77621_gpu) PCV services Icosa, Copper
9 0x39000001 0:6B N 100000 3 5000000 Charger IC (BQ24193) PTM services Icosa, Hoag, Iowa, Unknown
10 0x39000033 0:36 N 100000 3 5000000 Fuel Gauge IC (MAX17050) PTM services, PCV services Icosa, Hoag, Iowa, Unknown
11 0x040000C9 0:18 N 100000 3 5000000 USB-PD controller (RHOM BM92T30MWV) USB services Icosa, Copper, Hoag, Iowa, Calcio, Unknown
12 0x3F000401 1:40 N 400000 3 5000000 Power Monitor (ina226_V_VDD15V0-HB) nvdbgsvc Factory
13 0x3F000001 1:41 N 400000 3 5000000 Power Monitor (ina226_V_VSYS-CPU-DS or SdevMariko_ina226_VDD_CPU_AP) nvdbgsvc Factory
14 0x3F000002 1:44 N 400000 3 5000000 Power Monitor (ina226_V_VSYS-GPU-DS or SdevMariko_ina226_VDD_GPU_AP) nvdbgsvc Factory
15 0x3F000003 1:45 N 400000 3 5000000 Power Monitor (ina226_V_VSYS-DDR-DS or SdevMariko_ina226_V_VDD-DDR_1V1-PMIC) nvdbgsvc Factory
16 0x3F000402 1:46 N 400000 3 5000000 Power Monitor (ina226_V_VSYS-AP) nvdbgsvc Factory
17 0x3F000403 1:47 N 400000 3 5000000 Power Monitor (ina226_V_VSYS-BL-DS) nvdbgsvc Factory
18 0x35000047 1:29 N 400000 3 5000000 Ambient Light Sensor (BH1730) Backlight services Icosa, Hoag, Iowa, Unknown
19 0x3F000404 1:48 N 400000 3 5000000 Power Monitor (ina226_V_SYS-CORE or SdevMariko_ina226_V_VDD-CORE-AP) nvdbgsvc Factory
20 0x3F000405 1:49 N 400000 3 5000000 Power Monitor (ina226_V_SOC-1V8 or SdevMariko_ina226_V_VDD_SOC-1V8) nvdbgsvc Factory
21 0x3F000406 1:4A N 400000 3 5000000 Power Monitor (ina226_V_LPDDR-1V8 or SdevMariko_ina226_V_VDD_1V8) nvdbgsvc Factory
22 0x3F000407 1:4B N 400000 3 5000000 Power Monitor (ina226_V_REG-1V32) nvdbgsvc Factory
23 0x3F000408 1:4D N 400000 3 5000000 Power Monitor (ina226_V_VDD-3V3-SYS) nvdbgsvc Factory
[2.0.0+] 24 0x34000001 3:50 N 100000 0 0 HDMI DDC NV services Copper, Calcio
[2.0.0+] 25 0x34000002 3:54 N 100000 0 0 HDMI SCDC NV services Copper, Calcio
[2.0.0+] 26 0x34000003 3:3A N 100000 0 0 HDMI HDCP NV services Copper, Calcio
[4.0.0+] 27 0x3A000005 4:52 ([4.0.0-8.0.0] 4:A4) N 400000 0 0 Buck Regulator (FAN53528) Hoag, Iowa, Calcio, Unknown
[4.0.0+] 28 0x3A000002 4:31 ([8.0.0-9.2.0] 4:33, [4.0.0-8.0.0] 4:31) N 400000 0 0 PMIC (MAX77812) PCV services Hoag, Iowa, Calcio, Unknown
[4.0.0+] 29 0x3A000006 ([4.0.0-9.2.0] 0x3A000002) 4:33 ([4.0.0-8.0.0] 4:31) N 400000 0 0 PMIC (MAX77812) PCV services Hoag, Iowa, Calcio, Unknown
[4.0.0+] 30 0x3F000409 1:4E N 400000 3 5000000 Power Monitor (SdevMariko_ina226_V_VDD_DDR_0V6) nvdbgsvc Factory
[8.0.0+] 31 0x36000001 1:08 N 400000 3 5000000 NFC IC NFC services Hoag

UartPort

Name DeviceCode (internal) DeviceCode (mapped) Port Usage
0 0x03000001 UART-A Invalid
1 0x03000004 0x37000001 UART-D Bluetooth
2 0x03000002 0x35000405 UART-B Joy-Con(R)
3 0x03000003 0x3500040F UART-C Joy-Con(L)
4 0x03000003 0x35000419 UART-C MCU

UartPortForDev

Name DeviceCode (internal) DeviceCode (mapped) Port Usage
0 0x03000001 UART-A Invalid
1 0x03000002 0x35000405 UART-B Joy-Con(R)
2 0x03000003 0x3500040F UART-C Joy-Con(L)
3 0x03000004 0x37000001 UART-D Bluetooth

ChannelName

This is "nn::pwm::ChannelName".

Name DeviceCode Interface Usage Used by
1 0x3D000001 PWM Channel 1 Fan PTM services
2 0x3400003D PWM Channel 0 Backlight Backlight services, NV services
3 0x35000065 PMC LED Soft Blink Led Bus services

AssignablePinGroupName

This is "nn::pinmux::AssignablePinGroupName".

Name Usage
0 GPIO(G, 0) and GPIO(G, 3)
1 GPIO(D, 1) and GPIO(D, 4)
2 Sdmmc1Clk or GPIO(M, 0), GPIO(M, 1), GPIO(M, 2), GPIO(M, 3), GPIO(M, 4) and GPIO(M, 5)
3 GPIO(V, 4)
100 Invalid

AssignablePinGroupNameForHardwareTest

This is "nn::pinmux::AssignablePinGroupNameForHardwareTest".

Name Usage
0 Invalid
1 Invalid
2 Invalid
3 Invalid
100 Uart4Tx, Uart4Rx, Uart4Rts and Uart4Cts

SasbusPort

Name DeviceCode Port Usage
0 0x3500003D SPI4 Joy-Con