diff --git a/src/usb.h b/src/usb.h index ab55866..e99b44c 100644 --- a/src/usb.h +++ b/src/usb.h @@ -5,33 +5,69 @@ #include #include +/** @file usb.h + * @brief USB Module Header File + * + * This file contains functions and definitions related to USB operations, + * including initializing, starting, stopping, and deinitializing USB storage. + */ + +/** @brief Gets the current USB state. + * + * This macro retrieves the current state of the USB connection. + * It maps directly to `sceUsbGetState`. + */ #define oslGetUsbState sceUsbGetState /** @defgroup Usb USB + * @brief USB functions to start/stop USB storage. + * @{ + */ - USB functions to start/stop usb storage - @{ -*/ - -enum {OSL_USB_ACTIVATED=PSP_USB_ACTIVATED, - OSL_USB_CABLE_CONNECTED=PSP_USB_CABLE_CONNECTED, - OSL_USB_CONNECTION_ESTABLISHED=PSP_USB_CONNECTION_ESTABLISHED}; +/** @brief USB State Enum. + * + * Enum containing the possible states of the USB connection. + */ +enum { + OSL_USB_ACTIVATED = PSP_USB_ACTIVATED, /**< USB is activated */ + OSL_USB_CABLE_CONNECTED = PSP_USB_CABLE_CONNECTED, /**< USB cable is connected */ + OSL_USB_CONNECTION_ESTABLISHED = PSP_USB_CONNECTION_ESTABLISHED /**< USB connection is established */ +}; -/** Initializes USB modules, must be called before oslStartUsbStorage. -Returns 0 on success.*/ +/** @brief Initializes the USB storage modules. + * + * This function initializes the necessary USB modules. It must be called + * before any other USB storage operations. + * + * @return Returns 0 on success, a negative value on failure. + */ extern int oslInitUsbStorage(); -/** Starts USB storage -Returns 0 on success.*/ +/** @brief Starts USB storage. + * + * This function starts the USB storage, making the PSP appear as a USB storage + * device when connected to a host. + * + * @return Returns 0 on success, a negative value on failure. + */ extern int oslStartUsbStorage(); -/** Stops USB storage -Returns 0 on success.*/ +/** @brief Stops USB storage. + * + * This function stops the USB storage, safely disconnecting the PSP from the + * host system. + * + * @return Returns 0 on success, a negative value on failure. + */ extern int oslStopUsbStorage(); -/** Deinitializes USB modules. */ +/** @brief Deinitializes the USB storage modules. + * + * This function deinitializes the USB modules, releasing any resources that + * were allocated during initialization. + */ extern int oslDeinitUsbStorage(); -/** @} */ // end of USB +/** @} */ // end of Usb #endif