-
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: slightly rework params to expose offset values to ili9341 driver #17925
Conversation
d8f14f3
to
25aa562
Compare
c0d532d
to
cef72ba
Compare
cef72ba
to
d060f47
Compare
@@ -107,7 +107,8 @@ extern "C" { | |||
#define ILI9341_PARAM_NUM_LINES (240U) /**< Number of screen lines */ | |||
#define ILI9341_PARAM_RGB (1) /**< RGB configuration */ | |||
#define ILI9341_PARAM_INVERTED (1) /**< Inversion configuration */ | |||
#define ILI9341_PARAM_ROTATION (LCD_ROTATION_HORZ_FLIP) /**< Rotation mode */ | |||
#define ILI9341_PARAM_ROTATION (LCD_ROTATION_VERT) /**< Rotation mode */ | |||
#define ILI9341_PARAM_OFFSET_X (80) /**< Vertical rotation requires a 80 pixel offset */ |
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 seems a bit weird, are you able to correctly draw in the whole screen? the 80 offset makes me think it has something to do with the display being 240X320
and with the flip you want to treat it as 320x240
, but its strange that this is not handled by the driver.
If you are able to correctly draw to the whole display I'm ok as it is, although it still seems a bit weird to me.
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 the adafruit clue, the display is 240x240 and yes it draws correctly with the 80 pixels offset. I also tested this on the pinetime (also 240x240) and to rotate by 180°, I also had to add an offset (on Y this time).
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.
ACK, trusting @aabadie testing
Thanks! |
Contribution description
This is a follow-up of #16176 that reworks the ili9341 parameters to also expose X/Y offset values. The idea behind this PR is about the adafruit-clue display that was not oriented correctly.
Setting the orientation parameter to the right value (
LCD_ROTATION_VERT
) raised an offset issue with the ili9341.It seems that the offset values can be handled in a similar way as for the st7735 driver. So this PR unifies all this.
What is not done by this PR is to add the possibility to play with the ST7735 orientation parameters (they are actually still hard coded) but I couldn't find a combination that works for all possible values.
Testing procedure
tests/driver_ili9341
display is correctly oriented on adafruit-clue (tested and it works)Issues/PRs references
Follow-up of #16176