code: func SpiBegin(dev SpiDev) error {
  	spiMem[csReg] = 0 // reset spi settings to default
  	if spiMem[csReg] == 0 {
  		// this should not read only zeroes after reset -> mem map failed
  		return SpiMapError
  	}
  
  	for _, pin := range getSpiPins(dev) {
  		pin.Mode(Spi)
  	}
  
  	clearSpiTxRxFifo()
  	setSpiDiv(128)
  	return nil
  }
docs: // SpiBegin: Sets all pins of given SPI device to SPI mode
  //  dev\pin | CE0 | CE1 | CE2 | SCLK | MOSI | MISO |
  //  Spi0    |   7 |   8 |   - |    9 |   10 |   11 |
  //  Spi1    |  16 |  17 |  18 |   19 |   20 |   21 |
  //  Spi2    |  40 |  41 |  42 |   43 |   44 |   45 |
  //
  // It also resets SPI control register.
  //
  // Note that you should disable SPI interface in raspi-config first!