Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add arduino SPISettings, start/endTransaction() functions to firmware #1152
The existing Particle firmware supports the basic Arduino SPI functions. However, when there are two or more SPI devices on the bus, they tend not to play nice. In arduino land, this is addressed using SPISettings() object, and accompanying beginTransaction() and endTransaction() functions to set and reset the SPI bus settings before and after each transaction (the SDFat library uses simple versions of these!). Vendors are writing their libraries using these functions more often (and for good reasons).
An ideal implementation would "push" the active SPI control register (2) values on SPI.beginTransaction() and "pop" them on SPI.endTransaction() to be the ultimate best SPI citizen.
I have attached copies of the Arduino (v1.6.14) SPI library files for reference