コード例 #1
0
ファイル: TFT.py プロジェクト: not-cosmo/sensorian-firmware
	def __init__(self):
		"""
		Creates a TFT object and configures SPI bus and pins.
		
		
		:param none: 
		:returns none :
		"""
		self.dc = DC
		self.rst = RST
		self.cs = TFT_CS
		self.width = TFT_WIDTH
		self.height = TFT_HEIGHT
		
		spi.open(0,1)             		#will open bus 0, CE1. 
		#spi.max_speed_hz = 8000000
		spi.max_speed_hz = int(16000000)
		
		GPIO.setwarnings(True)
		GPIO.setmode(GPIO.BOARD)	
		GPIO.setup(self.cs, GPIO.OUT)		#Set GPIO24 as output
		GPIO.setup(self.dc, GPIO.OUT)		# Set DC as output.
		GPIO.setup(self.rst, GPIO.OUT)	
		self.CE_DESELECT()
		self.buffer = Image.new('RGB', (self.width, self.height))	# Create an image buffer.
コード例 #2
0
ファイル: TFT.py プロジェクト: sensorian/sensorian-firmware
    def __init__(self):
        """
		Creates a TFT object and configures SPI bus and pins.
		
		
		:param none: 
		:returns none :
		"""
        self.dc = DC
        self.rst = RST
        self.cs = TFT_CS
        self.width = TFT_WIDTH
        self.height = TFT_HEIGHT

        spi.open(0, 1)  #will open bus 0, CE1.
        #spi.max_speed_hz = 8000000
        spi.max_speed_hz = int(16000000)

        GPIO.setwarnings(True)
        GPIO.setmode(GPIO.BOARD)
        GPIO.setup(self.cs, GPIO.OUT)  #Set GPIO24 as output
        GPIO.setup(self.dc, GPIO.OUT)  # Set DC as output.
        GPIO.setup(self.rst, GPIO.OUT)
        self.CE_DESELECT()
        self.buffer = Image.new(
            'RGB', (self.width, self.height))  # Create an image buffer.
コード例 #3
0
	def __init__(self):
		"""Configures the SPI bus and the chip select pin."""
		spi.open(0,1)             		#will open bus 0, CE1. 
		spi.max_speed_hz = 8000000

		GPIO.setmode()
		self.CE_OUTPUT()
		self.CE_DESELECT()	
コード例 #4
0
 def __init__(self):
     """Configures the SPI bus and the chip select pin."""
     spi.open(0, 1)  #will open bus 0, CE1.
     spi.max_speed_hz = 8000000
     GPIO.setwarnings(False)
     GPIO.setmode(GPIO.BOARD)
     self.CE_OUTPUT()
     self.CE_DESELECT()
コード例 #5
0
ファイル: TFT.py プロジェクト: sensorian/sensorian-firmware
	def __init__(self):
		""" Creates a TFT object and configures SPI bus and pins.
		:param none: 
		:returns none :
		"""
		self.dc = DC
		self.rst = RST
		self.width = TFT_WIDTH
		self.height = TFT_HEIGHT
		
		GPIO.setwarnings(False)
		GPIO.setmode(GPIO.BOARD)		
		GPIO.setup(self.dc, GPIO.OUT)		# Set DC as output.
		GPIO.setup(self.rst, GPIO.OUT)
		spi.open(0,0)						# Set SPI to mode 0, MSB first.
		spi.max_speed_hz = 20000000
		self.buffer = Image.new('RGB', (self.width, self.height))	# Create an image buffer.
コード例 #6
0
	def __init__(self):
		""" Creates a TFT object and configures SPI bus and pins.
		:param none: 
		:returns none :
		"""
		self.dc = DC
		self.rst = RST
		self.width = TFT_WIDTH
		self.height = TFT_HEIGHT
		
		GPIO.setmode()		
		GPIO.setup(self.dc, GPIO.OUT)	# Set DC as output.
		# Setup reset as output (if provided).
		if self.rst is not None:
			GPIO.setup(self.rst, GPIO.OUT)
		# Set SPI to mode 0, MSB first.
		spi.open(32766,0)
		spi.max_speed_hz = 20000000
		# Create an image buffer.
		self.buffer = Image.new('RGB', (self.width, self.height))