edited spi controller