-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
drivers: display: Add LED-Strip matrix display driver #68614
Conversation
d4a7fcb
to
14b73c7
Compare
This is fun :) |
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.
Cool, can you also add a build case in tests/drivers/build_all/display/
?
14b73c7
to
edd43aa
Compare
@soburi give it a rebase, the display test was broken and the format changed |
Thank you for the notification. |
82fbd38
to
7d9f1a6
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.
Cool! Just a nitpicky comments about variable names from me.
7d9f1a6
to
6a96534
Compare
@kartben |
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 @soburi,
Thanks for this nice driver. I will definitely use it !
Please find few comments and questions below. I'll try to review the code next week.
[ 7][ 6][ 5][ 4] | ||
[11][10][ 9][ 8] | ||
[15][14][13][12] | ||
|
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.
Should you also handle the case where the first LED is at the bottom of the display matrix ? start-from-bottom
?
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.
Added start-from-bottom
.
|
||
* Modules are arranged circulative from top left to bottom right. | ||
[M0][M1] | ||
[M2][M3] |
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.
And what about supporting a serpentine layout of modules ? :)
Is it common to have a large grid/array of LED assembled from several smaller modules ?
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.
Since I was expecting a module like this that the user could connect with the connector, I didn't give much thought to the arrangement of the modules. However, the serpentine arrangement can have shorter wiring.
The placement can now be specified using the same rules as for LEDs.
description: | | ||
Specify the LED strip that is the substance of the matrix. | ||
If more than one element is specified, split the matrix into multiple strips. | ||
The amount of LEDs must equal the [width * height] value. |
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.
Maybe it is worth mentioning that the phandles of LED strip controllers must be ordered based on their position in the "flattened" chain of pixels, and that the strip controller must be chained "simply" (i.e. all LEDs of controller 1, all LED of controller 2, etc).
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.
Added explanation. Could you check, please?
6a96534
to
79897c3
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.
this is very cool stuff! ❤️
|
||
width: | ||
description: | | ||
Specifies the overall `width` of the matrix. |
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.
nit to be consistent with height:
Specifies the overall `width` of the matrix. | |
Specifies the overall width of the matrix. |
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.
Fixed it.
caps->supported_pixel_formats = PIXEL_FORMAT_ARGB_8888; | ||
caps->current_pixel_format = PIXEL_FORMAT_ARGB_8888; |
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.
btw was there a reason for not using PIXEL_FORMAT_RGB_888
? It doesn't look like alpha channel can be used in any meaningful way so having 24-bit per colour instead of 32 could save quite a bit of memory.
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.
I changed to be able to select pixel format on devicetree.
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.
on a second thought, adding back a request for change regarding my latest comment about pixel format.
5c635a1
to
7d6239f
Compare
This property only accept PANEL_PIXEL_FORMAT_RGB_888 and PANEL_PIXEL_FORMAT_RRGB_8888. | ||
If not set this property, the behavior is same as selecting PANEL_PIXEL_FORMAT_RGB_888. |
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.
This property only accept PANEL_PIXEL_FORMAT_RGB_888 and PANEL_PIXEL_FORMAT_RRGB_8888. | |
If not set this property, the behavior is same as selecting PANEL_PIXEL_FORMAT_RGB_888. | |
This property only accepts PANEL_PIXEL_FORMAT_RGB_888 and PANEL_PIXEL_FORMAT_RRGB_8888. | |
If this property is not set, the behavior is same as selecting PANEL_PIXEL_FORMAT_RGB_888. |
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.
btw why not just use PANEL_PIXEL_FORMAT_RGB_888 (1) as a default value here?
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.
I didn't deeply consider it. It's easier to understand if you explicitly set the default value, so I've modified it that way.
Adds a driver for a display of LED strips arranged in a grid. Signed-off-by: TOKITA Hiroshi <[email protected]>
7d6239f
to
3ad79a5
Compare
This type of product is available from Adafruit's Adafruit NeoPixel Shield for Arduino.
But electrically, it is just an LED strip, so it is a general-purpose product.
https://www.adafruit.com/product/1430
There is no problem in merging this patch itself, but
Changes may occur depending on the progress of #68514 and #67610.
I verify this PR with 16x16 WS2812 matrix with following overlay.