-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Stm32f429i disc1 LTDC & Display #44533
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
Merged
mbolivar-nordic
merged 6 commits into
zephyrproject-rtos:main
from
papadkostas:stm32f429i_disc1-display
Apr 8, 2022
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
81eea7a
drivers: ILI9341 add interface control registers
papadkostas ab23d03
boards: arm: stm32f429i_disc1: update onboard display
papadkostas 9504816
boards: arm: stm32f429i_disc1: enable LTDC interface
papadkostas 901e3d0
dts: arm: st: f4: stm32f429: fix LTDC
papadkostas 44c8458
drivers: display: stm32_ltdc temporary patch for LTDC clock
papadkostas 34c6ea7
boards: arm: stm32f429i_disc1: update defconfig
papadkostas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ supported: | |
| - counter | ||
| - i2c | ||
| - spi | ||
| - display | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| /* | ||
| * Copyright (c) 2020 Teslabs Engineering S.L. | ||
| * Copyright (c) 2021 Krivorot Oleg <[email protected]> | ||
| * Copyright (c) 2022 Konstantinos Papadopoulos <[email protected]> | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
@@ -115,6 +116,18 @@ int ili9341_regs_init(const struct device *dev) | |
| return r; | ||
| } | ||
|
|
||
| LOG_HEXDUMP_DBG(regs->ifmode, ILI9341_IFMODE_LEN, "IFMODE"); | ||
| r = ili9xxx_transmit(dev, ILI9341_IFMODE, regs->ifmode, ILI9341_IFMODE_LEN); | ||
| if (r < 0) { | ||
| return r; | ||
| } | ||
|
|
||
| LOG_HEXDUMP_DBG(regs->ifctl, ILI9341_IFCTL_LEN, "IFCTL"); | ||
| r = ili9xxx_transmit(dev, ILI9341_IFCTL, regs->ifctl, ILI9341_IFCTL_LEN); | ||
| if (r < 0) { | ||
| return r; | ||
| } | ||
|
|
||
| LOG_HEXDUMP_DBG(regs->etmod, ILI9341_ETMOD_LEN, "ETMOD"); | ||
| r = ili9xxx_transmit(dev, ILI9341_ETMOD, regs->etmod, ILI9341_ETMOD_LEN); | ||
| if (r < 0) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| /* | ||
| * Copyright (c) 2020 Teslabs Engineering S.L. | ||
| * Copyright (c) 2021 Krivorot Oleg <[email protected]> | ||
| * Copyright (c) 2022 Konstantinos Papadopoulos <[email protected]> | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
@@ -11,6 +12,7 @@ | |
|
|
||
| /* Commands/registers. */ | ||
| #define ILI9341_GAMSET 0x26 | ||
| #define ILI9341_IFMODE 0xB0 | ||
| #define ILI9341_FRMCTR1 0xB1 | ||
| #define ILI9341_DISCTRL 0xB6 | ||
| #define ILI9341_ETMOD 0xB7 | ||
|
|
@@ -26,10 +28,12 @@ | |
| #define ILI9341_TIMCTRLB 0xEA | ||
| #define ILI9341_PWSEQCTRL 0xED | ||
| #define ILI9341_ENABLE3G 0xF2 | ||
| #define ILI9341_IFCTL 0xF6 | ||
| #define ILI9341_PUMPRATIOCTRL 0xF7 | ||
|
|
||
| /* Commands/registers length. */ | ||
| #define ILI9341_GAMSET_LEN 1U | ||
| #define ILI9341_IFMODE_LEN 1U | ||
| #define ILI9341_FRMCTR1_LEN 2U | ||
| #define ILI9341_DISCTRL_LEN 3U | ||
| #define ILI9341_PWCTRL1_LEN 1U | ||
|
|
@@ -45,6 +49,7 @@ | |
| #define ILI9341_TIMCTRLB_LEN 2U | ||
| #define ILI9341_PUMPRATIOCTRL_LEN 1U | ||
| #define ILI9341_ENABLE3G_LEN 1U | ||
| #define ILI9341_IFCTL_LEN 3U | ||
| #define ILI9341_ETMOD_LEN 1U | ||
|
|
||
| /** X resolution (pixels). */ | ||
|
|
@@ -55,6 +60,7 @@ | |
| /** ILI9341 registers to be initialized. */ | ||
| struct ili9341_regs { | ||
| uint8_t gamset[ILI9341_GAMSET_LEN]; | ||
| uint8_t ifmode[ILI9341_IFMODE_LEN]; | ||
| uint8_t frmctr1[ILI9341_FRMCTR1_LEN]; | ||
| uint8_t disctrl[ILI9341_DISCTRL_LEN]; | ||
| uint8_t pwctrl1[ILI9341_PWCTRL1_LEN]; | ||
|
|
@@ -70,13 +76,16 @@ struct ili9341_regs { | |
| uint8_t timctrlb[ILI9341_TIMCTRLB_LEN]; | ||
| uint8_t pumpratioctrl[ILI9341_PUMPRATIOCTRL_LEN]; | ||
| uint8_t enable3g[ILI9341_ENABLE3G_LEN]; | ||
| uint8_t ifctl[ILI9341_IFCTL_LEN]; | ||
| uint8_t etmod[ILI9341_ETMOD_LEN]; | ||
| }; | ||
|
|
||
| /* Initializer macro for ILI9341 registers. */ | ||
| #define ILI9341_REGS_INIT(n) \ | ||
| BUILD_ASSERT(DT_PROP_LEN(DT_INST(n, ilitek_ili9341), gamset) == ILI9341_GAMSET_LEN, \ | ||
| "ili9341: Error length gamma set (GAMSET) register"); \ | ||
| BUILD_ASSERT(DT_PROP_LEN(DT_INST(n, ilitek_ili9341), ifmode) == ILI9341_IFMODE_LEN, \ | ||
| "ili9341: Error length frame rate control (IFMODE) register"); \ | ||
| BUILD_ASSERT(DT_PROP_LEN(DT_INST(n, ilitek_ili9341), frmctr1) == ILI9341_FRMCTR1_LEN, \ | ||
| "ili9341: Error length frame rate control (FRMCTR1) register"); \ | ||
| BUILD_ASSERT(DT_PROP_LEN(DT_INST(n, ilitek_ili9341), disctrl) == ILI9341_DISCTRL_LEN, \ | ||
|
|
@@ -108,10 +117,13 @@ struct ili9341_regs { | |
| "ili9341: Error length Pump ratio control (PUMPRATIOCTRL) register"); \ | ||
| BUILD_ASSERT(DT_PROP_LEN(DT_INST(n, ilitek_ili9341), enable3g) == ILI9341_ENABLE3G_LEN, \ | ||
| "ili9341: Error length enable 3G (ENABLE3G) register"); \ | ||
| BUILD_ASSERT(DT_PROP_LEN(DT_INST(n, ilitek_ili9341), ifctl) == ILI9341_IFCTL_LEN, \ | ||
| "ili9341: Error length frame rate control (IFCTL) register"); \ | ||
| BUILD_ASSERT(DT_PROP_LEN(DT_INST(n, ilitek_ili9341), etmod) == ILI9341_ETMOD_LEN, \ | ||
| "ili9341: Error length entry Mode Set (ETMOD) register"); \ | ||
| static const struct ili9341_regs ili9xxx_regs_##n = { \ | ||
| .gamset = DT_PROP(DT_INST(n, ilitek_ili9341), gamset), \ | ||
| .ifmode = DT_PROP(DT_INST(n, ilitek_ili9341), ifmode), \ | ||
| .frmctr1 = DT_PROP(DT_INST(n, ilitek_ili9341), frmctr1), \ | ||
| .disctrl = DT_PROP(DT_INST(n, ilitek_ili9341), disctrl), \ | ||
| .pwctrl1 = DT_PROP(DT_INST(n, ilitek_ili9341), pwctrl1), \ | ||
|
|
@@ -127,6 +139,7 @@ struct ili9341_regs { | |
| .timctrlb = DT_PROP(DT_INST(n, ilitek_ili9341), timctrlb), \ | ||
| .pumpratioctrl = DT_PROP(DT_INST(n, ilitek_ili9341), pumpratioctrl), \ | ||
| .enable3g = DT_PROP(DT_INST(n, ilitek_ili9341), enable3g), \ | ||
| .ifctl = DT_PROP(DT_INST(n, ilitek_ili9341), ifctl), \ | ||
| .etmod = DT_PROP(DT_INST(n, ilitek_ili9341), etmod), \ | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| # Copyright (c) 2018, Jan Van Winkel <[email protected]> | ||
| # Copyright (c) 2020, Teslabs Engineering S.L. | ||
| # Copyright (c) 2021, Krivorot Oleg <[email protected]> | ||
| # Copyright (c) 2022, Konstantinos Papadopulos <[email protected]> | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| description: ILI9341 320x240 display controller | ||
|
|
@@ -10,6 +11,18 @@ compatible: "ilitek,ili9341" | |
| include: ilitek,ili9xxx-common.yaml | ||
|
|
||
| properties: | ||
| ifmode: | ||
| type: uint8-array | ||
| default: [0x40] | ||
| description: | ||
| RGB interface signal control (IFMOD) register value. | ||
|
|
||
| ifctl: | ||
| type: uint8-array | ||
| default: [0x01, 0x00, 0x00] | ||
| description: | ||
| Interface control (IFCTL) register value. | ||
|
|
||
| pwctrla: | ||
| type: uint8-array | ||
| default: [0x39, 0x2c, 0x00, 0x34, 0x02] | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 commit 09f8518 is doing too many changes:
...
please split into individual commits explaining the rationale of the change
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 did so because all changes were made targeting the display support, except boosting clock speed.
Will do as requested.