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

embassy-nrf: New Event/Task types #121

Closed
fnafnio opened this issue Mar 29, 2021 · 1 comment
Closed

embassy-nrf: New Event/Task types #121

fnafnio opened this issue Mar 29, 2021 · 1 comment
Labels
kind-question Further information is requested

Comments

@fnafnio
Copy link
Contributor

fnafnio commented Mar 29, 2021

So I've just tried the new updates and found no way to link up timer compare events to PPI, as ppi::Event is not implemented for the timer events and Event::from_reg is private.
Will Event::from_reg eventually become public or be implemented for the rest of the peripherals?
For now I will just make from_reg public and use it like in BufferedUarte, but I might be missing something

@Dirbaio
Copy link
Member

Dirbaio commented Mar 29, 2021

The inner pointer in Task and Event is public, so you can implement a from_reg equivalent in your crate.

pub struct Task(pub NonNull<()>);
pub struct Event(pub NonNull<()>);

This is intentional, because I want to remove all references to the PAC from the public API, so it can be bumped or replaced without breaking the public API.

I'm aware short-term it's less usable. This would also be improved by implementing a Timer HAL in embassy.

(tldr of the reasons for that: We may switch to something else due to a few problems with the PAC design: slow compile, can only link one major version in the binary, almost all PAC changes are breaking so require a major version, the owned singletons can't be semver-tricked due to Deref impl, rust-embedded/wg#387, and for stm32 stm32-rs/meta#4)

@Dirbaio Dirbaio added the kind-question Further information is requested label Mar 29, 2021
@Dirbaio Dirbaio closed this as completed Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind-question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants