Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions RaspberryPi_JetsonNano/python/lib/waveshare_epd/epdconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class RaspberryPi:
PWR_PIN = 18
MOSI_PIN = 10
SCLK_PIN = 11
Flag = 0

def __init__(self):
import spidev
Expand Down Expand Up @@ -139,15 +140,18 @@ def module_init(self, cleanup=False):
self.DEV_SPI.DEV_Module_Init()

else:
# SPI device, bus = 0, device = 0
self.SPI.open(0, 0)
self.SPI.max_speed_hz = 4000000
self.SPI.mode = 0b00
if self.Flag == 0:
self.Flag = 1
# SPI device, bus = 0, device = 0
self.SPI.open(0, 0)
self.SPI.max_speed_hz = 4000000
self.SPI.mode = 0b00
return 0

def module_exit(self, cleanup=False):
logger.debug("spi end")
self.SPI.close()
self.Flag = 0

self.GPIO_RST_PIN.off()
self.GPIO_DC_PIN.off()
Expand Down