refactor spi_write in write e spi_Receive in read

Signed-off-by: Andrea Corna <andrea.corna.ac.91@gmail.com>