aboutsummaryrefslogtreecommitdiff
path: root/protocol/lufa/descriptor.h
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2015-08-21 23:14:48 -0400
committerJack Humbert <jack.humb@gmail.com>2015-08-21 23:14:48 -0400
commit476e29d1190ac45b810109512bbb50cc4769493b (patch)
tree1d493bae3b0ae91a6202918aa1bf53fb0da936fa /protocol/lufa/descriptor.h
parent2d76b5c3d421c984f6b4b9da757383cc87e3f808 (diff)
parentb191f8c60fbbaf1fb55d67edb86a6c33489b2ce3 (diff)
downloadqmk_firmware-476e29d1190ac45b810109512bbb50cc4769493b.tar.gz
qmk_firmware-476e29d1190ac45b810109512bbb50cc4769493b.zip
Merge pull request #26 from jackhumbert/midi
Midi
Diffstat (limited to 'protocol/lufa/descriptor.h')
-rw-r--r--protocol/lufa/descriptor.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/protocol/lufa/descriptor.h b/protocol/lufa/descriptor.h
index 42af07917..0471ef31d 100644
--- a/protocol/lufa/descriptor.h
+++ b/protocol/lufa/descriptor.h
@@ -85,6 +85,25 @@ typedef struct
85 USB_HID_Descriptor_HID_t NKRO_HID; 85 USB_HID_Descriptor_HID_t NKRO_HID;
86 USB_Descriptor_Endpoint_t NKRO_INEndpoint; 86 USB_Descriptor_Endpoint_t NKRO_INEndpoint;
87#endif 87#endif
88
89#ifdef MIDI_ENABLE
90 // MIDI Audio Control Interface
91 USB_Descriptor_Interface_t Audio_ControlInterface;
92 USB_Audio_Descriptor_Interface_AC_t Audio_ControlInterface_SPC;
93
94 // MIDI Audio Streaming Interface
95 USB_Descriptor_Interface_t Audio_StreamInterface;
96 USB_MIDI_Descriptor_AudioInterface_AS_t Audio_StreamInterface_SPC;
97 USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Emb;
98 USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Ext;
99 USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Emb;
100 USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Ext;
101 USB_Audio_Descriptor_StreamEndpoint_Std_t MIDI_In_Jack_Endpoint;
102 USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_In_Jack_Endpoint_SPC;
103 USB_Audio_Descriptor_StreamEndpoint_Std_t MIDI_Out_Jack_Endpoint;
104 USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC;
105#endif
106
88} USB_Descriptor_Configuration_t; 107} USB_Descriptor_Configuration_t;
89 108
90 109
@@ -115,9 +134,15 @@ typedef struct
115# define NKRO_INTERFACE CONSOLE_INTERFACE 134# define NKRO_INTERFACE CONSOLE_INTERFACE
116#endif 135#endif
117 136
137#ifdef MIDI_ENABLE
138# define MIDI_INTERFACE (NKRO_INTERFACE + 1)
139# define MIDI2_INTERFACE (NKRO_INTERFACE + 2)
140#else
141# define MIDI2_INTERFACE NKRO_INTERFACE
142#endif
118 143
119/* nubmer of interfaces */ 144/* nubmer of interfaces */
120#define TOTAL_INTERFACES (NKRO_INTERFACE + 1) 145#define TOTAL_INTERFACES MIDI2_INTERFACE + 1
121 146
122 147
123// Endopoint number and size 148// Endopoint number and size
@@ -150,12 +175,21 @@ typedef struct
150# endif 175# endif
151#endif 176#endif
152 177
178#ifdef MIDI_ENABLE
179# define MIDI_STREAM_IN_EPNUM (NKRO_IN_EPNUM + 1)
180# define MIDI_STREAM_OUT_EPNUM (NKRO_IN_EPNUM + 1)
181#else
182# define MIDI_STREAM_IN_EPNUM NKRO_IN_EPNUM
183# define MIDI_STREAM_OUT_EPNUM NKRO_IN_EPNUM
184#endif
185
153 186
154#define KEYBOARD_EPSIZE 8 187#define KEYBOARD_EPSIZE 8
155#define MOUSE_EPSIZE 8 188#define MOUSE_EPSIZE 8
156#define EXTRAKEY_EPSIZE 8 189#define EXTRAKEY_EPSIZE 8
157#define CONSOLE_EPSIZE 32 190#define CONSOLE_EPSIZE 32
158#define NKRO_EPSIZE 16 191#define NKRO_EPSIZE 16
192#define MIDI_STREAM_EPSIZE 64
159 193
160 194
161uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, 195uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,