diff --git a/interfaces/spich.hpp b/interfaces/spich.hpp index 702f7d4..49f3b7c 100644 --- a/interfaces/spich.hpp +++ b/interfaces/spich.hpp @@ -4,6 +4,8 @@ #include "pin.hpp" #include "spi.hpp" +// spi channel has a hardware spi object and a pin object for the chipselect. + template struct SPICH @@ -19,11 +21,14 @@ struct SPICH uint8_t read_write_u8(const uint8_t& data) { uint8_t temp; + + // spiHwCH.takeMutex(); chipSelect.write(false); temp = spiHwCH.trx_u8(data); chipSelect.write(true); + // spiHwCH.releaseMutex(); return temp; } @@ -57,7 +62,7 @@ struct SPICH chipSelect.write(true); } - + private: // hardware resources