aboutsummaryrefslogtreecommitdiffstats
path: root/lib/lufa/Projects/MIDIToneGenerator/Descriptors.c
blob: b4bcea1ee74366c40017f231d29cd7e6e1bb1df9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
/*
             LUFA Library
     Copyright (C) Dean Camera, 2017.

  dean [at] fourwalledcubicle [dot] com
           www.lufa-lib.org
*/

/*
  Copyright 2017  Dean Camera (dean [at] fourwalledcubicle [dot] com)

  Permission to use, copy, modify, distribute, and sell this
  software and its documentation for any purpose is hereby granted
  without fee, provided that the above copyright notice appear in
  all copies and that both that the copyright notice and this
  permission notice and warranty disclaimer appear in supporting
  documentation, and that the name of the author not be used in
  advertising or publicity pertaining to distribution of the
  software without specific, written prior permission.

  The author disclaims all warranties with regard to this
  software, including all implied warranties of merchantability
  and fitness.  In no event shall the author be liable for any
  special, indirect or consequential damages or any damages
  whatsoever resulting from loss of use, data or profits, whether
  in an action of contract, negligence or other tortious action,
  arising out of or in connection with the use or performance of
  this software.
*/

/** \file
 *
 *  USB Device Descriptors, for library use when in USB device mode. Descriptors are special
 *  computer-readable structures which the host requests upon device enumeration, to determine
 *  the device's capabilities and functions.
 */

#include "Descriptors.h"

/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
 *  device characteristics, including the supported USB version, control endpoint size and the
 *  number of device configurations. The descriptor is read out by the USB host when the enumeration
 *  process begins.
 */
const USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
	.Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},

	.USBSpecification       = VERSION_BCD(1,1,0),
	.Class                  = USB_CSCP_NoDeviceClass,
	.SubClass               = USB_CSCP_NoDeviceSubclass,
	.Protocol               = USB_CSCP_NoDeviceProtocol,

	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,

	.VendorID               = 0x03EB,
	.ProductID              = 0x2048,
	.ReleaseNumber          = VERSION_BCD(0,0,1),

	.ManufacturerStrIndex   = STRING_ID_Manufacturer,
	.ProductStrIndex        = STRING_ID_Product,
	.SerialNumStrIndex      = NO_DESCRIPTOR,

	.NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
};

/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
 *  of the device in one of its supported configurations, including information about any device interfaces
 *  and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
 *  a configuration so that the host may correctly communicate with the USB device.
 */
const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
	.Config =
		{
			.Header                   = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},

			.TotalConfigurationSize   = sizeof(USB_Descriptor_Configuration_t),
			.TotalInterfaces          = 2,

			.ConfigurationNumber      = 1,
			.ConfigurationStrIndex    = NO_DESCRIPTOR,

			.ConfigAttributes         = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_SELFPOWERED),

			.MaxPowerConsumption      = USB_CONFIG_POWER_MA(100)
		},

	.Audio_ControlInterface =
		{
			.Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},

			.InterfaceNumber          = INTERFACE_ID_AudioControl,
			.AlternateSetting         = 0,

			.TotalEndpoints           = 0,

			.Class                    = AUDIO_CSCP_AudioClass,
			.SubClass                 = AUDIO_CSCP_ControlSubclass,
			.Protocol                 = AUDIO_CSCP_ControlProtocol,

			.InterfaceStrIndex        = NO_DESCRIPTOR
		},

	.Audio_ControlInterface_SPC =
		{
			.Header                   = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface},
			.Subtype                  = AUDIO_DSUBTYPE_CSInterface_Header,

			.ACSpecification          = VERSION_BCD(1,0,0),
			.TotalLength              = sizeof(USB_Audio_Descriptor_Interface_AC_t),

			.InCollection             = 1,
			.InterfaceNumber          = INTERFACE_ID_AudioStream,
		},

	.Audio_StreamInterface =
		{
			.Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},

			.InterfaceNumber          = INTERFACE_ID_AudioStream,
			.AlternateSetting         = 0,

			.TotalEndpoints           = 2,

			.Class                    = AUDIO_CSCP_AudioClass,
			.SubClass                 = AUDIO_CSCP_MIDIStreamingSubclass,
			.Protocol                 = AUDIO_CSCP_StreamingProtocol,

			.InterfaceStrIndex        = NO_DESCRIPTOR
		},

	.Audio_StreamInterface_SPC =
		{
			.Header                   = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = DTYPE_CSInterface},
			.Subtype                  = AUDIO_DSUBTYPE_CSInterface_General,

			.AudioSpecification       = VERSION_BCD(1,0,0),

			.TotalLength              = (sizeof(USB_Descriptor_Configuration_t) -
			                             offsetof(USB_Descriptor_Configuration_t, Audio_StreamInterface_SPC))
		},

	.MIDI_In_Jack_Emb =
		{
			.Header                   = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface},
			.Subtype                  = AUDIO_DSUBTYPE_CSInterface_InputTerminal,

			.JackType                 = MIDI_JACKTYPE_Embedded,
			.JackID                   = 0x01,

			.JackStrIndex             = NO_DESCRIPTOR
		},

	.MIDI_In_Jack_Ext =
		{
			.Header                   = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface},
			.Subtype                  = AUDIO_DSUBTYPE_CSInterface_InputTerminal,

			.JackType                 = MIDI_JACKTYPE_External,
			.JackID                   = 0x02,

			.JackStrIndex             = NO_DESCRIPTOR
		},

	.MIDI_Out_Jack_Emb =
		{
			.Header                   = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface},
			.Subtype                  = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,

			.JackType                 = MIDI_JACKTYPE_Embedded,
			.JackID                   = 0x03,

			.NumberOfPins             = 1,
			.SourceJackID             = {0x02},
			.SourcePinID              = {0x01},

			.JackStrIndex             = NO_DESCRIPTOR
		},

	.MIDI_Out_Jack_Ext =
		{
			.Header                   = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface},
			.Subtype                  = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,

			.JackType                 = MIDI_JACKTYPE_External,
			.JackID                   = 0x04,

			.NumberOfPins             = 1,
			.SourceJackID             = {0x01},
			.SourcePinID              = {0x01},

			.JackStrIndex             = NO_DESCRIPTOR
		},

	.MIDI_In_Jack_Endpoint =
		{
			.Endpoint =
				{
					.Header              = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},

					.EndpointAddress     = MIDI_STREAM_OUT_EPADDR,
					.Attributes          = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
					.EndpointSize        = MIDI_STREAM_EPSIZE,
					.PollingIntervalMS   = 0x05
				},

			.Refresh                  = 0,
			.SyncEndpointNumber       = 0
		},

	.MIDI_In_Jack_Endpoint_SPC =
		{
			.Header                   = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
			.Subtype                  = AUDIO_DSUBTYPE_CSEndpoint_General,

			.TotalEmbeddedJacks       = 0x01,
			.AssociatedJackID         = {0x01}
		},

	.MIDI_Out_Jack_Endpoint =
		{
			.Endpoint =
				{
					.Header              = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},

					.EndpointAddress     = MIDI_STREAM_IN_EPADDR,
					.Attributes          = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
					.EndpointSize        = MIDI_STREAM_EPSIZE,
					.PollingIntervalMS   = 0x05
				},

			.Refresh                  = 0,
			.SyncEndpointNumber       = 0
		},

	.MIDI_Out_Jack_Endpoint_SPC =
		{
			.Header                   = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
			.Subtype                  = AUDIO_DSUBTYPE_CSEndpoint_General,

			.TotalEmbeddedJacks       = 0x01,
			.AssociatedJackID         = {0x03}
		}
};

/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
 *  the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
 *  via the language ID table available at USB.org what languages the device supports for its string descriptors.
 */
const USB_Descriptor_String_t PROGMEM LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGUAGE_ID_ENG);

/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
 *  form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
 *  Descriptor.
 */
const USB_Descriptor_String_t PROGMEM ManufacturerString = USB_STRING_DESCRIPTOR(L"Dean Camera");

/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
 *  and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
 *  Descriptor.
 */
const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"LUFA MIDI Demo");

/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
 *  documentation) by the application code so that the address and size of a requested descriptor can be given
 *  to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function
 *  is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
 *  USB host.
 */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                                    const uint16_t wIndex,
                                    const void** const DescriptorAddress)
{
	const uint8_t  DescriptorType   = (wValue >> 8);
	const uint8_t  DescriptorNumber = (wValue & 0xFF);

	const void* Address = NULL;
	uint16_t    Size    = NO_DESCRIPTOR;

	switch (DescriptorType)
	{
		case DTYPE_Device:
			Address = &DeviceDescriptor;
			Size    = sizeof(USB_Descriptor_Device_t);
			break;
		case DTYPE_Configuration:
			Address = &ConfigurationDescriptor;
			Size    = sizeof(USB_Descriptor_Configuration_t);
			break;
		case DTYPE_String:
			switch (DescriptorNumber)
			{
				case STRING_ID_Language:
					Address = &LanguageString;
					Size    = pgm_read_byte(&LanguageString.Header.Size);
					break;
				case STRING_ID_Manufacturer:
					Address = &ManufacturerString;
					Size    = pgm_read_byte(&ManufacturerString.Header.Size);
					break;
				case STRING_ID_Product:
					Address = &ProductString;
					Size    = pgm_read_byte(&ProductString.Header.Size);
					break;
			}

			break;
	}

	*DescriptorAddress = Address;
	return Size;
}
pan> print("(3)\n"); return (raw2scan(raw)); // Shift(u) } } else { if (IS_BREAK(raw3)) { // Case 2: print("(2)\n"); keybuf = (raw2scan(raw3) | M0110_CALC_OFFSET); // Calc(u) return (raw2scan(raw3) | M0110_KEYPAD_OFFSET); // Arrow(u) } else { // Case 1: print("(1)\n"); return (raw2scan(raw3) | M0110_CALC_OFFSET); // Calc(d) } } break; default: // Shift + Keypad keybuf = (raw2scan(raw3) | M0110_KEYPAD_OFFSET); return raw2scan(raw); // Shift(d/u) break; } break; default: // Shift + Normal keys keybuf = raw2scan(raw2); return raw2scan(raw); // Shift(d/u) break; } break; default: // Normal keys return raw2scan(raw); break; } } static inline uint8_t raw2scan(uint8_t raw) { return (raw == M0110_NULL) ? M0110_NULL : ( (raw == M0110_ERROR) ? M0110_ERROR : ( ((raw&0x80) | ((raw&0x7F)>>1)) ) ); } static inline uint8_t inquiry(void) { m0110_send(M0110_INQUIRY); return m0110_recv(); } static inline uint8_t instant(void) { m0110_send(M0110_INSTANT); uint8_t data = m0110_recv(); if (data != M0110_NULL) { debug_hex(data); debug(" "); } return data; } static inline void clock_lo() { M0110_CLOCK_PORT &= ~(1<<M0110_CLOCK_BIT); M0110_CLOCK_DDR |= (1<<M0110_CLOCK_BIT); } static inline void clock_hi() { /* input with pull up */ M0110_CLOCK_DDR &= ~(1<<M0110_CLOCK_BIT); M0110_CLOCK_PORT |= (1<<M0110_CLOCK_BIT); } static inline bool clock_in() { M0110_CLOCK_DDR &= ~(1<<M0110_CLOCK_BIT); M0110_CLOCK_PORT |= (1<<M0110_CLOCK_BIT); _delay_us(1); return M0110_CLOCK_PIN&(1<<M0110_CLOCK_BIT); } static inline void data_lo() { M0110_DATA_PORT &= ~(1<<M0110_DATA_BIT); M0110_DATA_DDR |= (1<<M0110_DATA_BIT); } static inline void data_hi() { /* input with pull up */ M0110_DATA_DDR &= ~(1<<M0110_DATA_BIT); M0110_DATA_PORT |= (1<<M0110_DATA_BIT); } static inline bool data_in() { M0110_DATA_DDR &= ~(1<<M0110_DATA_BIT); M0110_DATA_PORT |= (1<<M0110_DATA_BIT); _delay_us(1); return M0110_DATA_PIN&(1<<M0110_DATA_BIT); } static inline uint16_t wait_clock_lo(uint16_t us) { while (clock_in() && us) { asm(""); _delay_us(1); us--; } return us; } static inline uint16_t wait_clock_hi(uint16_t us) { while (!clock_in() && us) { asm(""); _delay_us(1); us--; } return us; } static inline uint16_t wait_data_lo(uint16_t us) { while (data_in() && us) { asm(""); _delay_us(1); us--; } return us; } static inline uint16_t wait_data_hi(uint16_t us) { while (!data_in() && us) { asm(""); _delay_us(1); us--; } return us; } static inline void idle(void) { clock_hi(); data_hi(); } static inline void request(void) { clock_hi(); data_lo(); } /* Primitive M0110 Library for AVR ============================== Signaling --------- CLOCK is always from KEYBOARD. DATA are sent with MSB first. 1) IDLE: both lines are high. CLOCK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DATA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2) KEYBOARD->HOST: HOST reads bit on rising edge. CLOCK ~~~~~~~~~~~~|__|~~~|__|~~~|__|~~~|__|~~~|__|~~~|__|~~~|__|~~~|__|~~~~~~~~~~~ DATA ~~~~~~~~~~~~X777777X666666X555555X444444X333333X222222X111111X000000X~~~~~~~ <--> 160us(clock low) <---> 180us(clock high) 3) HOST->KEYBOARD: HOST asserts bit on falling edge. CLOCK ~~~~~~~~~~~~|__|~~~|__|~~~|__|~~~|__|~~~|__|~~~|__|~~~|__|~~~|__|~~~~~~~~~~~ DATA ~~~~~~|_____X777777X666666X555555X444444X333333X222222X111111X000000X~~~~~~~ <----> 840us(request to send by host) <---> 80us(hold DATA) <--> 180us(clock low) <---> 220us(clock high) Protocol -------- COMMAND: Inquiry 0x10 get key event with block Instant 0x12 get key event Model 0x14 get model number(M0110 responds with 0x09) bit 7 1 if another device connected(used when keypad exists?) bit4-6 next device model number bit1-3 keyboard model number bit 0 always 1 Test 0x16 test(ACK:0x7D/NAK:0x77) KEY EVENT: bit 7 key state(0:press 1:release) bit 6-1 scan code(see below) bit 0 always 1 To get scan code use this: ((bits&(1<<7)) | ((bits&0x7F))>>1). Note: On the M0110A, Keypad keys and Arrow keys are preceded by 0x79. Moreover, some Keypad keys(=, /, * and +) are preceded by 0x71 on press and 0xF1 on release. ARROW KEYS: Arrow keys and Calc keys(+,*,/,= on keypad) share same byte sequence and preceding byte of Calc keys(0x71 and 0xF1) means press and release event of SHIFT. This causes a very confusing situation, it is difficult or impossible to tell Calc key from Arrow key plus SHIFT in some cases. Raw key events: press release ---------------- ---------------- Left: 0x79, 0x0D 0x79, 0x8D Right: 0x79, 0x05 0x79, 0x85 Up: 0x79, 0x1B 0x79, 0x9B Down: 0x79, 0x11 0x79, 0x91 Pad+: 0x71, 0x79, 0x0D 0xF1, 0x79, 0x8D Pad*: 0x71, 0x79, 0x05 0xF1, 0x79, 0x85 Pad/: 0x71, 0x79, 0x1B 0xF1, 0x79, 0x9B Pad=: 0x71, 0x79, 0x11 0xF1, 0x79, 0x91 RAW CODE: M0110A ,---------------------------------------------------------. ,---------------. | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bcksp| |Clr| =| /| *| |---------------------------------------------------------| |---------------| |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| |-----------------------------------------------------' | |---------------| |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| |---------------------------------------------------------| |---------------| |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | |---------------------------------------------------------' |-----------|Ent| |Optio|Mac | Space | \|Lft|Rgt|Dn | | 0| .| | `---------------------------------------------------------' `---------------' ,---------------------------------------------------------. ,---------------. | 65| 25| 27| 29| 2B| 2F| 2D| 35| 39| 33| 3B| 37| 31| 67| |+0F|*11|*1B|*05| |---------------------------------------------------------| |---------------| | 61| 19| 1B| 1D| 1F| 23| 21| 41| 45| 3F| 47| 43| 3D| | |+33|+37|+39|+1D| |-----------------------------------------------------' | |---------------| | 73| 01| 03| 05| 07| 0B| 09| 4D| 51| 4B| 53| 4F| 49| |+2D|+2F|+31|*0D| |---------------------------------------------------------| |---------------| | 71| 0D| 0F| 11| 13| 17| 5B| 5D| 27| 5F| 59| 71|+1B| |+27|+29|+2B| | |---------------------------------------------------------' |-----------|+19| | 75| 6F| 63 | 55|+0D|+05|+11| | +25|+03| | `---------------------------------------------------------' `---------------' + 0x79, 0xDD / 0xF1, 0xUU * 0x71, 0x79,DD / 0xF1, 0x79, 0xUU MODEL NUMBER: M0110: 0x09 00001001 : model number 4 (100) M0110A: 0x0B 00001011 : model number 5 (101) M0110 & M0120: ??? Scan Code --------- m0110_recv_key() function returns following scan codes instead of M0110 raw codes. Scan codes are 1 byte size and MSB(bit7) is set when key is released. scancode = ((raw&0x80) | ((raw&0x7F)>>1)) M0110 M0120 ,---------------------------------------------------------. ,---------------. | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| -|Lft|Rgt| |---------------------------------------------------------| |---------------| |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9|Up | |---------------------------------------------------------| |---------------| |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6|Dn | |---------------------------------------------------------| |---------------| |Shift | Z| X| C| V| B| N| M| ,| ,| /| | | 1| 2| 3| | `---------------------------------------------------------' |-----------|Ent| |Opt|Mac | Space |Enter|Opt| | 0| .| | `------------------------------------------------' `---------------' ,---------------------------------------------------------. ,---------------. | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 4E| 46| 42| |---------------------------------------------------------| |---------------| | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4D| |---------------------------------------------------------| |---------------| | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 48| |---------------------------------------------------------| |---------------| | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| | 53| 54| 55| | `---------------------------------------------------------' |-----------| 4C| | 3A| 37| 31 | 34| 3A| | 52| 41| | `------------------------------------------------' `---------------' International keyboard(See page 22 of "Technical Info for 128K/512K") ,---------------------------------------------------------. | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| |---------------------------------------------------------| | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| |------------------------------------------------------ | | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | |---------------------------------------------------------| | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 0A| 38| `---------------------------------------------------------' | 3A| 37| 34 | 31| 3A| `------------------------------------------------' M0110A ,---------------------------------------------------------. ,---------------. | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bcksp| |Clr| =| /| *| |---------------------------------------------------------| |---------------| |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| |-----------------------------------------------------' | |---------------| |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| |---------------------------------------------------------| |---------------| |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | |---------------------------------------------------------' |-----------|Ent| |Optio|Mac | Space | \|Lft|Rgt|Dn | | 0| .| | `---------------------------------------------------------' `---------------' ,---------------------------------------------------------. ,---------------. | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| |---------------------------------------------------------| |---------------| | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E| |-----------------------------------------------------' | |---------------| | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66| |---------------------------------------------------------| |---------------| | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| 4D| | 53| 54| 55| | |---------------------------------------------------------' |-----------| 4C| | 3A| 37| 31 | 2A| 46| 42| 48| | 52| 41| | `---------------------------------------------------------' `---------------' References ---------- Technical Info for 128K/512K and Plus ftp://ftp.apple.asimov.net/pub/apple_II/documentation/macintosh/Mac%20Hardware%20Info%20-%20Mac%20128K.pdf ftp://ftp.apple.asimov.net/pub/apple_II/documentation/macintosh/Mac%20Hardware%20Info%20-%20Mac%20Plus.pdf Protocol: Page 20 of Tech Info for 128K/512K http://www.mac.linux-m68k.org/devel/plushw.php Connector: Page 20 of Tech Info for 128K/512K http://www.kbdbabel.org/conn/kbd_connector_macplus.png Signaling: http://www.kbdbabel.org/signaling/kbd_signaling_mac.png http://typematic.blog.shinobi.jp/Entry/14/ M0110 raw scan codes: Page 22 of Tech Info for 128K/512K Page 07 of Tech Info for Plus http://m0115.web.fc2.com/m0110.jpg http://m0115.web.fc2.com/m0110a.jpg */