SPI code updated

Signed-off-by: Vitali Samurov <vitali.s@elisanet.fi>