Skip to content
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

dsi: add support for DSI host peripheral #786

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

tegimeki
Copy link
Contributor

@tegimeki tegimeki commented Aug 2, 2024

Adapted from the stm32h7xx-hal implementation, changed to use register accessor functions and use the RCC enable/reset mechanisms which are different in the stm32f4xx-hal.

Changes the LtdcPins argument to the DisplayController to be an Option, as they aren't used (and aren't needed for DSI interfaces).

Tested on STM32F469I-DISC board, in this project (pending various crate updates before that BSP is directly usable)

src/dsi.rs Outdated Show resolved Hide resolved
src/dsi.rs Outdated Show resolved Hide resolved
@burrbull
Copy link
Contributor

burrbull commented Aug 2, 2024

Changes the LtdcPins argument to the DisplayController to be an Option, as they aren't used (and aren't needed for DSI interfaces).

Not sure what is better. Option or additional constructor.

@tegimeki
Copy link
Contributor Author

tegimeki commented Aug 2, 2024

Changes the LtdcPins argument to the DisplayController to be an Option, as they aren't used (and aren't needed for DSI interfaces).

Not sure what is better. Option or additional constructor.

I wasn't sure either, so will follow any recommendations. Since the parameter isn't used it could be removed altogether; the purpose of the pin declarations appears to be for setting the ALT mode, which gets done by the calling code anyway. But if there are other intentions for this parameter we could make a separate constructor for the pin-less DSI case.

src/dsi.rs Outdated Show resolved Hide resolved
src/dsi.rs Show resolved Hide resolved
Adapted from the stm32h7xx-hal implementation, changed to use
register accessor functions and use the RCC enable/reset
mechanisms which are different in the stm32f4xx-hal.

Changes the `LtdcPins` argument to the `DisplayController` to
be an `Option`, as they aren't used (and aren't needed for DSI
interfaces).
@burrbull
Copy link
Contributor

burrbull commented Aug 3, 2024

LGTM. Do you have an example to add?

@tegimeki
Copy link
Contributor Author

tegimeki commented Aug 3, 2024

LGTM. Do you have an example to add?

I have an example in my BSP project but since that board requires SDRAM for framebuffer, it depends on stm32-rs/stm32-fmc#14 and #759 in order to work.

I could add an example which configures the DSI peripheral on the STM32F469I-DISCO board and puts it in pattern test mode, as this does not require SDRAM and I might even be able to pare-down or eliminate the LTDC in this case. I will try this out and if that would be interesting I can add it to this pull request.

@burrbull
Copy link
Contributor

burrbull commented Aug 3, 2024

I could add an example which configures the DSI peripheral on the STM32F469I-DISCO board and puts it in pattern test mode, as this does not require SDRAM and I might even be able to pare-down or eliminate the LTDC in this case. I will try this out and if that would be interesting I can add it to this pull request.

Ok. Let's merge this PR and you open a new one with example when it will be ready.

@burrbull burrbull added this pull request to the merge queue Aug 3, 2024
Merged via the queue into stm32-rs:master with commit 2e8f1ba Aug 3, 2024
22 checks passed
@joelsa
Copy link

joelsa commented Aug 4, 2024

I have an example in my BSP project but since that board requires SDRAM for framebuffer, it depends on stm32-rs/stm32-fmc#14 and #759 in order to work.

I could add an example which configures the DSI peripheral on the STM32F469I-DISCO board and puts it in pattern test mode, as this does not require SDRAM and I might even be able to pare-down or eliminate the LTDC in this case. I will try this out and if that would be interesting I can add it to this pull request.

You can put an image in the internal flash, that way you also don't need the SDRAM.

It's what i did in this PR with an Example: embassy-rs/embassy#2976

@tegimeki
Copy link
Contributor Author

tegimeki commented Aug 4, 2024

You can put an image in the internal flash, that way you also don't need the SDRAM.

It's what i did in this PR with an Example: embassy-rs/embassy#2976

Good point and nice example @joelsa!

Though ultimately SDRAM is needed for rendering dynamically, I did make a simple HAL test which uses the built-in pattern generator in #789. Hopefully your stm32-fmc change will get in soon 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants