summaryrefslogtreecommitdiff
path: root/include/user/usbserial.h
diff options
context:
space:
mode:
authorTim Keller2016-11-10 21:41:29 -0500
committerSunguk Lee2016-11-11 11:41:29 +0900
commit63043bfcd07ee2d2d2708318f57bcededceef3cb (patch)
tree4927c09ad3b81c16cdeade9f7d0afaee38559e6f /include/user/usbserial.h
parentFixed power callb (diff)
downloadvds-libraries-63043bfcd07ee2d2d2708318f57bcededceef3cb.tar.gz
Add DB defines and Header for SceUsbSerial (#81)
* Added DB defines for SceUsbSerial Added in header for SceUsbSerial * Changed to usbserial.h updated db.json to camelCase Fixed spelling errors in usbserial.h added documentation from wiki to usbserial.h * sceUsbSerialget_len -> sceUsbSerialGetLen sceUsbSerialget_lenForKernel -> sceUsbSerialGetLenForKernel * Dangit missed some information on the wiki! * fix camelCase. * fix some formatting issues * Split usbserial.h to psp2kern/kernel/usbserial.h fix some documentation. * Moved kernel defines for usbserial.h to appropriate folder Fix preprocessor macros update copyright * Git decided my changes were not important and chose to ignore them
Diffstat (limited to '')
-rw-r--r--include/user/usbserial.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/include/user/usbserial.h b/include/user/usbserial.h
new file mode 100644
index 0000000..baf4c41
--- /dev/null
+++ b/include/user/usbserial.h
@@ -0,0 +1,83 @@
+#ifndef _PSP2_USBSERIAL_H_
+#define _PSP2_USBSERIAL_H_
+
+#include <psp2/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Activate USB serial device
+ *
+ * @return 0 on success, < 0 on error
+ *
+ * @note The user is responsible for making sure no other UDC driver is active. This activates UDC as a "PS Vita" Type D device.
+ *
+ * @note Wrapper for kernel function sceUsbSerialStart()
+ */
+int sceUsbSerialStart(void);
+
+/**
+ * Setup USB serial device
+ *
+ * @return 0 on success, < 0 on error
+ *
+ * @param unk Unknown
+ *
+ * @note Wrapper for kernel function sceUsbSerialSetup()
+ */
+int sceUsbSerialSetup(int unk);
+
+/**
+ * Close USB serial device
+ *
+ * @note Wrapper for kernel function sceUsbSerialClose()
+ */
+int sceUsbSerialClose(void);
+
+/**
+ * Close USB serial device
+ *
+ * @return Returns 1 when serial port is open
+ *
+ * @note Wrapper for kernel function sceUsbSerialStatus()
+ */
+int sceUsbSerialStatus(void);
+
+/**
+ * Get receive buffer length
+ *
+ * @return Returns length of USB rx buffer
+ *
+ * @note Wrapper for kernel function sceUsbSerialGetLen()
+ */
+unsigned int sceUsbSerialGetLen(void);
+
+/**
+ * Send data
+ * @param[in] *buffer data to send over usb
+ * @param len int len of serial buffer data
+ * @param unk1 Unknown
+ * @param unk2 Unknown
+ * @note max send length is 0x10000
+ * @note Wrapper for kernel function sceUsbSerialSend()
+ */
+unsigned int sceUsbSerialSend(const void *buffer, unsigned int len, int unk1, int unk2);
+
+/**
+ * Receive Data
+ *
+ * @param[out] *buffer buffer for incoming data
+ * @param max_len max data length to receive
+ * @param unk1 Unknown
+ * @param unk2 Unknown
+ * @note max recv length is 0x10000
+ * @note Wrapper for kernel function sceUsbSerialRecv()
+ */
+unsigned int sceUsbSerialRecv(void *buffer, unsigned int max_len, int unk1, int unk2);
+
+#ifdef __cplusplus
+}
+#endif
+#endif