-
Notifications
You must be signed in to change notification settings - Fork 2k
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/lcd: add CMD sequence feature #19918
base: master
Are you sure you want to change the base?
Conversation
0e7ec13
to
10f11ca
Compare
|
||
#include "st7735_internal.h" | ||
|
||
static const uint8_t st7735_default_init[] = { |
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 think those should live in the driver, not copy & pasted between applications/boards.
Or is there anything application specific about this?
(Sure it makes sense being able to supply an out-of-tree command sequence, but if we already have some known good init sequences for some boards, they should be easily usable)
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.
These init sequences are actually only intended for test and demonstration purposes. They have the disadvantage that they use the parameter macros directly and cannot be parameterized by the parameter set of the device. Furthermore, most of the commands in these example sequences only configure the default values after resetting the display anyway and are actually not needed at all. Last, the default init sequences are already implemented by the driver for the ST77xx variants.
9f8ca48
to
5d6a28c
Compare
I had to rebase the PR to resolve conflicts. |
I had to rebase the PR. |
5d6a28c
to
fbbcb56
Compare
fbbcb56
to
52926ab
Compare
When would using a CMD seq be the preferred method vs adding or extending the LCD specific drivers? |
After taking a year off, I am slowly trying to resume my work on RIOT-OS and am simply rebasing my old PRs to start with. |
Sometimes you will only find the sequence of bytes that represent the command sequence for initialization in data sheets, manufacturer examples or reference implementations.In this case, such a function is helpful. |
|
Sorry, I didn't mean to close this. I pressed the wrong button. Re-opening. |
The part I am unclear on is; what functionality does this PR provide that is not already possible with the existing code. It appears to be a another way to do what is already possible. If it does not provide new functionality, than an explanation of why the duplicate method is desirable to add would be helpful. |
Instead of using an endless sequence of calls to It corresponds to the approach as it is done in the Adafriut ST7735 Library: https://github.com/adafruit/Adafruit-ST7735-Library/blob/master/Adafruit_ST7735.cpp#L44-L209 |
Contribution description
The PR provides the capability to execute a sequence of LCD controller commands defined in a byte array as CLP tuples (command, length, parameter). This can be used for example
The PR introduces the pseudomodule
lcd_init_sequence
to use the initialization command sequence defined in the driver parameter set instead of the the controller-specific initialization function.The format of a CLP tuple is:
For testing,
tests/drivers/st77xx
has been extended to use initialize the LCD controller by a intialization command sequence if modulelcd_init_sequence
is enabled.Testing procedure
tests/drivers/st77xx
should work with enabledlcd_init_sequence
:Issues/PRs references