workable GPIO control and SPI code added