USB services: Difference between revisions
add usb states enum |
No edit summary |
||
Line 661: | Line 661: | ||
This uses the same func internally as [[#PostBufferAsync_2|#PostBufferAsync]] except multiple urbs are specified by the user: the input buffer contains an array of u32s for the size of each urb, where '''urbCount''' is the total number of entries in this array. With [[#PostBufferAsync_2|#PostBufferAsync]] the last 2 params passed to the internal func are hard-coded to 0, while with this command it's '''unk1''' and '''unk2'''. | This uses the same func internally as [[#PostBufferAsync_2|#PostBufferAsync]] except multiple urbs are specified by the user: the input buffer contains an array of u32s for the size of each urb, where '''urbCount''' is the total number of entries in this array. With [[#PostBufferAsync_2|#PostBufferAsync]] the last 2 params passed to the internal func are hard-coded to 0, while with this command it's '''unk1''' and '''unk2'''. | ||
= usb:pd = | |||
This is "nn::usb::pd::detail::IPdManager". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || [[#OpenSession]] | |||
|} | |||
Only system-titles with access to this are [[PTM_services|ptm]] and [[AM_services|am]]. | |||
== OpenSession == | |||
No input. Returns an [[#IPdSession]]. | |||
== IPdSession == | |||
This is "nn::usb::pd::detail::IPdSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || BindNoticeEvent | |||
|- | |||
| 1 || UnbindNoticeEvent | |||
|- | |||
| 2 || GetStatus | |||
|- | |||
| 3 || GetNotice | |||
|- | |||
| 4 || EnablePowerRequestNotice | |||
|- | |||
| 5 || DisablePowerRequestNotice | |||
|- | |||
| 6 || ReplyPowerRequest | |||
|} | |||
= usb:pd:c = | |||
This is "nn::usb::pd::detail::IPdCradleManager". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || [[#OpenCradleSession]] | |||
|} | |||
USB-sysmodule symbols for this refer to "Cradle", which is the [[Dock]]. | |||
== OpenCradleSession == | |||
No input. Returns an [[#IPdCradleSession]]. | |||
== IPdCradleSession == | |||
This is "nn::usb::pd::detail::IPdCradleSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || [[#AccessCradleVdoWithWriteRequest]] | |||
|- | |||
| 1 || [[#AccessCradleVdoWithReadRequest]] | |||
|- | |||
| 2 || Vdm20Init || No input/output. | |||
If Cradle or RelayBox is connected, caches result of VDM 0x20. | |||
|- | |||
| 3 || [2.0.0+] GetFwType | |||
|- | |||
| 4 || [2.0.0+] GetFwRevision | |||
|- | |||
| 5 || [2.0.0+] GetManufacturerId | |||
|- | |||
| 6 || [2.0.0+] GetDeviceId | |||
|- | |||
| 7 || [3.0.0+] | |||
|- | |||
| 8 || [3.0.0+] | |||
|} | |||
=== AccessCradleVdoWithWriteRequest === | |||
Takes two input u32s '''Value''' and '''UserId'''. No output. | |||
'''UserId''' is translated to the actual [[#VdmCommand]] to send. | |||
=== AccessCradleVdoWithReadRequest === | |||
Takes an input u32 '''UserId'''. Returns an u32 '''Value'''. | |||
'''UserId''' is translated to the actual [[#VdmCommand]] to send. | |||
=== GetFwType === | |||
No input. Returns an output u16. | |||
=== GetFwRevision === | |||
No input. Returns an output u16. | |||
=== GetManufacturerId === | |||
No input. Returns an output u16. | |||
=== GetDeviceId === | |||
No input. Returns an output u16. | |||
= usb:pd:m = | |||
This is "nn::usb::pd::detail::IPdManufactureManager". | |||
[2.0.0+] This service was merged into [[#usb:pd:c|usb:pd:c]]. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || [[#OpenManufactureSession]] | |||
|} | |||
== OpenManufactureSession == | |||
No input. Returns an [[#IPdManufactureSession]]. | |||
== IPdManufactureSession == | |||
This is "nn::usb::pd::detail::IPdManufactureSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || GetFwType | |||
|- | |||
| 1 || GetFwRevision | |||
|- | |||
| 2 || GetManufacturerId | |||
|- | |||
| 3 || GetDeviceId | |||
|} | |||
= usb:pm = | |||
This is "nn::usb::pm::IPmService". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|- | |||
| 1 || | |||
|- | |||
| 2 || | |||
|- | |||
| 3 || | |||
|- | |||
| 4 || | |||
|- | |||
| 5 || | |||
|} | |||
USB Port Manager, only system-title using this is [[PTM_services|ptm]]. | |||
= usb:qdb = | |||
Added with [[7.0.0]]. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|- | |||
| 1 || | |||
|} | |||
== Cmd0 == | |||
No input/output, takes a type-0x5 input buffer. | |||
This loads data for [[#HidGamepad]] with the input .json. | |||
== Cmd1 == | |||
Takes 6-bytes of input (u16s '''vid''', '''pid''', '''bcdDevice''') and a type-0x5 input buffer, returns an output u8 bool indicating success. | |||
Locates an entry in the [[#HidGamepad]] state with the input u16s, and checks for a '''quirks''' array entry where '''name''' matches the input buffer string. Returns 1 when found, 0 otherwise. | |||
= usb:obsv = | |||
Added with [8.0.0+]. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|- | |||
| 1 || | |||
|} | |||
= UsbHsInterface = | = UsbHsInterface = | ||
Line 780: | Line 968: | ||
Official sw only uses the Result/size fields. | Official sw only uses the Result/size fields. | ||
= | = VdmCommand = | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! | ! Value || UserId || Name | ||
|- | |- | ||
| 0 | | | 0 || - || None | ||
|- | |||
|- | |- | ||
| | | 1 || 0 || LedControlRequest | ||
| 0 || | |||
|- | |- | ||
| 2 || - || SleepButtonNotice | |||
|- | |- | ||
| | | 3 || 10 || DeviceTypeRequest | ||
|- | |- | ||
| | | 4 || - || DeviceTypeReply | ||
|- | |- | ||
| | | 5 || - || UsbPowerErrorNotice | ||
|- | |- | ||
| | | 6 || 1 || Dp2HdmiFwVerRequest | ||
|- | |- | ||
| | | 7 || - || Dp2HdmiFwVerReply | ||
|- | |- | ||
| | | 8 || - || Dp2HdmiFwUpdateRequest | ||
|- | |- | ||
| | | 9 || - || Dp2HdmiFwUpdateReply | ||
|- | |- | ||
| | | 10 || - || Dp2HdmiFwUpdateNotice | ||
|- | |- | ||
| | | 11 || 2 || PdcHFwVerRequest | ||
|- | |- | ||
| 12 || - || PdcHFwVerReply | |||
|- | |- | ||
| | | 13 || - || PdcHFwUpdateRequest | ||
|- | |- | ||
| 14 || - || PdcHFwUpdateReply | |||
|- | |- | ||
| | | 15 || - || PdcHFwUpdateNotice | ||
|- | |- | ||
| | | 16 || 3 || PdcAFwVerRequest | ||
|- | |- | ||
| | | 17 || - || PdcAFwVerReply | ||
|- | |- | ||
| | | 18 || - || PdcAFwUpdateRequest | ||
|- | |- | ||
| | | 19 || - || PdcAFwUpdateReply | ||
|- | |- | ||
| 20 || - || PdcAFwUpdateNotice | |||
|- | |- | ||
| | | 21 || - || DeviceErrorNotice | ||
|- | |- | ||
| | | 22 || 4 || DeviceStateRequest | ||
|- | |- | ||
| | | 23 || || DeviceStateReply | ||
|- | |- | ||
| | | 24 || 5 || McuFwVerRequest | ||
|- | |- | ||
| | | 25 || || McuFwVerReply | ||
|- | |- | ||
| | | 26 || 6 || McuFwUpdateRequest | ||
| | |||
|- | |- | ||
| 27 || || McuFwUpdateReply | |||
|- | |- | ||
| | | 28 || 7 || McuFwUpdateNotice | ||
|- | |- | ||
| | | 29 || - || | ||
| | |||
|- | |- | ||
| 30 || 8 || | |||
|- | |- | ||
| | | 31 || - || | ||
|- | |- | ||
| | | 32 || 9 || | ||
|} | |} | ||