Line 1:
Line 1:
−
nsysuhs.rpl is the system library that provides low-level USB device access. It is a wrapper over the [[/dev/uhs]] IOSU interface, and is meant for USB peripheral drivers. Despite nsysuhs.rpl's presence in OSv11, it is impossible to load with OSDynLoad_Acquire(), at least in the web browser; doing so returns no error but an invalid handle. There is one known library that performs low-level USB operations, [[usb_mic.rpl]], but it includes its own copy of the nsysuhs.rpl functions. This seems to imply that nsysuhs.rpl was not meant to be used directly be anything.
+
nsysuhs.rpl is the system library that provides low-level USB device access. It is a wrapper over the [[:/dev/uhs]] IOSU interface, and is meant for USB peripheral drivers. Despite nsysuhs.rpl's presence in OSv11, it is impossible to load with OSDynLoad_Acquire(), at least in the web browser; doing so returns no error but an invalid handle. There is one known library that performs low-level USB operations, [[usb_mic.rpl]], but it includes its own copy of the nsysuhs.rpl functions. This seems to imply that nsysuhs.rpl was not meant to be used directly be anything, and may only be included by accident.
+
+
==Functions==
+
All of the UHS functions communicate with the IOSU node through a client connection. This connection consists of an IOSU handle, an IPC memory pool, and state information, which is contained in the devbuf argument. devbuf is an opaque 0x18-byte structure, and the first argument to all UHS functions.
+
===Client===
+
{| class="wikitable"
+
!Name
+
!Prototype
+
!Description
+
|-
+
|UhsClientOpen
+
|<code>int UhsClientOpen(void *devbuf, UhsClientOptions *options);</code>
+
|Open a handle to the UHS interface with the specified options, placing the handle in devbuf and returning 0 on success
+
|-
+
|UhsClientClose
+
|<code>int UhsClientClose(void *devbuf);</code>
+
|Close a handle to the UHS interface, returning 0 on success
+
|}
+
+
==Structures==
+
===Client===
+
<syntaxhighlight lang="C">
+
typedef struct
+
{
+
int controller_num;
+
void *pool_mem;
+
uint32_t pool_size;
+
} UhsClientOptions;
+
</syntaxhighlight>