-
Notifications
You must be signed in to change notification settings - Fork 171
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
I2S reconfiguration support #334
Comments
Can you describe a bit your specific use case, and in particular - why dropping and re-creating the driver would not work for your case? |
I'm writing a sort-of wrapper around the I2S driver that I may or may not publish later as a crate. I hold the driver within my struct wrapper, meaning when I want to drop and re-create the driver I have to also keep ties to the peripherals or pass them into the function that calls for re-configuration. This is all doable but by using the API above it would make it a little bit cleaner and easier to reason about. |
Hi! I also need reconfiguration possibility in my scenario.
Could you please explain, did you mean using clone_unchecked() for keeping peripherals and reusing them to create a new instance of I2sDriver with a new configuration? By making use of |
You can always create the driver with the peripherals passed by |
Oh, thanks, i've missed this feature! The only thing I want to know is a preferred way to keep I2S mode metadata, are generics ok? (e.g. |
If - as part of the reconfiguration - you plan to change the mode (i.e. to go from |
I don't want to change mode during reconfiguration, but everything else. And we need to track which mode was selected upon driver creation to call appropriate reconfigure function. |
This can be done in many ways. You can also track it with a simple enum. That is, unless the reconfigure functions have different signatures for each mode. |
I'm working on a project and I'd like to be able to reconfigure the I2S channels on-the-fly.
The IDF already has support for that so it would be great if we could also do it here.
I'm willing to work on this, in fact I started already, going to post a WIP PR.
The text was updated successfully, but these errors were encountered: