More optimal SPI communication, for Wiznet W5500 and possibly others. #2925
Closed
Pe3ucTop
started this conversation in
Feature requests
Replies: 1 comment 2 replies
-
Thanks, we are not interested |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I start using library and like it, great job.
But, I noticed in case of using SPI-Ethernet adapter (Wiznet W5500 in my case) there is ineffective SPI communication and I'm ready to prepare pull request with improvements.
Description of ineffective communication and limitations of library used function
uint8_t (*txn)(void *, uint8_t); // SPI transaction: write 1 byte, read reply
:-- which limit use of existing resources like DMA or FIFO buffers
-- which force to start/stop SPI peripheral for each byte, a bit insane
I modify my copy to work with unidirectional functions
void (*tx)(void *, uint8_t *buf, uint32_t len); // SPI transaction: write N bytes from provided buffer
void (*rx)(void *, uint8_t *buf, uint32_t len); // SPI transaction: read N bytes to provided buffer
and it work perfect.
Or I can prepare single universal function usage, which could be any directional (uni/bi)
void (*transfer)(void *, uint8_t *buf, uint32_t len, uint8_t direction); // SPI transaction: write/read/rw N bytes from/to/replace buffer
extra multi-line unidirectional transfers could be included here with
direction
value.Would like to see your thoughts and comments.
Beta Was this translation helpful? Give feedback.
All reactions