spi buffer processing