Closed kazetsukaimiko closed 3 months ago
Please use this for ESP32.
Arduino for ESP32 has too many limitations. And it has too few features.
Please use this for ESP32.
Can you elaborate? Should I reimplement these changes there, or do you already have a mechanism to lock the SPI bus?
Please use this for ESP32.
Arduino for ESP32 has too many limitations. And it has too few features.
I agree. PLEASE update the readme here to note that.
do you already have a mechanism to lock the SPI bus?
By using ESP-IDF multitasking, simultaneous SPI accesses can be completely prevented.
Hello there, I have successfully integrated a customized version of this library into an ESP32-S3 / FreeRTOS project in PIO. We addressed threading concerns by adding RTOS semaphores to all of the SPI transactions, and I'd like to get this mainlined if possible.
Change overview
First we define a status code for SPI request timeouts:
Ra01S.h
Then we define methods on the class to take and release the semaphore.
Ra01S.h
Then we wrap all transactions in
ReserveSPI
andFreeSPIReservation
.Ra01S.cpp
Caveat: Some transactions occur in void methods, which do not indicate success or failure. Examining these usages, this addition may necessitate a return value. I did not add this by default to maintain backwards API compatibility.
Finally to enable define-based integration, we have one flag and two overrides:
Alternatively, override the programmatic methods.