TCA8418 initial config + basic 3x4 keypad config#6320
Conversation
added the TCA8418
add TCA8418
add TCA8418KB
add TCA8418KB
Create TCA8418Keyboard.cpp
Create TCA8418Keyboard.h
add TCA8418
add TCA8418
add TCA8418KB
add TCA8418KB
old version in initial commit
|
this is going to be a big lesson for me, sorry guys... |
|
Hey! Welcome to meshtastic and thanks for your first patch. |
|
|
||
| SCAN_SIMPLE_CASE(TDECK_KB_ADDR, TDECKKB, "T-Deck keyboard", (uint8_t)addr.address); | ||
| SCAN_SIMPLE_CASE(BBQ10_KB_ADDR, BBQ10KB, "BB Q10", (uint8_t)addr.address); | ||
| SCAN_SIMPLE_CASE(TCA8418_KB_ADDR, TCA8418KB, "TCA8418 keyboard", (uint8_t)addr.address); |
There was a problem hiding this comment.
Unfortunately XPOWERS_AXP192_AXP2101_ADDRESS has the same address. What you'll need to do is find where that is called and then make a "complex" case - use register values in either the AXP chips or TCS chip to work out which one is detected. Lots of examples above. We're here to help.
There was a problem hiding this comment.
I missed that one too. Why is the AXP192 address not defined in configuration.h like all the others?
@Nasimovy I had no intention to pull my code into the official master because of the specific use case. Not sure if that is a good idea.
There was a problem hiding this comment.
I'm happy to see it added to the main firmware - it just needs to be done in a harmonious way.
There was a problem hiding this comment.
@Mictronics the use case doesn`t really matter (i think) its more to you use your code as a foundation and edit it along the way, it would be cool if the TCA8418 could be used for a whole arsenal of keyboards, keypads etc...
@NomDeTom what do suggest for it to be harmonius?
TCA8418-layout 3x4 should work Nokia 5130 needs editing.
|
should i convert this to draft? |
|
there should be no braking changes, the code needs testing though for checking if the XPOWERS_AXP192_AXP2101_ADDRESS case does it job edit: sorry for the boat load of edits, i should have started with visual studio code and not just push every little file change, lesson learned i guess |
This reverts commit 13101c1.
* add TCA8418 to configuration.h added the TCA8418 * add TCA8418 to ScanI2C.cpp add TCA8418 * add TCA8418KB to ScanI2C.h add TCA8418KB * add TCA8418KB ScanI2CTwoWire.cpp add TCA8418KB * Create TCA8418Keyboard.cpp Create TCA8418Keyboard.cpp * Create TCA8418Keyboard.h Create TCA8418Keyboard.h * add TCA8418 to kbI2cBase.cpp add TCA8418 * add TCA8418 to kbI2cBase.h add TCA8418 * add TCA8418KB to main.cpp add TCA8418KB * add TCA8418KB to cardKbI2cImpl.cpp add TCA8418KB * Update TCA8418 kbI2cBase.cpp * enable debug TCA8418 * Nokia 5130 config * Update TCA8418Keyboard.h old version in initial commit * Update ScanI2CTwoWire.cpp * add tap_interval and backlight_on to constructor * Create TCA8418-layouts.cpp TCA8418-layout 3x4 should work Nokia 5130 needs editing. * put layouts in different file + adjusted code for variable matrix sizes * rename TCA8418-layouts.cpp to TCA8418Layouts.cpp + add endif * Update TCA8418Keyboard.cpp name change layouts * forgot a \ * Create TCA8418Layouts.h * Update TCA8418Keyboard.cpp * add include forgot include * Update TCA8418Keyboard.cpp * Update TCA8418Keyboard.h * Update TCA8418Layouts.h * revert to keyboard layout in main TCA8418Keyboard.cpp * fixed the address * changed ordering of constructor * reflect changes meshtastic#6371 * edit config.h * bug fix fast pressing multiple buttons + clean up scanI2CTwoWire.cpp * trunked --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: Tom Fifield <tom@tomfifield.net>
…6320)" (meshtastic#6410) This reverts commit 30f508a.
pull request for adding the TCA8418, the config now is for a
Nokia 5130 key matrix3x4 with (backlight)the issue i see at this moment is that the TCA8418 supports up to 80 buttons, the config for the
5130 uses 16 buttons3x4 keypad uses 12 buttons and 1 pin as an output for the backlight.Is there a good way on how to select the button mapping?
Thanks to @Mictronics for writing the code in his fork
@NomDeTom paging you to.
I'm in the process of ordering parts myself for a 3x4 button matrix.
edit: reflect the changes for the current code