當前位置: 首頁>>代碼示例>>Python>>正文


Python SPI.cshigh方法代碼示例

本文整理匯總了Python中Adafruit_BBIO.SPI.SPI.cshigh方法的典型用法代碼示例。如果您正苦於以下問題:Python SPI.cshigh方法的具體用法?Python SPI.cshigh怎麽用?Python SPI.cshigh使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Adafruit_BBIO.SPI.SPI的用法示例。


在下文中一共展示了SPI.cshigh方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: SPI

# 需要導入模塊: from Adafruit_BBIO.SPI import SPI [as 別名]
# 或者: from Adafruit_BBIO.SPI.SPI import cshigh [as 別名]
#!/usr/bin/python

from Adafruit_BBIO.SPI import SPI

spi = SPI(0,0)

spi.lsbfirst=False
spi.msh=1000000

spi.cshigh=False
spi.xfer2([0x36])
spi.cshigh=True

for reg in range(0x0,0x3d+1,1):
 spi.cshigh=False
 send = [ reg+0xc0 , 0x0 ]
 recv = spi.xfer2(send)
 spi.cshigh=True
 print reg,recv

patable=9*[0]
patable[0]=0x3e+0xc0

spi.cshigh=False
dd = spi.xfer2(patable)
spi.cshigh=True
print 0x3e,dd

rxfifo=65*[0]
rxfifo[0]=0x3f+0xc0
開發者ID:cudnn,項目名稱:beaglebonequadcopter,代碼行數:32,代碼來源:bbb-spi-cc1101.py

示例2: RegWrite

# 需要導入模塊: from Adafruit_BBIO.SPI import SPI [as 別名]
# 或者: from Adafruit_BBIO.SPI.SPI import cshigh [as 別名]
	RegWrite(ADS1248.IDAC1,0b11001100);	# IDAC1: n.c.
	RegWrite(ADS1248.VBIAS,0b00000000);	# VBIAS: BIAS voltage disabled
 	RegWrite(ADS1248.OFC0, 0b00000000);	# OFC0:  0 => reset offset calibration
	RegWrite(ADS1248.OFC1, 0b00000000);	# OFC1:  0 => reset offset calibration
	RegWrite(ADS1248.OFC2, 0b00000000);	# OFC2:  0 => reset offset calibration
	RegWrite(ADS1248.GPIOCFG, 0b00000000);	# GPIOCFG: all used as analog inputs
	RegWrite(ADS1248.GPIODIR, 0b00000000);	# GPIODIR: -
	RegWrite(ADS1248.GPIODAT, 0b00000000);	# GPIODAT: -
	
spi = SPI(0,0)	#/dev/spidev1.0
spi.msh=10000 # SPI clock set to 100 kHz
spi.bpw = 8  # bits/word
spi.threewire = False
spi.lsbfirst = False
spi.mode = 1 
spi.cshigh = False  # ADS1248 chip select (active low)
spi.open(0,0)

GPIO.setup("P9_14", GPIO.OUT)


# drive START high to start conversion

GPIO.setup(ADS1248.STARTPIN, GPIO.OUT)
GPIO.output(ADS1248.STARTPIN,GPIO.HIGH)

time.sleep(0.02)

ADCinit()

while True:
開發者ID:donfuge,項目名稱:ADS1248,代碼行數:33,代碼來源:ADS1248_minimal.py


注:本文中的Adafruit_BBIO.SPI.SPI.cshigh方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。