Difference between revisions of "IR Services"

From 3dbrew
Jump to navigation Jump to search
m (Add anchors)
 
(25 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Services]]
+
__TOC__
 +
{{Anchor|IRU}}{{Anchor|ir:u}}
 
= IR Service "ir:u" =
 
= IR Service "ir:u" =
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
!  Command Header
 
!  Command Header
 +
!  Available since system version
 
!  Description
 
!  Description
 
|-
 
|-
 
| 0x00010000
 
| 0x00010000
 +
| [[1.0.0-0]]
 
| [[IRU:Initialize|Initialize]]
 
| [[IRU:Initialize|Initialize]]
 
|-
 
|-
 
| 0x00020000
 
| 0x00020000
 +
| [[1.0.0-0]]
 
| [[IRU:Shutdown|Shutdown]]
 
| [[IRU:Shutdown|Shutdown]]
 
|-
 
|-
 
| 0x00030042
 
| 0x00030042
 +
| [[1.0.0-0]]
 
| [[IRU:StartSendTransfer|StartSendTransfer]]
 
| [[IRU:StartSendTransfer|StartSendTransfer]]
 
|-
 
|-
 
| 0x00040000
 
| 0x00040000
 +
| [[1.0.0-0]]
 
| [[IRU:WaitSendTransfer|WaitSendTransfer]]
 
| [[IRU:WaitSendTransfer|WaitSendTransfer]]
 
|-
 
|-
 
| 0x000500C2
 
| 0x000500C2
 +
| [[1.0.0-0]]
 
| [[IRU:StartRecvTransfer|StartRecvTransfer]]
 
| [[IRU:StartRecvTransfer|StartRecvTransfer]]
 
|-
 
|-
 
| 0x00060000
 
| 0x00060000
 +
| [[1.0.0-0]]
 
| [[IRU:WaitRecvTransfer|WaitRecvTransfer]]
 
| [[IRU:WaitRecvTransfer|WaitRecvTransfer]]
 
|-
 
|-
 
| 0x00070000
 
| 0x00070000
 +
| [[1.0.0-0]]
 
| [[IRU:GetRecvTransferCount|GetRecvTransferCount]]
 
| [[IRU:GetRecvTransferCount|GetRecvTransferCount]]
 
|-
 
|-
 
| 0x00080000
 
| 0x00080000
 +
| [[1.0.0-0]]
 
| [[IRU:GetSendState|GetSendState]]
 
| [[IRU:GetSendState|GetSendState]]
 
|-
 
|-
 
| 0x00090040
 
| 0x00090040
 +
| [[1.0.0-0]]
 
| [[IRU:SetBitRate|SetBitRate]]
 
| [[IRU:SetBitRate|SetBitRate]]
 
|-
 
|-
 
| 0x000A0000
 
| 0x000A0000
 +
| [[1.0.0-0]]
 
| [[IRU:GetBitRate|GetBitRate]]
 
| [[IRU:GetBitRate|GetBitRate]]
 
|-
 
|-
 
| 0x000B0040
 
| 0x000B0040
 +
| [[1.0.0-0]]
 
| [[IRU:SetIRLEDState|SetIRLEDState]]
 
| [[IRU:SetIRLEDState|SetIRLEDState]]
 
|-
 
|-
 
| 0x000C0000
 
| 0x000C0000
 +
| [[1.0.0-0]]
 
| [[IRU:GetIRLEDRecvState|GetIRLEDRecvState]]
 
| [[IRU:GetIRLEDRecvState|GetIRLEDRecvState]]
 
|-
 
|-
 
| 0x000D0000
 
| 0x000D0000
 +
| [[1.0.0-0]]
 
| [[IRU:GetSendFinishedEvent|GetSendFinishedEvent]]
 
| [[IRU:GetSendFinishedEvent|GetSendFinishedEvent]]
 
|-
 
|-
 
| 0x000E0000
 
| 0x000E0000
 +
| [[1.0.0-0]]
 
| [[IRU:GetRecvFinishedEvent|GetRecvFinishedEvent]]
 
| [[IRU:GetRecvFinishedEvent|GetRecvFinishedEvent]]
 
|-
 
|-
 
| 0x000F0000
 
| 0x000F0000
 +
| [[1.0.0-0]]
 
| [[IRU:GetTransferState|GetTransferState]]
 
| [[IRU:GetTransferState|GetTransferState]]
 
|-
 
|-
 
| 0x00100000
 
| 0x00100000
|  
+
| [[1.0.0-0]]
 +
| GetErrorStatus
 
|-
 
|-
 
| 0x00110040
 
| 0x00110040
 +
| [[1.0.0-0]]
 
| [[IRU:SetSleepModeActive|SetSleepModeActive]]
 
| [[IRU:SetSleepModeActive|SetSleepModeActive]]
 
|-
 
|-
 
| 0x00120040
 
| 0x00120040
 +
| [[1.0.0-0]]
 
| [[IRU:SetSleepModeState|SetSleepModeState]]
 
| [[IRU:SetSleepModeState|SetSleepModeState]]
 
|}
 
|}
  
 +
{{Anchor|IRUSER}}{{Anchor|ir:USER}}
 
= IR Service "ir:USER" =
 
= IR Service "ir:USER" =
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 69: Line 90:
 
|-
 
|-
 
| 0x00010182
 
| 0x00010182
|  
+
| [[2.0.0-2]]
| Initialize
+
| [[IRUSER:InitializeIrnop|InitializeIrnop]]
 
|-
 
|-
 
| 0x00020000
 
| 0x00020000
|  
+
| [[2.0.0-2]]
| Shutdown
+
| FinalizeIrnop
 
|-
 
|-
 
| 0x00030000
 
| 0x00030000
|  
+
| [[2.0.0-2]]
| ?
+
| ClearReceiveBuffer
 
|-
 
|-
 
| 0x00040000
 
| 0x00040000
|  
+
| [[2.0.0-2]]
| ?
+
| ClearSendBuffer
 
|-
 
|-
| 0x00050000
+
| 0x000500C0
|  
+
| [[2.0.0-2]]
| ?
+
| WaitConnection
 
|-
 
|-
| 0x00060000
+
| 0x00060040
|  
+
| [[2.0.0-2]]
| ?
+
| RequireConnection (u8 input)
 
|-
 
|-
| 0x00070000
+
| 0x000702C0
|  
+
| [[2.0.0-2]]
| ?
+
| AutoConnection
 
|-
 
|-
 
| 0x00080000
 
| 0x00080000
|  
+
| [[2.0.0-2]]
| ?
+
| AnyConnection
 
|-
 
|-
 
| 0x00090000
 
| 0x00090000
|  
+
| [[2.0.0-2]]
| ?
+
| Disconnect
 
|-
 
|-
 
| 0x000A0000
 
| 0x000A0000
|  
+
| [[2.0.0-2]]
| ?
+
| GetReceiveEvent (writes event handle to cmdreply[3])
 
|-
 
|-
 
| 0x000B0000
 
| 0x000B0000
|  
+
| [[2.0.0-2]]
| ?
+
| GetSendEvent (writes event handle to cmdreply[3])
 
|-
 
|-
 
| 0x000C0000
 
| 0x000C0000
|  
+
| [[2.0.0-2]]
| GetConnectionStatusEvent
+
| GetConnectionStatusEvent (writes event handle to cmdreply[3])
 
|-
 
|-
| 0x000D0000
+
| 0x000D0042
|  
+
| [[2.0.0-2]]
| ?
+
| SendIrnop (u32 size, ((Size<<14) <nowiki>|</nowiki> 2), inbufptr)
 
|-
 
|-
| 0x000E0000
+
| 0x000E0042
|  
+
| [[2.0.0-2]]
| ?
+
| SendIrnopLarge (u32 size, ((Size<<8) <nowiki>|</nowiki> 10), inbufptr)
 
|-
 
|-
| 0x000F0000
+
| 0x000F0040
|  
+
| [[2.0.0-2]]
| ?
+
| ReceiveIrnop
 
|-
 
|-
| 0x00100000
+
| 0x00100042
|  
+
| [[2.0.0-2]]
| ?
+
| ReceiveIrnopLarge
 
|-
 
|-
| 0x00110000
+
| 0x0011....
|  
+
| [[2.0.0-2]]
| ?
+
| GetLatestReceiveErrorResult
 
|-
 
|-
| 0x00120000
+
| 0x0012....
|  
+
| [[2.0.0-2]]
| ?
+
| GetLatestSendErrorResult
 
|-
 
|-
| 0x00130000
+
| 0x0013....
|  
+
| [[2.0.0-2]]
| ?
+
| GetConnectionStatus
 
|-
 
|-
| 0x00140000
+
| 0x0014....
|  
+
| [[2.0.0-2]]
| ?
+
| GetTryingToConnectStatus
 
|-
 
|-
| 0x00150000
+
| 0x0015....
|  
+
| [[2.0.0-2]]
| ?
+
| GetReceiveSizeFreeAndUsed
 
|-
 
|-
| 0x00160000
+
| 0x0016....
|  
+
| [[2.0.0-2]]
| ?
+
| GetSendSizeFreeAndUsed
 
|-
 
|-
| 0x00170000
+
| 0x0017....
| Unknown, >[[2.0.0-2]]
+
| [[2.2.0-X]]
| ?
+
| GetConnectionRole
 
|-
 
|-
| 0x00180000
+
| 0x00180182
| Unknown, >[[2.0.0-2]]
+
| [[2.2.0-X]]
| InitializeIrnopShared
+
| [[IRUSER:InitializeIrnopShared|InitializeIrnopShared]]
 
|-
 
|-
| 0x00190000
+
| 0x00190040
| Unknown, >[[2.0.0-2]]
+
| [[2.2.0-X]]
| ?
+
| ReleaseReceivedData (32bit_value input)
 
|-
 
|-
| 0x001A0000
+
| 0x001A0040
| Unknown, >[[2.0.0-2]]
+
| [[2.2.0-X]]
| ?
+
| SetOwnMachineId (u8 input)
 
|}
 
|}
  
 +
This service was added with [[2.0.0-2]].
 +
 +
When sending data, SendIrnop is used when the size is <=0xFC, otherwise SendIrnopLarge is used.
 +
 +
{{Anchor|IRRST}}{{Anchor|ir:rst}}
 
= IR Service "ir:rst" =
 
= IR Service "ir:rst" =
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
!  Command Header
 
!  Command Header
 +
!  Available since system-version
 
!  Description
 
!  Description
 
|-
 
|-
 
| 0x00010000
 
| 0x00010000
 +
| [[8.0.0-18]]
 
| [[IRRST:GetHandles|GetHandles]]
 
| [[IRRST:GetHandles|GetHandles]]
 
|-
 
|-
 
| 0x00020080
 
| 0x00020080
 +
| [[8.0.0-18]]
 
| [[IRRST:Initialize|Initialize]]
 
| [[IRRST:Initialize|Initialize]]
 
|-
 
|-
 
| 0x00030000
 
| 0x00030000
 +
| [[8.0.0-18]]
 
| [[IRRST:Shutdown|Shutdown]]
 
| [[IRRST:Shutdown|Shutdown]]
 
|-
 
|-
 
| 0x00040000
 
| 0x00040000
 +
| [[8.0.0-18]]
 
| This writes an unknown u8 to index-word cmdreply[2], from data loaded from an I2C device register.
 
| This writes an unknown u8 to index-word cmdreply[2], from data loaded from an I2C device register.
 
|-
 
|-
 
| 0x00050000
 
| 0x00050000
 +
| [[8.0.0-18]]
 
| This writes an unknown u8 from IR-module state to index-word cmdreply[2].
 
| This writes an unknown u8 from IR-module state to index-word cmdreply[2].
 
|-
 
|-
 
| 0x00060000
 
| 0x00060000
 +
| [[8.0.0-18]]
 
| This writes two unknown u8 fields from IR-module state to index-word cmdreply[2] and cmdreply[3].
 
| This writes two unknown u8 fields from IR-module state to index-word cmdreply[2] and cmdreply[3].
 +
|-
 +
| 0x00070080
 +
| [[9.0.0-20]]
 +
| (u8 unk0, u8 unk1) This is used for calibrating the C-stick on the N3DS EXTHID.
 +
|-
 +
| 0x00080000
 +
| [[9.0.0-20]]
 +
| (u8 unk0, u8 unk1) ?
 +
|-
 +
| 0x00090000
 +
| [[9.0.0-20]]
 +
| This writes two unknown u8 fields to index-word cmdreply[2] and cmdreply[3].
 
|}
 
|}
  
This service was added with [[8.0.0-18]]. Unlike the other IR services, this uses [[I2C]] deviceid 17(this deviceid isn't actually handled by the [[8.0.0-18]] I2C module). Therefore, this is probably for the new IR LED for the [[New 3DS]].
+
This service was added with [[8.0.0-18]]. Unlike the other IR services, this uses [[I2C]] deviceid 17(this deviceid isn't actually handled by the [[8.0.0-18]] I2C module). This is for the additional [[New 3DS]] HID hardware, this HID data is stored in [[IRRST_Shared_Memory|shared-memory]]. Even with [[9.0.0-20]] IR module still registers+handles this service on both Old3DS+New3DS.
  
 
=IR Services=
 
=IR Services=
 
Only one session(two sessions starting with [[8.0.0-18]]) to any of these services can be open at a time, thus only one/two process(es) can use any of these services at once. These services interface with hardware services gpio::IR and i2c::IR. The i2c::IR service is used for sending/receiving data.
 
Only one session(two sessions starting with [[8.0.0-18]]) to any of these services can be open at a time, thus only one/two process(es) can use any of these services at once. These services interface with hardware services gpio::IR and i2c::IR. The i2c::IR service is used for sending/receiving data.
  
IRU is for regular IR comms. IRUSER uses a custom IR protocol(above the physical layer). The IR hardware only supports IrDA-SIR, other physical protocols such as the one for TV-remotes are not supported(going by the datasheet linked [[Hardware|here]] at least).
+
IRU is for regular IR comms. IRUSER uses a custom IR protocol(above the physical layer). Both of these services use IrDA-SIR. The IR hardware seems to only support IrDA-SIR, other physical protocols such as the one for TV-remotes are not supported(going by the datasheet linked [[Hardware|here]] for a different IC at least).
 +
 
 +
The protocol used with IRUSER involves encryption(?) implemented in software. IRUSER is used for the [[Circle Pad Pro]]. This same IRUSER service uses the New3DS HID hardware when running on New3DS. Note that the main service for New3DS HID is ir:rst, and these two service are mutually exclusive: when one is initialized and reading data from New3DS HID, the other cannot access it.
  
The protocol used with IRUSER involves encryption implemented in software. IRUSER is used for the [[Circle Pad Pro]].
+
[[Category:Services]]

Latest revision as of 11:28, 18 September 2024

IR Service "ir:u"[edit]

Command Header Available since system version Description
0x00010000 1.0.0-0 Initialize
0x00020000 1.0.0-0 Shutdown
0x00030042 1.0.0-0 StartSendTransfer
0x00040000 1.0.0-0 WaitSendTransfer
0x000500C2 1.0.0-0 StartRecvTransfer
0x00060000 1.0.0-0 WaitRecvTransfer
0x00070000 1.0.0-0 GetRecvTransferCount
0x00080000 1.0.0-0 GetSendState
0x00090040 1.0.0-0 SetBitRate
0x000A0000 1.0.0-0 GetBitRate
0x000B0040 1.0.0-0 SetIRLEDState
0x000C0000 1.0.0-0 GetIRLEDRecvState
0x000D0000 1.0.0-0 GetSendFinishedEvent
0x000E0000 1.0.0-0 GetRecvFinishedEvent
0x000F0000 1.0.0-0 GetTransferState
0x00100000 1.0.0-0 GetErrorStatus
0x00110040 1.0.0-0 SetSleepModeActive
0x00120040 1.0.0-0 SetSleepModeState

IR Service "ir:USER"[edit]

Command Header Available since system version Description
0x00010182 2.0.0-2 InitializeIrnop
0x00020000 2.0.0-2 FinalizeIrnop
0x00030000 2.0.0-2 ClearReceiveBuffer
0x00040000 2.0.0-2 ClearSendBuffer
0x000500C0 2.0.0-2 WaitConnection
0x00060040 2.0.0-2 RequireConnection (u8 input)
0x000702C0 2.0.0-2 AutoConnection
0x00080000 2.0.0-2 AnyConnection
0x00090000 2.0.0-2 Disconnect
0x000A0000 2.0.0-2 GetReceiveEvent (writes event handle to cmdreply[3])
0x000B0000 2.0.0-2 GetSendEvent (writes event handle to cmdreply[3])
0x000C0000 2.0.0-2 GetConnectionStatusEvent (writes event handle to cmdreply[3])
0x000D0042 2.0.0-2 SendIrnop (u32 size, ((Size<<14) | 2), inbufptr)
0x000E0042 2.0.0-2 SendIrnopLarge (u32 size, ((Size<<8) | 10), inbufptr)
0x000F0040 2.0.0-2 ReceiveIrnop
0x00100042 2.0.0-2 ReceiveIrnopLarge
0x0011.... 2.0.0-2 GetLatestReceiveErrorResult
0x0012.... 2.0.0-2 GetLatestSendErrorResult
0x0013.... 2.0.0-2 GetConnectionStatus
0x0014.... 2.0.0-2 GetTryingToConnectStatus
0x0015.... 2.0.0-2 GetReceiveSizeFreeAndUsed
0x0016.... 2.0.0-2 GetSendSizeFreeAndUsed
0x0017.... 2.2.0-X GetConnectionRole
0x00180182 2.2.0-X InitializeIrnopShared
0x00190040 2.2.0-X ReleaseReceivedData (32bit_value input)
0x001A0040 2.2.0-X SetOwnMachineId (u8 input)

This service was added with 2.0.0-2.

When sending data, SendIrnop is used when the size is <=0xFC, otherwise SendIrnopLarge is used.

IR Service "ir:rst"[edit]

Command Header Available since system-version Description
0x00010000 8.0.0-18 GetHandles
0x00020080 8.0.0-18 Initialize
0x00030000 8.0.0-18 Shutdown
0x00040000 8.0.0-18 This writes an unknown u8 to index-word cmdreply[2], from data loaded from an I2C device register.
0x00050000 8.0.0-18 This writes an unknown u8 from IR-module state to index-word cmdreply[2].
0x00060000 8.0.0-18 This writes two unknown u8 fields from IR-module state to index-word cmdreply[2] and cmdreply[3].
0x00070080 9.0.0-20 (u8 unk0, u8 unk1) This is used for calibrating the C-stick on the N3DS EXTHID.
0x00080000 9.0.0-20 (u8 unk0, u8 unk1) ?
0x00090000 9.0.0-20 This writes two unknown u8 fields to index-word cmdreply[2] and cmdreply[3].

This service was added with 8.0.0-18. Unlike the other IR services, this uses I2C deviceid 17(this deviceid isn't actually handled by the 8.0.0-18 I2C module). This is for the additional New 3DS HID hardware, this HID data is stored in shared-memory. Even with 9.0.0-20 IR module still registers+handles this service on both Old3DS+New3DS.

IR Services[edit]

Only one session(two sessions starting with 8.0.0-18) to any of these services can be open at a time, thus only one/two process(es) can use any of these services at once. These services interface with hardware services gpio::IR and i2c::IR. The i2c::IR service is used for sending/receiving data.

IRU is for regular IR comms. IRUSER uses a custom IR protocol(above the physical layer). Both of these services use IrDA-SIR. The IR hardware seems to only support IrDA-SIR, other physical protocols such as the one for TV-remotes are not supported(going by the datasheet linked here for a different IC at least).

The protocol used with IRUSER involves encryption(?) implemented in software. IRUSER is used for the Circle Pad Pro. This same IRUSER service uses the New3DS HID hardware when running on New3DS. Note that the main service for New3DS HID is ir:rst, and these two service are mutually exclusive: when one is initialized and reading data from New3DS HID, the other cannot access it.