libtock-rs icon indicating copy to clipboard operation
libtock-rs copied to clipboard

Screen API implementation

Open inesmaria08 opened this issue 1 year ago • 1 comments

This pull request adds an interface for screen management. It includes implementations and unit tests, and has been tested on a Raspberry Pi Pico using a Pico Explorer Base.

Files added:

  • unittest/src/fake/display/mod.rs
  • unittest/src/fake/display/tests.rs
  • examples/screen.rs
  • apis/interface/display/src/lib.rs
  • apis/interface/display/src/tests.rs

Tests:

  • Manually tested on a Raspberry Pi Pico with a Pico Explorer Base.
  • Unit tests added for both fake and real interfaces.

inesmaria08 avatar Feb 11 '25 16:02 inesmaria08

This seems to be a rust version problem, @inesmaria08 could you please rebase your branch and force push it?

alexandruradovici avatar Jun 22 '25 13:06 alexandruradovici

I would like to try this out. It seems like it needs a rebase at this point. I was able to confirm that just including the relevant changes do work with the nrf52840dk (https://github.com/tock/libtock-rs/compare/display-bradjc?expand=1).

To merge this I think we should rename "display" to "screen" to be consistent with the kernel.

bradjc avatar Jul 28 '25 18:07 bradjc

Any chance you have tried embedded graphics? https://crates.io/crates/embedded-graphics

bradjc avatar Jul 28 '25 18:07 bradjc

To merge this I think we should rename "display" to "screen" to be consistent with the kernel.

The display crate should be renamed to screen and moved to a folder called display in the apis folder.

bradjc avatar Jul 28 '25 21:07 bradjc

I tested this on a Pico Explorer Base with 2 Pico boards (Pico 1 and Pico 2). On the Pico 2 this works out of the box, but on the Pico 1 there is a strange bug. If I am using normal UART for debugging, it works out of the box, but when I use UART over USB, the screen gets stuck on the init and I have to reset the board from Process Console for it to work. I can't tell if this is an issue with the board, the Tock port or libtock-rs.

JADarius avatar Aug 05 '25 14:08 JADarius

This looks good except for making the crate apis/display/screen so we can add other displays in the future.

bradjc avatar Aug 12 '25 08:08 bradjc

@alexandruradovici can you review?

bradjc avatar Aug 22 '25 16:08 bradjc