User manual
Code Mercenaries
18
II
II
OO
OO
--
--
WW
WW
aa
aa
rr
rr
rr
rr
ii
ii
oo
oo
rr
rr
55
55
66
66
5.10.4 Driving a LED matrix
IO-Warrior56 has the capability to drive a matrix
of up to 8x64 LEDs with the aid of a few simple
external driver chips.
To enable the reciever function a report with ID
$14 is sent to interface 1:
enable = $01 enables the LED function, enable =
$00 disables it again.
Data to be displayed in the matrix is written in two
blocks of 32 bytes:
"block" = 0 writes to the first four lines, "block" =
1 to the second four lines.
5.10.5 Switch Matrix Mode
IO-Warrior56 can handle a matrix of 8x8 switches
or keys. Other than with a keyboard controller it is
possible to read out all possible combinations of
closed switches. Since the switch status is reported
as a bitmap there is no limitation to the number of
switches that can be closed at the same time
(diodes are required in the matrix though if more
than two keys can be pressed at the same time).
To enable the switch matrix function a report with
ID $18 is sent to interface 1:
"enable" = $01 enables the switch matrix function,
"enable" = $00 disables it again.
The status of the matrix is returned when ever there
is a change of status or it can be requested
immediately by sending a report with ID $19:
The status of the matrix is returned in an input
report with ID $19. A set bit denotes a closed
switch:
5.10.6 Getting special mode function status
To get the information which special modes are
currently in use, send a report with reportID $FE to
interface 1:
This will immediately return an input report with
ID $FE that contains flags for the special mode
functions. Non zero means the function is active:
5.10.7 Getting current pin status
Due to the way Windows implements HID support
IO-Warrior56 is unable to continuously send its
status.
HID class devices do have a function that allows
the host to set the rate at which reports should be
repeated if there is no change to the data. Windows
does set this rate to zero for IO-Warrior56, which
means IO-Warrior56 may send data only if there
are changes.
To be able to get the current status from IO-
Warrior56 it does support a Special Mode Function
that always returns the current status of all pins.
To get the port status just send a report with ID
$FF to interface 1:
This will result in the current pin status to be
returned immediately in an input report with ID
$FF with the following format:
ReportID
$14 out
12
enable $00
34
$00 $00
... 62
$00 $00
63
$00
ReportID
$15 out
12
block
data0
... 33
datan data31
34 ...
$00 $00
63
$00
ReportID
$18 out
12
enable $00
34
$00 $00
… 62
$00 $00
63
$00
ReportID
$19 out
12
$00 $00
34
$00 $00
… 62
$00 $00
63
$00
ReportID
$19 in
12
Y0 Y1
34
Y2 Y3
56
Y4 Y5
78
Y6 Y7
… 63
$00 $00
ReportID
$FE out
12
$00 $00
34
$00 $00
... 62
$00 $00
63
$00
ReportID
$FF in
12
IIC LCD
34
SPI LED
56
Key $00
... 63
$00 $00
ReportID
$FF out
12
$00 $00
34
$00 $00
... 62
$00 $00
63
$00
ReportID
$FF in
12
Prt0 Prt1
34
Prt2 Prt3
56
Prt4 Prt5
7 ...
Prt6 $00
V 1.0.3, November 6nd 2012 for chip version V1.1.0.1