From 6cbd7352132c43a5fc2ea61bf4658a0bbb00ef98 Mon Sep 17 00:00:00 2001 From: Nico Date: Fri, 2 Jan 2015 14:53:53 +0100 Subject: [PATCH] Moved Core again --- Readme.md | 13 + {hardware/HID/avr => avr}/boards.txt | 36 +- {hardware/HID/avr => avr}/cores/hid/Arduino.h | 0 {hardware/HID/avr => avr}/cores/hid/Client.h | 0 .../avr => avr}/cores/hid/HardwareSerial.cpp | 0 .../avr => avr}/cores/hid/HardwareSerial.h | 0 .../avr => avr}/cores/hid/HardwareSerial0.cpp | 0 .../avr => avr}/cores/hid/HardwareSerial1.cpp | 0 .../avr => avr}/cores/hid/HardwareSerial2.cpp | 0 .../avr => avr}/cores/hid/HardwareSerial3.cpp | 0 .../cores/hid/HardwareSerial_private.h | 0 .../HID/avr => avr}/cores/hid/IPAddress.cpp | 0 .../HID/avr => avr}/cores/hid/IPAddress.h | 0 {hardware/HID/avr => avr}/cores/hid/Print.cpp | 0 {hardware/HID/avr => avr}/cores/hid/Print.h | 0 .../HID/avr => avr}/cores/hid/Printable.h | 0 {hardware/HID/avr => avr}/cores/hid/Server.h | 0 .../HID/avr => avr}/cores/hid/Stream.cpp | 0 {hardware/HID/avr => avr}/cores/hid/Stream.h | 0 {hardware/HID/avr => avr}/cores/hid/Tone.cpp | 0 .../avr => avr}/cores/hid/USB-Core/CDC.cpp | 0 .../HID/avr => avr}/cores/hid/USB-Core/CDC.h | 0 .../cores/hid/USB-Core/Consumer.cpp | 0 .../avr => avr}/cores/hid/USB-Core/Consumer.h | 0 .../cores/hid/USB-Core/Gamepad.cpp | 0 .../avr => avr}/cores/hid/USB-Core/Gamepad.h | 0 .../avr => avr}/cores/hid/USB-Core/HID.cpp | 0 .../HID/avr => avr}/cores/hid/USB-Core/HID.h | 0 .../avr => avr}/cores/hid/USB-Core/HIDAPI.h | 0 .../cores/hid/USB-Core/HIDTables.h | 0 .../cores/hid/USB-Core/Keyboard.cpp | 0 .../avr => avr}/cores/hid/USB-Core/Keyboard.h | 0 .../avr => avr}/cores/hid/USB-Core/Mouse.cpp | 0 .../avr => avr}/cores/hid/USB-Core/Mouse.h | 0 .../avr => avr}/cores/hid/USB-Core/System.cpp | 0 .../avr => avr}/cores/hid/USB-Core/System.h | 0 .../avr => avr}/cores/hid/USB-Core/USBAPI.h | 0 .../cores/hid/USB-Core/USBCore.cpp | 0 .../avr => avr}/cores/hid/USB-Core/USBCore.h | 0 .../avr => avr}/cores/hid/USB-Core/USBDesc.h | 0 {hardware/HID/avr => avr}/cores/hid/Udp.h | 0 .../HID/avr => avr}/cores/hid/WCharacter.h | 0 .../HID/avr => avr}/cores/hid/WInterrupts.c | 0 {hardware/HID/avr => avr}/cores/hid/WMath.cpp | 0 .../HID/avr => avr}/cores/hid/WString.cpp | 0 {hardware/HID/avr => avr}/cores/hid/WString.h | 0 {hardware/HID/avr => avr}/cores/hid/abi.cpp | 0 {hardware/HID/avr => avr}/cores/hid/binary.h | 0 {hardware/HID/avr => avr}/cores/hid/hooks.c | 0 {hardware/HID/avr => avr}/cores/hid/main.cpp | 0 {hardware/HID/avr => avr}/cores/hid/new.cpp | 0 {hardware/HID/avr => avr}/cores/hid/new.h | 0 {hardware/HID/avr => avr}/cores/hid/wiring.c | 0 .../HID/avr => avr}/cores/hid/wiring_analog.c | 0 .../avr => avr}/cores/hid/wiring_digital.c | 0 .../avr => avr}/cores/hid/wiring_private.h | 0 .../HID/avr => avr}/cores/hid/wiring_pulse.c | 0 .../HID/avr => avr}/cores/hid/wiring_shift.c | 0 {hardware/HID/avr => avr}/platform.txt | 4 +- .../hid_descriptors/hid_descriptors.h | 0 avr/variants/leonardo_hid/pins_arduino.h | 22 ++ avr/variants/micro_hid/pins_arduino.h | 22 ++ .../hidtests2}/hidtests2.ino | 0 .../HID/avr/variants/leonardo/pins_arduino.h | 361 ------------------ .../avr/variants/leonardo_hid/pins_arduino.h | 2 - .../HID/avr/variants/micro/pins_arduino.h | 37 -- .../HID/avr/variants/micro_hid/pins_arduino.h | 2 - 67 files changed, 94 insertions(+), 405 deletions(-) rename {hardware/HID/avr => avr}/boards.txt (53%) rename {hardware/HID/avr => avr}/cores/hid/Arduino.h (100%) rename {hardware/HID/avr => avr}/cores/hid/Client.h (100%) rename {hardware/HID/avr => avr}/cores/hid/HardwareSerial.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/HardwareSerial.h (100%) rename {hardware/HID/avr => avr}/cores/hid/HardwareSerial0.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/HardwareSerial1.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/HardwareSerial2.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/HardwareSerial3.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/HardwareSerial_private.h (100%) rename {hardware/HID/avr => avr}/cores/hid/IPAddress.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/IPAddress.h (100%) rename {hardware/HID/avr => avr}/cores/hid/Print.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/Print.h (100%) rename {hardware/HID/avr => avr}/cores/hid/Printable.h (100%) rename {hardware/HID/avr => avr}/cores/hid/Server.h (100%) rename {hardware/HID/avr => avr}/cores/hid/Stream.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/Stream.h (100%) rename {hardware/HID/avr => avr}/cores/hid/Tone.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/CDC.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/CDC.h (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/Consumer.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/Consumer.h (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/Gamepad.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/Gamepad.h (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/HID.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/HID.h (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/HIDAPI.h (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/HIDTables.h (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/Keyboard.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/Keyboard.h (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/Mouse.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/Mouse.h (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/System.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/System.h (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/USBAPI.h (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/USBCore.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/USBCore.h (100%) rename {hardware/HID/avr => avr}/cores/hid/USB-Core/USBDesc.h (100%) rename {hardware/HID/avr => avr}/cores/hid/Udp.h (100%) rename {hardware/HID/avr => avr}/cores/hid/WCharacter.h (100%) rename {hardware/HID/avr => avr}/cores/hid/WInterrupts.c (100%) rename {hardware/HID/avr => avr}/cores/hid/WMath.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/WString.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/WString.h (100%) rename {hardware/HID/avr => avr}/cores/hid/abi.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/binary.h (100%) rename {hardware/HID/avr => avr}/cores/hid/hooks.c (100%) rename {hardware/HID/avr => avr}/cores/hid/main.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/new.cpp (100%) rename {hardware/HID/avr => avr}/cores/hid/new.h (100%) rename {hardware/HID/avr => avr}/cores/hid/wiring.c (100%) rename {hardware/HID/avr => avr}/cores/hid/wiring_analog.c (100%) rename {hardware/HID/avr => avr}/cores/hid/wiring_digital.c (100%) rename {hardware/HID/avr => avr}/cores/hid/wiring_private.h (100%) rename {hardware/HID/avr => avr}/cores/hid/wiring_pulse.c (100%) rename {hardware/HID/avr => avr}/cores/hid/wiring_shift.c (100%) rename {hardware/HID/avr => avr}/platform.txt (55%) rename {hardware/HID/avr => avr}/variants/hid_descriptors/hid_descriptors.h (100%) create mode 100644 avr/variants/leonardo_hid/pins_arduino.h create mode 100644 avr/variants/micro_hid/pins_arduino.h rename {hidtests2 => examples/hidtests2}/hidtests2.ino (100%) delete mode 100644 hardware/HID/avr/variants/leonardo/pins_arduino.h delete mode 100644 hardware/HID/avr/variants/leonardo_hid/pins_arduino.h delete mode 100644 hardware/HID/avr/variants/micro/pins_arduino.h delete mode 100644 hardware/HID/avr/variants/micro_hid/pins_arduino.h diff --git a/Readme.md b/Readme.md index e21c55e..7dbb0cc 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,15 @@ +Installation +============ + +put these files into *sketchbook/hardware/HID/* + +at the moment you have to move +the cores/hid folder into your Arduino installation because of a bug in the ide. +This Core is ment to use with 1.5.8 or newer Arduino IDE + +You can compile all HID APIs +but this doesnt mean that you can use them if no hid descriptor is set correctly. + TODO ==== @@ -25,6 +37,7 @@ Bugs Mouse Abs only works with system report under special circumstances. Gamepad + Mouse Abs doesnt work (fix Gamepad) Fix HID_SendReport() prototype workaround in HID-APIs +Core selection in boards.txt is not working ``` diff --git a/hardware/HID/avr/boards.txt b/avr/boards.txt similarity index 53% rename from hardware/HID/avr/boards.txt rename to avr/boards.txt index 8866d1b..ff9f9f9 100644 --- a/hardware/HID/avr/boards.txt +++ b/avr/boards.txt @@ -1,6 +1,6 @@ ############################################################## -leonardo_extended.name=Arduino Leonardo Extended HID-Core +leonardo_extended.name=Arduino Leonardo Custom HID leonardo_extended.vid.0=0x2341 leonardo_extended.pid.0=0x0036 leonardo_extended.vid.1=0x2341 @@ -30,4 +30,36 @@ leonardo_extended.build.usb_product="Arduino Leonardo" leonardo_extended.build.board=AVR_LEONARDO leonardo_extended.build.core=arduino:hid leonardo_extended.build.variant=leonardo_hid -leonardo_extended.build.extra_flags={build.usb_flags} \ No newline at end of file +leonardo_extended.build.extra_flags={build.usb_flags} + +############################################################## + +micro.name=Arduino Micro Custom HID +micro.upload.tool=arduino:avrdude +micro.upload.protocol=avr109 +micro.upload.maximum_size=28672 +micro.upload.maximum_data_size=2560 +micro.upload.speed=57600 +micro.upload.disable_flushing=true +micro.upload.use_1200bps_touch=true +micro.upload.wait_for_upload_port=true + +micro.bootloader.tool=arduino:avrdude +micro.bootloader.low_fuses=0xff +micro.bootloader.high_fuses=0xd8 +micro.bootloader.extended_fuses=0xcb +micro.bootloader.file=arduino:caterina/Caterina-Micro.hex +micro.bootloader.unlock_bits=0x3F +micro.bootloader.lock_bits=0x2F + +micro.build.mcu=atmega32u4 +micro.build.f_cpu=16000000L +micro.build.vid=0x2341 +micro.build.pid=0x8037 +micro.build.usb_product="Arduino Micro" +micro.build.board=AVR_MICRO +micro.build.core=arduino:hid +micro.build.variant=micro_hid +micro.build.extra_flags={build.usb_flags} + +############################################################## \ No newline at end of file diff --git a/hardware/HID/avr/cores/hid/Arduino.h b/avr/cores/hid/Arduino.h similarity index 100% rename from hardware/HID/avr/cores/hid/Arduino.h rename to avr/cores/hid/Arduino.h diff --git a/hardware/HID/avr/cores/hid/Client.h b/avr/cores/hid/Client.h similarity index 100% rename from hardware/HID/avr/cores/hid/Client.h rename to avr/cores/hid/Client.h diff --git a/hardware/HID/avr/cores/hid/HardwareSerial.cpp b/avr/cores/hid/HardwareSerial.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/HardwareSerial.cpp rename to avr/cores/hid/HardwareSerial.cpp diff --git a/hardware/HID/avr/cores/hid/HardwareSerial.h b/avr/cores/hid/HardwareSerial.h similarity index 100% rename from hardware/HID/avr/cores/hid/HardwareSerial.h rename to avr/cores/hid/HardwareSerial.h diff --git a/hardware/HID/avr/cores/hid/HardwareSerial0.cpp b/avr/cores/hid/HardwareSerial0.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/HardwareSerial0.cpp rename to avr/cores/hid/HardwareSerial0.cpp diff --git a/hardware/HID/avr/cores/hid/HardwareSerial1.cpp b/avr/cores/hid/HardwareSerial1.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/HardwareSerial1.cpp rename to avr/cores/hid/HardwareSerial1.cpp diff --git a/hardware/HID/avr/cores/hid/HardwareSerial2.cpp b/avr/cores/hid/HardwareSerial2.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/HardwareSerial2.cpp rename to avr/cores/hid/HardwareSerial2.cpp diff --git a/hardware/HID/avr/cores/hid/HardwareSerial3.cpp b/avr/cores/hid/HardwareSerial3.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/HardwareSerial3.cpp rename to avr/cores/hid/HardwareSerial3.cpp diff --git a/hardware/HID/avr/cores/hid/HardwareSerial_private.h b/avr/cores/hid/HardwareSerial_private.h similarity index 100% rename from hardware/HID/avr/cores/hid/HardwareSerial_private.h rename to avr/cores/hid/HardwareSerial_private.h diff --git a/hardware/HID/avr/cores/hid/IPAddress.cpp b/avr/cores/hid/IPAddress.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/IPAddress.cpp rename to avr/cores/hid/IPAddress.cpp diff --git a/hardware/HID/avr/cores/hid/IPAddress.h b/avr/cores/hid/IPAddress.h similarity index 100% rename from hardware/HID/avr/cores/hid/IPAddress.h rename to avr/cores/hid/IPAddress.h diff --git a/hardware/HID/avr/cores/hid/Print.cpp b/avr/cores/hid/Print.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/Print.cpp rename to avr/cores/hid/Print.cpp diff --git a/hardware/HID/avr/cores/hid/Print.h b/avr/cores/hid/Print.h similarity index 100% rename from hardware/HID/avr/cores/hid/Print.h rename to avr/cores/hid/Print.h diff --git a/hardware/HID/avr/cores/hid/Printable.h b/avr/cores/hid/Printable.h similarity index 100% rename from hardware/HID/avr/cores/hid/Printable.h rename to avr/cores/hid/Printable.h diff --git a/hardware/HID/avr/cores/hid/Server.h b/avr/cores/hid/Server.h similarity index 100% rename from hardware/HID/avr/cores/hid/Server.h rename to avr/cores/hid/Server.h diff --git a/hardware/HID/avr/cores/hid/Stream.cpp b/avr/cores/hid/Stream.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/Stream.cpp rename to avr/cores/hid/Stream.cpp diff --git a/hardware/HID/avr/cores/hid/Stream.h b/avr/cores/hid/Stream.h similarity index 100% rename from hardware/HID/avr/cores/hid/Stream.h rename to avr/cores/hid/Stream.h diff --git a/hardware/HID/avr/cores/hid/Tone.cpp b/avr/cores/hid/Tone.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/Tone.cpp rename to avr/cores/hid/Tone.cpp diff --git a/hardware/HID/avr/cores/hid/USB-Core/CDC.cpp b/avr/cores/hid/USB-Core/CDC.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/CDC.cpp rename to avr/cores/hid/USB-Core/CDC.cpp diff --git a/hardware/HID/avr/cores/hid/USB-Core/CDC.h b/avr/cores/hid/USB-Core/CDC.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/CDC.h rename to avr/cores/hid/USB-Core/CDC.h diff --git a/hardware/HID/avr/cores/hid/USB-Core/Consumer.cpp b/avr/cores/hid/USB-Core/Consumer.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/Consumer.cpp rename to avr/cores/hid/USB-Core/Consumer.cpp diff --git a/hardware/HID/avr/cores/hid/USB-Core/Consumer.h b/avr/cores/hid/USB-Core/Consumer.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/Consumer.h rename to avr/cores/hid/USB-Core/Consumer.h diff --git a/hardware/HID/avr/cores/hid/USB-Core/Gamepad.cpp b/avr/cores/hid/USB-Core/Gamepad.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/Gamepad.cpp rename to avr/cores/hid/USB-Core/Gamepad.cpp diff --git a/hardware/HID/avr/cores/hid/USB-Core/Gamepad.h b/avr/cores/hid/USB-Core/Gamepad.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/Gamepad.h rename to avr/cores/hid/USB-Core/Gamepad.h diff --git a/hardware/HID/avr/cores/hid/USB-Core/HID.cpp b/avr/cores/hid/USB-Core/HID.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/HID.cpp rename to avr/cores/hid/USB-Core/HID.cpp diff --git a/hardware/HID/avr/cores/hid/USB-Core/HID.h b/avr/cores/hid/USB-Core/HID.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/HID.h rename to avr/cores/hid/USB-Core/HID.h diff --git a/hardware/HID/avr/cores/hid/USB-Core/HIDAPI.h b/avr/cores/hid/USB-Core/HIDAPI.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/HIDAPI.h rename to avr/cores/hid/USB-Core/HIDAPI.h diff --git a/hardware/HID/avr/cores/hid/USB-Core/HIDTables.h b/avr/cores/hid/USB-Core/HIDTables.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/HIDTables.h rename to avr/cores/hid/USB-Core/HIDTables.h diff --git a/hardware/HID/avr/cores/hid/USB-Core/Keyboard.cpp b/avr/cores/hid/USB-Core/Keyboard.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/Keyboard.cpp rename to avr/cores/hid/USB-Core/Keyboard.cpp diff --git a/hardware/HID/avr/cores/hid/USB-Core/Keyboard.h b/avr/cores/hid/USB-Core/Keyboard.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/Keyboard.h rename to avr/cores/hid/USB-Core/Keyboard.h diff --git a/hardware/HID/avr/cores/hid/USB-Core/Mouse.cpp b/avr/cores/hid/USB-Core/Mouse.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/Mouse.cpp rename to avr/cores/hid/USB-Core/Mouse.cpp diff --git a/hardware/HID/avr/cores/hid/USB-Core/Mouse.h b/avr/cores/hid/USB-Core/Mouse.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/Mouse.h rename to avr/cores/hid/USB-Core/Mouse.h diff --git a/hardware/HID/avr/cores/hid/USB-Core/System.cpp b/avr/cores/hid/USB-Core/System.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/System.cpp rename to avr/cores/hid/USB-Core/System.cpp diff --git a/hardware/HID/avr/cores/hid/USB-Core/System.h b/avr/cores/hid/USB-Core/System.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/System.h rename to avr/cores/hid/USB-Core/System.h diff --git a/hardware/HID/avr/cores/hid/USB-Core/USBAPI.h b/avr/cores/hid/USB-Core/USBAPI.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/USBAPI.h rename to avr/cores/hid/USB-Core/USBAPI.h diff --git a/hardware/HID/avr/cores/hid/USB-Core/USBCore.cpp b/avr/cores/hid/USB-Core/USBCore.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/USBCore.cpp rename to avr/cores/hid/USB-Core/USBCore.cpp diff --git a/hardware/HID/avr/cores/hid/USB-Core/USBCore.h b/avr/cores/hid/USB-Core/USBCore.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/USBCore.h rename to avr/cores/hid/USB-Core/USBCore.h diff --git a/hardware/HID/avr/cores/hid/USB-Core/USBDesc.h b/avr/cores/hid/USB-Core/USBDesc.h similarity index 100% rename from hardware/HID/avr/cores/hid/USB-Core/USBDesc.h rename to avr/cores/hid/USB-Core/USBDesc.h diff --git a/hardware/HID/avr/cores/hid/Udp.h b/avr/cores/hid/Udp.h similarity index 100% rename from hardware/HID/avr/cores/hid/Udp.h rename to avr/cores/hid/Udp.h diff --git a/hardware/HID/avr/cores/hid/WCharacter.h b/avr/cores/hid/WCharacter.h similarity index 100% rename from hardware/HID/avr/cores/hid/WCharacter.h rename to avr/cores/hid/WCharacter.h diff --git a/hardware/HID/avr/cores/hid/WInterrupts.c b/avr/cores/hid/WInterrupts.c similarity index 100% rename from hardware/HID/avr/cores/hid/WInterrupts.c rename to avr/cores/hid/WInterrupts.c diff --git a/hardware/HID/avr/cores/hid/WMath.cpp b/avr/cores/hid/WMath.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/WMath.cpp rename to avr/cores/hid/WMath.cpp diff --git a/hardware/HID/avr/cores/hid/WString.cpp b/avr/cores/hid/WString.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/WString.cpp rename to avr/cores/hid/WString.cpp diff --git a/hardware/HID/avr/cores/hid/WString.h b/avr/cores/hid/WString.h similarity index 100% rename from hardware/HID/avr/cores/hid/WString.h rename to avr/cores/hid/WString.h diff --git a/hardware/HID/avr/cores/hid/abi.cpp b/avr/cores/hid/abi.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/abi.cpp rename to avr/cores/hid/abi.cpp diff --git a/hardware/HID/avr/cores/hid/binary.h b/avr/cores/hid/binary.h similarity index 100% rename from hardware/HID/avr/cores/hid/binary.h rename to avr/cores/hid/binary.h diff --git a/hardware/HID/avr/cores/hid/hooks.c b/avr/cores/hid/hooks.c similarity index 100% rename from hardware/HID/avr/cores/hid/hooks.c rename to avr/cores/hid/hooks.c diff --git a/hardware/HID/avr/cores/hid/main.cpp b/avr/cores/hid/main.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/main.cpp rename to avr/cores/hid/main.cpp diff --git a/hardware/HID/avr/cores/hid/new.cpp b/avr/cores/hid/new.cpp similarity index 100% rename from hardware/HID/avr/cores/hid/new.cpp rename to avr/cores/hid/new.cpp diff --git a/hardware/HID/avr/cores/hid/new.h b/avr/cores/hid/new.h similarity index 100% rename from hardware/HID/avr/cores/hid/new.h rename to avr/cores/hid/new.h diff --git a/hardware/HID/avr/cores/hid/wiring.c b/avr/cores/hid/wiring.c similarity index 100% rename from hardware/HID/avr/cores/hid/wiring.c rename to avr/cores/hid/wiring.c diff --git a/hardware/HID/avr/cores/hid/wiring_analog.c b/avr/cores/hid/wiring_analog.c similarity index 100% rename from hardware/HID/avr/cores/hid/wiring_analog.c rename to avr/cores/hid/wiring_analog.c diff --git a/hardware/HID/avr/cores/hid/wiring_digital.c b/avr/cores/hid/wiring_digital.c similarity index 100% rename from hardware/HID/avr/cores/hid/wiring_digital.c rename to avr/cores/hid/wiring_digital.c diff --git a/hardware/HID/avr/cores/hid/wiring_private.h b/avr/cores/hid/wiring_private.h similarity index 100% rename from hardware/HID/avr/cores/hid/wiring_private.h rename to avr/cores/hid/wiring_private.h diff --git a/hardware/HID/avr/cores/hid/wiring_pulse.c b/avr/cores/hid/wiring_pulse.c similarity index 100% rename from hardware/HID/avr/cores/hid/wiring_pulse.c rename to avr/cores/hid/wiring_pulse.c diff --git a/hardware/HID/avr/cores/hid/wiring_shift.c b/avr/cores/hid/wiring_shift.c similarity index 100% rename from hardware/HID/avr/cores/hid/wiring_shift.c rename to avr/cores/hid/wiring_shift.c diff --git a/hardware/HID/avr/platform.txt b/avr/platform.txt similarity index 55% rename from hardware/HID/avr/platform.txt rename to avr/platform.txt index cf12aa4..8887bd7 100644 --- a/hardware/HID/avr/platform.txt +++ b/avr/platform.txt @@ -4,6 +4,8 @@ # For more info: # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification +# https://github.com/arduino/Arduino/wiki/Arduino-Hardware-Cores-migration-guide-from-1.0-to-1.6 -name=Arduino HID-Core +# https://github.com/NicoHood +name=Arduino Custom HID-Core version=2.1 diff --git a/hardware/HID/avr/variants/hid_descriptors/hid_descriptors.h b/avr/variants/hid_descriptors/hid_descriptors.h similarity index 100% rename from hardware/HID/avr/variants/hid_descriptors/hid_descriptors.h rename to avr/variants/hid_descriptors/hid_descriptors.h diff --git a/avr/variants/leonardo_hid/pins_arduino.h b/avr/variants/leonardo_hid/pins_arduino.h new file mode 100644 index 0000000..77655bd --- /dev/null +++ b/avr/variants/leonardo_hid/pins_arduino.h @@ -0,0 +1,22 @@ +/* +Copyright (c) 2014 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. +*/ + +#include <../../variants/leonardo/pins_arduino.h> +#include "../hid_descriptors/hid_descriptors.h" \ No newline at end of file diff --git a/avr/variants/micro_hid/pins_arduino.h b/avr/variants/micro_hid/pins_arduino.h new file mode 100644 index 0000000..4dc36e2 --- /dev/null +++ b/avr/variants/micro_hid/pins_arduino.h @@ -0,0 +1,22 @@ +/* +Copyright (c) 2014 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. +*/ + +#include <../../variants/micro/pins_arduino.h> +#include "../hid_descriptors/hid_descriptors.h" \ No newline at end of file diff --git a/hidtests2/hidtests2.ino b/examples/hidtests2/hidtests2.ino similarity index 100% rename from hidtests2/hidtests2.ino rename to examples/hidtests2/hidtests2.ino diff --git a/hardware/HID/avr/variants/leonardo/pins_arduino.h b/hardware/HID/avr/variants/leonardo/pins_arduino.h deleted file mode 100644 index fd75373..0000000 --- a/hardware/HID/avr/variants/leonardo/pins_arduino.h +++ /dev/null @@ -1,361 +0,0 @@ -/* - pins_arduino.h - Pin definition functions for Arduino - Part of Arduino - http://www.arduino.cc/ - - Copyright (c) 2007 David A. Mellis - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ -*/ - -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -// Workaround for wrong definitions in "iom32u4.h". -// This should be fixed in the AVR toolchain. -#undef UHCON -#undef UHINT -#undef UHIEN -#undef UHADDR -#undef UHFNUM -#undef UHFNUML -#undef UHFNUMH -#undef UHFLEN -#undef UPINRQX -#undef UPINTX -#undef UPNUM -#undef UPRST -#undef UPCONX -#undef UPCFG0X -#undef UPCFG1X -#undef UPSTAX -#undef UPCFG2X -#undef UPIENX -#undef UPDATX -#undef TCCR2A -#undef WGM20 -#undef WGM21 -#undef COM2B0 -#undef COM2B1 -#undef COM2A0 -#undef COM2A1 -#undef TCCR2B -#undef CS20 -#undef CS21 -#undef CS22 -#undef WGM22 -#undef FOC2B -#undef FOC2A -#undef TCNT2 -#undef TCNT2_0 -#undef TCNT2_1 -#undef TCNT2_2 -#undef TCNT2_3 -#undef TCNT2_4 -#undef TCNT2_5 -#undef TCNT2_6 -#undef TCNT2_7 -#undef OCR2A -#undef OCR2_0 -#undef OCR2_1 -#undef OCR2_2 -#undef OCR2_3 -#undef OCR2_4 -#undef OCR2_5 -#undef OCR2_6 -#undef OCR2_7 -#undef OCR2B -#undef OCR2_0 -#undef OCR2_1 -#undef OCR2_2 -#undef OCR2_3 -#undef OCR2_4 -#undef OCR2_5 -#undef OCR2_6 -#undef OCR2_7 - -#define NUM_DIGITAL_PINS 30 -#define NUM_ANALOG_INPUTS 12 - -#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0) -#define TXLED0 PORTD |= (1<<5) -#define TXLED1 PORTD &= ~(1<<5) -#define RXLED0 PORTB |= (1<<0) -#define RXLED1 PORTB &= ~(1<<0) - -static const uint8_t SDA = 2; -static const uint8_t SCL = 3; -#define LED_BUILTIN 13 - -// Map SPI port to 'new' pins D14..D17 -static const uint8_t SS = 17; -static const uint8_t MOSI = 16; -static const uint8_t MISO = 14; -static const uint8_t SCK = 15; - -// Mapping of analog pins as digital I/O -// A6-A11 share with digital pins -static const uint8_t A0 = 18; -static const uint8_t A1 = 19; -static const uint8_t A2 = 20; -static const uint8_t A3 = 21; -static const uint8_t A4 = 22; -static const uint8_t A5 = 23; -static const uint8_t A6 = 24; // D4 -static const uint8_t A7 = 25; // D6 -static const uint8_t A8 = 26; // D8 -static const uint8_t A9 = 27; // D9 -static const uint8_t A10 = 28; // D10 -static const uint8_t A11 = 29; // D12 - -#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0)) -#define digitalPinToPCICRbit(p) 0 -#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0)) -#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4)))))) - -// __AVR_ATmega32U4__ has an unusual mapping of pins to channels -extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; -#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) ) - -#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT))))) - -#ifdef ARDUINO_MAIN - -// On the Arduino board, digital pins are also used -// for the analog output (software PWM). Analog input -// pins are a separate set. - -// ATMEL ATMEGA32U4 / ARDUINO LEONARDO -// -// D0 PD2 RXD1/INT2 -// D1 PD3 TXD1/INT3 -// D2 PD1 SDA SDA/INT1 -// D3# PD0 PWM8/SCL OC0B/SCL/INT0 -// D4 A6 PD4 ADC8 -// D5# PC6 ??? OC3A/#OC4A -// D6# A7 PD7 FastPWM #OC4D/ADC10 -// D7 PE6 INT6/AIN0 -// -// D8 A8 PB4 ADC11/PCINT4 -// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5 -// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6 -// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7 -// D12 A11 PD6 T1/#OC4D/ADC9 -// D13# PC7 PWM10 CLK0/OC4A -// -// A0 D18 PF7 ADC7 -// A1 D19 PF6 ADC6 -// A2 D20 PF5 ADC5 -// A3 D21 PF4 ADC4 -// A4 D22 PF1 ADC1 -// A5 D23 PF0 ADC0 -// -// New pins D14..D17 to map SPI port to digital pins -// -// MISO D14 PB3 MISO,PCINT3 -// SCK D15 PB1 SCK,PCINT1 -// MOSI D16 PB2 MOSI,PCINT2 -// SS D17 PB0 RXLED,SS/PCINT0 -// -// TXLED PD5 -// RXLED PB0 -// HWB PE2 HWB - -// these arrays map port names (e.g. port B) to the -// appropriate addresses for various functions (e.g. reading -// and writing) -const uint16_t PROGMEM port_to_mode_PGM[] = { - NOT_A_PORT, - NOT_A_PORT, - (uint16_t) &DDRB, - (uint16_t) &DDRC, - (uint16_t) &DDRD, - (uint16_t) &DDRE, - (uint16_t) &DDRF, -}; - -const uint16_t PROGMEM port_to_output_PGM[] = { - NOT_A_PORT, - NOT_A_PORT, - (uint16_t) &PORTB, - (uint16_t) &PORTC, - (uint16_t) &PORTD, - (uint16_t) &PORTE, - (uint16_t) &PORTF, -}; - -const uint16_t PROGMEM port_to_input_PGM[] = { - NOT_A_PORT, - NOT_A_PORT, - (uint16_t) &PINB, - (uint16_t) &PINC, - (uint16_t) &PIND, - (uint16_t) &PINE, - (uint16_t) &PINF, -}; - -const uint8_t PROGMEM digital_pin_to_port_PGM[] = { - PD, // D0 - PD2 - PD, // D1 - PD3 - PD, // D2 - PD1 - PD, // D3 - PD0 - PD, // D4 - PD4 - PC, // D5 - PC6 - PD, // D6 - PD7 - PE, // D7 - PE6 - - PB, // D8 - PB4 - PB, // D9 - PB5 - PB, // D10 - PB6 - PB, // D11 - PB7 - PD, // D12 - PD6 - PC, // D13 - PC7 - - PB, // D14 - MISO - PB3 - PB, // D15 - SCK - PB1 - PB, // D16 - MOSI - PB2 - PB, // D17 - SS - PB0 - - PF, // D18 - A0 - PF7 - PF, // D19 - A1 - PF6 - PF, // D20 - A2 - PF5 - PF, // D21 - A3 - PF4 - PF, // D22 - A4 - PF1 - PF, // D23 - A5 - PF0 - - PD, // D24 / D4 - A6 - PD4 - PD, // D25 / D6 - A7 - PD7 - PB, // D26 / D8 - A8 - PB4 - PB, // D27 / D9 - A9 - PB5 - PB, // D28 / D10 - A10 - PB6 - PD, // D29 / D12 - A11 - PD6 -}; - -const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { - _BV(2), // D0 - PD2 - _BV(3), // D1 - PD3 - _BV(1), // D2 - PD1 - _BV(0), // D3 - PD0 - _BV(4), // D4 - PD4 - _BV(6), // D5 - PC6 - _BV(7), // D6 - PD7 - _BV(6), // D7 - PE6 - - _BV(4), // D8 - PB4 - _BV(5), // D9 - PB5 - _BV(6), // D10 - PB6 - _BV(7), // D11 - PB7 - _BV(6), // D12 - PD6 - _BV(7), // D13 - PC7 - - _BV(3), // D14 - MISO - PB3 - _BV(1), // D15 - SCK - PB1 - _BV(2), // D16 - MOSI - PB2 - _BV(0), // D17 - SS - PB0 - - _BV(7), // D18 - A0 - PF7 - _BV(6), // D19 - A1 - PF6 - _BV(5), // D20 - A2 - PF5 - _BV(4), // D21 - A3 - PF4 - _BV(1), // D22 - A4 - PF1 - _BV(0), // D23 - A5 - PF0 - - _BV(4), // D24 / D4 - A6 - PD4 - _BV(7), // D25 / D6 - A7 - PD7 - _BV(4), // D26 / D8 - A8 - PB4 - _BV(5), // D27 / D9 - A9 - PB5 - _BV(6), // D28 / D10 - A10 - PB6 - _BV(6), // D29 / D12 - A11 - PD6 -}; - -const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - TIMER0B, /* 3 */ - NOT_ON_TIMER, - TIMER3A, /* 5 */ - TIMER4D, /* 6 */ - NOT_ON_TIMER, - - NOT_ON_TIMER, - TIMER1A, /* 9 */ - TIMER1B, /* 10 */ - TIMER0A, /* 11 */ - - NOT_ON_TIMER, - TIMER4A, /* 13 */ - - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, - NOT_ON_TIMER, -}; - -const uint8_t PROGMEM analog_pin_to_channel_PGM[] = { - 7, // A0 PF7 ADC7 - 6, // A1 PF6 ADC6 - 5, // A2 PF5 ADC5 - 4, // A3 PF4 ADC4 - 1, // A4 PF1 ADC1 - 0, // A5 PF0 ADC0 - 8, // A6 D4 PD4 ADC8 - 10, // A7 D6 PD7 ADC10 - 11, // A8 D8 PB4 ADC11 - 12, // A9 D9 PB5 ADC12 - 13, // A10 D10 PB6 ADC13 - 9 // A11 D12 PD6 ADC9 -}; - -#endif /* ARDUINO_MAIN */ - -// These serial port names are intended to allow libraries and architecture-neutral -// sketches to automatically default to the correct port name for a particular type -// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, -// the first hardware serial port whose RX/TX pins are not dedicated to another use. -// -// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor -// -// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial -// -// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library -// -// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. -// -// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX -// pins are NOT connected to anything by default. -#define SERIAL_PORT_MONITOR Serial -#define SERIAL_PORT_USBVIRTUAL Serial -#define SERIAL_PORT_HARDWARE Serial1 -#define SERIAL_PORT_HARDWARE_OPEN Serial1 - -#endif /* Pins_Arduino_h */ diff --git a/hardware/HID/avr/variants/leonardo_hid/pins_arduino.h b/hardware/HID/avr/variants/leonardo_hid/pins_arduino.h deleted file mode 100644 index 6de11a9..0000000 --- a/hardware/HID/avr/variants/leonardo_hid/pins_arduino.h +++ /dev/null @@ -1,2 +0,0 @@ -#include "../leonardo/pins_arduino.h" -#include "../hid_descriptors/hid_descriptors.h" \ No newline at end of file diff --git a/hardware/HID/avr/variants/micro/pins_arduino.h b/hardware/HID/avr/variants/micro/pins_arduino.h deleted file mode 100644 index ea8e42d..0000000 --- a/hardware/HID/avr/variants/micro/pins_arduino.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - pins_arduino.h - Pin definition functions for Arduino - Part of Arduino - http://www.arduino.cc/ - - Copyright (c) 2007 David A. Mellis - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ -*/ - -#include "../leonardo/pins_arduino.h" - -#undef TXLED0 -#undef TXLED1 -#undef RXLED0 -#undef RXLED1 -#undef TX_RX_LED_INIT - -#define TXLED0 PORTD &= ~(1<<5) -#define TXLED1 PORTD |= (1<<5) -#define RXLED0 PORTB &= ~(1<<0) -#define RXLED1 PORTB |= (1<<0) -#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0), TXLED0, RXLED0 \ No newline at end of file diff --git a/hardware/HID/avr/variants/micro_hid/pins_arduino.h b/hardware/HID/avr/variants/micro_hid/pins_arduino.h deleted file mode 100644 index 5eb21b9..0000000 --- a/hardware/HID/avr/variants/micro_hid/pins_arduino.h +++ /dev/null @@ -1,2 +0,0 @@ -#include "../micro/pins_arduino.h" -#include "../hid_descriptors/hid_descriptors.h" \ No newline at end of file