1-Key-Keyboard

Registered forum users can contribute their rating for projects based on V-USB in this forum.

Please rate 1-Key-Keyboard on a scale from 0 (worst) to 5 (best):

(0)
0
No votes
(1) *
0
No votes
(2) **
0
No votes
(3) ***
0
No votes
(4) ****
0
No votes
(5) *****
0
No votes
 
Total votes: 0

christian
Objective Development
Objective Development
Posts: 1429
Joined: Thu Nov 09, 2006 11:46 am

1-Key-Keyboard

Postby christian » Thu Oct 23, 2008 8:32 pm

Registered forum users can rate 1-Key-Keyboard in the poll above.

To comment on the project, reply to this topic.

henni
Posts: 16
Joined: Mon Sep 08, 2008 4:17 pm

Re: 1-Key-Keyboard

Postby henni » Mon Aug 08, 2011 11:54 am

While this project mimics the HID behaviour of a real keyboard, there is no need to doing so.
A much simpler approach is using a bitmap usage of key(s) according to the port bits.
As a positive side effect, multiple keys are detected by HID OS driver without much firmware efford.
This applies also to the 4-key and the 16-key keyboard.

See example:
http://www.tu-chemnitz.de/~heha/mikro/OneKey.zip

Each bit in the bitmap corresponds to a key with a specific usage assigned.
So the descriptor code looks like:
...
Usage Page (Keyboard)
Report Size (1)
Report Count (1)
Logical Minimum (0)
Logical Maximum (1)
Input (Const) ;this bit is unused because port pin B0 is used for USB D-
Usage (KEY1)
Input (Var)
Input (Const) ;this bit is unused because port pin B2 is used for USB D+
Usage (KEY3)
Input (Var)
Usage (KEY4)
Input (Var)
Usage (KEY5) ;when RESET DISABLE fuse is set
Input (Var)
Input(Const) ;Bit 6 is not available on ATtiny25/45/85
Input(Const) ;Bit 7 is not available on ATtiny25/45/85
...

The descriptor is longer but the amount of code is much less.
Only if someone needs a boot keyboard, the behaviour must be copied from the USB HID book example.
Whereas "Usage (Keypad)" makes much more sense than "Usage (Keyboard)" for the Collection (Application), it's not recognized by Windows 98 SE. But NT based (modern) systems work well (but won't show differences in Device Manager, e.g. "HID keypad" instead of "HID keyboard").

henni


Return to “V-USB Project Ratings”

Who is online

Users browsing this forum: No registered users and 1 guest