mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Merge 076dd7b24a
into 0a4ac1b87c
This commit is contained in:
commit
d84c427e9e
@ -55,6 +55,8 @@ typedef enum {
|
|||||||
} UsbComplexId;
|
} UsbComplexId;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
UsbDeviceSpeed_None = 0x0,
|
||||||
|
UsbDeviceSpeed_Low = 0x1, ///< USB 1.0 Low Speed
|
||||||
UsbDeviceSpeed_Full = 0x2, ///< USB 1.1 Full Speed
|
UsbDeviceSpeed_Full = 0x2, ///< USB 1.1 Full Speed
|
||||||
UsbDeviceSpeed_High = 0x3, ///< USB 2.0 High Speed
|
UsbDeviceSpeed_High = 0x3, ///< USB 2.0 High Speed
|
||||||
UsbDeviceSpeed_Super = 0x4, ///< USB 3.0 Super Speed
|
UsbDeviceSpeed_Super = 0x4, ///< USB 3.0 Super Speed
|
||||||
@ -119,6 +121,9 @@ Result usbDsEnable(void);
|
|||||||
/// Only available on [5.0.0+].
|
/// Only available on [5.0.0+].
|
||||||
Result usbDsDisable(void);
|
Result usbDsDisable(void);
|
||||||
|
|
||||||
|
/// Only available on [8.0.0+].
|
||||||
|
Result usbDsGetSpeed(UsbDeviceSpeed *out);
|
||||||
|
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
///@name IDsInterface
|
///@name IDsInterface
|
||||||
@ -158,4 +163,3 @@ Result usbDsEndpoint_Stall(UsbDsEndpoint* endpoint);
|
|||||||
Result usbDsEndpoint_SetZlt(UsbDsEndpoint* endpoint, bool zlt); // Sets Zero Length Termination for endpoint
|
Result usbDsEndpoint_SetZlt(UsbDsEndpoint* endpoint, bool zlt); // Sets Zero Length Termination for endpoint
|
||||||
|
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
|
@ -558,6 +558,14 @@ Result usbDsDisable(void) {
|
|||||||
return _usbDsCmdNoIO(&g_usbDsSrv, hosversionAtLeast(11,0,0) ? 10 : 11);
|
return _usbDsCmdNoIO(&g_usbDsSrv, hosversionAtLeast(11,0,0) ? 10 : 11);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result usbDsGetSpeed(UsbDeviceSpeed *out) {
|
||||||
|
if (hosversionBefore(8,0,0))
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
|
||||||
|
_Static_assert(sizeof(*out) == sizeof(u32));
|
||||||
|
return _usbDsCmdNoInOutU32(&g_usbDsSrv, (u32*)out, hosversionAtLeast(11,0,0) ? 11 : 12);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//IDsInterface
|
//IDsInterface
|
||||||
|
|
||||||
@ -729,4 +737,3 @@ Result usbDsEndpoint_SetZlt(UsbDsEndpoint* endpoint, bool zlt) {
|
|||||||
|
|
||||||
return _usbDsCmdInBoolNoOut(&endpoint->s, zlt, 5);
|
return _usbDsCmdInBoolNoOut(&endpoint->s, zlt, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user