1
\ *****************************************************************************
2
\ * Copyright (c) 2004, 2008 IBM Corporation
3
\ * All rights reserved.
4
\ * This program and the accompanying materials
5
\ * are made available under the terms of the BSD License
6
\ * which accompanies this distribution, and is available at
7
\ * http://www.opensource.org/licenses/bsd-license.php
10
\ * IBM Corporation - initial implementation
11
\ ****************************************************************************/
15
s" rw-endpoint" $call-parent ;
18
s" controlxfer" $call-parent ;
20
: control-std-get-device-descriptor
21
s" control-std-get-device-descriptor" $call-parent ;
23
: control-std-get-configuration-descriptor
24
s" control-std-get-configuration-descriptor" $call-parent ;
26
: control-std-set-configuration
27
s" control-std-set-configuration" $call-parent ;
29
: control-cls-set-protocol ( reportvalue FuncAddr -- TRUE|FALSE )
32
210b000000000100 kbd-buf kb>setup-packet !
33
temp2 kbd-buf kb>data l!-le
34
1 kbd-buf kb>data 1 kbd-buf kb>setup-packet
35
DEFAULT-CONTROL-MPS temp1 controlxfer
38
: control-cls-set-idle ( reportvalue FuncAddr -- TRUE|FALSE )
41
210a000000000000 kbd-buf kb>setup-packet !
42
temp2 kbd-buf kb>data l!-le
43
0 kbd-buf kb>data 0 kbd-buf kb>setup-packet
44
DEFAULT-CONTROL-MPS temp1 controlxfer
47
: control-std-get-report-descriptor ( data-buffer data-len MPS FuncAddr -- TRUE|FALSE )
51
8106002200000000 kbd-buf kb>setup-packet !
52
temp3 kbd-buf kb>setup-packet 6 + w!-le
53
0 swap temp3 kbd-buf kb>setup-packet
54
temp2 temp1 controlxfer
58
s" Starting to initialize keyboard" usb-debug-print
59
s" MPS-INTIN" get-my-property
61
s" not possible" usb-debug-print
63
decode-int nip nip to mps-int-in
65
s" INT-IN-EP-ADDR" get-my-property
67
s" not possible" usb-debug-print
69
decode-int nip nip to int-in-ep
72
kbd-buf kb>cfg 12 8 kbd-addr \ get device descriptor
73
control-std-get-device-descriptor
75
\ s" dev_desc=" type cfg-buffer 12 dump cr
77
kbd-buf kb>cfg 9 8 kbd-addr \ get config descriptor
78
control-std-get-configuration-descriptor
80
\ s" cfg_desc=" type cfg-buffer 9 dump cr
82
kbd-buf kb>cfg 5 + c@ kbd-addr \ set configuration
83
control-std-set-configuration
85
s" KBDS: Set config returned" usb-debug-print
87
0 kbd-addr control-cls-set-idle drop \ set idle
88
s" KBDS: Set idle returned" usb-debug-print
90
kbd-buf kb>cfg 3f 8 kbd-addr \ get report descriptor
91
control-std-get-report-descriptor
93
\ s" report_desc=" type cfg-buffer 3f dump cr
95
s" Finished initializing keyboard" usb-debug-print