Module melpomene::sim_drivers::emb_display
source · Expand description
Simulated display driver
This is an early attempt at a “frame buffer” style display driver. It uses the embedded-graphics simulator crate to act as a display in simulated environments.
This implementation is sort of a work in progress, it isn’t really a great long-term solution, but rather “okay for now”.
A framebuffer of pixels is allocated for the entire display on registration. This could be, for example, 400x240 pixels.
The driver will then allow for a certain number of “sub frames” to be requested.
These sub frames could be for the entire display (400x240), or a portion of it, for example 200x120 pixels.
Clients of the driver can draw into the sub-frames that they receive, then send them back to be rendered into the total frame. Any data in the client’s sub-frame will replace the current contents of the whole frame buffer.
Structs§
- This task is spawned by the call to
SimDisplay::register
. It is a single async function that will process requests, and periodically redraw the framebuffer. - Context 🔒
- Implements the
EmbDisplayService
driver using theembedded-graphics
simulator.
Functions§
- draw_to 🔒
- Create and return a Simulator display object from raw pixel data.