code: func SpiExchange(data []byte) {
  	const ta = 1 << 7   // transfer active
  	const txd = 1 << 18 // tx fifo can accept data
  	const rxd = 1 << 17 // rx fifo contains data
  	const done = 1 << 16
  
  	clearSpiTxRxFifo()
  
  	// set TA = 1
  	spiMem[csReg] |= ta
  
  	for i := range data {
  		// wait for TXD
  		for spiMem[csReg]&txd == 0 {
  		}
  		// write bytes to SPI_FIFO
  		spiMem[fifoReg] = uint32(data[i])
  
  		// wait for RXD
  		for spiMem[csReg]&rxd == 0 {
  		}
  		// read bytes from SPI_FIFO
  		data[i] = byte(spiMem[fifoReg])
  	}
  
  	// wait for DONE
  	for spiMem[csReg]&done == 0 {
  	}
  
  	// Set TA = 0
  	spiMem[csReg] &^= ta
  }
docs: // SpiExchange: Transmit all bytes in data to slave
  // and simultaneously receives bytes from slave to data.
  //
  // If you want to only send or only receive, use SpiTransmit/SpiReceive