mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
rework HID-based libraries and add Due fallback
This commit is contained in:
parent
99814355ec
commit
af290fc5a3
@ -21,8 +21,6 @@
|
||||
|
||||
#if defined(USBCON)
|
||||
|
||||
//#define RAWHID_ENABLED
|
||||
|
||||
HID_ HID;
|
||||
|
||||
static u8 HID_ENDPOINT_INT;
|
||||
|
@ -27,6 +27,8 @@
|
||||
|
||||
#if defined(USBCON)
|
||||
|
||||
#define _USING_HID
|
||||
|
||||
//================================================================================
|
||||
//================================================================================
|
||||
// HID 'Driver'
|
||||
|
21
hardware/arduino/avr/libraries/HID/keywords.txt
Normal file
21
hardware/arduino/avr/libraries/HID/keywords.txt
Normal file
@ -0,0 +1,21 @@
|
||||
#######################################
|
||||
# Syntax Coloring Map HID
|
||||
#######################################
|
||||
|
||||
#######################################
|
||||
# Datatypes (KEYWORD1)
|
||||
#######################################
|
||||
|
||||
HID KEYWORD1
|
||||
|
||||
#######################################
|
||||
# Methods and Functions (KEYWORD2)
|
||||
#######################################
|
||||
begin KEYWORD2
|
||||
SendReport KEYWORD2
|
||||
AppendDescriptor KEYWORD2
|
||||
|
||||
#######################################
|
||||
# Constants (LITERAL1)
|
||||
#######################################
|
||||
HID_TX LITERAL1
|
8
hardware/arduino/avr/libraries/HID/library.properties
Normal file
8
hardware/arduino/avr/libraries/HID/library.properties
Normal file
@ -0,0 +1,8 @@
|
||||
name=HID
|
||||
version=1.0
|
||||
author=Arduino
|
||||
maintainer=Arduino <info@arduino.cc>
|
||||
sentence=Module for PluggableUSB infrastructure. Exposes an API for devices like Keyboards, Mice and Gamepads
|
||||
paragraph=
|
||||
url=http://www.arduino.cc/en/Reference/HID
|
||||
architectures=avr
|
3
hardware/arduino/sam/libraries/HID/HID.h
Normal file
3
hardware/arduino/sam/libraries/HID/HID.h
Normal file
@ -0,0 +1,3 @@
|
||||
// HID.h
|
||||
|
||||
// placeholder waiting for HID library to be DUE compatible
|
25
libraries/Keyboard/README.adoc
Normal file
25
libraries/Keyboard/README.adoc
Normal file
@ -0,0 +1,25 @@
|
||||
= Keyboard Library for Arduino =
|
||||
|
||||
This library allows an Arduino board with USB capabilites to act as a Keyboard.
|
||||
Being based on HID library you need to include "HID.h" in your sketch.
|
||||
|
||||
For more information about this library please visit us at
|
||||
http://www.arduino.cc/en/Reference/Keyboard
|
||||
|
||||
== License ==
|
||||
|
||||
Copyright (c) Arduino LLC. All right reserved.
|
||||
|
||||
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
24
libraries/Keyboard/keywords.txt
Normal file
24
libraries/Keyboard/keywords.txt
Normal file
@ -0,0 +1,24 @@
|
||||
#######################################
|
||||
# Syntax Coloring Map For Keyboard
|
||||
#######################################
|
||||
|
||||
#######################################
|
||||
# Datatypes (KEYWORD1)
|
||||
#######################################
|
||||
|
||||
Keyboard KEYWORD1
|
||||
|
||||
#######################################
|
||||
# Methods and Functions (KEYWORD2)
|
||||
#######################################
|
||||
|
||||
begin KEYWORD2
|
||||
write KEYWORD2
|
||||
press KEYWORD2
|
||||
release KEYWORD2
|
||||
releaseAll KEYWORD2
|
||||
|
||||
#######################################
|
||||
# Constants (LITERAL1)
|
||||
#######################################
|
||||
|
9
libraries/Keyboard/library.properties
Normal file
9
libraries/Keyboard/library.properties
Normal file
@ -0,0 +1,9 @@
|
||||
name=Keyboard
|
||||
version=1.0.0
|
||||
author=Arduino
|
||||
maintainer=Arduino <info@arduino.cc>
|
||||
sentence=Allows an Arduino board with USB capabilites to act as a Keyboard. For Leonardo/Micro only
|
||||
paragraph=This library plugs on the HID library. It can be used with or without other HID-based libraries (Mouse, Gamepad etc)
|
||||
category=USB
|
||||
url=http://www.arduino.cc/en/Reference/Keyboard
|
||||
architectures=*
|
@ -19,10 +19,10 @@
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#if 1
|
||||
|
||||
#include "Keyboard.h"
|
||||
|
||||
#if defined(_USING_HID)
|
||||
|
||||
//================================================================================
|
||||
//================================================================================
|
||||
// Keyboard
|
@ -22,16 +22,14 @@
|
||||
#ifndef KEYBOARD_h
|
||||
#define KEYBOARD_h
|
||||
|
||||
#if 0 //defined(_USING_HID)
|
||||
#include "HID.h"
|
||||
|
||||
#error "Can only attach one submodule to HID module"
|
||||
#if !defined(_USING_HID)
|
||||
|
||||
#warning "Using legacy HID core (non pluggable)"
|
||||
|
||||
#else
|
||||
|
||||
#define _USING_HID
|
||||
|
||||
#include "HID.h"
|
||||
|
||||
//================================================================================
|
||||
//================================================================================
|
||||
// Keyboard
|
25
libraries/Mouse/README.adoc
Normal file
25
libraries/Mouse/README.adoc
Normal file
@ -0,0 +1,25 @@
|
||||
= Mouse Library for Arduino =
|
||||
|
||||
This library allows an Arduino board with USB capabilites to act as a Mouse.
|
||||
Being based on HID library you need to include "HID.h" in your sketch
|
||||
|
||||
For more information about this library please visit us at
|
||||
http://www.arduino.cc/en/Reference/Mouse
|
||||
|
||||
== License ==
|
||||
|
||||
Copyright (c) Arduino LLC. All right reserved.
|
||||
|
||||
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
24
libraries/Mouse/keywords.txt
Normal file
24
libraries/Mouse/keywords.txt
Normal file
@ -0,0 +1,24 @@
|
||||
#######################################
|
||||
# Syntax Coloring Map For Keyboard
|
||||
#######################################
|
||||
|
||||
#######################################
|
||||
# Datatypes (KEYWORD1)
|
||||
#######################################
|
||||
|
||||
Mouse KEYWORD1
|
||||
|
||||
#######################################
|
||||
# Methods and Functions (KEYWORD2)
|
||||
#######################################
|
||||
|
||||
begin KEYWORD2
|
||||
click KEYWORD2
|
||||
move KEYWORD2
|
||||
press KEYWORD2
|
||||
release KEYWORD2
|
||||
isPressed KEYWORD2
|
||||
|
||||
#######################################
|
||||
# Constants (LITERAL1)
|
||||
#######################################
|
9
libraries/Mouse/library.properties
Normal file
9
libraries/Mouse/library.properties
Normal file
@ -0,0 +1,9 @@
|
||||
name=Mouse
|
||||
version=1.0.0
|
||||
author=Arduino
|
||||
maintainer=Arduino <info@arduino.cc>
|
||||
sentence=Allows an Arduino board with USB capabilites to act as a Mouse. For Leonardo/Micro only
|
||||
paragraph=This library plugs on the HID library. Can be used with or without other HID-based libraries (Keyboard, Gamepad etc)
|
||||
category=USB
|
||||
url=http://www.arduino.cc/en/Reference/Mouse
|
||||
architectures=*
|
@ -19,10 +19,10 @@
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#if 1 //defined(USBCON)
|
||||
|
||||
#include "Mouse.h"
|
||||
|
||||
#if defined(_USING_HID)
|
||||
|
||||
static const u8 _hidReportDescriptor[] PROGMEM = {
|
||||
|
||||
// Mouse
|
@ -22,15 +22,14 @@
|
||||
#ifndef MOUSE_h
|
||||
#define MOUSE_h
|
||||
|
||||
#if 0 //defined(_USING_HID)
|
||||
#include "HID.h"
|
||||
|
||||
#error "Can only attach one submodule to HID module"
|
||||
#if !defined(_USING_HID)
|
||||
|
||||
#warning "Using legacy HID core (non pluggable)"
|
||||
|
||||
#else
|
||||
|
||||
#define _USING_HID
|
||||
|
||||
#include "HID.h"
|
||||
//================================================================================
|
||||
//================================================================================
|
||||
// Mouse
|
Loading…
Reference in New Issue
Block a user