Added chip selection to SPI transfer function