Root/atusb/fw/include/atusb/ep0.h

Source at commit 96b6a50b3a1f9f889e1a59631bc17836511aaf06 created 8 years 11 months ago.
By Werner Almesberger, The Great ATSPI Renaming, part 2: rename ATSPI_* identifiers to ATUSB_*
1/*
2 * include/atusb/ep0.h - EP0 extension protocol
3 *
4 * Written 2008-2010 by Werner Almesberger
5 * Copyright 2008-2010 Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13
14#ifndef EP0_H
15#define EP0_H
16
17/*
18 * Direction bRequest wValue wIndex wLength
19 *
20 * ->host ATUSB_ID - - 3
21 * ->host ATUSB_BUILD - - #bytes
22 * host-> ATUSB_RESET - - 0
23 *
24 * host-> ATUSB_RF_RESET - - 0
25 * ->host ATUSB_POLL_INT - - 1
26 * host-> ATUSB_TEST - - 0
27 *
28 * host-> ATUSB_REG_WRITE value addr 0
29 * ->host ATUSB_REG_READ - addr 1
30 * host-> ATUSB_BUF_WRITE - - #bytes
31 * ->host ATUSB_BUF_READ - - #bytes
32 * host-> ATUSB_SRAM_WRITE - addr #bytes
33 * ->host ATUSB_SRAM_READ - addr #bytes
34 */
35
36/*
37 * EP0 protocol:
38 *
39 * 0.0 initial release
40 * 0.1 addition of ATUSB_TEST
41 */
42
43#define EP0ATUSB_MAJOR 0 /* EP0 protocol, major revision */
44#define EP0ATUSB_MINOR 1 /* EP0 protocol, minor revision */
45
46#define HW_TYPE_100813 0 /* 100813 */
47
48
49/*
50 * bmRequestType:
51 *
52 * D7 D6..5 D4...0
53 * | | |
54 * direction (0 = host->dev)
55 * type (2 = vendor)
56 * recipient (0 = device)
57 */
58
59
60#define ATUSB_TO_DEV(req) (0x40 | (req) << 8)
61#define ATUSB_FROM_DEV(req) (0xc0 | (req) << 8)
62
63
64enum atspi_requests {
65    ATUSB_ID = 0x00,
66    ATUSB_BUILD,
67    ATUSB_RESET,
68    ATUSB_RF_RESET = 0x10,
69    ATUSB_POLL_INT,
70    ATUSB_TEST,
71    ATUSB_REG_WRITE = 0x20,
72    ATUSB_REG_READ,
73    ATUSB_BUF_WRITE,
74    ATUSB_BUF_READ,
75    ATUSB_SRAM_WRITE,
76    ATUSB_SRAM_READ,
77};
78
79
80void ep0_init(void);
81
82#endif /* !EP0_H */
83

Archive Download this file



interactive