stateMachine/lib/ssiSpi/ssiSpi.h
inline static uint8_t transfer(uint8_t data) {
		SPI2_SR = SPI_SR_TCF;
		SPI2_PUSHR = data;
		for (int loopCounter = 0; !(SPI2_SR & SPI_SR_TCF); loopCounter++) {
            if (loopCounter > 100000) {
                Serial.println("Error: loop uint8_t failed");
                break;
            }
        }
		return SPI2_POPR;
	}
// Write to the SPI bus (MOSI pin) and also receive (MISO pin)
Write to the SPI bus (MOSI pin) and also receive (MISO pin)
Write to the SPI bus ( MOSI pin ) and also receive ( MISO pin )
inline static uint8_t transfer(uint8_t data) {
		SPI2_SR = SPI_SR_TCF;
		SPI2_PUSHR = data;
		for (int loopCounter = 0; !(SPI2_SR & SPI_SR_TCF); loopCounter++) {
            if (loopCounter > 100000) {
                Serial.println("Error: loop uint8_t failed");
                break;
            }
        }
		return SPI2_POPR;
	}
inline static uint8_t transfer ( uint8_t data ) { SPI2_SR = SPI_SR_TCF ; SPI2_PUSHR = data ; for ( int loopCounter = 0 ; ! ( SPI2_SR & SPI_SR_TCF ) ; loopCounter ++ ) { if ( loopCounter > 100000 ) { Serial . println ( " " ) ; break ; } } return SPI2_POPR ; }
Write to the SPI bus (MOSI pin) and also receive (MISO pin)
Write to the SPI bus ( MOSI pin ) and also receive ( MISO pin )