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

Separate sensors into other crate #27

Closed
Kixunil opened this issue Nov 10, 2016 · 10 comments · Fixed by #40
Closed

Separate sensors into other crate #27

Kixunil opened this issue Nov 10, 2016 · 10 comments · Fixed by #40

Comments

@Kixunil
Copy link

Kixunil commented Nov 10, 2016

I believe that sensors are higher-level stuff, which should use i2c crate as their dependency. It makes little sense to pull also code for sensors if somebody wants to use just i2c.

BTW, regarding this issue and the others I filled, I'm willing to help with code, if you agree. I already have some code (open and io traits). (I didn't realize that I2C library already exists when I was writing it.)

@posborne
Copy link
Member

I agree on this one. The sensors present evolved from examples and were my fleshing out ideas as to what these drivers might look like. Do you think having the crate in the same repo makes sense or a separate Github repo?

@Kixunil
Copy link
Author

Kixunil commented Nov 11, 2016

I would personally prefer separate repo.

@Kixunil
Copy link
Author

Kixunil commented Jun 10, 2017

I've started working on separate repo for i2c-devsensors. I decided to make each sensor a separate crate within common repository.

That brings me to question: what to do with sensor traits? I could put them into i2cdev-sensors crate but I think a better idea would be to create a separate crate (called sensors), because the traits technically don't necessitate use of i2cdev. This way one could e.g. implement Thermometer for DS18B20 which connects over One-wire.

What do you think?

@MrSpock
Copy link

MrSpock commented Jun 23, 2017

I believe there should be separate sensors crate with misc devices in it. Many devices you can access over I2C and SPI, so in future you can select connecting interface by feature/cfg stanzas.
That decision would be usefull since I'm starting writing another library for range sensor (VL53L0X) and I'm wondering if I should create separate create or make pull req here :)

@tadeegan
Copy link

@Kixunil The problem with what you have done is that you wiped all the git history so the authors who created these plugins no longer attributed to their work. A separate create named "sensors" containing only interfaces SGTM.

@rust-embedded Can we move the repository under your namespace?

This is taking so long.....

@Kixunil
Copy link
Author

Kixunil commented Jun 26, 2017

OK, I'll look into creating sensors crate, hopefully today.

@tadeegan good point. How do you think I should attribute their work? Is linking the original repo sufficient? Or should I clone the original repo and build the new one on top of it? (That'd be more work.)

@Kixunil
Copy link
Author

Kixunil commented Jun 26, 2017

@MrSpock I believe the crate should be separate but repository might be the same. It depends on amount of code - if there is a lot of code, I'd prefer separate repo.

@posborne
Copy link
Member

posborne commented Jun 26, 2017

@MrSpock I believe the crate should be separate but repository might be the same. It depends on amount of code - if there is a lot of code, I'd prefer separate repo.

Let's start with the same repo approach for the core platform support and traits. That can be easier to manage as well -- if we separate out the crates properly people can still have separate crates in separate repos as well.

If that doesn't scale, we can pivot.

EDIT: I'll try to look at where things are at a little bit more and may update this proposal a bit. I can definitely get more repos added here as required but would prefer too much churn in repos as the Org should mostly contain things that are a bit more canonical.

@tadeegan
Copy link

@Kixunil
Copy link
Author

Kixunil commented Sep 11, 2017

Ping! @martindeegan and @tadeegan did a huge amount of work in a PR against my repo. I'd like to unblock them.

Unfortunately, I don't have much time these days, but I'd help with minimal things. I can also handover the repo or whatever is needed.

Things that we need to resolve:

  • How to name traits crate. I strongly favor sensor-traits (in the spirit of num-traits).
  • How to attribute original authors. If someone wants to retain the history, please do it yourself - it's too much work for me now and I have full time job + another (embedded Rust but w/o i2c) project + I want some social life to not become crazy :)

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

Successfully merging a pull request may close this issue.

4 participants