Revert "Revert "SPI code and got rid of buffer lock""

This reverts commit fb6791389800355a4bd7c39a9408661ee21d3550.

Revert "SPI code and got rid of buffer lock"

This reverts commit
2ef50fb79b45e3890586bdf75995b5bb3a5e1368.
i dont know what im doing