Signed-off-by: Gergely Nagy <algernon@keyboard.io>
wip/rcm-stm32
Gergely Nagy 3 years ago
parent c28eea03f3
commit 785cb841fe
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -15,17 +15,17 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef ARDUINO_GD32F303ZE_EVAL
#ifdef KBIO_TEST
#include "kaleidoscope/Runtime.h"
#include "kaleidoscope/driver/keyscanner/Base_Impl.h"
namespace kaleidoscope {
namespace device {
namespace gd32 {
namespace stm32 {
} // namespace gd32
} // namespace stm32
} // namespace device
} // namespace kaleidoscope
#endif // ifdef ARDUINO_GD32F303ZE_EVAL
#endif // ifdef KBIO_TEST

@ -22,16 +22,25 @@
#include <Arduino.h>
#include "kaleidoscope/device/Base.h"
#include "kaleidoscope/driver/hid/RCMComposite.h"
namespace kaleidoscope {
namespace device {
namespace stm32 {
struct TestProps: kaleidoscope::device::BaseProps {
struct TestProps: public kaleidoscope::device::BaseProps {
typedef kaleidoscope::driver::hid::RCMCompositeProps HIDProps;
typedef kaleidoscope::driver::hid::RCMComposite<HIDProps> HID;
static constexpr const char *short_name = "KBIOTest";
};
class Test: public kaleidoscope::device::Base<TestProps> {};
class Test: public kaleidoscope::device::Base<TestProps> {
public:
auto serialPort() -> decltype(kaleidoscope::driver::hid::rcmcomposite::CompositeSerial) & {
return kaleidoscope::driver::hid::rcmcomposite::CompositeSerial;
}
};
#define PER_KEY_DATA(dflt, \
R0C0, R0C1 \

@ -0,0 +1,32 @@
// -*- mode: c++ -*-
/* Kaleidoscope - Firmware for computer input devices
* Copyright (C) 2021 Keyboard.io, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, version 3.
*
* This program 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 General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "kaleidoscope/driver/hid/RCMComposite.h"
namespace kaleidoscope {
namespace driver {
namespace hid {
namespace rcmcomposite {
USBHID RCMHID;
HIDKeyboard RCMKeyboard(RCMHID);
USBCompositeSerial CompositeSerial;
} // namespace rcmcomposite
} // namespace hid
} // namespace driver
} // namespace kaleidoscope

@ -0,0 +1,56 @@
// -*- mode: c++ -*-
/* Kaleidoscope - Firmware for computer input devices
* Copyright (C) 2021 Keyboard.io, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, version 3.
*
* This program 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 General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <Arduino.h>
#include <USBComposite.h>
#include "kaleidoscope/driver/hid/Base.h"
#include "rcmcomposite/Keyboard.h"
//#include "rcmcomposite/Mouse.h"
namespace kaleidoscope {
namespace driver {
namespace hid {
namespace rcmcomposite {
extern USBHID RCMHID;
extern HIDKeyboard RCMKeyboard;
extern USBCompositeSerial CompositeSerial;
}
struct RCMCompositeProps: public BaseProps {
typedef rcmcomposite::KeyboardProps KeyboardProps;
typedef rcmcomposite::Keyboard<KeyboardProps> Keyboard;
// typedef rcmcomposite::MouseProps MouseProps;
// typedef rcmcomposite::Mouse<MouseProps> Mouse;
};
template <typename _Props>
class RCMComposite: public Base<_Props> {
public:
void setup() {
//rcmcomposite::RCMHID.begin(rcmcomposite::CompositeSerial, HID_KEYBOARD_MOUSE);
rcmcomposite::RCMHID.begin(HID_KEYBOARD_MOUSE);
}
};
} // namespace hid
} // namespace driver
} // namespace kaleidoscope

@ -0,0 +1,95 @@
// -*- mode: c++ -*-
/* Kaleidoscope - Firmware for computer input devices
* Copyright (C) 2021 Keyboard.io, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, version 3.
*
* This program 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 General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <Arduino.h>
#include <USBComposite.h>
#include "kaleidoscope/driver/hid/base/Keyboard.h"
namespace kaleidoscope {
namespace driver {
namespace hid {
namespace rcmcomposite {
extern USBHID RCMHID;
extern HIDKeyboard RCMKeyboard;
class BootKeyboardWrapper {
public:
BootKeyboardWrapper() {}
void begin() {}
uint8_t getProtocol() {
return 0;
}
void setProtocol(uint8_t protocol) {}
void setDefaultProtocol(uint8_t protocol) {}
void sendReport() {
RCMKeyboard.sendReport();
}
void press(uint8_t code) {
RCMKeyboard.press(code);
}
void release(uint8_t code) {
RCMKeyboard.release(code);
}
void releaseAll() {
RCMKeyboard.releaseAll();
}
bool isKeyPressed(uint8_t code) {
//return BootKeyboard.isKeyPressed(code);
return 0;
}
bool isModifierActive(uint8_t code) {
//return BootKeyboard.isModifierActive(code);
return 0;
}
bool wasModifierActive(uint8_t code) {
//return BootKeyboard.wasModifierActive(code);
return 0;
}
bool isAnyModifierActive() {
//return BootKeyboard.isAnyModifierActive();
return 0;
}
bool wasAnyModifierActive() {
//return BootKeyboard.wasAnyModifierActive();
return 0;
}
uint8_t getLeds() {
return RCMKeyboard.getLEDs();
}
};
struct KeyboardProps: public base::KeyboardProps {
typedef BootKeyboardWrapper BootKeyboard;
};
template <typename _Props>
class Keyboard: public base::Keyboard<_Props> {};
} // namespace rcmcomposite
} // namespace hid
} // namespace driver
} // namespace keyboardio
Loading…
Cancel
Save