small modification to allow read and writes from/to spi