This is the final version but missing irq interrupt to read spi data