Skip to content

Added initial support for Texas Instruments LP5562#6381

Merged
caveman99 merged 5 commits into
meshtastic:masterfrom
NomadStar-outdoor:ti-LP5562-rgbw
Apr 1, 2025
Merged

Added initial support for Texas Instruments LP5562#6381
caveman99 merged 5 commits into
meshtastic:masterfrom
NomadStar-outdoor:ti-LP5562-rgbw

Conversation

@CypressXt

Copy link
Copy Markdown
Contributor

Hi there 👋,

Our beloved NCP5623 RBG/LCD controller has reached it's retirement age and became discontinued. One potential replacement for the RGB controller part could be the Texas Instruments LP5562 RGBW.

The goal of this PR draft would be to integrate the LP5562 into the Meshtastic firmware and start this implementation by integrating it into the external notification module. Support for Ambient lighting would also be handy.

Feel free to hop on-board, feedback and comments are very welcome 🚀

@CLAassistant

CLAassistant commented Mar 23, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@CypressXt

Copy link
Copy Markdown
Contributor Author

For additional context, if you want to test it, don't forget to update your variant.h and platformio.ini with the following lines:

variant.h

// Texas Instrument LP5562
#define HAS_LP5562

platformio.ini

lib_deps = 
  https://github.com/NomadStar-outdoor/IOBoard-RGB-LP5562-Library.git#53196fc

The work in progress Arduino library for the LP5562 can be found here: NomadStar-outdoor/IOBoard-RGB-LP5562-Library

@CypressXt

Copy link
Copy Markdown
Contributor Author

So far the code compile but no success yet with the LED status. We are working on it and will update this PR.

@CypressXt

CypressXt commented Mar 29, 2025

Copy link
Copy Markdown
Contributor Author

Success 🎉, the issue was the ti LP5562 initialization in our Arduino lib and how we wrote into registers.
This is now fixed and working on our dev-board for both modules external-notification and ambient-lighting.
(The Arduino lib still needs some love as the colour accuracy and light intensity are still suboptimal).

platformio.ini

lib_deps = 
  https://github.com/NomadStar-outdoor/IOBoard-RGB-LP5562-Library.git#fb62e2f

Now that everything works on the firmware side I'll try to refactor the code to support further RBG controller addition in the future in a way that limit the spread of defined(HAS_NCP5623) || defined(HAS_LP5562) || defined(HAS_ANOTHERRBGCONTROLLERHERE)

@CypressXt

Copy link
Copy Markdown
Contributor Author

Hiiii 👋, I've refactor as much code as possible and introduced a HAS_RGB_LED case (Thanks @caveman99 for the hint) to make future RBG devices capable integration a bit easier. It's not perfect as you still have to do some special check for specific features embedded in some controllers but it reduce the overall footprint a little.

What are your thoughts about it, should we merge as is ?

@CypressXt CypressXt marked this pull request as ready for review March 30, 2025 10:49

@caveman99 caveman99 left a comment

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.

LGTM, please see inline comments for some nitpicking.

Comment thread src/AmbientLightingThread.h Outdated
Comment thread src/main.cpp
@caveman99

Copy link
Copy Markdown
Member

Also please run trunk fmt on the code. Note: this needs to be done from a UNIX type operating system, windows does not support all needed formattes.

@CypressXt CypressXt requested a review from caveman99 March 31, 2025 08:40
@caveman99 caveman99 merged commit f6ed10f into meshtastic:master Apr 1, 2025
@CypressXt

CypressXt commented Apr 1, 2025

Copy link
Copy Markdown
Contributor Author

Thanks a lot for the reviews, feedback and the merge ! ❤️ 🎉

Nasimovy added a commit to Nasimovy/meshtastic-firmware that referenced this pull request Apr 2, 2025
thebentern added a commit that referenced this pull request Apr 3, 2025
* TCA8418 with base config for 3x4 keypad

* replaced k with uppercase K

* change detection method

* reflect changes  #6381

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Jorropo added a commit to Jorropo/firmware that referenced this pull request Apr 29, 2025
This reverts commit ef18a9b.

Fixes meshtastic#6683, I have not tried to understand *why* this work, this was found by `git bisect`:
```
git bisect start
# status: waiting for both good and bad commits
# bad: [b4e8f7d] Update Adafruit BusIO digest to 159f86a (meshtastic#6681)
git bisect bad b4e8f7d
# status: waiting for good commit(s), bad commit known
# good: [6429eca] udp-multicast: do not listen for incoming udp multicast packets if disabled (meshtastic#6397)
git bisect good 6429eca
# bad: [1b1d462] chore: update ubx.h (meshtastic#6522)
git bisect bad 1b1d462
# good: [89cde1a] udp-multicast: bump platform-native to UDP with error handling support (meshtastic#6433)
git bisect good 89cde1a
# good: [2c01fad] meshtasticd: Add FrequencyLabs MeshAdv-Mini Hat (meshtastic#6458)
git bisect good 2c01fad
# bad: [0110275] Revert "Try-fix ESP32 wifi disconnects (meshtastic#6363)" (meshtastic#6493)
git bisect bad 0110275
# bad: [ef18a9b] meshtasticd: Set available.d dir in yaml (meshtastic#6481)
git bisect bad ef18a9b
# good: [ea4ce8d] MUI unPhone-tft: fix defaults (meshtastic#6477)
git bisect good ea4ce8d
# good: [f6ed10f] Added initial support for Texas Instruments LP5562 (meshtastic#6381)
git bisect good f6ed10f
# good: [67fddcc] Upgrade trunk (meshtastic#6480)
git bisect good 67fddcc
# first bad commit: [ef18a9b] meshtasticd: Set available.d dir in yaml (meshtastic#6481)
```
I have tested this patch and it does work as expected after reverting.
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.

4 participants