-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: led: is31fl3197 Arduino GIGA #96821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
fd309e3 to
b69ff55
Compare
|
@pillo79 @facchinm and all - As far as I can tell, the basic parts of this PR are working. That is I can set the RGB led on the I am going to mark this as ready to review, however I know there are issues with twister, as it appears like the GIGA board Currently I have the sample setup to work with just specifying board as arduino_giga_r1//m7, as the shield currently Also should mention: that the code is hard coded similarly to the is31fl3194 code in that it assumes RED/GREEN/BLUE But before I go much further, it would help to know if this is a direction that Arduino wishes to go. |
simonguinot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @KurtE,
Thanks for this PR !
Can it be merged with the driver is31fl3194 ? into a is31fl319x driver ?
I didn't check but I am asking because in Linux the leds-is31fl319x driver supports the IS31FL319{0,1,3,6,9} models...
Good question, both of them have stuff in common, and I started off that way, but then found many of the registers @pillo79 As the one who originally did the 94 version, What do you think? |
|
Thanks Kurt! I also think this is worth merging with the existing driver, there's a lot of common code, and the few exceptions look like they can be specifically handled. Take a look at the end of Oh, and re/ Arduino attitude, upstream is the way to go so 👍 on that! By all means make it part of the Giga Display shield, that way it will be automatically available everywhere you use that and not only in the test code 🙂 |
|
@KurtE Lines 391 to 413 in 8843fd9
|
Can do. At least the basics, that the display shield uses. Don't have any other things to try more advanced stuff on. My first thoughts were to hack it and drive everything off of Product ID. I believe the 94 has a fixed ID of 0xce
I agree, that in the Zephyr world, having it all here under the shield is the way to go and not have to put the DT info in the Some questions on this, should I then remove the GIGA from the integration section of the sample.yaml? As I don't believe Include Portenta H7? I have a overlay I experimented with yesterday, that had the LEDS working on an H7 plugged into a MID Main Secondary Question: Currently with ArduinoCore-zephyr if I wish to build for a GIGA, it includes all of the Giga Shield stuff, regardless if I actually have a shield. With the MBED version, only the basics for the display are included with a board release in the library Arduino_H7_video, The I decided to try first with the LEDS as it is pretty self contained and not very large. Our zephyr version of Arduino library for this: Longer term question: how much of the stuff in the ArduinoCore-zephyr overlays/config files maybe should be |
|
Sorry, another quick question: Is there any Boards other than the Nicla Sense ME that uses is31fl3194? |
|
@JarmouniA and others. I see some twister jobs are failing. Wondering if we need to add the LED Sketch to the sample test sketch run? Like maybe to the sample.yaml file? |
1c02bde to
c8f9304
Compare
thedjnK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR needs original commit fixing instead of fixups in second commit then looks OK
Edit: Is this about the \ don't align? |
Look at first 2 commits, anything that the first commit adds and the second commit fixes up, move to the first commit |
c8f9304 to
eb6c587
Compare
|
First commit, line 343 in .c file, undef it still present |
eb6c587 to
db4dfef
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First & 3rd commit message needs fixing, there is stuff after the sign-off
In preparation to allow this driver to support more than one IS31FL319x object such as ...97, rename the source file and the functions to make them more generic. I also changed the enumeration/creation of object to generate the right names for the current 94 objects Still have not renamed the Kconfig file yet as was having issues with it not building... Did not load the .c file Update README.rst one Kconfig Delete Kconfig.is31fl3194 Fix documents run drivers: led: IS31FL3194 to 9x fix redirects,py Signed-off-by: Kurt Eckhardt <[email protected]>
more refactoring, don't use the 94 registers everywhere. Introduce structure, with registers and fixed values, and use it. Signed-off-by: Kurt Eckhardt <[email protected]>
Removed the driver knowing anything about what color each channel is. When you output to an LED with a buffer it simply writes the channels out with buffer. Also removed the assumptions that the leds are either a) RGB or b) 3 channels and instead use them the way they are defined. That is for example if we have 4 channels, we could define an LED with just one color in it and we could define another with three. The user can define 4 leds each with color yellow. For each LED it counts how many buffers were used by previous LEDs and starts there and outputs N channels. Decided it looked cleaner to use helper function write channels, so implemented it and added it to the call table. Updated sample: It manually computes which channel maps to red, green and blue and then uses those indexes to map the table of colors to the right channels. Signed-off-by: Kurt Eckhardt <[email protected]>
Add the registers and the like to the .c file plus add a Kconf file plus bindings. Updated sample: to also check for is31fl3197 boards Signed-off-by: Kurt Eckhardt <[email protected]>
Added is31fl3197@50 to overlay Also updated GIGA board yaml file to say that it supports i2c And updated sample to mention it Signed-off-by: Kurt Eckhardt <[email protected]>
857b8cc to
183586a
Compare
I think done now ... Had git hiccup ... Github desktop decided to do a merged... I think |
|
pillo79
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
|
||
| uint8_t channel_start = is31fl319x_map_led_to_start_channel(config, led); | ||
|
|
||
| if (info->num_colors > config->channel_count) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be num_colors, the actual parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pillo79 - Wondering if I should still address this. I actually think that whole if block, should just
be removed. That is the only thing after this is a call to the write channels, which validates the
information any way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the confusing approval, that was a leftover comment I forgot about in my review history. As you said, the check is useless anyway - not blocking especially since PR has been already approved, IMO can be addressed with a one-liner later.
Waiting for a final review from @simonguinot 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for a final review from @simonguinot 😉
I know, I know. I am just to busy right now. I'll take care of it this week.




Start of support for the is31fl3197 LED controller used by Arduino in the Arduino Giga Display shield.
So far there is just enough implemented that allows me to control the LEDS, to the same extent as our version of the library we implemented that runs on ArduinoCore-zephyr
@pillo79 @facchinm - I am not sure what direction Arduino is heading with functionality such as this.
Add support to zephyr? Or do it external as libraries within ArduinoCore-zephyr (either integrated within the zephyr builds or external libraries), This is also true, about for some of the other
features of the display, like the display itself. Should there be samples setup to actually
display something on the display, preferably without the need for LVGL.
So far this only has the minimal support for setting up to 4 LEDS (the GIGA only uses 3).
Added sample sketch that runs on the GIGA. Currently it works with just
west build -p -b arduino_giga_r1//m7
I put the device tree into sample/boards. Potentially it should be defined as part of the
overlay in the arduino_giga_display_shield, in which case the west build should
define the shield as part of the command.
Let me know know what you think.
Thanks