openpcd/firmware/src/pcd.h @ master
1 | f57b548d | (no author) | #ifndef _OPENPCD_H
|
---|---|---|---|
2 | #define _OPENPCD_H
|
||
3 | /* pcd.h - OpenPCD USB protocol definitions
|
||
4 | * (C) 2006 Harald Welte <laforge@gnumonks.org>
|
||
5 | */
|
||
6 | |||
7 | #include <sys/types.h>
|
||
8 | |||
9 | struct opcd_cmd_hdr { |
||
10 | 373c172a | Harald Welte | uint8_t cmd; |
11 | uint8_t arg1; |
||
12 | uint16_t arg2; |
||
13 | f57b548d | (no author) | } __attribute__ ((packed)); |
14 | |||
15 | enum opcd_cmd { |
||
16 | OPCD_CMD_REG_READ = 0x01, /* Transparent Read of RC632 REG */ |
||
17 | OPCD_CMD_REG_WRITE = 0x02, /* Transparent Write to RC632 REG */ |
||
18 | |||
19 | OPCD_CMD_FIFO_READ = 0x03, /* Transparent Read fron RC632 FIFO */ |
||
20 | OPCD_CMD_FIFO_WRITE = 0x04, /* Transparent Write to RC632 FIFO */ |
||
21 | |||
22 | OPCD_CMD_VFIFO_READ = 0x05, /* Read bytes from virtual FIFO */ |
||
23 | OPCD_CMD_VFIFO_WRITE = 0x06, /* Write bytes to virtual FIFO */ |
||
24 | OPCD_CMD_VFIFO_MODE = 0x07, /* Set Virtual FIFO mode */ |
||
25 | |||
26 | OPCD_CMD_REG_SETBIT = 0x08, /* Set a bit in RC632 Register */ |
||
27 | OPCD_CMD_REG_CLRBIT = 0x09, /* Clear a bit in RC632 Register */ |
||
28 | };
|
||
29 | |||
30 | struct opcd_status_hdr { |
||
31 | 373c172a | Harald Welte | uint8_t cause, /* interrupt cause register RC632 */ |
32 | uint8_t prim_status, /* primary status register RC632 */ |
||
33 | f57b548d | (no author) | } __attribute__ ((packed)); |
34 | |||
35 | #endif /* _OPENPCD_H */ |