From ea375a570cdbbb678ea06771e4b263d88e07ae4d Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> Date: Fri, 11 Aug 2006 09:18:21 +0000 Subject: - 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 --- openpcd/opcd_test/opcd_test.c | 2 +- openpcd/opcd_test/opcd_usb.c | 8 +++----- openpcd/opcd_test/openpcd.h | 34 ---------------------------------- 3 files changed, 4 insertions(+), 40 deletions(-) delete mode 100644 openpcd/opcd_test/openpcd.h 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 -#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 #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 - -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 -- cgit v1.2.3