Add buffer read and write functions for SPI