agausmann / polybius

Keyboard firmware experiments on the bleeding edge of Rust's const-eval.
Other
6 stars 0 forks source link

Split keyboard support #1

Open agausmann opened 2 years ago

agausmann commented 2 years ago

Design questions:

agausmann commented 2 years ago

only one pin for communication.

Turns out this is incorrect. At least for Keebio boards, both I2C pins are connected between halves. However there is no I2C slave driver for AVR yet - Rahix/avr-hal#90

agausmann commented 2 years ago

The interaction with const generics also makes this complicated. Each side will have pins for half of the total rows or columns (depending on how it is logically split). So a plain InputGroup/OutputGroup will have 1/2 of the total rows or columns of the end user's layout.

To fix this, there could be a Split wrapper that accepts a InputGroup<N> or OutputGroup<N> and implements InputGroup<2 * N> or OutputGroup<2 * N> respectively, with an internal flag to say which half it is (detected by the keyboard driver code). It will simply be a no-op for the pins of the other half (whose state should be reported by the MCU on the other half, via a separate SplitSync trait/driver).