Please add a variant of the transfer() function which will basically appear blocking to the user, but put the calling thread into deep sleep for the duration of the transfer.
Right now, the way to do this is:
- Acquire bus lock
- Create a semaphore at 1
- Create a transfer with a callback that will decrement the semaphore
- Wait for the semaphore to reach zero
- Release bus lock
A convenience method inside the SPI/I2C drivers to do these steps in a single function would lead to much cleaner-looking code.