230 lines
9.1 KiB
Markdown
230 lines
9.1 KiB
Markdown
Arduino HID Project 2.1
|
|
=======================
|
|

|
|
|
|
This project went through a lot of phases and has now reached a new Arduino USB-Core
|
|
with a lot of new functions like extended HID. It also supports HoodLoader1+2.
|
|
The idea is to enable enhanced USB functions to almost all 'standard' Arduino boards.
|
|
|
|
Wiki
|
|
====
|
|
|
|
All documentation moved to the [wiki page](https://github.com/NicoHood/HID/wiki).
|
|
|
|
An offline version will be available soon.
|
|
|
|
TODO
|
|
====
|
|
|
|
Under Construction. This is a todo list for myself.
|
|
|
|
```
|
|
Keyboard Layout for different Languages
|
|
Clean up USB Core code from fixed values. Use better understandable definitions
|
|
Magic key fix for 32u4?
|
|
|
|
keycode/raw for keyboard
|
|
Check Keyboard keycode function again? + add example
|
|
Generalize HID key definitions via HIDTables for example?
|
|
|
|
update Burning via ISP for HL2
|
|
Test with Android phone (HL1)
|
|
"Emulate" HL1 protocol
|
|
remove dev HL2 link
|
|
```
|
|
|
|
|
|
Known Bugs
|
|
==========
|
|
* See Hoodloader1+2 repositories for HoodLoader1+2 related Bugs/Issues.
|
|
* Mouse Abs only works with system report under special circumstances.
|
|
* Gamepad + Mouse Abs doesnt work together
|
|
* Core selection in boards.txt is not working
|
|
* Do not name the Arduino Sketch 'Mouse.ino' or 'Keyboard.ino' etc.
|
|
Your Arduino IDE will output errors then if you double click the file and try to compile.
|
|
* RawHID is not working properly, test it at your own risk.
|
|
* All OS have some problems with Gamepads. Dont use more than one device for Linux and be careful when you change the descriptor.
|
|
* XBMC 13.1 (a Media Center) uses Gamepad input. Its seems to not work and may cause weird errors.
|
|
Even with a standard Gamepad I have these errors. Just want to mention it here.
|
|
* The Serial may disconnect if you have too much throughput. This is a general bug of the Arduino Core,
|
|
which might be fixed. For example Adalight dosnt work well for me,
|
|
so you better use an Arduino Uno with Hoodloader1 (yes the older one!) for Mediacenter control and Ambilight.
|
|
* Feel free to open an Issue on Github if you find a bug. Or message me via my [blog](http://nicohood.wordpress.com/)!
|
|
|
|
Useful Links/Credits
|
|
====================
|
|
|
|
* [LUFA from Dean Camera](http://www.fourwalledcubicle.com/LUFA.php)
|
|
* [Darran's HID Projects] (https://github.com/harlequin-tech/arduino-usb)
|
|
* [Connor's Joystick for the Leonardo](http://www.imaginaryindustries.com/blog/?p=80)
|
|
* [Stefan Jones Multimedia Keys Example](http://stefanjones.ca/blog/arduino-leonardo-remote-multimedia-keys/)
|
|
* [Athanasios Douitsis Multimedia Keys Example](https://github.com/aduitsis/ardumultimedia)
|
|
* [The Original Arduino Sources](https://github.com/arduino/Arduino/tree/master/hardware/arduino/firmwares/atmegaxxu2/arduino-usbserial)
|
|
* [USBlyzer](http://www.usblyzer.com/)
|
|
* [Mattairtechs 16u2 Lufa USB Core](https://www.mattairtech.com/index.php/development-boards/mt-db-u1.html)
|
|
* [Paul Brook's Minimus 32u2 Arduino USB Core](https://github.com/pbrook/minimus-arduino)
|
|
* [Paul Stoffregen's Teensy Core](https://github.com/PaulStoffregen/cores)
|
|
* [Keyboard Led Out report by hartmut_holgraefe](http://forum.arduino.cc/index.php?topic=173583.0)
|
|
* [Github Pull Request with a lot of new functions](https://github.com/arduino/Arduino/pull/1803)
|
|
* [Arduino ISP fix](https://petervanhoyweghen.wordpress.com/2012/09/16/arduinoisp-on-the-leonardo/)
|
|
* A lot of searching through the web
|
|
* The awesome official Arduino IRC chat!
|
|
* [The NicoHood Protocol ^.^](https://github.com/NicoHood/NicoHoodProtocol)
|
|
* See HoodLoader1&2 repository for more credits/links
|
|
* [Hackaday post about HoodLoader2](hackaday.com/2014/11/30/using-the-second-microcontroller-on-an-arduino)
|
|
* [Gamecube to PC adapter](https://github.com/NicoHood/Nintendo)
|
|
* See http://nicohood.wordpress.com/ for more tutorials, projects and contact.
|
|
* For donations please contact me on my blog :)
|
|
|
|
Version History
|
|
===============
|
|
```
|
|
2.1 Release (xx.01.2015)
|
|
* Reworked the whole USB-Core from scratch
|
|
* Uses less flash if HID or Serial is not used
|
|
* Extended and compacter(flash) HID Report Descriptors
|
|
* Fixed USB Device Descriptor
|
|
* Added u2 compatibility with smaller USB_EP_SIZE (16u2 etc)
|
|
* Added Serial Event for LineEncoding and LineState
|
|
* Added Serial Function to get dtr state, line encoding etc
|
|
* Added Keyboard Led Out report to get Led states (for numlock etc)
|
|
* Made CDC-Core independent from USB-Core
|
|
* Made HID-Core independent from USB-Core
|
|
* Made HID-API independent from HID-Core
|
|
* Removed not needed virtual functions in Keyboard
|
|
* Made HID Reports and its IDs replaceable via pins_Arduino.h
|
|
* Added Absolute Mouse
|
|
* Removed uint8_t USBPutChar(uint8_t c); in HID.cpp
|
|
* Made void Recv(volatile u8* data, u8 count) in USBCore.cpp static inline
|
|
* HID-APIs sends a clean report on begin() and end() now.
|
|
* Removed virtual functions in Keyboard API
|
|
* Added Keycode functions in Keyboard API
|
|
* Inlined a lot of the HID API functions to save flash
|
|
* Added Gamepad
|
|
* Added RawHID API (but RawHID itself isnt working still)
|
|
* Added USB Wakeup support
|
|
* Separated USB-Core in its own folder
|
|
* Added HID Tables
|
|
* USB-Serial now fully reprogrammable
|
|
* Easy USB-Core selection via Tools->USB-Core
|
|
* Added Arduino as ISP fix for 32u4 (u2 Series doesn't work at the moment)
|
|
* Updated USB-Serial
|
|
|
|
2.0 Release (29.11.2014)
|
|
* Added HoodLoader2
|
|
* Separated HoodLoader1&2 more
|
|
* Added u2 series for USB-Core
|
|
* Extended USB core and fixed minor things for the u2 series
|
|
* Added Led Out report.
|
|
* Added CDC Line state
|
|
* Reworked the whole library structure again
|
|
|
|
1.8 Beta Release (26.08.2014)
|
|
* Changes in the Hoodloader1:
|
|
* **Huge improvements**, see Hoodloader1 repository
|
|
* Reworked the whole library, easy installation now
|
|
* HID fixes for Media Keys/Ubuntu
|
|
* Removed Joystick, added 4 Gamepads
|
|
|
|
1.7.3 Beta Release (10.08.2014)
|
|
* Changes in the Hoodloader1:
|
|
* Fixed HID flush bug (1.6 - 1.7.2)
|
|
|
|
1.7.2 Beta Release (10.08.2014)
|
|
* Changes in the Hoodloader1:
|
|
* Added Lite version for 8u2
|
|
* Added Versions that show up as Uno/Mega (not recommended)
|
|
* Makefile and structure changes
|
|
|
|
1.7.1 Beta Release (10.08.2014)
|
|
* Changes in the Hoodloader1:
|
|
* Fixed HID deactivation bug
|
|
|
|
1.7 Beta Release (10.08.2014)
|
|
* Changes in the Hoodloader1:
|
|
* Works as ISP now. See Hoodloader1 Repository for more information.
|
|
* Exceeded 8kb limit. For flashing a 8u2 use v1.6 please!
|
|
* Changed Readme text
|
|
|
|
1.6 Beta Release (09.08.2014)
|
|
* Bugfixes in the Hoodloader1:
|
|
* Changed HID management (not blocking that much, faster)
|
|
* added RawHID in/out (HID to Serial)
|
|
* Added RawHID Class and example
|
|
|
|
1.5 Beta Release (21.07.2014)
|
|
* Moved Hoodloader1 source to a separate Github page
|
|
* Bugfixes in the Hoodloader:
|
|
* Firmware is still available here
|
|
* Overall a lot of ram improvements, now with a big global union of ram
|
|
* Removed USBtoUSART buffer (not needed, saved 128/500 bytes)
|
|
* Removed Lite version because of better ram usage not needed
|
|
* Separated different modes better to not cause any errors in default mode
|
|
* Improved the deactivate option
|
|
* Integrated NHP directly
|
|
* Replaced LightweightRingbuffer with native Lufa Ringbuffer
|
|
* Improved writing to CDC Host
|
|
* Fixed a bug in checkNHPProtocol: & needs to be a ==
|
|
* General structure changes
|
|
* Improved stability
|
|
* Fixed Arduino as ISP bug
|
|
|
|
1.4.1 Beta Release (10.07.2014)
|
|
* #define Bugfix in USBAPI.h
|
|
|
|
1.4 Beta Release (10.07.2014)
|
|
* Bugfixes in the Hoodloader1:
|
|
* Added Lite Version with less ram usage
|
|
* Changed PIDs, edited driver file
|
|
* merged v1.0.x and v1.5.x together (both are compatible!)
|
|
* added IDE v1.5.7 support
|
|
* added Tutorials
|
|
|
|
1.3 Beta Release (01.07.2014)
|
|
* Bugfixes in the Hoodloader1:
|
|
* Improved ram usage
|
|
* **Important NHP fix inside the HID Class for Uno/Mega**
|
|
|
|
1.2 Beta Release (22.06.2014)
|
|
* Added 1.0.x/1.5.x support
|
|
* Bugfixes in the Hoodloader1:
|
|
* Sometimes HID Devices weren't updating
|
|
when using more than 1 Device (set forcewrite to true)
|
|
* Fast updates crashed the bootloader
|
|
(too much ram usage, set CDC buffer from 128b to 100b each)
|
|
* Minor file structure changes
|
|
|
|
1.1 Beta Release (05.06.2014)
|
|
* Added Leonardo/Micro support
|
|
* Included NicoHoodProtocol
|
|
* Minor fixes
|
|
|
|
1.0 Beta Release (03.06.2014)
|
|
```
|
|
|
|
Licence and Copyright
|
|
=====================
|
|
If you use this library for any cool project let me know!
|
|
|
|
```
|
|
Copyright (c) 2014-2015 NicoHood
|
|
See the readme for credit to other people.
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
```
|