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

How can one use the timers on nrf51 #31

Open
rnestler opened this issue Jun 14, 2020 · 1 comment
Open

How can one use the timers on nrf51 #31

rnestler opened this issue Jun 14, 2020 · 1 comment

Comments

@rnestler
Copy link
Contributor

I see there are two timers implemented in https://github.com/Nemo157/embrio-rs/tree/master/embrio-nrf51/src/timer. But as far as I can see they aren't used anywhere?
How is one supposed to use them?

@Nemo157
Copy link
Owner

Nemo157 commented Jun 15, 2020

Good question, I used these in an internal project before adding in the EmbrioNrf51 abstraction. So you can use them something like

let timer = Timer::timer0(peripherals.TIMER0);
timer.timeout(time).await?;

but that requires bypassing EmbrioNrf51 and getting the Peripherals directly to initialize the different components.

It'd probably be good to add these into EmbrioNrf51 and the example (though that might require changing how they work to support just borrowing the timer instance).

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

No branches or pull requests

2 participants