Adapt KeyboardioHID as a Kaleidoscope driver

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
f/driver/keyboardiohid
Michael Richters 3 years ago
parent 1badde1497
commit 5659368d76
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -17,11 +17,13 @@
#pragma once #pragma once
#include <KeyboardioHID.h> // for BootKeyboard, BootKeyboard_, Keyboard
#include <stdint.h> // for uint8_t, uint16_t #include <stdint.h> // for uint8_t, uint16_t
// From Kaleidoscope: #include "kaleidoscope/driver/hid/base/Keyboard.h" // for Keyboard, Keyboar...
#include "kaleidoscope/driver/hid/base/Keyboard.h" // for Keyboard, KeyboardProps #include "kaleidoscope/driver/hid/keyboardio/usb/BootKeyboard/BootKeyboard.h"
#include "kaleidoscope/driver/hid/keyboardio/usb/MultiReport/ConsumerControl.h"
#include "kaleidoscope/driver/hid/keyboardio/usb/MultiReport/Keyboard.h"
#include "kaleidoscope/driver/hid/keyboardio/usb/MultiReport/SystemControl.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace driver { namespace driver {

@ -17,11 +17,10 @@
#pragma once #pragma once
#include <KeyboardioHID.h> // for HID_MouseReport_Data_t, (anonymous union...
#include <stdint.h> // for int8_t, uint8_t #include <stdint.h> // for int8_t, uint8_t
// From Kaleidoscope:
#include "kaleidoscope/driver/hid/base/Mouse.h" // for Mouse, MouseProps #include "kaleidoscope/driver/hid/base/Mouse.h" // for Mouse, MouseProps
#include "kaleidoscope/driver/hid/keyboardio/usb/MultiReport/Mouse.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace driver { namespace driver {

@ -23,9 +23,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#include "BootKeyboard.h" #include "kaleidoscope/driver/hid/keyboardio/usb/BootKeyboard/BootKeyboard.h"
#include "DescriptorPrimitives.h" #include "kaleidoscope/driver/hid/keyboardio/usb/DescriptorPrimitives.h"
#include "HIDReportObserver.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HIDReportObserver.h"
// See Appendix B of USB HID spec // See Appendix B of USB HID spec
static const uint8_t boot_keyboard_hid_descriptor_[] PROGMEM = { static const uint8_t boot_keyboard_hid_descriptor_[] PROGMEM = {

@ -27,9 +27,10 @@ THE SOFTWARE.
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include "HID.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID_.h"
#include "HIDTables.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID-Settings.h"
#include "HIDAliases.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HIDAliases.h"
#include "kaleidoscope/HIDTables.h"
typedef union { typedef union {
// Low level key report: up to 6 keys and shift, ctrl etc at once // Low level key report: up to 6 keys and shift, ctrl etc at once

@ -27,10 +27,10 @@ THE SOFTWARE.
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include "HID.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID_.h"
#include "HID-Settings.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID-Settings.h"
#include "MouseButtons.h" #include "kaleidoscope/driver/hid/keyboardio/usb/MouseButtons.h"
#include "DescriptorPrimitives.h" #include "kaleidoscope/driver/hid/keyboardio/usb/DescriptorPrimitives.h"
#define DESCRIPTOR_ABS_MOUSE_BUTTONS \ #define DESCRIPTOR_ABS_MOUSE_BUTTONS \

@ -25,7 +25,7 @@ THE SOFTWARE.
#pragma once #pragma once
#include "HIDTables.h" #include "kaleidoscope/HIDTables.h"
#define HID_FIRST_KEY HID_KEYBOARD_NO_EVENT #define HID_FIRST_KEY HID_KEYBOARD_NO_EVENT
#define HID_LAST_KEY HID_KEYPAD_HEXADECIMAL #define HID_LAST_KEY HID_KEYPAD_HEXADECIMAL

@ -22,6 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#include "HIDReportObserver.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HIDReportObserver.h"
HIDReportObserver::SendReportHook HIDReportObserver::send_report_hook_ = nullptr; HIDReportObserver::SendReportHook HIDReportObserver::send_report_hook_ = nullptr;

@ -18,8 +18,8 @@
#ifndef KEYBOARDIOHID_BUILD_WITHOUT_HID #ifndef KEYBOARDIOHID_BUILD_WITHOUT_HID
#include "HID.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID_.h"
#include "HIDReportObserver.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HIDReportObserver.h"
#if defined(USBCON) #if defined(USBCON)

@ -21,7 +21,7 @@
#include <stdint.h> #include <stdint.h>
#include <Arduino.h> #include <Arduino.h>
#include "HID-Settings.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID-Settings.h"
#if defined(USBCON) #if defined(USBCON)

@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#include "AbsoluteMouse.h" #include "kaleidoscope/driver/hid/keyboardio/usb/MultiReport/AbsoluteMouse.h"
#include "DescriptorPrimitives.h" #include "kaleidoscope/driver/hid/keyboardio/usb/DescriptorPrimitives.h"
static const uint8_t absolute_mouse_hid_descriptor_[] PROGMEM = { static const uint8_t absolute_mouse_hid_descriptor_[] PROGMEM = {
/* Mouse absolute */ /* Mouse absolute */

@ -27,9 +27,9 @@ THE SOFTWARE.
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include "HID.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID_.h"
#include "HID-Settings.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID-Settings.h"
#include "../DeviceAPIs/AbsoluteMouseAPI.h" #include "kaleidoscope/driver/hid/keyboardio/usb/DeviceAPIs/AbsoluteMouseAPI.h"
class AbsoluteMouse_ : public AbsoluteMouseAPI { class AbsoluteMouse_ : public AbsoluteMouseAPI {
public: public:

@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#include "ConsumerControl.h" #include "kaleidoscope/driver/hid/keyboardio/usb/MultiReport/ConsumerControl.h"
#include "DescriptorPrimitives.h" #include "kaleidoscope/driver/hid/keyboardio/usb/DescriptorPrimitives.h"
static const uint8_t consumer_control_hid_descriptor_[] PROGMEM = { static const uint8_t consumer_control_hid_descriptor_[] PROGMEM = {
/* Consumer Control (Sound/Media keys) */ /* Consumer Control (Sound/Media keys) */

@ -27,8 +27,8 @@ THE SOFTWARE.
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include "HID.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID_.h"
#include "HID-Settings.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID-Settings.h"
typedef union { typedef union {
// Every usable Consumer key possible, up to 4 keys presses possible // Every usable Consumer key possible, up to 4 keys presses possible

@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#include "Gamepad.h" #include "kaleidoscope/driver/hid/keyboardio/usb/MultiReport/Gamepad.h"
#include "DescriptorPrimitives.h" #include "kaleidoscope/driver/hid/keyboardio/usb/DescriptorPrimitives.h"
static const uint8_t gamepad_hid_descriptor_[] PROGMEM = { static const uint8_t gamepad_hid_descriptor_[] PROGMEM = {
/* Gamepad with 32 buttons and 6 axis*/ /* Gamepad with 32 buttons and 6 axis*/

@ -27,8 +27,8 @@ THE SOFTWARE.
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include "HID.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID_.h"
#include "HID-Settings.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID-Settings.h"
// Dpad directions // Dpad directions
#define GAMEPAD_DPAD_CENTERED 0 #define GAMEPAD_DPAD_CENTERED 0

@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#include "Keyboard.h" #include "kaleidoscope/driver/hid/keyboardio/usb/MultiReport/Keyboard.h"
#include "DescriptorPrimitives.h" #include "kaleidoscope/driver/hid/keyboardio/usb/DescriptorPrimitives.h"
static const uint8_t nkro_keyboard_hid_descriptor_[] PROGMEM = { static const uint8_t nkro_keyboard_hid_descriptor_[] PROGMEM = {
// NKRO Keyboard // NKRO Keyboard

@ -27,11 +27,11 @@ THE SOFTWARE.
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include "HID.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID_.h"
#include "HID-Settings.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID-Settings.h"
#include "HIDTables.h" #include "kaleidoscope/HIDTables.h"
#include "HIDAliases.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HIDAliases.h"
#define KEY_BYTES 28 #define KEY_BYTES 28

@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#include "Mouse.h" #include "kaleidoscope/driver/hid/keyboardio/usb/MultiReport/Mouse.h"
#include "DescriptorPrimitives.h" #include "kaleidoscope/driver/hid/keyboardio/usb/DescriptorPrimitives.h"
static const uint8_t mouse_hid_descriptor_[] PROGMEM = { static const uint8_t mouse_hid_descriptor_[] PROGMEM = {
/* Mouse relative */ /* Mouse relative */

@ -27,9 +27,9 @@ THE SOFTWARE.
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include "HID.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID_.h"
#include "HID-Settings.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID-Settings.h"
#include "../MouseButtons.h" #include "kaleidoscope/driver/hid/keyboardio/usb/MouseButtons.h"
typedef union { typedef union {
// Mouse report: 8 buttons, position, wheel // Mouse report: 8 buttons, position, wheel

@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#include "SystemControl.h" #include "kaleidoscope/driver/hid/keyboardio/usb/MultiReport/SystemControl.h"
#include "DescriptorPrimitives.h" #include "kaleidoscope/driver/hid/keyboardio/usb/DescriptorPrimitives.h"
static const uint8_t system_control_hid_descriptor_[] PROGMEM = { static const uint8_t system_control_hid_descriptor_[] PROGMEM = {
//TODO limit to system keys only? //TODO limit to system keys only?

@ -27,9 +27,9 @@ THE SOFTWARE.
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include "HID.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID_.h"
#include "HID-Settings.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID-Settings.h"
#include "HIDTables.h" #include "kaleidoscope/HIDTables.h"
typedef union { typedef union {
// Every usable system control key possible // Every usable system control key possible

@ -23,9 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#include "SingleAbsoluteMouse.h" #include "kaleidoscope/driver/hid/keyboardio/usb/SingleReport/SingleAbsoluteMouse.h"
#include "HIDReportObserver.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HIDReportObserver.h"
#include "HID-Settings.h"
static const uint8_t _hidSingleReportDescriptorAbsoluteMouse[] PROGMEM = { static const uint8_t _hidSingleReportDescriptorAbsoluteMouse[] PROGMEM = {
D_USAGE_PAGE, D_PAGE_GENERIC_DESKTOP, /* USAGE_PAGE (Generic Desktop) 54 */ D_USAGE_PAGE, D_PAGE_GENERIC_DESKTOP, /* USAGE_PAGE (Generic Desktop) 54 */

@ -27,9 +27,9 @@ THE SOFTWARE.
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include "HID.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID_.h"
#include "HID-Settings.h" #include "kaleidoscope/driver/hid/keyboardio/usb/HID-Settings.h"
#include "../DeviceAPIs/AbsoluteMouseAPI.h" #include "kaleidoscope/driver/hid/keyboardio/usb/DeviceAPIs/AbsoluteMouseAPI.h"
class SingleAbsoluteMouse_ : public PluggableUSBModule, public AbsoluteMouseAPI { class SingleAbsoluteMouse_ : public PluggableUSBModule, public AbsoluteMouseAPI {

Loading…
Cancel
Save