summaryrefslogtreecommitdiff
path: root/openpcd
diff options
context:
space:
mode:
author(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-08-11 09:18:21 +0000
committer(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-08-11 09:18:21 +0000
commitea375a570cdbbb678ea06771e4b263d88e07ae4d (patch)
tree38cca8085753c3eb6d80bf89d2872143d6ae1be5 /openpcd
parentb244501b670d8e2465adbaef831f943c99773577 (diff)
- remove local copy of openpcd.h, use the one from firmware instead
- adopt to new openpcd_hdr (4 bytes) git-svn-id: https://svn.openpcd.org:2342/trunk@103 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpcd')
-rw-r--r--openpcd/opcd_test/opcd_test.c2
-rw-r--r--openpcd/opcd_test/opcd_usb.c8
-rw-r--r--openpcd/opcd_test/openpcd.h34
3 files changed, 4 insertions, 40 deletions
diff --git a/openpcd/opcd_test/opcd_test.c b/openpcd/opcd_test/opcd_test.c
index c9faa92..7b58aca 100644
--- a/openpcd/opcd_test/opcd_test.c
+++ b/openpcd/opcd_test/opcd_test.c
@@ -30,7 +30,7 @@
#include <usb.h>
-#include "openpcd.h"
+#include "../firmware/include/openpcd.h"
#include "opcd_usb.h"
static int get_number(const char *optarg, unsigned int min,
diff --git a/openpcd/opcd_test/opcd_usb.c b/openpcd/opcd_test/opcd_usb.c
index bd6eeb4..62f3d7f 100644
--- a/openpcd/opcd_test/opcd_usb.c
+++ b/openpcd/opcd_test/opcd_usb.c
@@ -6,7 +6,7 @@
#include <sys/types.h>
#include "ausb/ausb.h"
-#include "openpcd.h"
+#include "../firmware/include/openpcd.h"
#include "opcd_usb.h"
@@ -58,9 +58,8 @@ static struct usb_device *find_opcd_handle(void)
static void opcd_dump_hdr(struct openpcd_hdr *hdr)
{
- printf("IRQ: cmd=0x%02x, flags=0x%02x, reg=0x%02x, val=0x%02x "
- "len=%d, res=%d\n", hdr->cmd, hdr->flags, hdr->reg,
- hdr->val, hdr->len, hdr->res);
+ printf("IRQ: cmd=0x%02x, flags=0x%02x, reg=0x%02x, val=0x%02x\n",
+ hdr->cmd, hdr->flags, hdr->reg, hdr->val);
}
static void handle_interrupt(struct usbdevfs_urb *uurb, void *userdata)
@@ -167,7 +166,6 @@ int opcd_send_command(struct opcd_handle *od, u_int8_t cmd,
ohdr->cmd = cmd;
ohdr->reg = reg;
ohdr->val = val;
- ohdr->len = len;
if (data && len)
memcpy(ohdr->data, data, len);
diff --git a/openpcd/opcd_test/openpcd.h b/openpcd/opcd_test/openpcd.h
deleted file mode 100644
index d721baf..0000000
--- a/openpcd/opcd_test/openpcd.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#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 */
-
-#endif
personal git repositories of Harald Welte. Your mileage may vary