summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-07-23 18:38:25 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-07-23 18:38:25 +0000
commit91f920e0d37910c789528f3422dc904615f1a53c (patch)
tree4ccd2fe47e08587627e01400e8fa27b754df1626 /include
parent52f7a5374c6ca58a47dc12c553a66a9f04535bc6 (diff)
add support for new OpenPCD design
git-svn-id: https://svn.gnumonks.org/trunk/librfid@1851 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'include')
-rw-r--r--include/librfid/rfid_reader.h1
-rw-r--r--include/librfid/rfid_reader_openpcd.h42
2 files changed, 43 insertions, 0 deletions
diff --git a/include/librfid/rfid_reader.h b/include/librfid/rfid_reader.h
index 695221d..f604852 100644
--- a/include/librfid/rfid_reader.h
+++ b/include/librfid/rfid_reader.h
@@ -48,6 +48,7 @@ struct rfid_reader {
enum rfid_reader_id {
RFID_READER_CM5121,
RFID_READER_PEGODA,
+ RFID_READER_OPENPCD,
};
struct rfid_reader_handle {
diff --git a/include/librfid/rfid_reader_openpcd.h b/include/librfid/rfid_reader_openpcd.h
new file mode 100644
index 0000000..3f8a071
--- /dev/null
+++ b/include/librfid/rfid_reader_openpcd.h
@@ -0,0 +1,42 @@
+#ifndef _OPENPCD_PROTO_H
+#define _OPENPCD_PROTO_H
+
+/* This header file describes the USB protocol of the OpenPCD RFID reader */
+
+#include <sys/types.h>
+
+struct openpcd_hdr {
+ u_int8_t cmd; /* command */
+ u_int8_t flags;
+ u_int8_t reg; /* register */
+ u_int8_t val; /* value (in case of write *) */
+ u_int16_t len;
+ u_int16_t res;
+ u_int8_t data[0];
+} __attribute__((packed));
+
+#define OPENPCD_REG_MAX 0x3f
+
+#define OPENPCD_CMD_WRITE_REG 0x01
+#define OPENPCD_CMD_WRITE_FIFO 0x02
+#define OPENPCD_CMD_WRITE_VFIFO 0x03
+#define OPENPCD_CMD_REG_BITS_CLEAR 0x04
+#define OPENPCD_CMD_REG_BITS_SET 0x05
+
+#define OPENPCD_CMD_READ_REG 0x11
+#define OPENPCD_CMD_READ_FIFO 0x12
+#define OPENPCD_CMD_READ_VFIFO 0x13
+
+#define OPENPCD_CMD_SET_LED 0x21
+
+#define OPENPCD_CMD_IRQ 0x40 /* IRQ reported by RC632 */
+
+#define OPENPCD_VENDOR_ID 0x2342
+#define OPENPCD_PRODUCT_ID 0x0001
+#define OPENPCD_OUT_EP 0x01
+#define OPENPCD_IN_EP 0x82
+#define OPENPCD_IRQ_EP 0x83
+
+extern struct rfid_reader rfid_reader_openpcd;
+
+#endif
personal git repositories of Harald Welte. Your mileage may vary