ili CS pin
This commit is contained in:
parent
2f0a32e71f
commit
70a450ba74
@ -32,6 +32,7 @@ def draw_net(o):
|
||||
|
||||
drv = GPIO()
|
||||
drv.pins['LED'] = 6
|
||||
drv.pins['CS'] = 18
|
||||
o = ILI9325(240, 320, drv)
|
||||
|
||||
o.init()
|
||||
|
@ -39,6 +39,7 @@ def draw_net(o):
|
||||
|
||||
drv = ILIGPIO()
|
||||
drv.pins['LED'] = 6
|
||||
drv.pins['CS'] = 18
|
||||
lcd_tft = ILI9325(240, 320, drv)
|
||||
lcd_tft.init()
|
||||
|
||||
|
@ -9,6 +9,7 @@ RPi.GPIO.setmode(RPi.GPIO.BCM)
|
||||
|
||||
drv = ILIGPIO()
|
||||
drv.pins['LED'] = 6
|
||||
drv.pins['CS'] = 18
|
||||
lcd_tft = ILI9325(240, 320, drv)
|
||||
lcd_tft.init()
|
||||
|
||||
|
@ -38,6 +38,8 @@ class GPIO(Driver):
|
||||
"""reset a display"""
|
||||
if self.pins['LED']:
|
||||
RPi.GPIO.output(self.pins['LED'], 1)
|
||||
if self.pins['CS']:
|
||||
RPi.GPIO.output(self.pins['CS'], 1)
|
||||
RPi.GPIO.output(self.pins['RST'], 1)
|
||||
time.sleep(0.005)
|
||||
RPi.GPIO.output(self.pins['RST'], 0)
|
||||
@ -59,12 +61,16 @@ class GPIO(Driver):
|
||||
|
||||
def send(self, char, enable):
|
||||
"""send 16bit as 2*8bit"""
|
||||
if self.pins['CS']:
|
||||
RPi.GPIO.output(self.pins['CS'], 0)
|
||||
self._set_pins(char >> 8)
|
||||
RPi.GPIO.output(self.pins['W'], 0)
|
||||
RPi.GPIO.output(self.pins['W'], 1)
|
||||
self._set_pins(char)
|
||||
RPi.GPIO.output(self.pins['W'], 0)
|
||||
RPi.GPIO.output(self.pins['W'], 1)
|
||||
if self.pins['CS']:
|
||||
RPi.GPIO.output(self.pins['CS'], 1)
|
||||
|
||||
def data(self, data, enable):
|
||||
"""send data to display"""
|
||||
|
@ -233,6 +233,6 @@ Default:
|
||||
DB13 ------------------------ G16
|
||||
DB14 ------------------------ G20
|
||||
DB15 ------------------------ G21
|
||||
CS ------------------------ GND (always selected)
|
||||
CS ------------------------ GND (always selected) (or connect to GPIO pin)
|
||||
REST ------------------------ G25
|
||||
LED_A ------------------------ 3.3 (can be connected to GPIO pin)
|
||||
|
Loading…
Reference in New Issue
Block a user