aboutsummaryrefslogtreecommitdiff
path: root/host/usb.h
diff options
context:
space:
mode:
authorjaseg <jaseg@jaseg.net>2014-03-04 22:49:48 +0100
committerjaseg <jaseg@jaseg.net>2014-03-04 22:49:48 +0100
commit8f86c5ac4576b36aff906b91e194e68eb343c536 (patch)
tree228749e6d71fd247a61c16c5bbad0c2c86a2ef0d /host/usb.h
parentc4dd54e16fcc31c43c2ccccbb34eea07b9de735c (diff)
parent7878aa1d455ab24d0336fc68eb09f726bcba10b2 (diff)
downloadmatelight-8f86c5ac4576b36aff906b91e194e68eb343c536.tar.gz
matelight-8f86c5ac4576b36aff906b91e194e68eb343c536.tar.bz2
matelight-8f86c5ac4576b36aff906b91e194e68eb343c536.zip
Merge branch 'master' of matelight:matelight
Diffstat (limited to 'host/usb.h')
-rw-r--r--host/usb.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/host/usb.h b/host/usb.h
new file mode 100644
index 0000000..fee3487
--- /dev/null
+++ b/host/usb.h
@@ -0,0 +1,27 @@
+#ifndef __USB_H__
+#define __USB_H__
+
+#include <libusb-1.0/libusb.h>
+
+#define MATELIGHT_VID 0x1cbe
+#define MATELIGHT_PID 0x0003
+
+#define CRATE_WIDTH 5
+#define CRATE_HEIGHT 4
+
+#define MATELIGHT_FRAMEDATA_ENDPOINT 0x01
+#define MATELIGHT_TIMEOUT 1000
+
+#define GAMMA 2.5F
+
+typedef struct {
+ libusb_device_handle *handle;
+ char *serial;
+} matelight_handle;
+
+int matelight_usb_init(void);
+void matelight_usb_destroy(void);
+matelight_handle *matelight_open(void);
+int matelight_send_frame(matelight_handle *ml, void *buf, size_t w, size_t h, float brightness, int alpha);
+
+#endif//__USB_H__