summaryrefslogtreecommitdiff
path: root/include/user
diff options
context:
space:
mode:
Diffstat (limited to 'include/user')
-rw-r--r--include/user/kernel/clib.h11
-rw-r--r--include/user/usbserial.h83
2 files changed, 94 insertions, 0 deletions
diff --git a/include/user/kernel/clib.h b/include/user/kernel/clib.h
index bb8ba0d..1188707 100644
--- a/include/user/kernel/clib.h
+++ b/include/user/kernel/clib.h
@@ -9,10 +9,21 @@ extern "C" {
#endif
int sceClibStrcmp(const char *, const char *);
+void *sceClibStrncmp(const char *, const char *, SceSize);
+int sceClibStrncasecmp(const char *, const char *, SceSize);
+char *sceClibStrncpy(char *, const char *, SceSize);
+char *sceClibStrncat(char *, const char *, SceSize);
+SceSize sceClibStrnlen(const char *, SceSize);
+char *sceClibStrrchr(const char *, int);
+int sceClibPrintf(const char *, ...);
int sceClibSnprintf(char *, SceSize, const char *, ...);
int sceClibVsnprintf(char *, SceSize, const char *, va_list);
+void *sceClibMemset(void *, int, SceSize);
+void *sceClibMemcpy(void *, const void *, SceSize);
+void *sceClibMemmove(void *, const void *, SceSize);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/user/usbserial.h b/include/user/usbserial.h
new file mode 100644
index 0000000..00c9ba6
--- /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 sceUsbSerialGetRecvBufferSize(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