2015-10-09 19:46:06 +00:00
|
|
|
/*
|
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Include guard
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include "PluggableUSB.h"
|
2015-10-10 10:58:51 +00:00
|
|
|
#include "HID.h"
|
2015-10-09 19:46:06 +00:00
|
|
|
#include "HID-Settings.h"
|
2015-10-25 14:02:41 +00:00
|
|
|
#include "../HID-APIs/DefaultKeyboardAPI.h"
|
2015-10-09 19:46:06 +00:00
|
|
|
|
|
|
|
|
|
2015-10-25 13:26:55 +00:00
|
|
|
class BootKeyboard_ : public PluggableUSBModule, public DefaultKeyboardAPI
|
2015-10-09 19:46:06 +00:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
BootKeyboard_(void);
|
|
|
|
|
uint8_t getLeds(void);
|
2015-10-10 05:52:22 +00:00
|
|
|
uint8_t getProtocol(void);
|
2015-10-25 13:26:55 +00:00
|
|
|
void wakeupHost(void);
|
2015-10-09 19:46:06 +00:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// Implementation of the PUSBListNode
|
|
|
|
|
int getInterface(uint8_t* interfaceCount);
|
|
|
|
|
int getDescriptor(USBSetup& setup);
|
|
|
|
|
bool setup(USBSetup& setup);
|
|
|
|
|
|
|
|
|
|
uint8_t epType[1];
|
|
|
|
|
uint8_t protocol;
|
|
|
|
|
uint8_t idle;
|
|
|
|
|
|
|
|
|
|
uint8_t leds;
|
|
|
|
|
|
2015-10-25 13:26:55 +00:00
|
|
|
virtual int send(void) override;
|
2015-10-09 19:46:06 +00:00
|
|
|
};
|
|
|
|
|
extern BootKeyboard_ BootKeyboard;
|
|
|
|
|
|
|
|
|
|
|