reference-en
reference-en copied to clipboard
SPI documentation does not mention that SPI.begin must be called before using SPI.beginTransaction
The SPI library documentation does not mention that SPI.begin must be called in order to correctly configure the SPI bus. The documentation implies that SPI.beginTransaction can be used as a replacement for SPI.begin when custom, non-default SPI settings are needed. However, if SPI.begin is not called (even if SPI.beginTransaction is called), the SPI related registers/pins will not be configured correctly and thus SPI.transfer will fail. The provided examples might have avoided this confusion, but unfortunately they only show the use of SPI.begin and not SPI.beginTransaction.
Would it be possible to update the documentation to add a note that SPI.begin must be called and that settings can be adjusted from the defaults if needed via SPI.beginTransaction? It might also be worth noting this in the function specific documentation for SPI.beginTransaction.
@ajwolfram Maybe you could make some suggstions for specific bits of text to add or change?
We do not currently have the library reference documentation in a public git repository, unfortunately, but the current process is to suggest changes in an issue in this repository, which can then be published to the website by people with access.
Done in 31b6de3