Skip to content

TCA8418 initial config + basic 3x4 keypad config#6320

Merged
fifieldt merged 43 commits into
meshtastic:masterfrom
Nasimovy:master
Mar 26, 2025
Merged

TCA8418 initial config + basic 3x4 keypad config#6320
fifieldt merged 43 commits into
meshtastic:masterfrom
Nasimovy:master

Conversation

@Nasimovy

@Nasimovy Nasimovy commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

pull request for adding the TCA8418, the config now is for a Nokia 5130 key matrix 3x4 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 buttons 3x4 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

@Nasimovy

Copy link
Copy Markdown
Contributor Author

this is going to be a big lesson for me, sorry guys...

@fifieldt

Copy link
Copy Markdown
Member

Hey! Welcome to meshtastic and thanks for your first patch.

Comment thread src/detect/ScanI2CTwoWire.cpp Outdated

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);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to see it added to the main firmware - it just needs to be done in a harmonious way.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Comment thread src/input/TCA8418Keyboard.cpp
@Nasimovy

Copy link
Copy Markdown
Contributor Author

should i convert this to draft?

@Nasimovy Nasimovy marked this pull request as draft March 15, 2025 19:33
@Nasimovy Nasimovy changed the title TCA8418 initial config + Nokia 5130 TCA8418 initial config + basic 3x4 keypad config Mar 15, 2025
@Nasimovy Nasimovy marked this pull request as ready for review March 16, 2025 21:21
@Nasimovy

Nasimovy commented Mar 16, 2025

Copy link
Copy Markdown
Contributor Author

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

Comment thread src/detect/ScanI2CTwoWire.cpp Outdated
Comment thread src/detect/ScanI2CTwoWire.cpp Outdated
@fifieldt fifieldt merged commit 13101c1 into meshtastic:master Mar 26, 2025
thebentern added a commit that referenced this pull request Mar 27, 2025
thebentern added a commit that referenced this pull request Mar 27, 2025
jeek pushed a commit to jeek/Meshtastic-Exploiteers-Hacker-Pager that referenced this pull request Jun 30, 2026
* 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>
jeek pushed a commit to jeek/Meshtastic-Exploiteers-Hacker-Pager that referenced this pull request Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants