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

Source at commit b493f093636595a76b3d1be612df018fa77c7474 created 8 years 8 months ago.
By Werner Almesberger, Great renaming: atrf/wpan-atrf* becomes atusb/atusb*
1/*
2 * include/atspi/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 ATSPI_ID - - 3
21 * ->host ATSPI_BUILD - - #bytes
22 * host-> ATSPI_RESET - - 0
23 *
24 * host-> ATSPI_RF_RESET - - 0
25 * ->host ATSPI_POLL_INT - - 1
26 *
27 * host-> ATSPI_REG_WRITE value addr 0
28 * ->host ATSPI_REG_READ - addr 1
29 * host-> ATSPI_BUF_WRITE - - #bytes
30 * ->host ATSPI_BUF_READ - - #bytes
31 * host-> ATSPI_SRAM_WRITE - addr #bytes
32 * ->host ATSPI_SRAM_READ - addr #bytes
33 */
34
35/*
36 * EP0 protocol:
37 *
38 * 0.0 initial release
39 */
40
41#define EP0ATSPI_MAJOR 0 /* EP0 protocol, major revision */
42#define EP0ATSPI_MINOR 0 /* EP0 protocol, minor revision */
43
44#define HW_TYPE_100813 0 /* 100813 */
45
46
47/*
48 * bmRequestType:
49 *
50 * D7 D6..5 D4...0
51 * | | |
52 * direction (0 = host->dev)
53 * type (2 = vendor)
54 * recipient (0 = device)
55 */
56
57
58#define ATSPI_TO_DEV(req) (0x40 | (req) << 8)
59#define ATSPI_FROM_DEV(req) (0xc0 | (req) << 8)
60
61
62enum atspi_requests {
63    ATSPI_ID = 0x00,
64    ATSPI_BUILD,
65    ATSPI_RESET,
66    ATSPI_RF_RESET = 0x10,
67    ATSPI_POLL_INT,
68    ATSPI_REG_WRITE = 0x20,
69    ATSPI_REG_READ,
70    ATSPI_BUF_WRITE,
71    ATSPI_BUF_READ,
72    ATSPI_SRAM_WRITE,
73    ATSPI_SRAM_READ,
74};
75
76
77void ep0_init(void);
78
79#endif /* !EP0_H */
80

Archive Download this file



interactive