-
Notifications
You must be signed in to change notification settings - Fork 72
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
Portability improvements #14
Comments
Thank you very much for using LibDriver and providing valuable feedback. Your idea is a good idea, and we believe that the addition of customized handles will greatly improve the flexibility of driver development. We will incorporate your idea in future updates. It should be noted that a very small number of drivers that include state machine management need to be controlled through different driver handles. For example, some drivers have registers that are only written and require the handle to store the current register configuration internally(https://github.com/libdriver/wm8978), while others require the driver handle to record the current driver's state(https://github.com/libdriver/ir_remote). |
Thanks a lot for lightning reaction. You are doing a great job. Today, there are not many high-quality platform-agnostic drivers for all kinds of peripherals ICs. Chip manufacturers very often do not provide them. This project is great. |
Thank you very much. |
Is your feature request related to a problem? Please describe.
No response
Describe the idea you'd like
Hello! I think it would be useful to pass a customizable user handle like void* const hwHandle to all SPI interface functions declared in driver_w25qxx_interface.h. This pointer should be assigned by a setter in w25qxx_handle_t structure like that
![image](https://private-user-images.githubusercontent.com/60213752/297983215-77a48f9e-9ba4-438b-adc0-c7d906cf3ffb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwOTUwODgsIm5iZiI6MTcyNjA5NDc4OCwicGF0aCI6Ii82MDIxMzc1Mi8yOTc5ODMyMTUtNzdhNDhmOWUtOWJhNC00MzhiLWFkYzAtYzdkOTA2Y2YzZmZiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDIyNDYyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY3Y2NkYTQ0OGRhZmFiOThhNjBiNmJjN2Y2MTE5YzRhZWI5OTU0MGExNzhjZjA5MDdkM2NlMzQ3MDNiNjM0NjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.rO7J5UdyfyyXEqguWGX28awnWOocjk1XkfRwx14qgTA)
uint8_t w25qxx_set_hw_handle(w25qxx_handle_t *handle, void *hwHandle). A getter
uint8_t w25qxx_get_hw_handle(w25qxx_handle_t *handle, void **hwHandle) may be useful, too.
Rationale: modern MCUs may have several SPI/QSPI hardware interfaces. In this handle approach, we can assign the particular SPI interface to the device. We may simultaneously have several w25qxx devices on the same bus and/or on different buses.
In my opinion, this approach can lead to the significant improvement of the device driver portability for different platforms, because all MCUs chip vendors have incompatible CSP
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: