I have been gradually converting many devices from i2c to spi for various reasons. I noticed in tutorials like this from arduino.cc that SPI.beginTransaction
is explicitly called out. Then they link to examples such as this and this where they don't use SPI.beginTransaction
. In working through my own devices I found that I could often (almost always) forgo the use of SPI.beginTransaction
. The only case where I found problems was when I had 2 devices that used different SPI settings.
I went to Google and other searches for a simple reason for SPI.beginTransactions
and found discussions of interrupts and locks and settings. There was much discussions about users applications wrapping all calls with SPI.beginTransaction
and SPI.endTransaction
. There were bugs when libraries didn't wrap everywhere.
This leads me to the conclusion that making calls to SPI.beginTransaction
are only needed when the SPI settings need to change, but in practice you should always do it. Is there documentation or examples that definitely state the purpose and proper (best practice) usage of it?