Continue to shuffle and burn stuff
- Remove the concept of "mcus". With only one target platform (CircuitPython), it no longer makes a bunch of sense and has been kept around for "what if" reasons, complicating our import chains and eating up RAM for pointless subclasses. If you're a `board`, you derive from `KeyboardConfig`. If you're a handwire, the user will derive from `KeyboardConfig`. The end. As part of this, `kmk.hid` was refactored heavily to emphasize that CircuitPython is our only supported HID stack, with stubs for future HID implementations (`USB_HID` becomes `AbstractHID`, probably only usable for testing purposes, `CircuitPython_USB_HID` becomes `USBHID`, and `BLEHID` is added with an immediate `NotImplementedError` on instantiation) - `KeyboardConfig` can now take a HID type at runtime. The NRF52840 boards will happily run in either configuration once CircuitPython support is in place, and a completely separate `mcu` subclass for each mode made no sense. This also potentially allows runtime *swaps* of HID driver down the line, but no code has been added to this effect. The default, and only functional value, for this is `HIDModes.USB` - Most consts have been moved to more logical homes - often, the main or, often only, component that uses them. `DiodeOrientation` moved to `kmk.matrix`, and anything HID-related moved to `kmk.hid`
This commit is contained in:
@@ -3,49 +3,6 @@ try:
|
||||
except Exception:
|
||||
KMK_RELEASE = 'copied-from-git'
|
||||
|
||||
CIRCUITPYTHON = 'CircuitPython'
|
||||
|
||||
|
||||
class HIDReportTypes:
|
||||
KEYBOARD = 1
|
||||
MOUSE = 2
|
||||
CONSUMER = 3
|
||||
SYSCONTROL = 4
|
||||
|
||||
|
||||
class HIDUsage:
|
||||
KEYBOARD = 0x06
|
||||
MOUSE = 0x02
|
||||
CONSUMER = 0x01
|
||||
SYSCONTROL = 0x80
|
||||
|
||||
|
||||
class HIDUsagePage:
|
||||
CONSUMER = 0x0C
|
||||
KEYBOARD = MOUSE = SYSCONTROL = 0x01
|
||||
|
||||
|
||||
# Currently only used by the CircuitPython HIDHelper because CircuitPython
|
||||
# actually enforces these limits with a ValueError. Unused on PyBoard because
|
||||
# we can happily send full reports there and it magically works.
|
||||
HID_REPORT_SIZES = {
|
||||
HIDReportTypes.KEYBOARD: 8,
|
||||
HIDReportTypes.MOUSE: 4,
|
||||
HIDReportTypes.CONSUMER: 2,
|
||||
HIDReportTypes.SYSCONTROL: 8, # TODO find the correct value for this
|
||||
}
|
||||
|
||||
|
||||
class DiodeOrientation:
|
||||
'''
|
||||
Orientation of diodes on handwired boards. You can think of:
|
||||
COLUMNS = vertical
|
||||
ROWS = horizontal
|
||||
'''
|
||||
|
||||
COLUMNS = 0
|
||||
ROWS = 1
|
||||
|
||||
|
||||
class UnicodeMode:
|
||||
NOOP = 0
|
||||
|
Reference in New Issue
Block a user