]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/protocol/arm_atsam/usb/conf_usb.h
Massdrop keyboard support (#3780)
[qmk_firmware.git] / tmk_core / protocol / arm_atsam / usb / conf_usb.h
1 /**
2  * \file
3  *
4  * \brief USB configuration file
5  *
6  * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved.
7  *
8  * \asf_license_start
9  *
10  * \page License
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are met:
14  *
15  * 1. Redistributions of source code must retain the above copyright notice,
16  *    this list of conditions and the following disclaimer.
17  *
18  * 2. Redistributions in binary form must reproduce the above copyright notice,
19  *    this list of conditions and the following disclaimer in the documentation
20  *    and/or other materials provided with the distribution.
21  *
22  * 3. The name of Atmel may not be used to endorse or promote products derived
23  *    from this software without specific prior written permission.
24  *
25  * 4. This software may only be redistributed and used in connection with an
26  *    Atmel microcontroller product.
27  *
28  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38  * POSSIBILITY OF SUCH DAMAGE.
39  *
40  * \asf_license_stop
41  *
42  */
43 /*
44  * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
45  */
46
47 #ifndef _CONF_USB_H_
48 #define _CONF_USB_H_
49
50 #include "compiler.h"
51 #include "udi_device_conf.h"
52
53 #define  UDI_CDC_DEFAULT_RATE           115200
54 #define  UDI_CDC_DEFAULT_STOPBITS       CDC_STOP_BITS_1
55 #define  UDI_CDC_DEFAULT_PARITY         CDC_PAR_NONE
56 #define  UDI_CDC_DEFAULT_DATABITS       8
57
58 //! Device definition (mandatory)
59 #define  USB_DEVICE_VENDOR_ID           VENDOR_ID
60 #define  USB_DEVICE_PRODUCT_ID          PRODUCT_ID
61 #define  USB_DEVICE_VERSION             DEVICE_VER
62 #define  USB_DEVICE_POWER               500 // Consumption on Vbus line (mA)
63 #define  USB_DEVICE_ATTR                (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED)
64 //                                      (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED)
65 //                                      (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED)
66 //                                      (USB_CONFIG_ATTR_SELF_POWERED)
67 //                                      (USB_CONFIG_ATTR_BUS_POWERED)
68
69 //! USB Device string definitions (Optional)
70 #define  USB_DEVICE_MANUFACTURE_NAME      MANUFACTURER
71 #define  USB_DEVICE_PRODUCT_NAME          PRODUCT
72 #define  USB_DEVICE_SERIAL_NAME           SERIAL_NUM
73
74 //Comment out USB_DEVICE_SERIAL_USE_BOOTLOADER_SERIAL to prevent ROM lookup of factory programmed serial number
75 #define  USB_DEVICE_SERIAL_USE_BOOTLOADER_SERIAL
76
77 /**
78  * Device speeds support
79  * @{
80  */
81 //! To define a Low speed device
82 //#define  USB_DEVICE_LOW_SPEED
83
84 //! To authorize the High speed
85 #if (UC3A3||UC3A4)
86 //#define  USB_DEVICE_HS_SUPPORT
87 #elif (SAM3XA||SAM3U)
88 //#define  USB_DEVICE_HS_SUPPORT
89 #endif
90 //@}
91
92 /**
93  * USB Device Callbacks definitions (Optional)
94  * @{
95  */
96 #define  UDC_VBUS_EVENT(b_vbus_high)
97 #define  UDC_SOF_EVENT()                  main_sof_action()
98 #define  UDC_SUSPEND_EVENT()              main_suspend_action()
99 #define  UDC_RESUME_EVENT()               main_resume_action()
100 //! Mandatory when USB_DEVICE_ATTR authorizes remote wakeup feature
101 #define  UDC_REMOTEWAKEUP_ENABLE()        main_remotewakeup_enable()
102 #define  UDC_REMOTEWAKEUP_DISABLE()       main_remotewakeup_disable()
103 //! When a extra string descriptor must be supported
104 //! other than manufacturer, product and serial string
105 // #define  UDC_GET_EXTRA_STRING()
106 //@}
107
108 //@}
109
110
111 /**
112  * USB Interface Configuration
113  * @{
114  */
115 /**
116  * Configuration of HID Keyboard interface
117  * @{
118  */
119 //! Interface callback definition
120 #ifdef KBD
121 #define  UDI_HID_KBD_ENABLE_EXT()       main_kbd_enable()
122 #define  UDI_HID_KBD_DISABLE_EXT()      main_kbd_disable()
123 //#define  UDI_HID_KBD_CHANGE_LED(value)  ui_kbd_led(value)
124 #endif
125
126 #ifdef NKRO
127 #define  UDI_HID_NKRO_ENABLE_EXT()       main_nkro_enable()
128 #define  UDI_HID_NKRO_DISABLE_EXT()      main_nkro_disable()
129 //#define  UDI_HID_NKRO_CHANGE_LED(value)   ui_kbd_led(value)
130 #endif
131
132 #ifdef EXK
133 #define  UDI_HID_EXK_ENABLE_EXT()       main_exk_enable()
134 #define  UDI_HID_EXK_DISABLE_EXT()      main_exk_disable()
135 #endif
136
137 #ifdef MOU
138 #define  UDI_HID_MOU_ENABLE_EXT()       main_mou_enable()
139 #define  UDI_HID_MOU_DISABLE_EXT()      main_mou_disable()
140 #endif
141
142 #ifdef RAW
143 #define  UDI_HID_RAW_ENABLE_EXT()       main_raw_enable()
144 #define  UDI_HID_RAW_DISABLE_EXT()      main_raw_disable()
145 #endif
146
147
148 //@}
149 //@}
150
151
152 /**
153  * USB Device Driver Configuration
154  * @{
155  */
156 //@}
157
158 //! The includes of classes and other headers must be done at the end of this file to avoid compile error
159 #include "udi_hid_kbd_conf.h"
160 #include "usb_main.h"
161 #include "ui.h"
162
163 #endif // _CONF_USB_H_