1
0
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:
Martino Facchin 2015-07-15 16:15:46 +02:00 committed by Cristian Maglie
parent 99814355ec
commit af290fc5a3
15 changed files with 162 additions and 17 deletions

View File

@ -21,8 +21,6 @@
#if defined(USBCON)
//#define RAWHID_ENABLED
HID_ HID;
static u8 HID_ENDPOINT_INT;

View File

@ -27,6 +27,8 @@
#if defined(USBCON)
#define _USING_HID
//================================================================================
//================================================================================
// HID 'Driver'

View 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

View 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

View File

@ -0,0 +1,3 @@
// HID.h
// placeholder waiting for HID library to be DUE compatible

View 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

View 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)
#######################################

View 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=*

View File

@ -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

View File

@ -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

View 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

View 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)
#######################################

View 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=*

View File

@ -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

View File

@ -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