Sonochan II 0.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
usb_specific_request.h
Go to the documentation of this file.
1 /* -*- mode: c++; tab-width: 4; c-basic-offset: 4 -*- */
2 /* This header file is part of the ATMEL AVR32-SoftwareFramework-AT32UC3-1.5.0 Release */
3
4 /*This file is prepared for Doxygen automatic documentation generation.*/
20 /* Copyright (c) 2009 Atmel Corporation. All rights reserved.
21 *
22 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions are met:
24 *
25 * 1. Redistributions of source code must retain the above copyright notice, this
26 * list of conditions and the following disclaimer.
27 *
28 * 2. Redistributions in binary form must reproduce the above copyright notice,
29 * this list of conditions and the following disclaimer in the documentation
30 * and/or other materials provided with the distribution.
31 *
32 * 3. The name of Atmel may not be used to endorse or promote products derived
33 * from this software without specific prior written permission.
34 *
35 * 4. This software may only be redistributed and used in connection with an Atmel
36 * AVR product.
37 *
38 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
39 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
40 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
41 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
42 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
43 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
44 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
46 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
47 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
48 *
49 * Additions and Modifications to ATMEL AVR32-SoftwareFramework-AT32UC3 are:
50 *
51 * Copyright (C) Alex Lee
52 *
53 * This program is free software; you can redistribute it and/or
54 * modify it under the terms of the GNU General Public License
55 * as published by the Free Software Foundation; either version 2
56 * of the License, or (at your option) any later version.
57 *
58 * This program is distributed in the hope that it will be useful,
59 * but WITHOUT ANY WARRANTY; without even the implied warranty of
60 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
61 * GNU General Public License for more details.
62 *
63 * You should have received a copy of the GNU General Public License
64 * along with this program; if not, write to the Free Software
65 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
66 */
67
68 #ifndef _USB_SPECIFIC_REQUEST_H_
69 #define _USB_SPECIFIC_REQUEST_H_
70
71
72 //_____ I N C L U D E S ____________________________________________________
73
74 #include "conf_usb.h"
75
76 #if USB_DEVICE_FEATURE == DISABLED
77 #error usb_specific_request.h is #included although USB_DEVICE_FEATURE is disabled
78 #endif
79
80
81
82
83 //_____ M A C R O S ________________________________________________________
84
85
86 //_____ D E F I N I T I O N S ______________________________________________
87
88 extern U8 clock_selected;
89 extern Bool clock_changed;
90
91 extern U8 usb_feature_report[9];
92 extern U8 usb_report[9];
93
94 extern U8 g_u8_report_rate;
95
96 extern volatile U16 usb_interface_nb;
97 extern volatile U8 usb_alternate_setting, usb_alternate_setting_out;
98 extern volatile Bool usb_alternate_setting_changed, usb_alternate_setting_out_changed;
99
100 // convert an unsigned int sample rate, in Hz,
101 // into the four bytes required for usb transfer
102 #define Usb_sample_rate_as_bytes(rate) (((rate)>>0)&0xff),(((rate)>>8)&0xff),(((rate)>>16)&0xff),(((rate)>>24)&0xff)
103
104 // a union to pun between
105 // frequency as a 32 bit Hz value
106 // and the bytes that make it up
107 typedef union {
108 U32 frequency;
109 U8 freq_bytes[4];
110 } S_freq;
111
112 extern S_freq current_freq;
113 extern Bool freq_changed;
114
117
125 extern void usb_user_endpoint_init(U8);
126
127 extern void usb_user_set_interface(U8 wIndex, U8 wValue);
128
135 extern Bool usb_user_read_request(U8, U8);
136 extern Bool usb_user_get_descriptor(U8, U8);
137
138 // dg8saq EP0 hooks for the Mobo firmware
139
141
142 //-----------------------------------------------------------------------------
143 // Definition of Class specific request for CDC
144 //-----------------------------------------------------------------------------
145
146 // CDC ACM class specifc requests
147 #define SEND_ENCAPSULATED_COMMAND 0x00
148 #define GET_ENCAPSULATED_RESPONSE 0x01
149 #define SET_LINE_CODING 0x20
150 #define GET_LINE_CODING 0x21
151 #define SET_CONTROL_LINE_STATE 0x22
152 #define SEND_BREAK 0x23
153
154
157 void cdc_get_line_coding(void);
158
161 void cdc_set_line_coding(void);
162
167 void cdc_set_control_line_state (void);
168
169 // ____ T Y P E D E F I N I T I O N _______________________________________
170
171 typedef struct
172 {
173 U32 dwDTERate;
174 U8 bCharFormat;
175 U8 bParityType;
176 U8 bDataBits;
177 }S_line_coding;
178
180
181
182 #endif // _USB_SPECIFIC_REQUEST_H_