zsup / firmware-rust

Firmware libraries for running Rust on Particle devices (feature/rust branch)
https://www.particle.io/
Other
27 stars 5 forks source link

What should we adopt from Zinc? #4

Open zsup opened 8 years ago

zsup commented 8 years ago

https://zinc.rs/ https://github.com/hackndev/zinc

dbrgn commented 8 years ago

Maybe @farcaller @kvark @mcoffin @posborne can give us some pointers? It would be great if we could avoid duplication of development.

farcaller commented 8 years ago

I intend to move zinc into a direction where you'd just define HAL (ioregs + peripheral traits) in a crate, add it as a dependency and call it a day. Obviously, zinc is nowhere there yet (it's not a commercial project, but a research one), so there aren't even that much peripheral traits to implement. Still, I think that is how I foresee zinc to be used.

There is little sense to use zinc as a foundation, as pretty much everything is scattered there, but if you want to contribute back it would be nice to see some actual traits for peripherals to be defined.

On what you can reuse — ioregs are pretty useful and stable API as is VolatileCell. The OS part features a scheduler that should be reasonably stable, but it's very basic.

posborne commented 8 years ago

I agree with @farcaller's sentiment regarding peripheral traits. For instance, if there were traits for accessing peripherals such as the following, drivers/code could be written on top of these that would support multiple platforms (including test platforms):

How each of these are set up is going to vary platform-to-platform but I believe it would be invaluable to have traits defining the standard API for basic access to these peripherals available.

I myself have a few libraries available that currently only support Linux which I would like to have implement traits that are shared with other projects:

I started trying to tackle the GPIO/Digital IO trait problem here: https://github.com/posborne/rust-gpio