Generics and Lra support#1
Draft
jacobrosenthal wants to merge 18 commits into
Draft
Conversation
eca0f7a to
f6425c9
Compare
Author
|
For future travelers here. I found an api without generics (but thus only a single chip drv2605l, and not holding the motor type lra or erm in the typestate either) or a builder (I found a configuration with two seperate new fn for erm or lra and individual enums for loading the calibration that does most of what I wanted instead) I havent confirmed the lra stuff yet, but heres some more commits. |
…sary for erm as well
Author
|
Published drv2605l here Ill leave this open for people to find but wont be making noise here anymore :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey, thanks for the library.
Drv260x is kind of my hello world driver and I found your work. Are you interested in genericising this library to support drv2604 and also lra motors or would you prefer I just fork?
This is the just the start of what I was thinking. The goal is to use type state to enforce functions only in certain modes. Id like to next force all the difference modes with types, like the current default internal trigger mode be explicit with .into_trigger(), or elsewhere Ive called this ROM mode. Likewise you could consume that state and do into_pwm() instead.
After that Id like to get a builder pattern going, especially to enforce the complexity of the LRA setup and calibration. maybe something like