Difference between revisions of "Bus services"

From Nintendo Switch Brew
Jump to navigation Jump to search
(Add full interface name (imported from SwIPC))
Line 30: Line 30:
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! GpioPadName || GpioPadDescriptor || Description || Direction || Used by
+
! GpioPadName || GpioPadDescriptor || Tegra (unit, pin) || Usage || Direction || Used by
 
|-
 
|-
| 1 || 0xCC || || ||  
+
| 1 || 0xCC || Z, 4 || || ||  
 
|-
 
|-
| 2 || 0x24 || || ||  
+
| 2 || 0x24 || E, 4 || SDCard Power || ||  
 
|-
 
|-
| 4 || 0xDA || || ||  
+
| 4 || 0xDA || BB, 2 || || ||  
 
|-
 
|-
| 5 || 0xDB || || ||  
+
| 5 || 0xDB || BB, 3 || || ||  
 
|-
 
|-
| 6 || 0xDC || || ||  
+
| 6 || 0xDC || BB, 4 || || ||  
 
|-
 
|-
| 7 || 0x25 || || ||  
+
| 7 || 0x25 || E, 5 || || ||  
 
|-
 
|-
| 8 || 0x90 || || In || [[HID services]]
+
| 8 || 0x90 || S, 0 || || In || [[HID services]]
 
|-
 
|-
| 9 || 0x91 || || ||  
+
| 9 || 0x91 || S, 1 || || ||  
 
|-
 
|-
| 0xA || 0x96 || || ||  
+
| 0xA || 0x96 || S, 6 || || ||  
 
|-
 
|-
| 0xB || 0x97 || || ||  
+
| 0xB || 0x97 || S, 7 || || ||  
 
|-
 
|-
| 0xD || 6 || || ||  
+
| 0xD || 6 || A, 6 || || ||  
 
|-
 
|-
| 0xE || 0x78 || || ||  
+
| 0xE || 0x78 || P, 0 || || ||  
 
|-
 
|-
| 0xF || 0x93 || || ||  
+
| 0xF || 0x93 || S, 3 || || ||  
 
|-
 
|-
| 0x10 || 0x7D || || ||  
+
| 0x10 || 0x7D || P, 5 || || ||  
 
|-
 
|-
| 0x11 || 0x7C || || ||  
+
| 0x11 || 0x7C || P, 4 || || ||  
 
|-
 
|-
| 0x12 || 0x7B || || ||  
+
| 0x12 || 0x7B || P, 3 || || ||  
 
|-
 
|-
| 0x13 || 0x7A || || ||  
+
| 0x13 || 0x7A || P, 2 || || ||  
 
|-
 
|-
| 0x14 || 0xBC || || ||  
+
| 0x14 || 0xBC || X, 4 || || ||  
 
|-
 
|-
| 0x15 || 0xAE || || ||  
+
| 0x15 || 0xAE || V, 6 || || ||  
 
|-
 
|-
| 0x17 || 0xB9 || || In || [[HID services]]
+
| 0x17 || 0xB9 || X, 1 || || In || [[HID services]]
 
|-
 
|-
| 0x18 || 0xBD || || Out || [[HID services]]
+
| 0x18 || 0xBD || X, 5 || || Out || [[HID services]]
 
|-
 
|-
| 0x19 || 0xBE || Volume key || In || [[Boot2]]
+
| 0x19 || 0xBE || X, 6 || Volume key || In || [[Boot2]]
 
|-
 
|-
| 0x1A || 0xBF || Volume key || In || [[Boot2]]
+
| 0x1A || 0xBF || X, 7 || Volume key || In || [[Boot2]]
 
|-
 
|-
| 0x1B || 0xC0 || || ||  
+
| 0x1B || 0xC0 || Y, 0 || || ||  
 
|-
 
|-
| 0x1C || 0xC1 || || ||  
+
| 0x1C || 0xC1 || Y, 1 || || ||  
 
|-
 
|-
| 0x1D || 0xA9 || || ||  
+
| 0x1D || 0xA9 || V, 1 || || ||  
 
|-
 
|-
| 0x1E || 0xAA || || ||  
+
| 0x1E || 0xAA || V, 2 || || ||  
 
|-
 
|-
| 0x20 || 0xAD || || ||  
+
| 0x20 || 0xAD || V, 5 || || ||  
 
|-
 
|-
| 0x21 || 0xC8 || || ||  
+
| 0x21 || 0xC8 || Z, 0 || || ||  
 
|-
 
|-
| 0x22 || 0xCA || || ||  
+
| 0x22 || 0xCA || Z, 2 || || ||  
 
|-
 
|-
| 0x23 || 0xCB || || ||  
+
| 0x23 || 0xCB || Z, 3 || || ||  
 
|-
 
|-
| 0x24 || 0x4F || || ||  
+
| 0x24 || 0x4F || J, 7 || || ||  
 
|-
 
|-
| 0x25 || 0x50 || || ||  
+
| 0x25 || 0x50 || K, 0 || || ||  
 
|-
 
|-
| 0x26 || 0x51 || || ||  
+
| 0x26 || 0x51 || K, 1 || || ||  
 
|-
 
|-
| 0x27 || 0x52 || || ||  
+
| 0x27 || 0x52 || K, 2 || || ||  
 
|-
 
|-
| 0x28 || 0x54 || || ||  
+
| 0x28 || 0x54 || K, 4 || || ||  
 
|-
 
|-
| 0x29 || 0x56 || || ||  
+
| 0x29 || 0x56 || K, 6 || || ||  
 
|-
 
|-
| 0x2A || 0x57 || || ||  
+
| 0x2A || 0x57 || K, 7 || || ||  
 
|-
 
|-
| .. || .. || .. || .. || ..
+
| .. || .. || .. || .. || .. || ..
 +
|-
 +
| 0x38 || ? || ? || SDCard Card Detect || ||
 
|}
 
|}
  

Revision as of 20:38, 24 January 2018

gpio

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

Cmd Name
0 #OpenSessionForDev
1 #OpenSession
2 #OpenSessionForTest
3 IsWakeEventActive
4 GetWakeEventActiveFlagSet
5 SetWakeEventActiveFlagSetForDebug
6

OpenSessionForDev

Takes a raw GpioPadDescriptor and returns a #IPadSession session for it.

OpenSession

Same thing as OpenSessionForDev except the descriptor is looked up in the table below. Returns an #IPadSession session.

GpioPadName GpioPadDescriptor Tegra (unit, pin) Usage Direction Used by
1 0xCC Z, 4
2 0x24 E, 4 SDCard Power
4 0xDA BB, 2
5 0xDB BB, 3
6 0xDC BB, 4
7 0x25 E, 5
8 0x90 S, 0 In HID services
9 0x91 S, 1
0xA 0x96 S, 6
0xB 0x97 S, 7
0xD 6 A, 6
0xE 0x78 P, 0
0xF 0x93 S, 3
0x10 0x7D P, 5
0x11 0x7C P, 4
0x12 0x7B P, 3
0x13 0x7A P, 2
0x14 0xBC X, 4
0x15 0xAE V, 6
0x17 0xB9 X, 1 In HID services
0x18 0xBD X, 5 Out HID services
0x19 0xBE X, 6 Volume key In Boot2
0x1A 0xBF X, 7 Volume key In Boot2
0x1B 0xC0 Y, 0
0x1C 0xC1 Y, 1
0x1D 0xA9 V, 1
0x1E 0xAA V, 2
0x20 0xAD V, 5
0x21 0xC8 Z, 0
0x22 0xCA Z, 2
0x23 0xCB Z, 3
0x24 0x4F J, 7
0x25 0x50 K, 0
0x26 0x51 K, 1
0x27 0x52 K, 2
0x28 0x54 K, 4
0x29 0x56 K, 6
0x2A 0x57 K, 7
.. .. .. .. .. ..
0x38 ? ? SDCard Card Detect

OpenSessionForTest

Same as #OpenSession but panics on failure.

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

GpioPadDescriptor

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

i2c

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

Cmd Name
0 OpenSessionForDev
1 OpenSession
2 HasDevice
3 HasDeviceForDev

II2cSession

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

Cmd Name
0
1
2
3 Send
4 Receive
5 ExecuteCommandList

i2c:pcv

Cmd Name
0
1
2
10
11
12

uart

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

Cmd Name Notes
0 Returns a u8/bool.
1 Returns a u8/bool.
2 Returns a u8/bool.
3 Returns a u8/bool.
4 Takes marshalled arguments.
5 Takes marshalled arguments.
6 GetIPortSession
7
8

IPortSession

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

Cmd Name Notes
0 Takes marshalled arguments
1 Takes marshalled arguments
2
3 Takes marshalled arguments
4 Returns 2x u64. Both zero.
5
6
7

pwm

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

Cmd Name
0 OpenSessionForDev
1 OpenSession

IChannelSession

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

Cmd Name
0 SetPeriod
1 GetPeriod
2 SetDuty
3 GetDuty
4 SetEnabled
5 GetEnabled