From 82a87d53f51e9f233565fd0518524a163877f838 Mon Sep 17 00:00:00 2001 From: Bryan Bassett Date: Sun, 29 Mar 2020 01:32:57 -0400 Subject: [PATCH 1/2] delay SPI.open until module_init --- .../python/lib/waveshare_epd/epdconfig.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epdconfig.py b/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epdconfig.py index 861f43d..0dbcc5f 100644 --- a/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epdconfig.py +++ b/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epdconfig.py @@ -45,9 +45,7 @@ class RaspberryPi: import RPi.GPIO self.GPIO = RPi.GPIO - - # SPI device, bus = 0, device = 0 - self.SPI = spidev.SpiDev(0, 0) + self.SPI = spidev.SpiDev() def digital_write(self, pin, value): self.GPIO.output(pin, value) @@ -68,6 +66,9 @@ class RaspberryPi: self.GPIO.setup(self.DC_PIN, self.GPIO.OUT) self.GPIO.setup(self.CS_PIN, self.GPIO.OUT) self.GPIO.setup(self.BUSY_PIN, self.GPIO.IN) + + # SPI device, bus = 0, device = 0 + self.SPI.open(0, 0) self.SPI.max_speed_hz = 4000000 self.SPI.mode = 0b00 return 0 From d13e93279bb961cdbd684a776349e2c8354da199 Mon Sep 17 00:00:00 2001 From: bassettb Date: Thu, 7 Jan 2021 14:42:39 -0500 Subject: [PATCH 2/2] sample of additional changes needed in driver --- RaspberryPi_JetsonNano/python/examples/epd_2in13_V2_test.py | 1 - RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in13_V2.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/RaspberryPi_JetsonNano/python/examples/epd_2in13_V2_test.py b/RaspberryPi_JetsonNano/python/examples/epd_2in13_V2_test.py index 31fc88a..e376ba7 100644 --- a/RaspberryPi_JetsonNano/python/examples/epd_2in13_V2_test.py +++ b/RaspberryPi_JetsonNano/python/examples/epd_2in13_V2_test.py @@ -86,7 +86,6 @@ try: logging.info("Goto Sleep...") epd.sleep() time.sleep(3) - epd.Dev_exit() except IOError as e: logging.info(e) diff --git a/RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in13_V2.py b/RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in13_V2.py index 7d101af..1c8949c 100644 --- a/RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in13_V2.py +++ b/RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in13_V2.py @@ -315,8 +315,6 @@ class EPD: self.send_command(0x10) #enter deep sleep self.send_data(0x03) epdconfig.delay_ms(100) - - def Dev_exit(self): epdconfig.module_exit() ### END OF FILE ###