Contiki 2.5
usb_specific_request.h
Go to the documentation of this file.
1 /* This file has been prepared for Doxygen automatic documentation generation.*/
2 /*! \file *********************************************************************
3  *
4  * \brief
5  * This file contains the user callback functions corresponding to the
6  * application.
7  *
8  * \addtogroup usbtask
9  *
10  * \author
11  * Atmel Corporation: http://www.atmel.com \n
12  * Support email: avr@atmel.com
13  *
14  ******************************************************************************/
15 /* Copyright (c) 2008 ATMEL Corporation
16  All rights reserved.
17 
18  Redistribution and use in source and binary forms, with or without
19  modification, are permitted provided that the following conditions are met:
20 
21  * Redistributions of source code must retain the above copyright
22  notice, this list of conditions and the following disclaimer.
23  * Redistributions in binary form must reproduce the above copyright
24  notice, this list of conditions and the following disclaimer in
25  the documentation and/or other materials provided with the
26  distribution.
27  * Neither the name of the copyright holders nor the names of
28  contributors may be used to endorse or promote products derived
29  from this software without specific prior written permission.
30 
31  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
35  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  POSSIBILITY OF SUCH DAMAGE.
42 */
43 
44 #ifndef _USB_SPECIFIC_REQUEST_H_
45 #define _USB_SPECIFIC_REQUEST_H_
46 
47 /*_____ I N C L U D E S ____________________________________________________*/
48 
49 #include "config.h"
50 
51 /*_____ M A C R O S ________________________________________________________*/
52 
53 
54 #define SEND_ENCAPSULATED_COMMAND 0x00
55 #define GET_ENCAPSULATED_COMMAND 0x01
56 #define GET_LINE_CODING 0x21
57 #define SET_LINE_CODING 0x20
58 #define SET_CONTROL_LINE_STATE 0x22
59 #define SEND_BREAK 0x23
60 #define MASS_STORAGE_RESET 0xFF
61 #define GET_MAX_LUN 0xFE
62 
63 extern FLASH S_usb_device_descriptor usb_dev_desc_composite;
64 extern FLASH S_usb_device_descriptor usb_dev_desc_network;
65 extern FLASH S_usb_user_configuration_descriptor_composite usb_conf_desc_composite;
66 extern FLASH S_usb_user_configuration_descriptor_network usb_conf_desc_network;
67 extern FLASH S_usb_device_qualifier_descriptor usb_qual_desc;
68 extern FLASH S_usb_language_id usb_user_language_id;
69 
70 
71 
72 /*_____ D E F I N I T I O N ________________________________________________*/
73 Bool usb_user_read_request(U8, U8);
74 Bool usb_user_get_descriptor(U8 , U8);
75 void usb_user_endpoint_init(U8);
76 Bool usb_user_set_alt_interface(U8 interface, U8 alt_setting);
77 
78 PGM_P usb_user_get_string(U8 string_type);
79 const char* usb_user_get_string_sram(U8 string_type);
80 
81 void cdc_get_line_coding();
82 void cdc_set_line_coding();
83 void cdc_set_control_line_state (void);
84 
85 extern usb_mode_t usb_mode;
86 
87 // ____ T Y P E D E F I N I T I O N _______________________________________
88 
89 #endif // _USB_SPECIFIC_REQUEST_H_
90