add a set_mode method to Spi