hey, ho!
Well, I've taken another look to the design and it seems that whereas the left parts uses a GPIO expander (I do like MCP23018) the right one is not using it. This is due to the fact that the atmega32u (MCU in Teensy) has only 1 I2C port. I think that it could have been good having expanders at both sides and instead of using Teensy(paying twice for USB connector and pins), just layouting an AT32UC3L064, for instance. It would have probably been cheaper, and your code would work with not mayor changes in that other MCU from the mega32 family.
By the way, I read that you had one doubt with the 2K2 resistors of the I2C. The way of correctly setting up the pullup is as follows:
- First, you select the target speed you require in your I2C interface.
- Second, take a look to the I2C specifications from Philips (NXP) for the rise-time. The value of the rise-time will be the target for your RC.
- Third, calculate the capacitance of your interface or just measure with a given resistance. Reduce the pullups (a.k.a. have a stronger pullup) if you're out of spec.
- TIP: if your RC is out of spec or in the limit, you can have undesired effects (as clock stretching because of weak pulling up) that will make your communication even slower. In any case, this won't a problem for keyboard because pressing a key is a really slow event.
So, yeah, I will probably do a hack whenever I receive the keyboard. Just replace the Teensy for a custom-made board with a different ATmega, two extra I2C expanders, a SPI wireless thingy, a flash-camera Li-rechargeable battery and the trickle for it. So that would be all. I think that all your code will be easilly portable, maybe the worst issue is adjusting the remaps in the MCU for being 100% compatible towards the GUI for custom layouts and, obviously, the battery saving schema. Bad memories of duty-cycling atmegas 128!!
The LEDs would be trickier but nothing is impossible
P.S.: help is welcome in the SPI interface