diff options
Diffstat (limited to 'include/kernel/udcd.h')
-rw-r--r-- | include/kernel/udcd.h | 122 |
1 files changed, 77 insertions, 45 deletions
diff --git a/include/kernel/udcd.h b/include/kernel/udcd.h index c79f356..1551433 100644 --- a/include/kernel/udcd.h +++ b/include/kernel/udcd.h @@ -308,10 +308,10 @@ typedef struct SceUdcdEndpoint { /** USB driver configuration */ typedef struct SceUdcdConfiguration { - SceUdcdConfigDescriptor *configDescriptors; //!< Pointer to the configuration descriptors - SceUdcdInterfaceSettings *settings; //!< USB driver interface settings + SceUdcdConfigDescriptor *configDescriptors; //!< Pointer to the configuration descriptors + SceUdcdInterfaceSettings *settings; //!< USB driver interface settings SceUdcdInterfaceDescriptor *interfaceDescriptors; //!< Pointer to the first interface descriptor - SceUdcdEndpointDescriptor *endpointDescriptors; //!< Pointer to the first endpoint descriptor + SceUdcdEndpointDescriptor *endpointDescriptors; //!< Pointer to the first endpoint descriptor } SceUdcdConfiguration; /** USB EP0 Device Request @@ -381,48 +381,58 @@ typedef struct SceUdcdDeviceInfo { } SceUdcdDeviceInfo; /** - * Start a USB driver. - * - * @param driverName - Name of the USB driver to start - * @param size - Size of arguments to pass to USB driver start - * @param args - Arguments to pass to USB driver start - * - * @return 0 on success, < 0 on error. - */ + * Waits until an UDCD bus is initialized + * + * @param[in] timeout - Timeout + * @param[in] bus - UDCD bus (default is 2) + * + * @return 0 on success, < 0 on error. + */ +int sceUdcdWaitBusInitialized(unsigned int timeout, int bus); + +/** + * Start a USB driver. + * + * @param driverName - Name of the USB driver to start + * @param size - Size of arguments to pass to USB driver start + * @param args - Arguments to pass to USB driver start + * + * @return 0 on success, < 0 on error. + */ int sceUdcdStart(const char *driverName, int size, void *args); /** - * Stop a USB driver. - * - * @param driverName - Name of the USB driver to stop - * @param size - Size of arguments to pass to USB driver start - * @param args - Arguments to pass to USB driver start - * - * @return 0 on success, < 0 on error. - */ + * Stop a USB driver. + * + * @param driverName - Name of the USB driver to stop + * @param size - Size of arguments to pass to USB driver start + * @param args - Arguments to pass to USB driver start + * + * @return 0 on success, < 0 on error. + */ int sceUdcdStop(const char *driverName, int size, void *args); /** - * Activate a USB driver. - * - * @param pid - Product ID for the default USB Driver - * - * @return 0 on success, < 0 on error. - */ + * Activate a USB driver. + * + * @param pid - Product ID for the default USB Driver + * + * @return 0 on success, < 0 on error. + */ int sceUdcdActivate(unsigned int productId); /** - * Deactivate USB driver. - * - * @return 0 on success, < 0 on error. - */ + * Deactivate USB driver. + * + * @return 0 on success, < 0 on error. + */ int sceUdcdDeactivate(void); /** - * Get USB state - * - * @return One or more ::SceUdcdStatus. - */ + * Get USB state + * + * @return One or more ::SceUdcdStatus. + */ int sceUdcdGetDeviceState(void); /** @@ -435,22 +445,44 @@ int sceUdcdGetDeviceState(void); int sceUdcdGetDeviceInfo(SceUdcdDeviceInfo *devInfo); /** - * Get state of a specific USB driver - * - * @param driverName - name of USB driver to get status from - * - * @return SCE_UDCD_STATUS_DRIVER_STARTED if the driver has been started, SCE_UDCD_STATUS_DRIVER_REGISTERED if it is stopped - */ + * Get state of a specific USB driver + * + * @param driverName - name of USB driver to get status from + * + * @return SCE_UDCD_STATUS_DRIVER_STARTED if the driver has been started, SCE_UDCD_STATUS_DRIVER_REGISTERED if it is stopped + */ int sceUdcdGetDrvState(const char *driverName); /** - * Wait for USB state - * @param state - combination of states (returned by ::sceUdcdGetDeviceState) - * @param waitMode - one of the ::SceEventFlagWaitTypes - * @param timeout - pointer to timeout - * @return the usb state or < 0 in case of error + * Get state of a specific USB driver for an UDCD bus + * + * @param driverName - name of USB driver to get status from + * @param[in] bus - UDCD bus (default is 2) + * + * @return SCE_UDCD_STATUS_DRIVER_STARTED if the driver has been started, SCE_UDCD_STATUS_DRIVER_REGISTERED if it is stopped */ -int sceUdcdWaitState(unsigned int state, unsigned int waitMode, SceUInt *timeout); +int sceUdcdGetDrvStateInternal(const char *driverName, int bus); + +/** + * Wait for state + * + * @param[in] waitParam - Wait parameter + * @param[in] timeout - Timeout + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdWaitState(SceUdcdWaitParam *waitParam, unsigned int timeout); + +/** + * Wait for state for an UDCD bus + * + * @param[in] waitParam - Wait parameter + * @param[in] timeout - Timeout + * @param[in] bus - UDCD bus (default is 2) + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdWaitStateInternal(SceUdcdWaitParam *waitParam, unsigned int timeout, int bus); /** * Register a USB driver. |