]>
Commit | Line | Data |
---|---|---|
5bcc76c4 | 1 | /*\r |
2 | * at91sam7s USB CDC device implementation\r | |
3 | *\r | |
4 | * Copyright (c) 2012, Roel Verdult\r | |
5 | * All rights reserved.\r | |
6 | *\r | |
7 | * Redistribution and use in source and binary forms, with or without\r | |
8 | * modification, are permitted provided that the following conditions are met:\r | |
9 | * 1. Redistributions of source code must retain the above copyright\r | |
10 | * notice, this list of conditions and the following disclaimer.\r | |
11 | * 2. Redistributions in binary form must reproduce the above copyright\r | |
12 | * notice, this list of conditions and the following disclaimer in the\r | |
13 | * documentation and/or other materials provided with the distribution.\r | |
14 | * 3. Neither the name of the copyright holders nor the\r | |
15 | * names of its contributors may be used to endorse or promote products\r | |
16 | * derived from this software without specific prior written permission.\r | |
17 | *\r | |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY\r | |
19 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r | |
20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r | |
21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY\r | |
22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r | |
23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r | |
24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r | |
25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r | |
26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r | |
27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r | |
28 | *\r | |
29 | * based on the "Basic USB Example" from ATMEL (doc6123.pdf)\r | |
30 | *\r | |
31 | * @file usb_cdc.c\r | |
32 | * @brief\r | |
33 | */\r | |
34 | \r | |
72622d64 | 35 | #ifndef USB_CDC_H__\r |
36 | #define USB_CDC_H__\r | |
5bcc76c4 | 37 | \r |
72622d64 | 38 | #include <stddef.h>\r |
39 | #include <stdint.h>\r | |
40 | #include <stdbool.h>\r | |
867e10a5 | 41 | #include "usb_cmd.h"\r |
5bcc76c4 | 42 | \r |
72622d64 | 43 | extern void usb_disable();\r |
44 | extern void usb_enable();\r | |
72622d64 | 45 | extern bool usb_poll();\r |
46 | extern bool usb_poll_validate_length();\r | |
867e10a5 | 47 | extern bool cmd_receive(UsbCommand* cmd);\r |
b8ed9975 | 48 | extern bool cmd_send(uint16_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, uint16_t datalen); // new variable sized response\r |
49 | extern bool cmd_send_old(uint16_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, uint16_t datalen); // old fixed size response\r | |
5bcc76c4 | 50 | \r |
867e10a5 | 51 | #endif // USB_CDC_H__\r |