almindor / mipidsi

MIPI Display Serial Interface unified driver
MIT License
108 stars 46 forks source link

add `Builder::with_window_offset_handler` method #50

Closed lily-mara closed 1 year ago

lily-mara commented 1 year ago

ModelOptions has a field for storing an offset handler, but it's currently not accessible unless you provide a custom Model implementation to override Model::default_options. This addition allows you to set the offset handler via the Builder.

lily-mara commented 1 year ago

Thanks for the quick review! Do you have plans to cut a release any time soon? The display I'm working with requires an offset handler and it would be nice to remove my custom Model impl

almindor commented 1 year ago

Thanks for the quick review! Do you have plans to cut a release any time soon? The display I'm working with requires an offset handler and it would be nice to remove my custom Model impl

Hmm so the main blocker right now is #44 which needs more work. Would a pre-release work for you?

lily-mara commented 1 year ago

Yes, a pre-release would be just fine for me! What is the nature of the DCS changes, is the crate usable with the state of that PR right now?

almindor commented 1 year ago

Yes, a pre-release would be just fine for me! What is the nature of the DCS changes, is the crate usable with the state of that PR right now?

The DCS changes rewrites all the commands into more abstracted (and safer) versions. This will be offloaded to a separate "mipidcs" crate at some point. It changes all the inits, but in a compatible way. Basically instead of say write_command(di, Instruction::MADCTL, &[some_data]) you can now do things like dcs.set_address_mode(address_mode_command) where address_mode_command consists all the options for MADCTL in a safe abstracted way. (similar to how memory mapped registers are abstracted in a PAC/HAL).

It's also the first step in adding read functionality to displays although not really a blocker for it.

almindor commented 1 year ago

Looking at the current unreleased list in the changelog I think I'll do a normal 0.6 (since API changed) release for what we have in master right now. The DCS stuff can be 0.7

almindor commented 1 year ago

v0.6 is out https://crates.io/crates/mipidsi