Closed warfareonly closed 2 years ago
you can implement a functionnally equivalent of Matrix on your own (as nothing force you to use the Matrix struct), or you can use a fake pin:
struct FakePin;
impl ehal::OutputPin for FakePin {
...
}
I will accept a PR to add a FakePin in the matrix module, with some documentation on how to use it with Matrix.
Alright, sounds good!
I'll need some time to set up the firmware for my keyboard (having some issues with the initialisation/interrupt settings), but once I do that and have my firmware working, I'll make a PR for FakePin
.
Hi, I have a split keyboard with a WeAct Mini F4, where the switches are connected directly to the pins of the controller. It currently runs on QMK, but I'm planning on switching to keyberon. I took a brief look at the codebase, and it seems that there's currently no support for something like "DIRECT_PIN" from QMK.
I guess using a "ghost pin" (such as the A13/A14 pin used for serial debugging/flashing the MCU) would be the best bet for the firmware as it currently is? Breakout board's pinout. I use DFU for flashing, so it won't bother me to use those pins.
But that approach would not work if there are no free pins available on the controller, so in the meantime I guess I would also be interested in exploring a similar feature for keyberon. Would you be willing to entertain a PR for the same? (I currently have no clue as to how it will integrate in the existing code, but that's for later 😄 )
KiCAD schematic for one half of the keyboard (the "other" side is the same)
In case someone is looking at this issue and does not know what is DIRECT_PIN, here's a very short explanation: A switch is connected to (say) pin P1 on the MCU, with the other terminal of the switch being connected to GND. Pin P1 is set internally as "pull-up high". Then, whenever the switch is pressed, P1 gets pulled low. Its actually pretty much the same as the current matrix implementation: just that there is no "row" --> it's always GND. The get function from matrix.rs would then become:
The above code will obviously not work with the current implementation ;) .
Please let me know if I missed mentioning something!