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

peripheral drivers should have a config() API #2339

Open
buha opened this issue Oct 16, 2024 · 0 comments
Open

peripheral drivers should have a config() API #2339

buha opened this issue Oct 16, 2024 · 0 comments
Labels

Comments

@buha
Copy link
Contributor

buha commented Oct 16, 2024

There is an issue with UART being needlessly reinitialized by calling remove() and init() API's only to change the baudrate. This kind of problem could be solved by adding a mandatory config() API to the peripheral drivers so that the minimal API set would look like this:

init(**dev, *init_param) - allocate memory, calls config() internally
config(*dev, *init_param) - configure the peripheral
remove(*dev) - deallocate memory (and put the hardware in a good state, if needed)

The user could then reconfigure the peripheral with a new set of init_param structure without deallocating/reallocating memory.

@buha buha added the feature label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant