IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Git Source Tree
Root/
Source at commit ad2c72fa7f4f373716016dd0777f44b85c365209 created 13 years 3 months ago. By Werner Almesberger, atusb: firmware update for the 2010-12-16 board series | |
---|---|
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 /* 2010-08-13 */ |
47 | #define HW_TYPE_101216 1 /* 2010-12-16 */ |
48 | |
49 | |
50 | /* |
51 | * bmRequestType: |
52 | * |
53 | * D7 D6..5 D4...0 |
54 | * | | | |
55 | * direction (0 = host->dev) |
56 | * type (2 = vendor) |
57 | * recipient (0 = device) |
58 | */ |
59 | |
60 | |
61 | #define ATUSB_TO_DEV(req) (0x40 | (req) << 8) |
62 | #define ATUSB_FROM_DEV(req) (0xc0 | (req) << 8) |
63 | |
64 | |
65 | enum atspi_requests { |
66 | ATUSB_ID = 0x00, |
67 | ATUSB_BUILD, |
68 | ATUSB_RESET, |
69 | ATUSB_RF_RESET = 0x10, |
70 | ATUSB_POLL_INT, |
71 | ATUSB_TEST, |
72 | ATUSB_REG_WRITE = 0x20, |
73 | ATUSB_REG_READ, |
74 | ATUSB_BUF_WRITE, |
75 | ATUSB_BUF_READ, |
76 | ATUSB_SRAM_WRITE, |
77 | ATUSB_SRAM_READ, |
78 | }; |
79 | |
80 | |
81 | void ep0_init(void); |
82 | |
83 | #endif /* !EP0_H */ |
84 |