w25qxx icon indicating copy to clipboard operation
w25qxx copied to clipboard

Portability improvements

Open DzmitryStryzhevich opened this issue 5 months ago • 3 comments

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 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. image

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

DzmitryStryzhevich avatar Jan 19 '24 11:01 DzmitryStryzhevich