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

Usage of embedded-hal to support bindgen'ed OpenThread #235

Open
markushx opened this issue Jul 15, 2020 · 1 comment
Open

Usage of embedded-hal to support bindgen'ed OpenThread #235

markushx opened this issue Jul 15, 2020 · 1 comment
Labels

Comments

@markushx
Copy link

I am currently bindgen'ing OpenThread and want to create an idiomatic wrapper around it.

Among other things (e.g. radio-hal), OpenThread needs support for a MilliSecond timer API:

pub unsafe extern "C" fn otPlatAlarmMilliStop(_aInstance: *mut otInstance) {};
pub unsafe extern "C" fn otPlatAlarmMilliStartAt(_aInstance: *mut otInstance, _aT0: u32, _aDt: u32) {};
pub unsafe extern "C" fn otPlatAlarmMilliGetNow() -> u32 {};

I am wondering what I should build this on. I see several (competing? complementing?) options:

Any recommendations?

@ryankurte
Copy link
Contributor

the current state is pretty well covered here i think, at the moment people are experimenting with embedded-time and hopefully we'll move hardware traits back to e-h and maybe maintenance to the wg when it stabilises / becomes well used.

so i would probably suggest looking there if it works for you? in the past (for extremely similar reasons) i have defined a Timer trait along with whatever network component but, they're functionally very similar to those in embedded-time. the only note i would make is you may benefit from abstracting over this so you can consume a read only timer and perform any adjustments in the wrapper (so others can consume the same timer object).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants