Replies: 1 comment
-
The standard array transfer, When the standard array transfer is improved, it is easy to implement the above API with little extra code. First implement the standard API is then:
It is also easy to make sure all Arduino Core implementations support the API, maybe with lower performance, using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am the author of the SdFat library. Many users are disappointed with performance of SdFat on boards using the ArduinoCore-API. This package does not support high-speed transfers well.
The only block transfer function is
void transfer(void *buf, size_t count)
. This is a poor API for SD use. It can't be used for receive unless you fill buf with 0XFF since the SD examines the sent stream for commands. It can't be used for send unless you copy the block to a tmp buffer since buf will be overwritten.Often the implementation is just a loop with
uint8_t transfer(uint8_t data)
. This means using transfer(buf, count) is slower than using single byte transfer.Other board packages provide a suitable API. Adafruit, Sparkfun, Teensy, STM32, particle.io, and many others provide this function.
void transfer(const void *tx_buffer, void* rx_buffer, size_t length);
Some implementations return a status and some implement this async API for DMA.
void transfer(const void *tx_buffer, void* rx_buffer, size_t length, std::function myFunction);
Many users are very disappointed with performance on SAMD. Here are SD performance results for the current SAMD SPI library on a MKR Zero with my bench example:
Here is the result with a SAMD driver I implemented with the above API:
Here is the function I implemented:
I added a call to this function in SPI.h and a virtual version of the API to HardwareSPI.h.
Beta Was this translation helpful? Give feedback.
All reactions