-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adding crates that support multiple distinct devices #90
Comments
Oh interesting approach, I know my colleague @diondokter was working on a similar Register abstraction Could you export your drivers as one crate per device? This would also help with compile times, once you accumulate more drivers, a user would always need to fetch and compile the drivers for all your supported chips. All those drivers could still use the common register abstraction generation as a dependency. Otherwise you can also just add your crate here and leave out the device specific details, just listing the chip names and maybe dev-boards. |
Another example would be |
Maybe we could split driver crate from chip specifications in those cases or move most properties of pub struct Driver {
/// Version of this driver description TOML schema
pub manifest_version: semver::Version,
/// Metadata about the driver
pub meta: DriverMeta,
/// Supported chips
pub chips: Vec<Chip>,
}
pub struct Chip {
/// Metadata about the chip
pub meta: ChipMeta,
/// List of development boards that house this chip
#[serde(skip_serializing_if = "Vec::is_empty", default)]
pub dev_boards: Vec<DevBoard>,
/// Interfaces used by this chip
#[serde(skip_serializing_if = "Interfaces::is_empty", default)]
pub interfaces: Interfaces,
/// Blog articles and similar covering this driver and its usage
#[serde(skip_serializing_if = "Vec::is_empty", default)]
pub resources: Vec<Resource>,
} |
That sounds like a good idea. What kept me from doing this is the nested dev-boards in chips, but from a bit more reading it looks like that is not a problem with toml. Would you want to contribute a PR for this? |
I could do that when I find the time. How would you reflect that in the UI? It's probably best if it stays the same if only one chip is specified and only renders differently for multiple chips. Should this be hidden like the dev boards or displayed in a small table? What do you think? |
I think aggregating could be nice, since that would also be what the filter will do. If you like we can also work on this together or even do a bit of pair programming :) |
Is it possible to add a crate to this database which supports several different devices? I've recently been working on a more generalized driver crate called embedded-devices which abstracts register based devices of any kind. The idea was to make supporting async & non-async simultaneously less cumbersome and share some common abstractions and boilerplate such as SPI/I2C register access codecs. Currently I have 9 devices implemented in the framework (mostly temperature sensors and ADCs), but more are to come.
I love the idea of a search database, since crates.io is not always great for that. Unfortunately I don't understand whether it is intended or even possible to list my crate here (doesn't look like it), since it would require adding multiple addresses, footprints, links etc. per supported device. It seems like it is designed strictly for 1:1 crate to device relationships.
Is this generally something you'd like to have listed in the future?
The text was updated successfully, but these errors were encountered: