- Notifications
You must be signed in to change notification settings - Fork1k
[chore] Speedup for simple SPI.transfer#2082
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Hi@RudolphRiedel |
Hi@RudolphRiedel |
Uh oh!
There was an error while loading.Please reload this page.
Summary
This PR gives a speed boost to simple SPI.transfer(data) and SPI.transfer(buffer, count) operations
in which the user controls the chip-select by directly using only the necessary LL-HAL functions and not going thru the CS controlling functions and the spi_transfer() function.
With no DMA support in the SPI class the sending of a buffer takes a long time and with this modification
it takes at least less time.
Measured with STM32C031C6, SPI clock 8MHz and a buffer of 231 bytes:
digitalWrite(CS, LOW);
SPI.transfer(&buffer, 231);
digitalWrite(CS, HIGH);
original code: 587,26µs
this pr: 474.92µs