#!/usr/bin/python
import spidev
spi = spidev.SpiDev()
spi.open(0,0)
spi.max_speed_hz = 1000000
spi.mode = 0 #CPOL=0,CPHA=0 - data sampled at rising edge
msg = [0x30, 0xFF, 0xFF, 0xFF]
result = spi.xfer2(msg)
print (''.join('0x' + format(x, '02X') + ',' for x in result)) |