Explorar o código

Unify all Python trees for both RPi and Jetson Nano, Py2 and Py3

  * Move lib files into waveshare_epd package
  * Use int() where integer division is needed
  * Use logging (debug level) in library files, so they can be used by a
    user script without print()s being output
  * Use logging (info level) in example files
  * Move Font.ttc file into pic directory
  * epdconfig.py: Detect RPi or Jetson Nano
  * Search for sysfs_software_spi.so in several places
  * Include both Jetson and RPi readme files
  * Include setup.py for package installation
  * Fix few small syntax errors preventing setuptools byte-compiling
Ryan Finnie %!s(int64=6) %!d(string=hai) anos
pai
achega
d0918826de
Modificáronse 100 ficheiros con 5 adicións e 8190 borrados
  1. 5 0
      .gitignore
  2. 0 86
      Jetson Nano/python2/examples/epd_1in54_test.py
  3. 0 75
      Jetson Nano/python2/examples/epd_1in54b_test.py
  4. 0 72
      Jetson Nano/python2/examples/epd_1in54c_test.py
  5. 0 89
      Jetson Nano/python2/examples/epd_2in13_V2_test.py
  6. 0 87
      Jetson Nano/python2/examples/epd_2in13_test.py
  7. 0 91
      Jetson Nano/python2/examples/epd_2in13bc_test.py
  8. 0 81
      Jetson Nano/python2/examples/epd_2in7_test.py
  9. 0 93
      Jetson Nano/python2/examples/epd_2in9bc_test.py
  10. 0 101
      Jetson Nano/python2/examples/epd_2in9d_test.py
  11. 0 84
      Jetson Nano/python2/examples/epd_4in2_test.py
  12. 0 95
      Jetson Nano/python2/examples/epd_4in2bc_test.py
  13. 0 84
      Jetson Nano/python2/examples/epd_7in5_test.py
  14. 0 95
      Jetson Nano/python2/examples/epd_7in5bc_test.py
  15. 0 254
      Jetson Nano/python2/lib/epd1in54.py
  16. BIN=BIN
      Jetson Nano/python2/lib/epd1in54.pyc
  17. BIN=BIN
      Jetson Nano/python2/lib/epd1in54_V2.pyc
  18. 0 218
      Jetson Nano/python2/lib/epd1in54b.py
  19. BIN=BIN
      Jetson Nano/python2/lib/epd1in54b.pyc
  20. 0 152
      Jetson Nano/python2/lib/epd1in54c.py
  21. BIN=BIN
      Jetson Nano/python2/lib/epd1in54c.pyc
  22. 0 224
      Jetson Nano/python2/lib/epd2in13.py
  23. BIN=BIN
      Jetson Nano/python2/lib/epd2in13.pyc
  24. BIN=BIN
      Jetson Nano/python2/lib/epd2in13_V2.pyc
  25. 0 158
      Jetson Nano/python2/lib/epd2in13bc.py
  26. BIN=BIN
      Jetson Nano/python2/lib/epd2in13bc.pyc
  27. 0 357
      Jetson Nano/python2/lib/epd2in13d.py
  28. BIN=BIN
      Jetson Nano/python2/lib/epd2in13d.pyc
  29. 0 258
      Jetson Nano/python2/lib/epd2in7.py
  30. BIN=BIN
      Jetson Nano/python2/lib/epd2in7.pyc
  31. 0 266
      Jetson Nano/python2/lib/epd2in7b.py
  32. BIN=BIN
      Jetson Nano/python2/lib/epd2in7b.pyc
  33. 0 200
      Jetson Nano/python2/lib/epd2in9.py
  34. BIN=BIN
      Jetson Nano/python2/lib/epd2in9.pyc
  35. 0 154
      Jetson Nano/python2/lib/epd2in9bc.py
  36. BIN=BIN
      Jetson Nano/python2/lib/epd2in9bc.pyc
  37. 0 350
      Jetson Nano/python2/lib/epd2in9d.py
  38. BIN=BIN
      Jetson Nano/python2/lib/epd2in9d.pyc
  39. 0 240
      Jetson Nano/python2/lib/epd4in2.py
  40. BIN=BIN
      Jetson Nano/python2/lib/epd4in2.pyc
  41. 0 147
      Jetson Nano/python2/lib/epd4in2bc.py
  42. BIN=BIN
      Jetson Nano/python2/lib/epd4in2bc.pyc
  43. 0 199
      Jetson Nano/python2/lib/epd5in83.py
  44. BIN=BIN
      Jetson Nano/python2/lib/epd5in83.pyc
  45. 0 199
      Jetson Nano/python2/lib/epd5in83bc.py
  46. BIN=BIN
      Jetson Nano/python2/lib/epd5in83bc.pyc
  47. 0 200
      Jetson Nano/python2/lib/epd7in5.py
  48. BIN=BIN
      Jetson Nano/python2/lib/epd7in5.pyc
  49. 0 200
      Jetson Nano/python2/lib/epd7in5bc.py
  50. BIN=BIN
      Jetson Nano/python2/lib/epd7in5bc.pyc
  51. 0 97
      Jetson Nano/python2/lib/epdconfig.py
  52. BIN=BIN
      Jetson Nano/python2/lib/epdconfig.pyc
  53. 0 52
      Jetson Nano/python2/readme_CN.txt
  54. 0 56
      Jetson Nano/python2/readme_EN.txt
  55. 0 87
      Jetson Nano/python3/examples/epd_1in54_V2_test.py
  56. 0 87
      Jetson Nano/python3/examples/epd_1in54_test.py
  57. 0 72
      Jetson Nano/python3/examples/epd_1in54c_test.py
  58. 0 83
      Jetson Nano/python3/examples/epd_2in13d_test.py
  59. 0 98
      Jetson Nano/python3/examples/epd_2in7b_test.py
  60. 0 102
      Jetson Nano/python3/examples/epd_2in9_test.py
  61. 0 101
      Jetson Nano/python3/examples/epd_2in9d_test.py
  62. 0 84
      Jetson Nano/python3/examples/epd_4in2_test.py
  63. 0 95
      Jetson Nano/python3/examples/epd_4in2bc_test.py
  64. 0 84
      Jetson Nano/python3/examples/epd_5in83_test.py
  65. 0 93
      Jetson Nano/python3/examples/epd_5in83bc_test.py
  66. BIN=BIN
      Jetson Nano/python3/lib/Font.ttc
  67. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd1in54.cpython-36.pyc
  68. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd1in54_V2.cpython-36.pyc
  69. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd1in54b.cpython-36.pyc
  70. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd1in54c.cpython-36.pyc
  71. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd2in13.cpython-36.pyc
  72. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd2in13_V2.cpython-36.pyc
  73. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd2in13bc.cpython-36.pyc
  74. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd2in7.cpython-36.pyc
  75. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd2in7b.cpython-36.pyc
  76. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd2in9.cpython-36.pyc
  77. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd2in9bc.cpython-36.pyc
  78. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd2in9d.cpython-36.pyc
  79. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd4in2.cpython-36.pyc
  80. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd4in2bc.cpython-36.pyc
  81. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epd7in5bc.cpython-36.pyc
  82. BIN=BIN
      Jetson Nano/python3/lib/__pycache__/epdconfig.cpython-36.pyc
  83. 0 206
      Jetson Nano/python3/lib/epd1in54_V2.py
  84. 0 315
      Jetson Nano/python3/lib/epd2in13_V2.py
  85. 0 158
      Jetson Nano/python3/lib/epd2in13bc.py
  86. 0 258
      Jetson Nano/python3/lib/epd2in7.py
  87. 0 266
      Jetson Nano/python3/lib/epd2in7b.py
  88. 0 200
      Jetson Nano/python3/lib/epd2in9.py
  89. 0 350
      Jetson Nano/python3/lib/epd2in9d.py
  90. 0 240
      Jetson Nano/python3/lib/epd4in2.py
  91. 0 97
      Jetson Nano/python3/lib/epdconfig.py
  92. BIN=BIN
      Jetson Nano/python3/lib/sysfs_gpio.so
  93. BIN=BIN
      Jetson Nano/python3/lib/sysfs_software_spi.so
  94. BIN=BIN
      Jetson Nano/python3/pic/100x100.bmp
  95. BIN=BIN
      Jetson Nano/python3/pic/1in54.bmp
  96. BIN=BIN
      Jetson Nano/python3/pic/1in54b-b.bmp
  97. BIN=BIN
      Jetson Nano/python3/pic/1in54b-r.bmp
  98. BIN=BIN
      Jetson Nano/python3/pic/1in54c-b.bmp
  99. BIN=BIN
      Jetson Nano/python3/pic/1in54c-y.bmp
  100. BIN=BIN
      Jetson Nano/python3/pic/2in13-v2.bmp

+ 5 - 0
.gitignore

@@ -0,0 +1,5 @@
+Python/build/
+Python/dist/
+*.egg-info/
+*.pyc
+__pycache__/

+ 0 - 86
Jetson Nano/python2/examples/epd_1in54_test.py

@@ -1,86 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd1in54
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd1in54 Demo")
-    
-    epd = epd1in54.EPD()
-    print("init and Clear")
-    epd.init(epd.lut_full_update)
-    epd.Clear(0xFF)
-    
-    # Drawing on the image
-    print("1.Drawing on the image...")
-    image = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    
-    draw = ImageDraw.Draw(image)
-    font = ImageFont.truetype('../lib/Font.ttc', 24)
-    draw.rectangle((0, 10, 200, 34), fill = 0)
-    draw.text((8, 12), 'hello world', font = font, fill = 255)
-    draw.text((8, 36), u'微雪电子', font = font, fill = 0)
-    draw.line((16, 60, 56, 60), fill = 0)
-    draw.line((56, 60, 56, 110), fill = 0)
-    draw.line((16, 110, 56, 110), fill = 0)
-    draw.line((16, 110, 16, 60), fill = 0)
-    draw.line((16, 60, 56, 110), fill = 0)
-    draw.line((56, 60, 16, 110), fill = 0)
-    draw.arc((90, 60, 150, 120), 0, 360, fill = 0)
-    draw.rectangle((16, 130, 56, 180), fill = 0)
-    draw.chord((90, 130, 150, 190), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(image.rotate(90)))
-    time.sleep(2)
-    
-    # read bmp file 
-    print("2.read bmp file...")
-    image = Image.open('../pic/1in54.bmp')
-    epd.display(epd.getbuffer(image))
-    time.sleep(2)
-    
-    # read bmp file on window
-    print("3.read bmp file on window...")
-    epd.Clear(0xFF)
-    image1 = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    image1.paste(bmp, (50,50))    
-    epd.display(epd.getbuffer(image1))
-    time.sleep(2)
-    
-    # # partial update
-    print("4.show time...")
-    epd.init(epd.lut_partial_update)    
-    epd.Clear(0xFF)
-    
-    time_image = Image.new('1', (epd.width, epd.height), 255)
-    time_draw = ImageDraw.Draw(time_image)
-    num = 0
-    while (True):
-        time_draw.rectangle((10, 10, 120, 50), fill = 255)
-        time_draw.text((10, 10), time.strftime('%H:%M:%S'), font = font, fill = 0)
-        newimage = time_image.crop([10, 10, 120, 50])
-        time_image.paste(newimage, (10,10))  
-        epd.display(epd.getbuffer(time_image))
-        num = num + 1
-        if(num == 10):
-            break
-    
-    print("Clear...")
-    epd.Clear(0xFF)
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 75
Jetson Nano/python2/examples/epd_1in54b_test.py

@@ -1,75 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd1in54b
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd1in54b Demo")
-    
-    epd = epd1in54b.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    time.sleep(1)
-    
-    # Drawing on the image
-    print("1.Drawing on the image...")
-    blackimage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    redimage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    
-    font = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    drawblack = ImageDraw.Draw(blackimage)
-    drawred = ImageDraw.Draw(redimage)
-    drawblack.rectangle((0, 10, 200, 34), fill = 0)
-    drawblack.text((8, 12), 'hello world', font = font, fill = 255)
-    drawblack.text((8, 36), u'微雪电子', font = font18, fill = 0)
-    drawblack.line((16, 60, 56, 60), fill = 0)
-    drawblack.line((56, 60, 56, 110), fill = 0)
-    drawblack.line((16, 110, 56, 110), fill = 0)
-    drawred.line((16, 110, 16, 60), fill = 0)
-    drawred.line((16, 60, 56, 110), fill = 0)
-    drawred.line((56, 60, 16, 110), fill = 0)
-    drawred.arc((90, 60, 150, 120), 0, 360, fill = 0)
-    drawred.rectangle((16, 130, 56, 180), fill = 0)
-    drawred.chord((90, 130, 150, 190), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(blackimage),epd.getbuffer(redimage))
-    time.sleep(1)
-    
-    # read bmp file 
-    print("2.read bmp file...")
-    blackimage = Image.open('../pic/1in54b-b.bmp')
-    redimage = Image.open('../pic/1in54b-r.bmp')    
-    epd.display(epd.getbuffer(blackimage),epd.getbuffer(redimage))
-    time.sleep(1)
-    
-    # read bmp file on window
-    print("3.read bmp file on window...")
-    blackimage1 = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    redimage2 = Image.new('1', (epd.width, epd.height), 255)
-    
-    newimage = Image.open('../pic/100x100.bmp')
-    blackimage1.paste(newimage, (50,50))    
-    epd.display(epd.getbuffer(blackimage1), epd.getbuffer(redimage2))
-    
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 72
Jetson Nano/python2/examples/epd_1in54c_test.py

@@ -1,72 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd1in54c
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd1in54c Demo")
-    
-    epd = epd1in54c.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    time.sleep(1)
-    
-    # Drawing on the image
-    print("1.Drawing on the image...")
-    blackimage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    yellowimage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    
-    font = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    drawblack = ImageDraw.Draw(blackimage)
-    drawyellow = ImageDraw.Draw(yellowimage)
-    drawblack.rectangle((0, 10, 200, 34), fill = 0)
-    drawblack.text((8, 12), 'hello world', font = font, fill = 255)
-    drawblack.text((8, 36), u'微雪电子', font = font, fill = 0)
-    drawblack.line((10, 100, 70, 100), fill = 0)
-    drawblack.line((40, 70, 40, 130), fill = 0)
-    
-    drawyellow.rectangle((10, 70, 70, 130), outline = 0)    
-    drawyellow.arc((80, 70, 140, 130), 0, 360, fill = 0)
-    drawyellow.chord((90, 80, 130, 120), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(blackimage),epd.getbuffer(yellowimage))
-    time.sleep(1)
-    
-    # read bmp file 
-    print("2.read bmp file...")
-    blackimage = Image.open('../pic/1in54c-b.bmp')
-    yellowimage = Image.open('../pic/1in54c-y.bmp')    
-    epd.display(epd.getbuffer(blackimage),epd.getbuffer(yellowimage))
-    time.sleep(1)
-    
-    # read bmp file on window
-    print("3.read bmp file on window...")
-    blackimage1 = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    yellowimage2 = Image.new('1', (epd.width, epd.height), 255)
-    
-    newimage = Image.open('../pic/100x100.bmp')
-    blackimage1.paste(newimage, (50,50))    
-    epd.display(epd.getbuffer(blackimage1), epd.getbuffer(yellowimage2))
-    
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 89
Jetson Nano/python2/examples/epd_2in13_V2_test.py

@@ -1,89 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd2in13_V2
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd2in13_V2 Demo")
-    
-    epd = epd2in13_V2.EPD()
-    print("init and Clear")
-    epd.init(epd.FULL_UPDATE)
-    epd.Clear(0xFF)
-    
-    # Drawing on the image
-    font15 = ImageFont.truetype('../lib/Font.ttc', 15)
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    
-    print("1.Drawing on the image...")
-    image = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame    
-    draw = ImageDraw.Draw(image)
-    
-    draw.rectangle([(0,0),(50,50)],outline = 0)
-    draw.rectangle([(55,0),(100,50)],fill = 0)
-    draw.line([(0,0),(50,50)], fill = 0,width = 1)
-    draw.line([(0,50),(50,0)], fill = 0,width = 1)
-    draw.chord((10, 60, 50, 100), 0, 360, fill = 0)
-    draw.ellipse((55, 60, 95, 100), outline = 0)
-    draw.pieslice((55, 60, 95, 100), 90, 180, outline = 0)
-    draw.pieslice((55, 60, 95, 100), 270, 360, fill = 0)
-    draw.polygon([(110,0),(110,50),(150,25)],outline = 0)
-    draw.polygon([(190,0),(190,50),(150,25)],fill = 0)
-    draw.text((120, 60), 'e-Paper demo', font = font15, fill = 0)
-    draw.text((110, 90), u'微雪电子', font = font24, fill = 0)
-    epd.display(epd.getbuffer(image))
-    time.sleep(2)
-    
-    # read bmp file 
-    print("2.read bmp file...")
-    image = Image.open('../pic/2in13.bmp')
-    epd.display(epd.getbuffer(image))
-    time.sleep(2)
-    
-    # read bmp file on window
-    print("3.read bmp file on window...")
-    # epd.Clear(0xFF)
-    image1 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    image1.paste(bmp, (2,2))    
-    epd.display(epd.getbuffer(image1))
-    time.sleep(2)
-    
-    # # partial update
-    print("4.show time...")
-    time_image = Image.new('1', (epd.height, epd.width), 255)
-    time_draw = ImageDraw.Draw(time_image)
-    
-    epd.init(epd.FULL_UPDATE)
-    epd.displayPartBaseImage(epd.getbuffer(time_image))
-    
-    epd.init(epd.PART_UPDATE)
-    num = 0
-    while (True):
-        time_draw.rectangle((120, 80, 220, 105), fill = 255)
-        time_draw.text((120, 80), time.strftime('%H:%M:%S'), font = font24, fill = 0)
-        epd.displayPartial(epd.getbuffer(time_image))
-        num = num + 1
-        if(num == 10):
-            break
-    
-    print("Clear...")
-    epd.init(epd.FULL_UPDATE)
-    epd.Clear(0xFF)
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 87
Jetson Nano/python2/examples/epd_2in13_test.py

@@ -1,87 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd2in13
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd2in13 Demo")
-    
-    epd = epd2in13.EPD()
-    print("init and Clear")
-    epd.init(epd.lut_full_update)
-    epd.Clear(0xFF)
-    
-    # Drawing on the image
-    font15 = ImageFont.truetype('../lib/Font.ttc', 15)
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    
-    print("1.Drawing on the image...")
-    image = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame    
-    draw = ImageDraw.Draw(image)
-    
-    draw.rectangle([(0,0),(50,50)],outline = 0)
-    draw.rectangle([(55,0),(100,50)],fill = 0)
-    draw.line([(0,0),(50,50)], fill = 0,width = 1)
-    draw.line([(0,50),(50,0)], fill = 0,width = 1)
-    draw.chord((10, 60, 50, 100), 0, 360, fill = 0)
-    draw.ellipse((55, 60, 95, 100), outline = 0)
-    draw.pieslice((55, 60, 95, 100), 90, 180, outline = 0)
-    draw.pieslice((55, 60, 95, 100), 270, 360, fill = 0)
-    draw.polygon([(110,0),(110,50),(150,25)],outline = 0)
-    draw.polygon([(190,0),(190,50),(150,25)],fill = 0)
-    draw.text((120, 60), 'e-Paper demo', font = font15, fill = 0)
-    draw.text((110, 90), u'微雪电子', font = font24, fill = 0)
-    epd.display(epd.getbuffer(image))
-    time.sleep(2)
-    
-    # read bmp file 
-    print("2.read bmp file...")
-    image = Image.open('../pic/2in13.bmp')
-    epd.display(epd.getbuffer(image))
-    time.sleep(2)
-    
-    # read bmp file on window
-    print("3.read bmp file on window...")
-    # epd.Clear(0xFF)
-    image1 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    image1.paste(bmp, (2,2))    
-    epd.display(epd.getbuffer(image1))
-    time.sleep(2)
-    
-    # # partial update
-    print("4.show time...")
-    epd.init(epd.lut_partial_update)    
-    epd.Clear(0xFF)
-    
-    time_image = Image.new('1', (epd.height, epd.width), 255)
-    time_draw = ImageDraw.Draw(time_image)
-    num = 0
-    while (True):
-        time_draw.rectangle((120, 80, 220, 105), fill = 255)
-        time_draw.text((120, 80), time.strftime('%H:%M:%S'), font = font24, fill = 0)
-        epd.display(epd.getbuffer(time_image))
-        num = num + 1
-        if(num == 10):
-            break
-    
-    print("Clear...")
-    epd.init(epd.lut_full_update)
-    epd.Clear(0xFF)
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 91
Jetson Nano/python2/examples/epd_2in13bc_test.py

@@ -1,91 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd2in13bc
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd2in13bc Demo")
-    
-    epd = epd2in13bc.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    time.sleep(1)
-    
-    # Drawing on the image
-    print("Drawing")    
-    font20 = ImageFont.truetype('../lib/Font.ttc', 20)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...") 
-    HBlackimage = Image.new('1', (epd.height, epd.width), 255)  # 298*126
-    HRYimage = Image.new('1', (epd.height, epd.width), 255)  # 298*126  ryimage: red or yellow image  
-    drawblack = ImageDraw.Draw(HBlackimage)
-    drawry = ImageDraw.Draw(HRYimage)
-    drawblack.text((10, 0), 'hello world', font = font20, fill = 0)
-    drawblack.text((10, 20), '2.13inch e-Paper bc', font = font20, fill = 0)
-    drawblack.text((120, 0), u'微雪电子', font = font20, fill = 0)    
-    drawblack.line((20, 50, 70, 100), fill = 0)
-    drawblack.line((70, 50, 20, 100), fill = 0)
-    drawblack.rectangle((20, 50, 70, 100), outline = 0)    
-    drawry.line((165, 50, 165, 100), fill = 0)
-    drawry.line((140, 75, 190, 75), fill = 0)
-    drawry.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    drawry.rectangle((80, 50, 130, 100), fill = 0)
-    drawry.chord((85, 55, 125, 95), 0, 360, fill =1)
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    LBlackimage = Image.new('1', (epd.width, epd.height), 255)  # 126*298
-    LRYimage = Image.new('1', (epd.width, epd.height), 255)  # 126*298
-    drawblack = ImageDraw.Draw(LBlackimage)
-    drawry = ImageDraw.Draw(LRYimage)
-    
-    drawblack.text((2, 0), 'hello world', font = font18, fill = 0)
-    drawblack.text((2, 20), '2.13 epd b', font = font18, fill = 0)
-    drawblack.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    drawblack.line((10, 90, 60, 140), fill = 0)
-    drawblack.line((60, 90, 10, 140), fill = 0)
-    drawblack.rectangle((10, 90, 60, 140), outline = 0)
-    drawry.rectangle((10, 150, 60, 200), fill = 0)
-    drawry.arc((15, 95, 55, 135), 0, 360, fill = 0)
-    drawry.chord((15, 155, 55, 195), 0, 360, fill =1)
-    epd.display(epd.getbuffer(LBlackimage), epd.getbuffer(LRYimage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    HBlackimage = Image.open('../pic/2in13bc-b.bmp')
-    HRYimage = Image.open('../pic/2in13bc-ry.bmp')
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    blackimage1 = Image.new('1', (epd.height, epd.width), 255)  # 298*126
-    redimage1 = Image.new('1', (epd.height, epd.width), 255)  # 298*126    
-    newimage = Image.open('../pic/100x100.bmp')
-    blackimage1.paste(newimage, (10,10))    
-    epd.display(epd.getbuffer(blackimage1), epd.getbuffer(redimage1))
-    
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 81
Jetson Nano/python2/examples/epd_2in7_test.py

@@ -1,81 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd2in7
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd2in7 Demo")
-    
-    epd = epd2in7.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear(0xFF)
-    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...")
-    Himage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Himage)
-    draw.text((10, 0), 'hello world', font = font24, fill = 0)
-    draw.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    draw.line((20, 50, 70, 100), fill = 0)
-    draw.line((70, 50, 20, 100), fill = 0)
-    draw.rectangle((20, 50, 70, 100), outline = 0)
-    draw.line((165, 50, 165, 100), fill = 0)
-    draw.line((140, 75, 190, 75), fill = 0)
-    draw.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    draw.rectangle((80, 50, 130, 100), fill = 0)
-    draw.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    Limage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Limage)
-    draw.text((2, 0), 'hello world', font = font18, fill = 0)
-    draw.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    draw.line((10, 90, 60, 140), fill = 0)
-    draw.line((60, 90, 10, 140), fill = 0)
-    draw.rectangle((10, 90, 60, 140), outline = 0)
-    draw.line((95, 90, 95, 140), fill = 0)
-    draw.line((70, 115, 120, 115), fill = 0)
-    draw.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    draw.rectangle((10, 150, 60, 200), fill = 0)
-    draw.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Limage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    Himage = Image.open('../pic/2in7.bmp')
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    Himage2 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    Himage2.paste(bmp, (50,10))
-    epd.display(epd.getbuffer(Himage2))
-    time.sleep(2)
-        
-    print("Clear...")
-    epd.Clear(0xFF)
-    
-    print("Goto Sleep...")
-    epd.sleep()
-    
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 93
Jetson Nano/python2/examples/epd_2in9bc_test.py

@@ -1,93 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd2in9bc
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd2in9bc Demo")
-    
-    epd = epd2in9bc.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    time.sleep(1)
-    
-    # Drawing on the image
-    print("Drawing")    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...") 
-    HBlackimage = Image.new('1', (epd.height, epd.width), 255)  # 298*126
-    HRYimage = Image.new('1', (epd.height, epd.width), 255)  # 298*126  ryimage: red or yellow image  
-    drawblack = ImageDraw.Draw(HBlackimage)
-    drawry = ImageDraw.Draw(HRYimage)
-    drawblack.text((10, 0), 'hello world', font = font24, fill = 0)
-    drawblack.text((10, 20), '2.9inch e-Paper bc', font = font24, fill = 0)
-    drawblack.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    drawblack.line((20, 50, 70, 100), fill = 0)
-    drawblack.line((70, 50, 20, 100), fill = 0)
-    drawblack.rectangle((20, 50, 70, 100), outline = 0)    
-    drawry.line((165, 50, 165, 100), fill = 0)
-    drawry.line((140, 75, 190, 75), fill = 0)
-    drawry.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    drawry.rectangle((80, 50, 130, 100), fill = 0)
-    drawry.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    LBlackimage = Image.new('1', (epd.width, epd.height), 255)  # 126*298
-    LRYimage = Image.new('1', (epd.width, epd.height), 255)  # 126*298
-    drawblack = ImageDraw.Draw(LBlackimage)
-    drawry = ImageDraw.Draw(LRYimage)
-    
-    drawblack.text((2, 0), 'hello world', font = font18, fill = 0)
-    drawblack.text((2, 20), '2.9inch epd bc', font = font18, fill = 0)
-    drawblack.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    drawblack.line((10, 90, 60, 140), fill = 0)
-    drawblack.line((60, 90, 10, 140), fill = 0)
-    drawblack.rectangle((10, 90, 60, 140), outline = 0)
-    drawry.line((95, 90, 95, 140), fill = 0)
-    drawry.line((70, 115, 120, 115), fill = 0)
-    drawry.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    drawry.rectangle((10, 150, 60, 200), fill = 0)
-    drawry.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(LBlackimage), epd.getbuffer(LRYimage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    HBlackimage = Image.open('../pic/2in9bc-b.bmp')
-    HRYimage = Image.open('../pic/2in9bc-ry.bmp')
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    blackimage1 = Image.new('1', (epd.height, epd.width), 255)  # 298*126
-    redimage1 = Image.new('1', (epd.height, epd.width), 255)  # 298*126    
-    newimage = Image.open('../pic/100x100.bmp')
-    blackimage1.paste(newimage, (50,10))    
-    epd.display(epd.getbuffer(blackimage1), epd.getbuffer(redimage1))
-    
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 101
Jetson Nano/python2/examples/epd_2in9d_test.py

@@ -1,101 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd2in9d
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd2in9d Demo")
-    
-    epd = epd2in9d.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear(0xFF)
-    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...")
-    Himage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Himage)
-    draw.text((10, 0), 'hello world', font = font24, fill = 0)
-    draw.text((10, 20), '2.9inch e-Paper d', font = font24, fill = 0)
-    draw.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    draw.line((20, 50, 70, 100), fill = 0)
-    draw.line((70, 50, 20, 100), fill = 0)
-    draw.rectangle((20, 50, 70, 100), outline = 0)
-    draw.line((165, 50, 165, 100), fill = 0)
-    draw.line((140, 75, 190, 75), fill = 0)
-    draw.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    draw.rectangle((80, 50, 130, 100), fill = 0)
-    draw.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    Limage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Limage)
-    draw.text((2, 0), 'hello world', font = font18, fill = 0)
-    draw.text((2, 20), '2.9inch epd d', font = font18, fill = 0)
-    draw.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    draw.line((10, 90, 60, 140), fill = 0)
-    draw.line((60, 90, 10, 140), fill = 0)
-    draw.rectangle((10, 90, 60, 140), outline = 0)
-    draw.line((95, 90, 95, 140), fill = 0)
-    draw.line((70, 115, 120, 115), fill = 0)
-    draw.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    draw.rectangle((10, 150, 60, 200), fill = 0)
-    draw.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Limage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    Himage = Image.open('../pic/2in9d.bmp')
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    Himage2 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    Himage2.paste(bmp, (50,10))
-    epd.display(epd.getbuffer(Himage2))
-    time.sleep(2)
-    
-    # # partial update
-    print("5.show time...")
-    epd.init()    
-    epd.Clear(0xFF)
-    
-    time_image = Image.new('1', (epd.width, epd.height), 255)
-    time_draw = ImageDraw.Draw(time_image)
-    num = 0
-    while (True):
-        time_draw.rectangle((10, 10, 120, 50), fill = 255)
-        time_draw.text((10, 10), time.strftime('%H:%M:%S'), font = font24, fill = 0)
-        newimage = time_image.crop([10, 10, 120, 50])
-        time_image.paste(newimage, (10,10))  
-        epd.display(epd.getbuffer(time_image))
-        num = num + 1
-        if(num == 10):
-            break
-    
-    print("Clear...")
-    epd.Clear(0xFF)
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 84
Jetson Nano/python2/examples/epd_4in2_test.py

@@ -1,84 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd4in2
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd4in2 Demo")
-    
-    epd = epd4in2.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...")
-    Himage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Himage)
-    draw.text((10, 0), 'hello world', font = font24, fill = 0)
-    draw.text((10, 20), '4.2inch e-Paper', font = font24, fill = 0)
-    draw.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    draw.line((20, 50, 70, 100), fill = 0)
-    draw.line((70, 50, 20, 100), fill = 0)
-    draw.rectangle((20, 50, 70, 100), outline = 0)
-    draw.line((165, 50, 165, 100), fill = 0)
-    draw.line((140, 75, 190, 75), fill = 0)
-    draw.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    draw.rectangle((80, 50, 130, 100), fill = 0)
-    draw.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    Limage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Limage)
-    draw.text((2, 0), 'hello world', font = font18, fill = 0)
-    draw.text((2, 20), '4.2inch epd', font = font18, fill = 0)
-    draw.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    draw.line((10, 90, 60, 140), fill = 0)
-    draw.line((60, 90, 10, 140), fill = 0)
-    draw.rectangle((10, 90, 60, 140), outline = 0)
-    draw.line((95, 90, 95, 140), fill = 0)
-    draw.line((70, 115, 120, 115), fill = 0)
-    draw.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    draw.rectangle((10, 150, 60, 200), fill = 0)
-    draw.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Limage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    Himage = Image.open('../pic/4in2.bmp')
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    Himage2 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    Himage2.paste(bmp, (50,10))
-    epd.display(epd.getbuffer(Himage2))
-    time.sleep(2)
-
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-    
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 95
Jetson Nano/python2/examples/epd_4in2bc_test.py

@@ -1,95 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd4in2bc
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd4in2bc Demo")
-    
-    epd = epd4in2bc.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    time.sleep(1)
-    
-    # Drawing on the image
-    print("Drawing")    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...") 
-    HBlackimage = Image.new('1', (epd.width, epd.height), 255)  # 298*126
-    HRYimage = Image.new('1', (epd.width, epd.height), 255)  # 298*126  ryimage: red or yellow image  
-    drawblack = ImageDraw.Draw(HBlackimage)
-    drawry = ImageDraw.Draw(HRYimage)
-    drawblack.text((10, 0), 'hello world', font = font24, fill = 0)
-    drawblack.text((10, 20), '4.2inch e-Paper bc', font = font24, fill = 0)
-    drawblack.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    drawblack.line((20, 50, 70, 100), fill = 0)
-    drawblack.line((70, 50, 20, 100), fill = 0)
-    drawblack.rectangle((20, 50, 70, 100), outline = 0)    
-    drawry.line((165, 50, 165, 100), fill = 0)
-    drawry.line((140, 75, 190, 75), fill = 0)
-    drawry.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    drawry.rectangle((80, 50, 130, 100), fill = 0)
-    drawry.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    LBlackimage = Image.new('1', (epd.height, epd.width), 255)  # 126*298
-    LRYimage = Image.new('1', (epd.height, epd.width), 255)  # 126*298
-    drawblack = ImageDraw.Draw(LBlackimage)
-    drawry = ImageDraw.Draw(LRYimage)
-    
-    drawblack.text((2, 0), 'hello world', font = font18, fill = 0)
-    drawblack.text((2, 20), '4.2inch epd bc', font = font18, fill = 0)
-    drawblack.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    drawblack.line((10, 90, 60, 140), fill = 0)
-    drawblack.line((60, 90, 10, 140), fill = 0)
-    drawblack.rectangle((10, 90, 60, 140), outline = 0)
-    drawry.line((95, 90, 95, 140), fill = 0)
-    drawry.line((70, 115, 120, 115), fill = 0)
-    drawry.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    drawry.rectangle((10, 150, 60, 200), fill = 0)
-    drawry.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(LBlackimage), epd.getbuffer(LRYimage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    HBlackimage = Image.open('../pic/4in2b-b.bmp')
-    HRYimage = Image.open('../pic/4in2b-r.bmp')
-    # HBlackimage = Image.open('../pic/4in2c-b.bmp')
-    # HRYimage = Image.open('../pic/4in2c-y.bmp')
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    blackimage1 = Image.new('1', (epd.width, epd.height), 255)  # 298*126
-    redimage1 = Image.new('1', (epd.width, epd.height), 255)  # 298*126    
-    newimage = Image.open('../pic/100x100.bmp')
-    blackimage1.paste(newimage, (50,10))    
-    epd.display(epd.getbuffer(blackimage1), epd.getbuffer(redimage1))
-    
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 84
Jetson Nano/python2/examples/epd_7in5_test.py

@@ -1,84 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd7in5
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd7in5 Demo")
-    
-    epd = epd7in5.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...")
-    Himage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Himage)
-    draw.text((10, 0), 'hello world', font = font24, fill = 0)
-    draw.text((10, 20), '7.5inch e-Paper', font = font24, fill = 0)
-    draw.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    draw.line((20, 50, 70, 100), fill = 0)
-    draw.line((70, 50, 20, 100), fill = 0)
-    draw.rectangle((20, 50, 70, 100), outline = 0)
-    draw.line((165, 50, 165, 100), fill = 0)
-    draw.line((140, 75, 190, 75), fill = 0)
-    draw.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    draw.rectangle((80, 50, 130, 100), fill = 0)
-    draw.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    Limage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Limage)
-    draw.text((2, 0), 'hello world', font = font18, fill = 0)
-    draw.text((2, 20), '7.5inch epd', font = font18, fill = 0)
-    draw.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    draw.line((10, 90, 60, 140), fill = 0)
-    draw.line((60, 90, 10, 140), fill = 0)
-    draw.rectangle((10, 90, 60, 140), outline = 0)
-    draw.line((95, 90, 95, 140), fill = 0)
-    draw.line((70, 115, 120, 115), fill = 0)
-    draw.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    draw.rectangle((10, 150, 60, 200), fill = 0)
-    draw.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Limage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    Himage = Image.open('../pic/7in5.bmp')
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    Himage2 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    Himage2.paste(bmp, (50,10))
-    epd.display(epd.getbuffer(Himage2))
-    time.sleep(2)
-
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-    
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 95
Jetson Nano/python2/examples/epd_7in5bc_test.py

@@ -1,95 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd7in5bc
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd7in5bc Demo")
-    
-    epd = epd7in5bc.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    time.sleep(1)
-    
-    # Drawing on the image
-    print("Drawing")    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...") 
-    HBlackimage = Image.new('1', (epd.width, epd.height), 255)  # 298*126
-    HRYimage = Image.new('1', (epd.width, epd.height), 255)  # 298*126  ryimage: red or yellow image  
-    drawblack = ImageDraw.Draw(HBlackimage)
-    drawry = ImageDraw.Draw(HRYimage)
-    drawblack.text((10, 0), 'hello world', font = font24, fill = 0)
-    drawblack.text((10, 20), '7.5inch e-Paper bc', font = font24, fill = 0)
-    drawblack.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    drawblack.line((20, 50, 70, 100), fill = 0)
-    drawblack.line((70, 50, 20, 100), fill = 0)
-    drawblack.rectangle((20, 50, 70, 100), outline = 0)    
-    drawry.line((165, 50, 165, 100), fill = 0)
-    drawry.line((140, 75, 190, 75), fill = 0)
-    drawry.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    drawry.rectangle((80, 50, 130, 100), fill = 0)
-    drawry.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    LBlackimage = Image.new('1', (epd.height, epd.width), 255)  # 126*298
-    LRYimage = Image.new('1', (epd.height, epd.width), 255)  # 126*298
-    drawblack = ImageDraw.Draw(LBlackimage)
-    drawry = ImageDraw.Draw(LRYimage)
-    
-    drawblack.text((2, 0), 'hello world', font = font18, fill = 0)
-    drawblack.text((2, 20), '7.5inch epd bc', font = font18, fill = 0)
-    drawblack.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    drawblack.line((10, 90, 60, 140), fill = 0)
-    drawblack.line((60, 90, 10, 140), fill = 0)
-    drawblack.rectangle((10, 90, 60, 140), outline = 0)
-    drawry.line((95, 90, 95, 140), fill = 0)
-    drawry.line((70, 115, 120, 115), fill = 0)
-    drawry.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    drawry.rectangle((10, 150, 60, 200), fill = 0)
-    drawry.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(LBlackimage), epd.getbuffer(LRYimage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    HBlackimage = Image.open('../pic/7in5b-b.bmp')
-    HRYimage = Image.open('../pic/7in5b-r.bmp')
-    # HBlackimage = Image.open('../pic/7in5c-b.bmp')
-    # HRYimage = Image.open('../pic/7in5c-r.bmp')
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    blackimage1 = Image.new('1', (epd.width, epd.height), 255)  # 298*126
-    redimage1 = Image.new('1', (epd.width, epd.height), 255)  # 298*126    
-    newimage = Image.open('../pic/100x100.bmp')
-    blackimage1.paste(newimage, (50,10))    
-    epd.display(epd.getbuffer(blackimage1), epd.getbuffer(redimage1))
-    
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 254
Jetson Nano/python2/lib/epd1in54.py

@@ -1,254 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd1in54.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V3.1
-# * | Date        :   2019-06-18
-# # | Info        :   python2 demo
-# -----------------------------------------------------------------------------
-# V3.1(2019-06-18):
-# 2.remove commands define:
-#   #define PANEL_SETTING                               0x00
-#   #define POWER_SETTING                               0x01
-#   #define POWER_OFF                                   0x02
-#   #define POWER_OFF_SEQUENCE_SETTING                  0x03
-#   #define POWER_ON                                    0x04
-#   #define POWER_ON_MEASURE                            0x05
-#   #define BOOSTER_SOFT_START                          0x06
-#   #define DEEP_SLEEP                                  0x07
-#   #define DATA_START_TRANSMISSION_1                   0x10
-#   #define DATA_STOP                                   0x11
-#   #define DISPLAY_REFRESH                             0x12
-#   #define DATA_START_TRANSMISSION_2                   0x13
-#   #define PLL_CONTROL                                 0x30
-#   #define TEMPERATURE_SENSOR_COMMAND                  0x40
-#   #define TEMPERATURE_SENSOR_CALIBRATION              0x41
-#   #define TEMPERATURE_SENSOR_WRITE                    0x42
-#   #define TEMPERATURE_SENSOR_READ                     0x43
-#   #define VCOM_AND_DATA_INTERVAL_SETTING              0x50
-#   #define LOW_POWER_DETECTION                         0x51
-#   #define TCON_SETTING                                0x60
-#   #define TCON_RESOLUTION                             0x61
-#   #define SOURCE_AND_GATE_START_SETTING               0x62
-#   #define GET_STATUS                                  0x71
-#   #define AUTO_MEASURE_VCOM                           0x80
-#   #define VCOM_VALUE                                  0x81
-#   #define VCM_DC_SETTING_REGISTER                     0x82
-#   #define PROGRAM_MODE                                0xA0
-#   #define ACTIVE_PROGRAM                              0xA1
-#   #define READ_OTP_DATA                               0xA2
-# -----------------------------------------------------------------------------
-# V3.0(2018-11-01):
-# # 1.Remove:
-#   digital_write(self, pin, value)
-#   digital_read(self, pin)
-#   delay_ms(self, delaytime)
-#   set_lut(self, lut)
-#   self.lut = self.lut_full_update
-# * 2.Change:
-#   display_frame -> TurnOnDisplay
-#   set_memory_area -> SetWindow
-#   set_memory_pointer -> SetCursor
-# * 3.How to use
-#   epd = epd1in54.EPD()
-#   epd.init(epd.lut_full_update)
-#   image = Image.new('1', (epd1in54.EPD_WIDTH, epd1in54.EPD_HEIGHT), 255)
-#   ...
-#   drawing ......
-#   ...
-#   epd.display(getbuffer(image))
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 200
-EPD_HEIGHT      = 200
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_full_update = [
-        0x02, 0x02, 0x01, 0x11, 0x12, 0x12, 0x22, 0x22, 
-        0x66, 0x69, 0x69, 0x59, 0x58, 0x99, 0x99, 0x88, 
-        0x00, 0x00, 0x00, 0x00, 0xF8, 0xB4, 0x13, 0x51, 
-        0x35, 0x51, 0x51, 0x19, 0x01, 0x00
-    ]
-
-    lut_partial_update  = [
-        0x10, 0x18, 0x18, 0x08, 0x18, 0x18, 0x08, 0x00, 
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-        0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12, 
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-    ]
-        
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)         # module reset
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 1):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)
-        print("e-Paper busy release")
-
-    def TurnOnDisplay(self):
-        self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
-        self.send_data(0xC4)
-        self.send_command(0x20) # MASTER_ACTIVATION
-        self.send_command(0xFF) # TERMINATE_FRAME_READ_WRITE
-        
-        self.ReadBusy()
-
-    def SetWindow(self, x_start, y_start, x_end, y_end):
-        self.send_command(0x44) # SET_RAM_X_ADDRESS_START_END_POSITION
-        # x point must be the multiple of 8 or the last 3 bits will be ignored
-        self.send_data((x_start >> 3) & 0xFF)
-        self.send_data((x_end >> 3) & 0xFF)
-        self.send_command(0x45) # SET_RAM_Y_ADDRESS_START_END_POSITION
-        self.send_data(y_start & 0xFF)
-        self.send_data((y_start >> 8) & 0xFF)
-        self.send_data(y_end & 0xFF)
-        self.send_data((y_end >> 8) & 0xFF)
-
-    def SetCursor(self, x, y):
-        self.send_command(0x4E) # SET_RAM_X_ADDRESS_COUNTER
-        # x point must be the multiple of 8 or the last 3 bits will be ignored
-        self.send_data((x >> 3) & 0xFF)
-        
-        self.send_command(0x4F) # SET_RAM_Y_ADDRESS_COUNTER
-        self.send_data(y & 0xFF)
-        self.send_data((y >> 8) & 0xFF)
-        # self.ReadBusy()
-        
-    def init(self, lut):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01) # DRIVER_OUTPUT_CONTROL
-        self.send_data((EPD_HEIGHT - 1) & 0xFF)
-        self.send_data(((EPD_HEIGHT - 1) >> 8) & 0xFF)
-        self.send_data(0x00) # GD = 0 SM = 0 TB = 0
-        
-        self.send_command(0x0C) # BOOSTER_SOFT_START_CONTROL
-        self.send_data(0xD7)
-        self.send_data(0xD6)
-        self.send_data(0x9D)
-        
-        self.send_command(0x2C) # WRITE_VCOM_REGISTER
-        self.send_data(0xA8) # VCOM 7C
-        
-        self.send_command(0x3A) # SET_DUMMY_LINE_PERIOD
-        self.send_data(0x1A) # 4 dummy lines per gate
-        
-        self.send_command(0x3B) # SET_GATE_TIME
-        self.send_data(0x08) # 2us per line
-        
-        self.send_command(0x11) # DATA_ENTRY_MODE_SETTING
-        self.send_data(0x03) # X increment Y increment
-        
-        # set the look-up table register
-        self.send_command(0x32)
-        for i in range(0, len(lut)):
-            self.send_data(lut[i])
-        # EPD hardware init end
-        return 0
-
-    def getbuffer(self, image):
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        if(imwidth == self.width and imheight == self.height):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, image):
-        if (image == None):
-            return
-            
-        self.SetWindow(0, 0, self.width, self.height)
-        for j in range(0, self.height):
-            self.SetCursor(0, j)
-            self.send_command(0x24)
-            for i in range(0, self.width / 8):
-                self.send_data(image[i + j * (self.width / 8)])   
-        self.TurnOnDisplay()
-        
-    def Clear(self, color):
-        # self.SetWindow(0, 0, self.width - 1, self.height - 1)
-        # send the color data
-        self.SetWindow(0, 0, self.width, self.height)
-        for j in range(0, self.height):
-            self.SetCursor(0, j)
-            self.send_command(0x24)
-            for i in range(0, self.width / 8):
-                self.send_data(color)
-        self.TurnOnDisplay()
-
-    def sleep(self):
-        self.send_command(0x10) # DEEP_SLEEP_MODE
-        self.send_data(0x01)
-        
-        epdconfig.module_exit()
-
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd1in54.pyc


BIN=BIN
Jetson Nano/python2/lib/epd1in54_V2.pyc


+ 0 - 218
Jetson Nano/python2/lib/epd1in54b.py

@@ -1,218 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd1in54b.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-18
-# * | Info        :   python2 demo
-# ******************************************************************************
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 200
-EPD_HEIGHT      = 200
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_vcom0 = [0x0E, 0x14, 0x01, 0x0A, 0x06, 0x04, 0x0A, 0x0A, 0x0F, 0x03, 0x03, 0x0C, 0x06, 0x0A, 0x00]
-    lut_w = [0x0E, 0x14, 0x01, 0x0A, 0x46, 0x04, 0x8A, 0x4A, 0x0F, 0x83, 0x43, 0x0C, 0x86, 0x0A, 0x04]
-    lut_b = [0x0E, 0x14, 0x01, 0x8A, 0x06, 0x04, 0x8A, 0x4A, 0x0F, 0x83, 0x43, 0x0C, 0x06, 0x4A, 0x04]
-    lut_g1 = [0x8E, 0x94, 0x01, 0x8A, 0x06, 0x04, 0x8A, 0x4A, 0x0F, 0x83, 0x43, 0x0C, 0x06, 0x0A, 0x04]
-    lut_g2 = [0x8E, 0x94, 0x01, 0x8A, 0x06, 0x04, 0x8A, 0x4A, 0x0F, 0x83, 0x43, 0x0C, 0x06, 0x0A, 0x04]
-    lut_vcom1 = [0x03, 0x1D, 0x01, 0x01, 0x08, 0x23, 0x37, 0x37, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
-    lut_red0 = [0x83, 0x5D, 0x01, 0x81, 0x48, 0x23, 0x77, 0x77, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
-    lut_red1 = [0x03, 0x1D, 0x01, 0x01, 0x08, 0x23, 0x37, 0x37, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] 
-    
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0) # module reset
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):
-            epdconfig.delay_ms(100)    
-        print("e-Paper busy release")
-      
-    def set_lut_bw(self):
-        self.send_command(0x20) # vcom
-        for count in range(0, 15):
-            self.send_data(self.lut_vcom0[count])
-        self.send_command(0x21) # ww --
-        for count in range(0, 15):
-            self.send_data(self.lut_w[count])
-        self.send_command(0x22) # bw r
-        for count in range(0, 15):
-            self.send_data(self.lut_b[count])
-        self.send_command(0x23) # wb w
-        for count in range(0, 15):
-            self.send_data(self.lut_g1[count])
-        self.send_command(0x24) # bb b
-        for count in range(0, 15):
-            self.send_data(self.lut_g2[count])
-
-    def set_lut_red(self):
-        self.send_command(0x25)
-        for count in range(0, 15):
-            self.send_data(self.lut_vcom1[count])
-        self.send_command(0x26)
-        for count in range(0, 15):
-            self.send_data(self.lut_red0[count])
-        self.send_command(0x27)
-        for count in range(0, 15):
-            self.send_data(self.lut_red1[count])
-            
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01) # POWER_SETTING
-        self.send_data(0x07)
-        self.send_data(0x00)
-        self.send_data(0x08)
-        self.send_data(0x00)
-        self.send_command(0x06) # BOOSTER_SOFT_START
-        self.send_data(0x07)
-        self.send_data(0x07)
-        self.send_data(0x07)
-        self.send_command(0x04) # POWER_ON
-
-        self.ReadBusy()
-
-        self.send_command(0X00) # PANEL_SETTING
-        self.send_data(0xCF)
-        self.send_command(0X50) # VCOM_AND_DATA_INTERVAL_SETTING
-        self.send_data(0x17)
-        self.send_command(0x30) # PLL_CONTROL
-        self.send_data(0x39)
-        self.send_command(0x61) # TCON_RESOLUTION set x and y
-        self.send_data(0xC8)
-        self.send_data(0x00)
-        self.send_data(0xC8)
-        self.send_command(0x82) # VCM_DC_SETTING_REGISTER
-        self.send_data(0x0E)
-        
-        self.set_lut_bw()
-        self.set_lut_red()
-        return 0
-
-    def getbuffer(self, image):
-        buf = [0xFF] * (self.width * self.height / 8)
-        # Set buffer to value of Python Imaging Library image.
-        # Image must be in mode 1.
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        if imwidth != self.width or imheight != self.height:
-            raise ValueError('Image must be same dimensions as display \
-                ({0}x{1}).' .format(self.width, self.height))
-
-        pixels = image_monocolor.load()
-        for y in range(self.height):
-            for x in range(self.width):
-                # Set the bits for the column of pixels at the current position.
-                if pixels[x, y] == 0:
-                    buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        return buf
-
-    def display(self, blackimage, redimage):
-        # send black data
-        if (blackimage != None):
-            self.send_command(0x10) # DATA_START_TRANSMISSION_1
-            for i in range(0, self.width * self.height / 8):
-                temp = 0x00
-                for bit in range(0, 4):
-                    if (blackimage[i] & (0x80 >> bit) != 0):
-                        temp |= 0xC0 >> (bit * 2)
-                self.send_data(temp)  
-                temp = 0x00
-                for bit in range(4, 8):
-                    if (blackimage[i] & (0x80 >> bit) != 0):
-                        temp |= 0xC0 >> ((bit - 4) * 2)
-                self.send_data(temp)
-                
-        # send red data        
-        if (redimage != None):
-            self.send_command(0x13) # DATA_START_TRANSMISSION_2
-            for i in range(0, self.width * self.height / 8):
-                self.send_data(redimage[i])  
-
-        self.send_command(0x12) # DISPLAY_REFRESH
-        self.ReadBusy()
-
-    def Clear(self):
-        self.send_command(0x10) # DATA_START_TRANSMISSION_1
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-            self.send_data(0xFF)
-            
-        self.send_command(0x13) # DATA_START_TRANSMISSION_2
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-
-        self.send_command(0x12) # DISPLAY_REFRESH
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0x50) # VCOM_AND_DATA_INTERVAL_SETTING
-        self.send_data(0x17)
-        self.send_command(0x82) # to solve Vcom drop 
-        self.send_data(0x00)        
-        self.send_command(0x01) # power setting      
-        self.send_data(0x02) # gate switch to external
-        self.send_data(0x00)
-        self.send_data(0x00) 
-        self.send_data(0x00) 
-        self.ReadBusy()
-        
-        self.send_command(0x02) # power off
-        
-        epdconfig.module_exit()
-
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd1in54b.pyc


+ 0 - 152
Jetson Nano/python2/lib/epd1in54c.py

@@ -1,152 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd1in54c.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-18
-# * | Info        :   python2 demo
-# ******************************************************************************
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 152
-EPD_HEIGHT      = 152
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-        
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(10) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(1)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(10)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):        
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      #  0: idle, 1: busy
-            epdconfig.delay_ms(200)                
-        print("e-Paper busy release")
-     
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x06) # boost soft start
-        self.send_data(0x17)
-        self.send_data(0x17)
-        self.send_data(0x17)
-        self.send_command(0x04) # power on
-        
-        self.ReadBusy()
-        
-        self.send_command(0x00) # panel setting
-        self.send_data(0x0f) # LUT from OTP,160x296
-        self.send_data(0x0d) # VCOM to 0V fast
-        
-        self.send_command(0x61) # resolution setting
-        self.send_data(0x98)
-        self.send_data(0x00)
-        self.send_data(0x98)
-        
-        self.send_command(0x50)
-        self.send_data(0x77)
-
-    def getbuffer(self, image):
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        if(imwidth == self.width and imheight == self.height):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    #  Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, blackimage, yellowimage):
-        self.send_command(0x10)
-        print("blackimage")
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(blackimage[i])
-        self.send_command(0x13)
-        print("yellowimage")
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(yellowimage[i])
-            
-        self.send_command(0x12)
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)            
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-            
-        self.send_command(0x12)
-        self.ReadBusy()
-
-    #  after this, call epd.init() to awaken the module
-    def sleep(self):
-        self.send_command(0X02)  #  power off
-        self.ReadBusy() 
-        self.send_command(0X07)  #  deep sleep
-        self.send_data(0xA5)
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd1in54c.pyc


+ 0 - 224
Jetson Nano/python2/lib/epd2in13.py

@@ -1,224 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd2in13.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-19
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-import numpy as np
-
-# Display resolution
-EPD_WIDTH       = 122
-EPD_HEIGHT      = 250
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-        
-    lut_full_update = [
-        0x22, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x11,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E,
-        0x01, 0x00, 0x00, 0x00, 0x00, 0x00
-    ]
-
-    lut_partial_update  = [
-        0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-    ]
-        
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):        
-        while(epdconfig.digital_read(self.busy_pin) == 1):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)            
-
-    def TurnOnDisplay(self):
-        self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
-        self.send_data(0xC4)
-        self.send_command(0x20) # MASTER_ACTIVATION
-        self.send_command(0xFF) # TERMINATE_FRAME_READ_WRITE
-        
-        print("e-Paper busy")
-        self.ReadBusy()
-        print("e-Paper busy release")
-
-    def init(self, lut):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        self.send_command(0x01) # DRIVER_OUTPUT_CONTROL
-        self.send_data((EPD_HEIGHT - 1) & 0xFF)
-        self.send_data(((EPD_HEIGHT - 1) >> 8) & 0xFF)
-        self.send_data(0x00) # GD = 0 SM = 0 TB = 0
-        
-        self.send_command(0x0C) # BOOSTER_SOFT_START_CONTROL
-        self.send_data(0xD7)
-        self.send_data(0xD6)
-        self.send_data(0x9D)
-        
-        self.send_command(0x2C) # WRITE_VCOM_REGISTER
-        self.send_data(0xA8) # VCOM 7C
-        
-        self.send_command(0x3A) # SET_DUMMY_LINE_PERIOD
-        self.send_data(0x1A) # 4 dummy lines per gate
-        
-        self.send_command(0x3B) # SET_GATE_TIME
-        self.send_data(0x08) # 2us per line
-        
-        self.send_command(0X3C) # BORDER_WAVEFORM_CONTROL
-        self.send_data(0x03)      
-        
-        self.send_command(0X11) # DATA_ENTRY_MODE_SETTING
-        self.send_data(0x03) # X increment; Y increment
-        
-        # WRITE_LUT_REGISTER
-        self.send_command(0x32)
-        for count in range(30):
-            self.send_data(lut[count])
-
-        return 0
-        
-##
- #  @brief: specify the memory area for data R/W
- ##
-    def SetWindows(self, x_start, y_start, x_end, y_end):
-        self.send_command(0x44) # SET_RAM_X_ADDRESS_START_END_POSITION
-        self.send_data((x_start >> 3) & 0xFF)
-        self.send_data((x_end >> 3) & 0xFF)
-        self.send_command(0x45) # SET_RAM_Y_ADDRESS_START_END_POSITION
-        self.send_data(y_start & 0xFF)
-        self.send_data((y_start >> 8) & 0xFF)
-        self.send_data(y_end & 0xFF)
-        self.send_data((y_end >> 8) & 0xFF)
-
-##
- #  @brief: specify the start point for data R/W
- ##
-    def SetCursor(self, x, y):
-        self.send_command(0x4E) # SET_RAM_X_ADDRESS_COUNTER
-        # x point must be the multiple of 8 or the last 3 bits will be ignored
-        self.send_data((x >> 3) & 0xFF)
-        self.send_command(0x4F) # SET_RAM_Y_ADDRESS_COUNTER
-        self.send_data(y & 0xFF)
-        self.send_data((y >> 8) & 0xFF)
-        self.ReadBusy()
-        
-    def getbuffer(self, image):
-        if self.width%8 == 0:
-            linewidth = self.width/8
-        else:
-            linewidth = self.width/8 + 1
-         
-        buf = [0xFF] * (linewidth * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):                    
-                    if pixels[x, y] == 0:
-                        # x = imwidth - x
-                        buf[x / 8 + y * linewidth] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        # newy = imwidth - newy - 1
-                        buf[newx / 8 + newy*linewidth] &= ~(0x80 >> (y % 8))
-        return buf   
-
-        
-    def display(self, image):
-        if self.width%8 == 0:
-            linewidth = self.width/8
-        else:
-            linewidth = self.width/8 + 1
-
-        self.SetWindows(0, 0, self.width, self.height);
-        for j in range(0, self.height):
-            self.SetCursor(0, j);
-            self.send_command(0x24);
-            for i in range(0, linewidth):
-                self.send_data(image[i + j * linewidth])   
-        self.TurnOnDisplay()
-    
-    def Clear(self, color):
-        if self.width%8 == 0:
-            linewidth = self.width/8
-        else:
-            linewidth = self.width/8 + 1
-
-        self.SetWindows(0, 0, self.width, self.height);
-        for j in range(0, self.height):
-            self.SetCursor(0, j);
-            self.send_command(0x24);
-            for i in range(0, linewidth):
-                self.send_data(color)   
-        self.TurnOnDisplay()
-
-    def sleep(self):
-        self.send_command(0x10) #enter deep sleep
-        self.send_data(0x01)
-        epdconfig.delay_ms(100)
-         
-        epdconfig.module_exit()
-        
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd2in13.pyc


BIN=BIN
Jetson Nano/python2/lib/epd2in13_V2.pyc


+ 0 - 158
Jetson Nano/python2/lib/epd2in13bc.py

@@ -1,158 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd2in13bc.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 104
-EPD_HEIGHT      = 212
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)
-        print("e-Paper busy release")
-
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-            
-        self.reset()
-
-        self.send_command(0x06) # BOOSTER_SOFT_START
-        self.send_data(0x17)
-        self.send_data(0x17)
-        self.send_data(0x17)
-        
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-        
-        self.send_command(0x00) # PANEL_SETTING
-        self.send_data(0x8F)
-        
-        self.send_command(0x50) # VCOM_AND_DATA_INTERVAL_SETTING
-        self.send_data(0xF0)
-        
-        self.send_command(0x61) # RESOLUTION_SETTING
-        self.send_data(self.width & 0xff)
-        self.send_data(self.height >> 8)
-        self.send_data(self.height & 0xff)
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width/8) * self.height
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, imageblack, imagered):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(imageblack[i])
-        self.send_command(0x92)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(imagered[i])
-        self.send_command(0x92)
-        
-        self.send_command(0x12) # REFRESH
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-        self.send_command(0x92) 
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-        self.send_command(0x92)
-        
-        self.send_command(0x12) # REFRESH
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0x02) # POWER_OFF
-        self.ReadBusy()
-        self.send_command(0x07) # DEEP_SLEEP
-        self.send_data(0xA5) # check code
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd2in13bc.pyc


+ 0 - 357
Jetson Nano/python2/lib/epd2in13d.py

@@ -1,357 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd2in13d.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-from PIL import Image
-import RPi.GPIO as GPIO
-
-# Display resolution
-EPD_WIDTH       = 104
-EPD_HEIGHT      = 212
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_vcomDC = [  
-        0x00, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x60, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x00, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00,
-    ]
-
-    lut_ww = [  
-        0x40, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x40, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0xA0, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bw = [  
-        0x40, 0x17, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x0F, 0x0F, 0x00, 0x00, 0x03,
-        0x40, 0x0A, 0x01, 0x00, 0x00, 0x01,
-        0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_wb = [
-        0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bb = [ 
-        0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    
-    lut_vcom1 = [  
-        0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00,
-    ]
-
-    lut_ww1 = [  
-        0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bw1 = [  
-        0x80, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_wb1 = [
-        0x40, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bb1 = [ 
-        0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-        
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            self.send_command(0x71)
-            epdconfig.delay_ms(100)  
-        print("e-Paper busy release")
-        
-    def TurnOnDisplay(self):
-        self.send_command(0x12)
-        epdconfig.delay_ms(10)
-        self.ReadBusy()
-        
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01)	# POWER SETTING
-        self.send_data(0x03)
-        self.send_data(0x00)
-        self.send_data(0x2b)
-        self.send_data(0x2b)
-        self.send_data(0x03)
-
-        self.send_command(0x06)	# boost soft start
-        self.send_data(0x17) # A
-        self.send_data(0x17) # B
-        self.send_data(0x17) # C
-
-        self.send_command(0x04)
-        self.ReadBusy()
-
-        self.send_command(0x00)	# panel setting
-        self.send_data(0xbf) # LUT from OTP,128x296
-        self.send_data(0x0d) # VCOM to 0V fast
-
-        self.send_command(0x30)	# PLL setting
-        self.send_data(0x3a) # 3a 100HZ   29 150Hz 39 200HZ	31 171HZ
-
-        self.send_command(0x61)	# resolution setting
-        self.send_data(self.width)
-        self.send_data((self.height >> 8) & 0xff)
-        self.send_data(self.height& 0xff)
-
-        self.send_command(0x82)	# vcom_DC setting
-        self.send_data(0x28)
-        return 0
-        
-    def SetFullReg(self):
-        self.send_command(0x82)
-        self.send_data(0x00)
-        self.send_command(0X50)
-        self.send_data(0x97)
-        
-        self.send_command(0x20) # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcomDC[count])
-        self.send_command(0x21) # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww[count])
-        self.send_command(0x22) # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw[count])
-        self.send_command(0x23) # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_wb[count])
-        self.send_command(0x24) # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_bb[count])
-    
-    def SetPartReg(self):
-        self.send_command(0x82)
-        self.send_data(0x03)
-        self.send_command(0X50)
-        self.send_data(0x47)
-        
-        self.send_command(0x20) # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcom1[count])
-        self.send_command(0x21) # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww1[count])
-        self.send_command(0x22) # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw1[count])
-        self.send_command(0x23) # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_wb1[count])
-        self.send_command(0x24) # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_bb1[count])
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width/8) * self.height
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print "Vertical"
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print "Horizontal"
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, image):
-        if (Image == None):
-			return
-            
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0x00)
-        epdconfig.delay_ms(10)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(image[i])
-        epdconfig.delay_ms(10)
-        
-        self.SetFullReg()
-        self.TurnOnDisplay()
-        
-    def DisplayPartial(self, image):   
-        if (Image == None):
-			return
-            
-        self.SetPartReg()
-        self.send_command(0x91)
-        self.send_command(0x90)
-        self.send_data(0)
-        self.send_data(self.width - 1)
-
-        self.send_data(0)
-        self.send_data(0)
-        self.send_data(self.height / 256)
-        self.send_data(self.height % 256 - 1)
-        self.send_data(0x28)
-            
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(image[i])
-        epdconfig.delay_ms(10)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(~image[i])
-        epdconfig.delay_ms(10)
-          
-        self.TurnOnDisplay()
-        
-    def Clear(self, color):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0x00)
-        epdconfig.delay_ms(10)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-        epdconfig.delay_ms(10)
-        
-        self.SetFullReg()
-        self.TurnOnDisplay()
-
-    def sleep(self):
-        self.send_command(0X50)
-        self.send_data(0xf7)
-        self.send_command(0X02) # power off
-        self.send_command(0X07) # deep sleep  
-        self.send_data(0xA5)
-
-        epdconfig.module_exit()
-
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd2in13d.pyc


+ 0 - 258
Jetson Nano/python2/lib/epd2in7.py

@@ -1,258 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd2in7.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-19
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 176
-EPD_HEIGHT      = 264
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_vcom_dc = [0x00, 0x00,
-        0x00, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x60, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x00, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-    ]
-    lut_ww = [
-        0x40, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x40, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0xA0, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_bw = [
-        0x40, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x40, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0xA0, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_bb = [
-        0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_wb = [
-        0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):        
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      #  0: idle, 1: busy
-            epdconfig.delay_ms(200)                
-        print("e-Paper busy release")
-
-    def set_lut(self):
-        self.send_command(0x20) # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcom_dc[count])
-        self.send_command(0x21) # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww[count])
-        self.send_command(0x22) # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw[count])
-        self.send_command(0x23) # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_bb[count])
-        self.send_command(0x24) # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_wb[count])
-            
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-            
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01) # POWER_SETTING
-        self.send_data(0x03) # VDS_EN, VDG_EN
-        self.send_data(0x00) # VCOM_HV, VGHL_LV[1], VGHL_LV[0]
-        self.send_data(0x2b) # VDH
-        self.send_data(0x2b) # VDL
-        self.send_data(0x09) # VDHR
-        
-        self.send_command(0x06) # BOOSTER_SOFT_START
-        self.send_data(0x07)
-        self.send_data(0x07)
-        self.send_data(0x17)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x60)
-        self.send_data(0xA5)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x89)
-        self.send_data(0xA5)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x90)
-        self.send_data(0x00)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x93)
-        self.send_data(0x2A)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0xA0)
-        self.send_data(0xA5)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0xA1)
-        self.send_data(0x00)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x73)
-        self.send_data(0x41)
-        
-        self.send_command(0x16) # PARTIAL_DISPLAY_REFRESH
-        self.send_data(0x00)
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-
-        self.send_command(0x00) # PANEL_SETTING
-        self.send_data(0xAF) # KW-BF   KWR-AF    BWROTP 0f
-        
-        self.send_command(0x30) # PLL_CONTROL
-        self.send_data(0x3A) # 3A 100HZ   29 150Hz 39 200HZ    31 171HZ
-        
-        self.send_command(0x82) # VCM_DC_SETTING_REGISTER
-        self.send_data(0x12)
-        self.set_lut()
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width/8) * self.height
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, image):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(image[i])
-        self.send_command(0x12) 
-        self.ReadBusy()
-        
-    def Clear(self, color):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-        self.send_command(0x12) 
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0X50)
-        self.send_data(0xf7)
-        self.send_command(0X02)
-        self.send_command(0X07)
-        self.send_data(0xA5)
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd2in7.pyc


+ 0 - 266
Jetson Nano/python2/lib/epd2in7b.py

@@ -1,266 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd2in7b.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-19
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 176
-EPD_HEIGHT      = 264
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_vcom_dc = [
-        0x00, 0x00,
-        0x00, 0x1A, 0x1A, 0x00, 0x00, 0x01,
-        0x00, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x00, 0x0E, 0x01, 0x0E, 0x01, 0x10,
-        0x00, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x00, 0x04, 0x10, 0x00, 0x00, 0x05,
-        0x00, 0x03, 0x0E, 0x00, 0x00, 0x0A,
-        0x00, 0x23, 0x00, 0x00, 0x00, 0x01
-    ]
-
-    lut_ww = [
-        0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01,
-        0x40, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10,
-        0x80, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x00, 0x04, 0x10, 0x00, 0x00, 0x05,
-        0x00, 0x03, 0x0E, 0x00, 0x00, 0x0A,
-        0x00, 0x23, 0x00, 0x00, 0x00, 0x01
-    ]
-
-    # R22H    r
-    lut_bw = [
-        0xA0, 0x1A, 0x1A, 0x00, 0x00, 0x01,
-        0x00, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10,
-        0x90, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0xB0, 0x04, 0x10, 0x00, 0x00, 0x05,
-        0xB0, 0x03, 0x0E, 0x00, 0x00, 0x0A,
-        0xC0, 0x23, 0x00, 0x00, 0x00, 0x01
-    ]
-
-    # R23H    w
-    lut_bb = [
-        0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01,
-        0x40, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10,
-        0x80, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x00, 0x04, 0x10, 0x00, 0x00, 0x05,
-        0x00, 0x03, 0x0E, 0x00, 0x00, 0x0A,
-        0x00, 0x23, 0x00, 0x00, 0x00, 0x01
-    ]
-    # R24H    b
-    lut_wb = [
-        0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01,
-        0x20, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10,
-        0x10, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x00, 0x04, 0x10, 0x00, 0x00, 0x05,
-        0x00, 0x03, 0x0E, 0x00, 0x00, 0x0A,
-        0x00, 0x23, 0x00, 0x00, 0x00, 0x01
-    ]
-
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)
-        print("e-Paper busy release")
-        
-    def set_lut(self):
-        self.send_command(0x20)               # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcom_dc[count])
-        self.send_command(0x21)         # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww[count])
-        self.send_command(0x22)         # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw[count])
-        self.send_command(0x23)         # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_bb[count])
-        self.send_command(0x24)         # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_wb[count])
-            
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-            
-        self.reset()
-
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-
-        self.send_command(0x00) # PANEL_SETTING
-        self.send_data(0xaf) #KW-BF   KWR-AF    BWROTP 0f
-        
-        self.send_command(0x30) # PLL_CONTROL
-        self.send_data(0x3a) #3A 100HZ   29 150Hz 39 200HZ    31 171HZ
-
-        self.send_command(0x01) # POWER_SETTING
-        self.send_data(0x03) # VDS_EN, VDG_EN
-        self.send_data(0x00) # VCOM_HV, VGHL_LV[1], VGHL_LV[0]
-        self.send_data(0x2b) # VDH
-        self.send_data(0x2b) # VDL
-        self.send_data(0x09) # VDHR
-
-        self.send_command(0x06) # BOOSTER_SOFT_START
-        self.send_data(0x07)
-        self.send_data(0x07)
-        self.send_data(0x17)
-
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x60)
-        self.send_data(0xA5)
-
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x89)
-        self.send_data(0xA5)
-
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x90)
-        self.send_data(0x00)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x93)
-        self.send_data(0x2A)
-
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x73)
-        self.send_data(0x41)
-
-        self.send_command(0x82) # VCM_DC_SETTING_REGISTER
-        self.send_data(0x12)                   
-        self.send_command(0x50) # VCOM_AND_DATA_INTERVAL_SETTING
-        self.send_data(0x87) # define by OTP
-
-        self.set_lut()
-
-        self.send_command(0x16) # PARTIAL_DISPLAY_REFRESH
-        self.send_data(0x00)
-        
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width/8) * self.height
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, imageblack, imagered):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(~imageblack[i])
-        self.send_command(0x11)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(~imagered[i])
-        self.send_command(0x11)
-        
-        self.send_command(0x12) 
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0x00)
-        self.send_command(0x11) 
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0x00)
-        self.send_command(0x11)
-        
-        self.send_command(0x12) 
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0X50)
-        self.send_data(0xf7)
-        self.send_command(0X02)
-        self.send_command(0X07)
-        self.send_data(0xA5)
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd2in7b.pyc


+ 0 - 200
Jetson Nano/python2/lib/epd2in9.py

@@ -1,200 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd2in9.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-19
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 128
-EPD_HEIGHT      = 296
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_full_update = [
-        0x50, 0xAA, 0x55, 0xAA, 0x11, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0xFF, 0xFF, 0x1F, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-    ]
-
-    lut_partial_update  = [
-        0x10, 0x18, 0x18, 0x08, 0x18, 0x18,
-        0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x13, 0x14, 0x44, 0x12,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-    ]
-        
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        while(epdconfig.digital_read(self.busy_pin) == 1):      #  0: idle, 1: busy
-            epdconfig.delay_ms(200) 
-
-    def TurnOnDisplay(self):
-        self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
-        self.send_data(0xC4)
-        self.send_command(0x20) # MASTER_ACTIVATION
-        self.send_command(0xFF) # TERMINATE_FRAME_READ_WRITE
-        
-        print("e-Paper busy")
-        self.ReadBusy()
-        print("e-Paper busy release")  
-
-    def SetWindow(self, x_start, y_start, x_end, y_end):
-        self.send_command(0x44) # SET_RAM_X_ADDRESS_START_END_POSITION
-        # x point must be the multiple of 8 or the last 3 bits will be ignored
-        self.send_data((x_start >> 3) & 0xFF)
-        self.send_data((x_end >> 3) & 0xFF)
-        self.send_command(0x45) # SET_RAM_Y_ADDRESS_START_END_POSITION
-        self.send_data(y_start & 0xFF)
-        self.send_data((y_start >> 8) & 0xFF)
-        self.send_data(y_end & 0xFF)
-        self.send_data((y_end >> 8) & 0xFF)
-
-    def SetCursor(self, x, y):
-        self.send_command(0x4E) # SET_RAM_X_ADDRESS_COUNTER
-        # x point must be the multiple of 8 or the last 3 bits will be ignored
-        self.send_data((x >> 3) & 0xFF)
-        self.send_command(0x4F) # SET_RAM_Y_ADDRESS_COUNTER
-        self.send_data(y & 0xFF)
-        self.send_data((y >> 8) & 0xFF)
-        self.ReadBusy()
-        
-    def init(self, lut):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01) # DRIVER_OUTPUT_CONTROL
-        self.send_data((EPD_HEIGHT - 1) & 0xFF)
-        self.send_data(((EPD_HEIGHT - 1) >> 8) & 0xFF)
-        self.send_data(0x00) # GD = 0 SM = 0 TB = 0
-        
-        self.send_command(0x0C) # BOOSTER_SOFT_START_CONTROL 
-        self.send_data(0xD7)
-        self.send_data(0xD6)
-        self.send_data(0x9D)
-        
-        self.send_command(0x2C) # WRITE_VCOM_REGISTER
-        self.send_data(0xA8) # VCOM 7C
-        
-        self.send_command(0x3A) # SET_DUMMY_LINE_PERIOD
-        self.send_data(0x1A) # 4 dummy lines per gate
-        
-        self.send_command(0x3B) # SET_GATE_TIME
-        self.send_data(0x08) # 2us per line
-        
-        self.send_command(0x11) # DATA_ENTRY_MODE_SETTING
-        self.send_data(0x03) # X increment Y increment
-        
-        self.send_command(0x32) # WRITE_LUT_REGISTER
-        for i in range(0, len(lut)):
-            self.send_data(lut[i])
-        # EPD hardware init end
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width/8) * self.height
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, image):
-        if (image == None):
-            return            
-        self.SetWindow(0, 0, self.width - 1, self.height - 1)
-        for j in range(0, self.height):
-            self.SetCursor(0, j)
-            self.send_command(0x24) # WRITE_RAM
-            for i in range(0, self.width / 8):
-                self.send_data(image[i + j * (self.width / 8)])   
-        self.TurnOnDisplay()
-        
-    def Clear(self, color):
-        self.SetWindow(0, 0, self.width - 1, self.height - 1)
-        for j in range(0, self.height):
-            self.SetCursor(0, j)
-            self.send_command(0x24) # WRITE_RAM
-            for i in range(0, self.width / 8):
-                self.send_data(color)   
-        self.TurnOnDisplay()
-
-    def sleep(self):
-        self.send_command(0x10) # DEEP_SLEEP_MODE
-        self.send_data(0x01)
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd2in9.pyc


+ 0 - 154
Jetson Nano/python2/lib/epd2in9bc.py

@@ -1,154 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd2in9bc.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-19
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 128
-EPD_HEIGHT      = 296
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-        
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      #  0: idle, 1: busy
-            epdconfig.delay_ms(200)                
-        print("e-Paper busy release")
-        
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x06) # boost
-        self.send_data (0x17)
-        self.send_data (0x17)
-        self.send_data (0x17)
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-        self.send_command(0X00) # PANEL_SETTING
-        self.send_data(0x8F)
-        self.send_command(0X50) # VCOM_AND_DATA_INTERVAL_SETTING
-        self.send_data(0x77)
-        self.send_command(0x61) # TCON_RESOLUTION
-        self.send_data (0x80)
-        self.send_data (0x01)
-        self.send_data (0x28)
-        # self.send_command(VCM_DC_SETTING_REGISTER)
-        # self.send_data (0x0A)
-        
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width/8) * self.height
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, blackimage, ryimage): # ryimage: red or yellow image
-        if (blackimage != None):
-            self.send_command(0X10)
-            for i in range(0, self.width * self.height / 8):
-                self.send_data(blackimage[i])        
-        if (ryimage != None):
-            self.send_command(0X13)
-            for i in range(0, self.width * self.height / 8):
-                self.send_data(ryimage[i])
-
-        self.send_command(0x12)
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0X10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xff)
-        self.send_command(0X13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xff)
-
-        self.send_command(0x12)
-        self.ReadBusy()
-        
-    def sleep(self):
-        self.send_command(0X02) # power off
-        self.ReadBusy()
-        self.send_command(0X07) # deep sleep
-        self.send_data(0xA5)
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd2in9bc.pyc


+ 0 - 350
Jetson Nano/python2/lib/epd2in9d.py

@@ -1,350 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd2in9d.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V2.0
-# * | Date        :   2019-06-19
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-from PIL import Image
-import RPi.GPIO as GPIO
-
-# Display resolution
-EPD_WIDTH       = 128
-EPD_HEIGHT      = 296
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_vcomDC = [  
-        0x00, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x60, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x00, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00,
-    ]
-
-    lut_ww = [  
-        0x40, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x40, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0xA0, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bw = [  
-        0x40, 0x17, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x0F, 0x0F, 0x00, 0x00, 0x03,
-        0x40, 0x0A, 0x01, 0x00, 0x00, 0x01,
-        0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_wb = [
-        0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bb = [ 
-        0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    
-    lut_vcom1 = [  
-        0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00,
-    ]
-
-    lut_ww1 = [  
-        0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bw1 = [  
-        0x80, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_wb1 = [
-        0x40, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bb1 = [ 
-        0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-        
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            self.send_command(0x71)
-            epdconfig.delay_ms(100)  
-        print("e-Paper busy release")
-    def TurnOnDisplay(self):
-        self.send_command(0x12)
-        epdconfig.delay_ms(10)
-        self.ReadBusy()
-        
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01)	# POWER SETTING
-        self.send_data(0x03)
-        self.send_data(0x00)
-        self.send_data(0x2b)
-        self.send_data(0x2b)
-        self.send_data(0x03)
-
-        self.send_command(0x06)	# boost soft start
-        self.send_data(0x17) # A
-        self.send_data(0x17) # B
-        self.send_data(0x17) # C
-
-        self.send_command(0x04)
-        self.ReadBusy()
-
-        self.send_command(0x00)	# panel setting
-        self.send_data(0xbf) # LUT from OTP,128x296
-        self.send_data(0x0d) # VCOM to 0V fast
-
-        self.send_command(0x30)	#PLL setting
-        self.send_data(0x3a)     # 3a 100HZ   29 150Hz 39 200HZ	31 171HZ
-
-        self.send_command(0x61)	# resolution setting
-        self.send_data(self.width)
-        self.send_data((self.height >> 8) & 0xff)
-        self.send_data(self.height& 0xff)
-
-        self.send_command(0x82)	# vcom_DC setting
-        self.send_data(0x28)
-        return 0
-        
-    def SetFullReg(self):
-        self.send_command(0x82)
-        self.send_data(0x00)
-        self.send_command(0X50)
-        self.send_data(0x97)
-        
-        self.send_command(0x20)         # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcomDC[count])
-        self.send_command(0x21)         # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww[count])
-        self.send_command(0x22)         # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw[count])
-        self.send_command(0x23)         # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_wb[count])
-        self.send_command(0x24)         # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_bb[count])
-    
-    def SetPartReg(self):
-        self.send_command(0x82)
-        self.send_data(0x03)
-        self.send_command(0X50)
-        self.send_data(0x47)
-        
-        self.send_command(0x20)         # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcom1[count])
-        self.send_command(0x21)         # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww1[count])
-        self.send_command(0x22)         # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw1[count])
-        self.send_command(0x23)         # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_wb1[count])
-        self.send_command(0x24)         # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_bb1[count])
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width/8) * self.height
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, image):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0x00)
-        epdconfig.delay_ms(10)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(image[i])
-        epdconfig.delay_ms(10)
-        
-        self.SetFullReg()
-        self.TurnOnDisplay()
-        
-    def DisplayPartial(self, image):
-        self.SetPartReg()
-        self.send_command(0x91)
-        self.send_command(0x90)
-        self.send_data(0)
-        self.send_data(self.width - 1)
-
-        self.send_data(0)
-        self.send_data(0)
-        self.send_data(self.height / 256)
-        self.send_data(self.height % 256 - 1)
-        self.send_data(0x28)
-            
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(image[i])
-        epdconfig.delay_ms(10)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(~image[i])
-        epdconfig.delay_ms(10)
-          
-        self.TurnOnDisplay()
-        
-    def Clear(self, color):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0x00)
-        epdconfig.delay_ms(10)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-        epdconfig.delay_ms(10)
-        
-        self.SetFullReg()
-        self.TurnOnDisplay()
-
-    def sleep(self):
-        self.send_command(0X50)
-        self.send_data(0xf7)
-        self.send_command(0X02)         #power off
-        self.send_command(0X07)         #deep sleep  
-        self.send_data(0xA5)
-        
-        epdconfig.module_exit()
-
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd2in9d.pyc


+ 0 - 240
Jetson Nano/python2/lib/epd4in2.py

@@ -1,240 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd4in2.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-from PIL import Image
-import RPi.GPIO as GPIO
-
-# Display resolution
-EPD_WIDTH       = 400
-EPD_HEIGHT      = 300
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_vcom0 = [
-    0x00, 0x17, 0x00, 0x00, 0x00, 0x02,        
-    0x00, 0x17, 0x17, 0x00, 0x00, 0x02,        
-    0x00, 0x0A, 0x01, 0x00, 0x00, 0x01,        
-    0x00, 0x0E, 0x0E, 0x00, 0x00, 0x02,        
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,        
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,        
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_ww = [
-    0x40, 0x17, 0x00, 0x00, 0x00, 0x02,
-    0x90, 0x17, 0x17, 0x00, 0x00, 0x02,
-    0x40, 0x0A, 0x01, 0x00, 0x00, 0x01,
-    0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_bw = [
-    0x40, 0x17, 0x00, 0x00, 0x00, 0x02,
-    0x90, 0x17, 0x17, 0x00, 0x00, 0x02,
-    0x40, 0x0A, 0x01, 0x00, 0x00, 0x01,
-    0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_wb = [
-    0x80, 0x17, 0x00, 0x00, 0x00, 0x02,
-    0x90, 0x17, 0x17, 0x00, 0x00, 0x02,
-    0x80, 0x0A, 0x01, 0x00, 0x00, 0x01,
-    0x50, 0x0E, 0x0E, 0x00, 0x00, 0x02,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_bb = [
-    0x80, 0x17, 0x00, 0x00, 0x00, 0x02,
-    0x90, 0x17, 0x17, 0x00, 0x00, 0x02,
-    0x80, 0x0A, 0x01, 0x00, 0x00, 0x01,
-    0x50, 0x0E, 0x0E, 0x00, 0x00, 0x02,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):        
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)    
-
-    def set_lut(self):
-        self.send_command(0x20)               # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcom0[count])
-            
-        self.send_command(0x21)         # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww[count])
-            
-        self.send_command(0x22)         # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw[count])
-            
-        self.send_command(0x23)         # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_bb[count])
-            
-        self.send_command(0x24)         # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_wb[count])
-            
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01) # POWER SETTING
-        self.send_data(0x03) # VDS_EN, VDG_EN
-        self.send_data(0x00) # VCOM_HV, VGHL_LV[1], VGHL_LV[0]
-        self.send_data(0x2b) # VDH
-        self.send_data(0x2b) # VDL
-        
-        self.send_command(0x06) # boost soft start
-        self.send_data(0x17)
-        self.send_data(0x17)
-        self.send_data(0x17)
-        
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-        
-        self.send_command(0x00) # panel setting
-        self.send_data(0xbf) # KW-BF   KWR-AF  BWROTP 0f
-        self.send_data(0x0d)
-        
-        self.send_command(0x30) # PLL setting
-        self.send_data(0x3c) # 3A 100HZ   29 150Hz 39 200HZ  31 171HZ
-
-        self.send_command(0x61)	# resolution setting
-        self.send_data(0x01)
-        self.send_data(0x90) # 128
-        self.send_data(0x01)		
-        self.send_data(0x2c)
-
-        self.send_command(0x82)	# vcom_DC setting
-        self.send_data(0x28)
-
-        self.send_command(0X50)	# VCOM AND DATA INTERVAL SETTING
-        self.send_data(0x97) # 97white border 77black border		VBDF 17|D7 VBDW 97 VBDB 57		VBDF F7 VBDW 77 VBDB 37  VBDR B7
-    
-        self.set_lut()
-        # EPD hardware init end
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width/8) * self.height
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print "Horizontal"
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print "Vertical"
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, image):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-            
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(image[i])
-            
-        self.send_command(0x12) 
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-            
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-            
-        self.send_command(0x12) 
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0x02) # POWER_OFF
-        self.ReadBusy()
-        self.send_command(0x07) # DEEP_SLEEP
-        self.send_data(0XA5)
-        
-        epdconfig.module_exit()
-        
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd4in2.pyc


+ 0 - 147
Jetson Nano/python2/lib/epd4in2bc.py

@@ -1,147 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd4in2bc.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 400
-EPD_HEIGHT      = 300
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy
-            epdconfig.delay_ms(100)
-        print("e-Paper busy release")
-            
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-            
-        self.reset()
-
-        self.send_command(0x06) # BOOSTER_SOFT_START
-        self.send_data (0x17)
-        self.send_data (0x17)
-        self.send_data (0x17) # 07 0f 17 1f 27 2F 37 2f
-        
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-        
-        self.send_command(0x00) # PANEL_SETTING
-        self.send_data(0x0F) # LUT from OTP
-        
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width/8) * self.height
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, imageblack, imagered):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(imageblack[i])
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(imagered[i])
-        
-        self.send_command(0x12) 
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-            
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height / 8):
-            self.send_data(0xFF)
-        
-        self.send_command(0x12) 
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0x02) # POWER_OFF
-        self.ReadBusy()
-        self.send_command(0x07) # DEEP_SLEEP
-        self.send_data(0xA5) # check code
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd4in2bc.pyc


+ 0 - 199
Jetson Nano/python2/lib/epd5in83.py

@@ -1,199 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd5in83.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 600
-EPD_HEIGHT      = 448
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-    
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)    
-        print("e-Paper busy release")
-        
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01) # POWER_SETTING
-        self.send_data(0x37)
-        self.send_data(0x00)
-        
-        self.send_command(0x00) # PANEL_SETTING
-        self.send_data(0xCF)
-        self.send_data(0x08)
-        
-        self.send_command(0x06) # BOOSTER_SOFT_START
-        self.send_data(0xc7)
-        self.send_data(0xcc)
-        self.send_data(0x28)
-        
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-        
-        self.send_command(0x30) # PLL_CONTROL
-        self.send_data(0x3c)
-        
-        self.send_command(0x41) # TEMPERATURE_CALIBRATION
-        self.send_data(0x00)
-        
-        self.send_command(0x50) # VCOM_AND_DATA_INTERVAL_SETTING
-        self.send_data(0x77)
-        
-        self.send_command(0x60) # TCON_SETTING
-        self.send_data(0x22)
-        
-        self.send_command(0x61) # TCON_RESOLUTION
-        self.send_data(0x02) # source 600
-        self.send_data(0x58)
-        self.send_data(0x01) # gate 448
-        self.send_data(0xC0)
-        
-        self.send_command(0x82) # VCM_DC_SETTING
-        self.send_data(0x1E) # decide by LUT file
-        
-        self.send_command(0xe5) # FLASH MODE
-        self.send_data(0x03)
-        
-        # EPD hardware init end
-        return 0
-
-    def getbuffer(self, image):
-        buf = [0x00] * (self.width * self.height / 4)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        print("imwidth = ", imwidth, "imheight = ", imheight)
-        if(imwidth == self.width and imheight == self.height):
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] < 64:           # black
-                        buf[(x + y * self.width) / 4] &= ~(0xC0 >> (x % 4 * 2))
-                    elif pixels[x, y] < 192:     # convert gray to red
-                        buf[(x + y * self.width) / 4] &= ~(0xC0 >> (x % 4 * 2))
-                        buf[(x + y * self.width) / 4] |= 0x40 >> (x % 4 * 2)
-                    else:                           # white
-                        buf[(x + y * self.width) / 4] |= 0xC0 >> (x % 4 * 2)
-        elif(imwidth == self.height and imheight == self.width):
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1                    
-                    if pixels[x, y] < 64:           # black
-                        buf[(newx + newy*self.width) / 4] &= ~(0xC0 >> (y % 4 * 2))
-                    elif pixels[x, y] < 192:     # convert gray to red
-                        buf[(newx + newy*self.width) / 4] &= ~(0xC0 >> (y % 4 * 2))
-                        buf[(newx + newy*self.width) / 4] |= 0x40 >> (y % 4 * 2)
-                    else:                           # white
-                        buf[(newx + newy*self.width) / 4] |= 0xC0 >> (y % 4 * 2)
-        return buf
-
-    def display(self, image):
-        self.send_command(0x10)
-        for i in range(0, self.width / 4 * self.height):
-            temp1 = image[i]
-            j = 0
-            while (j < 4):
-                if ((temp1 & 0xC0) == 0xC0):
-                    temp2 = 0x03
-                elif ((temp1 & 0xC0) == 0x00):
-                    temp2 = 0x00
-                else:
-                    temp2 = 0x04
-                temp2 = (temp2 << 4) & 0xFF
-                temp1 = (temp1 << 2) & 0xFF
-                j += 1
-                if((temp1 & 0xC0) == 0xC0):
-                    temp2 |= 0x03
-                elif ((temp1 & 0xC0) == 0x00):
-                    temp2 |= 0x00
-                else:
-                    temp2 |= 0x04
-                temp1 = (temp1 << 2) & 0xFF
-                self.send_data(temp2)
-                j += 1
-                
-        self.send_command(0x12)
-        epdconfig.delay_ms(100)
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width / 4 * self.height):
-            for j in range(0, 4):
-                self.send_data(0x33)
-        self.send_command(0x12)
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0x02) # POWER_OFF
-        self.ReadBusy()
-        self.send_command(0x07) # DEEP_SLEEP
-        self.send_data(0XA5)
-        
-        epdconfig.module_exit()        
-        
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd5in83.pyc


+ 0 - 199
Jetson Nano/python2/lib/epd5in83bc.py

@@ -1,199 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd5in83b.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 600
-EPD_HEIGHT      = 448
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)
-        print("e-Paper busy release")
-            
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-            
-        self.reset()
-
-        self.send_command(0x01) # POWER_SETTING
-        self.send_data(0x37)
-        self.send_data(0x00)
-        
-        self.send_command(0x00) # PANEL_SETTING
-        self.send_data(0xCF)
-        self.send_data(0x08)
-        
-        self.send_command(0x30) # PLL_CONTROL
-        self.send_data(0x3A) # PLL:  0-15:0x3C, 15+:0x3A
-        self.send_command(0X82) # VCOM VOLTAGE SETTING
-        self.send_data(0x28) # all temperature  range
-
-        self.send_command(0x06) # boost
-        self.send_data(0xc7) 	   	
-        self.send_data(0xcc) 
-        self.send_data(0x15) 
-
-        self.send_command(0X50) # VCOM AND DATA INTERVAL SETTING
-        self.send_data(0x77) 
-
-        self.send_command(0X60) # TCON SETTING
-        self.send_data(0x22) 
-
-        self.send_command(0X65) # FLASH CONTROL
-        self.send_data(0x00)
-
-        self.send_command(0x61) # tres			
-        self.send_data(0x02) # source 600
-        self.send_data(0x58) 
-        self.send_data(0x01) # gate 448
-        self.send_data(0xc0)
-
-        self.send_command(0xe5) # FLASH MODE		   	
-        self.send_data(0x03) 
-        self.send_data(0x03)
-        
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width/8) * self.height
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, imageblack, imagered):
-        self.send_command(0x10)
-        for i in range(0, self.width / 8 * self.height):
-            temp1 = imageblack[i]
-            temp2 = imagered[i]
-            j = 0
-            while (j < 8):
-                if ((temp2 & 0x80) == 0x00):
-                    temp3 = 0x04                #red
-                elif ((temp1 & 0x80) == 0x00):
-                    temp3 = 0x00                #black
-                else:
-                    temp3 = 0x03                #white
-					
-                temp3 = (temp3 << 4) & 0xFF
-                temp1 = (temp1 << 1) & 0xFF
-                temp2 = (temp2 << 1) & 0xFF
-                j += 1
-                if((temp2 & 0x80) == 0x00):
-                    temp3 |= 0x04              #red
-                elif ((temp1 & 0x80) == 0x00):
-                    temp3 |= 0x00              #black
-                else:
-                    temp3 |= 0x03              #white
-                temp1 = (temp1 << 1) & 0xFF
-                temp2 = (temp2 << 1) & 0xFF
-                self.send_data(temp3)
-                j += 1
-                
-        self.send_command(0x04) # POWER ON
-        self.ReadBusy()
-        self.send_command(0x12) # display refresh
-        epdconfig.delay_ms(100)
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width / 8 * self.height):
-            self.send_data(0x33)
-            self.send_data(0x33)
-            self.send_data(0x33)
-            self.send_data(0x33)
-            
-        self.send_command(0x04) # POWER ON
-        self.ReadBusy()
-        self.send_command(0x12) # display refresh
-        epdconfig.delay_ms(100)
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0x02) # POWER_OFF
-        self.ReadBusy()
-        self.send_command(0x07) # DEEP_SLEEP
-        self.send_data(0xA5) # check code
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd5in83bc.pyc


+ 0 - 200
Jetson Nano/python2/lib/epd7in5.py

@@ -1,200 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd7in5.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 640
-EPD_HEIGHT      = 384
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-    
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)    
-        print("e-Paper busy release")
-        
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01) # POWER_SETTING
-        self.send_data(0x37)
-        self.send_data(0x00)
-        
-        self.send_command(0x00) # PANEL_SETTING
-        self.send_data(0xCF)
-        self.send_data(0x08)
-        
-        self.send_command(0x06) # BOOSTER_SOFT_START
-        self.send_data(0xc7)
-        self.send_data(0xcc)
-        self.send_data(0x28)
-        
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-        
-        self.send_command(0x30) # PLL_CONTROL
-        self.send_data(0x3c)
-        
-        self.send_command(0x41) # TEMPERATURE_CALIBRATION
-        self.send_data(0x00)
-        
-        self.send_command(0x50) # VCOM_AND_DATA_INTERVAL_SETTING
-        self.send_data(0x77)
-        
-        self.send_command(0x60) # TCON_SETTING
-        self.send_data(0x22)
-        
-        self.send_command(0x61) # TCON_RESOLUTION
-        self.send_data(EPD_WIDTH >> 8)     #source 640
-        self.send_data(EPD_WIDTH & 0xff)
-        self.send_data(EPD_HEIGHT >> 8)     #gate 384
-        self.send_data(EPD_HEIGHT & 0xff)
-        
-        self.send_command(0x82) # VCM_DC_SETTING
-        self.send_data(0x1E) # decide by LUT file
-        
-        self.send_command(0xe5) # FLASH MODE
-        self.send_data(0x03)
-        
-        # EPD hardware init end
-        return 0
-
-    def getbuffer(self, image):
-        buf = [0x00] * (self.width * self.height / 4)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        print("imwidth = ", imwidth, "imheight = ", imheight)
-        if(imwidth == self.width and imheight == self.height):
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] < 64:           # black
-                        buf[(x + y * self.width) / 4] &= ~(0xC0 >> (x % 4 * 2))
-                    elif pixels[x, y] < 192:     # convert gray to red
-                        buf[(x + y * self.width) / 4] &= ~(0xC0 >> (x % 4 * 2))
-                        buf[(x + y * self.width) / 4] |= 0x40 >> (x % 4 * 2)
-                    else:                           # white
-                        buf[(x + y * self.width) / 4] |= 0xC0 >> (x % 4 * 2)
-        elif(imwidth == self.height and imheight == self.width):
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1                    
-                    if pixels[x, y] < 64:           # black
-                        buf[(newx + newy*self.width) / 4] &= ~(0xC0 >> (y % 4 * 2))
-                    elif pixels[x, y] < 192:     # convert gray to red
-                        buf[(newx + newy*self.width) / 4] &= ~(0xC0 >> (y % 4 * 2))
-                        buf[(newx + newy*self.width) / 4] |= 0x40 >> (y % 4 * 2)
-                    else:                           # white
-                        buf[(newx + newy*self.width) / 4] |= 0xC0 >> (y % 4 * 2)
-        return buf    
-        
-    def display(self, image):
-        self.send_command(0x10)
-        for i in range(0, self.width / 4 * self.height):
-            temp1 = image[i]
-            j = 0
-            while (j < 4):
-                if ((temp1 & 0xC0) == 0xC0):
-                    temp2 = 0x03
-                elif ((temp1 & 0xC0) == 0x00):
-                    temp2 = 0x00
-                else:
-                    temp2 = 0x04
-                temp2 = (temp2 << 4) & 0xFF
-                temp1 = (temp1 << 2) & 0xFF
-                j += 1
-                if((temp1 & 0xC0) == 0xC0):
-                    temp2 |= 0x03
-                elif ((temp1 & 0xC0) == 0x00):
-                    temp2 |= 0x00
-                else:
-                    temp2 |= 0x04
-                temp1 = (temp1 << 2) & 0xFF
-                self.send_data(temp2)
-                j += 1
-                
-        self.send_command(0x12)
-        epdconfig.delay_ms(100)
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width / 4 * self.height):
-            for j in range(0, 4):
-                self.send_data(0x33)
-                
-        self.send_command(0x12)
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0x02) # POWER_OFF
-        self.ReadBusy()
-        
-        self.send_command(0x07) # DEEP_SLEEP
-        self.send_data(0XA5)
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd7in5.pyc


+ 0 - 200
Jetson Nano/python2/lib/epd7in5bc.py

@@ -1,200 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epd7in5bc.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# * | Info        :   python2 demo
-# ******************************************************************************/
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 640
-EPD_HEIGHT      = 384
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)
-        print("e-Paper busy release")
-            
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-            
-        self.reset()
-
-        self.send_command(0x01) # POWER_SETTING
-        self.send_data(0x37)
-        self.send_data(0x00)
-        
-        self.send_command(0x00) # PANEL_SETTING
-        self.send_data(0xCF)
-        self.send_data(0x08)
-        
-        self.send_command(0x30) # PLL_CONTROL
-        self.send_data(0x3A) # PLL:  0-15:0x3C, 15+:0x3A
-        
-        self.send_command(0x82) # VCM_DC_SETTING
-        self.send_data(0x28) #all temperature  range
-
-        self.send_command(0x06) # BOOSTER_SOFT_START
-        self.send_data(0xc7)
-        self.send_data(0xcc)
-        self.send_data(0x15)
-
-        self.send_command(0x50) # VCOM AND DATA INTERVAL SETTING
-        self.send_data(0x77)
-
-        self.send_command(0x60) # TCON_SETTING
-        self.send_data(0x22)
-
-        self.send_command(0x65) # FLASH CONTROL
-        self.send_data(0x00)
-
-        self.send_command(0x61) # TCON_RESOLUTION
-        self.send_data(self.width >> 8) # source 640
-        self.send_data(self.width & 0xff)
-        self.send_data(self.height >> 8) # gate 384
-        self.send_data(self.height & 0xff)
-
-        self.send_command(0xe5) # FLASH MODE
-        self.send_data(0x03)
-        
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width/8) * self.height
-        buf = [0xFF] * ((self.width/8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) / 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, imageblack, imagered):
-        self.send_command(0x10)
-        for i in range(0, self.width / 8 * self.height):
-            temp1 = imageblack[i]
-            temp2 = imagered[i]
-            j = 0
-            while (j < 8):
-                if ((temp2 & 0x80) == 0x00):
-                    temp3 = 0x04                #red
-                elif ((temp1 & 0x80) == 0x00):
-                    temp3 = 0x00                #black
-                else:
-                    temp3 = 0x03                #white
-					
-                temp3 = (temp3 << 4) & 0xFF
-                temp1 = (temp1 << 1) & 0xFF
-                temp2 = (temp2 << 1) & 0xFF
-                j += 1
-                if((temp2 & 0x80) == 0x00):
-                    temp3 |= 0x04              #red
-                elif ((temp1 & 0x80) == 0x00):
-                    temp3 |= 0x00              #black
-                else:
-                    temp3 |= 0x03              #white
-                temp1 = (temp1 << 1) & 0xFF
-                temp2 = (temp2 << 1) & 0xFF
-                self.send_data(temp3)
-                j += 1
-                
-        self.send_command(0x04) # POWER ON
-        self.ReadBusy()
-        self.send_command(0x12) # display refresh
-        epdconfig.delay_ms(100)
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width / 8 * self.height):
-            self.send_data(0x33)
-            self.send_data(0x33)
-            self.send_data(0x33)
-            self.send_data(0x33)
-            
-        self.send_command(0x04) # POWER ON
-        self.ReadBusy()
-        self.send_command(0x12) # display refresh
-        epdconfig.delay_ms(100)
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0x02) # POWER_OFF
-        self.ReadBusy()
-        
-        self.send_command(0x07) # DEEP_SLEEP
-        self.send_data(0XA5)
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

BIN=BIN
Jetson Nano/python2/lib/epd7in5bc.pyc


+ 0 - 97
Jetson Nano/python2/lib/epdconfig.py

@@ -1,97 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epdconfig.py
-# * | Author      :   Waveshare team
-# * | Function    :   Hardware underlying interface
-# * | Info        :
-# *----------------
-# * | This version:   V1.0
-# * | Date        :   2019-06-06
-# * | Info        :   
-# ******************************************************************************
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import Jetson.GPIO as GPIO
-import time
-
-import ctypes
-# import spidev
-
-# Pin definition
-RST_PIN         = 17
-DC_PIN          = 25
-CS_PIN          = 8
-BUSY_PIN        = 24
-
-# SPI device, bus = 0, device = 0
-# SPI = spidev.SpiDev(0, 0)
-
-clib = ctypes.cdll.LoadLibrary
-spi = clib('../lib/sysfs_software_spi.so')
-# gpio2 = clib('../lib/sysfs_gpio.so')
-
-def digital_write(pin, value):
-    GPIO.output(pin, value)
-
-def digital_read(pin):
-    return GPIO.input(BUSY_PIN)
-    # return gpio2.SYSFS_GPIO_Read(15)
-    
-def delay_ms(delaytime):
-    time.sleep(delaytime / 1000.0)
-
-def spi_writebyte(data):
-    # SPI.writebytes(data)
-    spi.SYSFS_software_spi_transfer(data[0])
-
-def module_init():
-    # print("module_init")
-    GPIO.setmode(GPIO.BCM)
-    GPIO.setwarnings(False)
-    # print("RST_PIN")
-    GPIO.setup(RST_PIN, GPIO.OUT)
-    # print("DC_PIN")
-    GPIO.setup(DC_PIN, GPIO.OUT)
-    # print("CS_PIN")
-    GPIO.setup(CS_PIN, GPIO.OUT)
-    # print("BUSY_PIN")
-    GPIO.setup(BUSY_PIN, GPIO.IN)
-    # SPI.max_speed_hz = 2000000
-    # SPI.mode = 0b00
-    
-    # gpio2.SYSFS_GPIO_Export(15)
-    # gpio2.SYSFS_GPIO_Direction(15, 0)
-    
-    spi.SYSFS_software_spi_begin()
-    return 0
-
-    
-def module_exit():
-    print("spi end")
-    spi.SYSFS_software_spi_end()
-    
-    print("close 5V, Module enters 0 power consumption ...")
-    GPIO.output(RST_PIN, 0)
-    GPIO.output(DC_PIN, 0)
-    
-    GPIO.cleanup()
-    
-    
-
-### END OF FILE ###

BIN=BIN
Jetson Nano/python2/lib/epdconfig.pyc


+ 0 - 52
Jetson Nano/python2/readme_CN.txt

@@ -1,52 +0,0 @@
-/*****************************************************************************
-* | File      	:   Readme_CN.txt
-* | Author      :   Waveshare team
-* | Function    :   Help with use
-* | Info        :
-*----------------
-* |	This version:   V1.0
-* | Date        :   2019-06-20
-* | Info        :   在这里提供一个中文版本的使用文档,以便你的快速使用
-******************************************************************************/
-这个文件是帮助您使用本例程。
-由于我们的墨水屏越来越多,不便于我们的维护,因此把所有的墨水屏程序做成一个工程。
-在这里简略的描述本工程的使用:
-
-1.基本信息:
-本例程是基于jetson-nano-sd-r32.1-2019-03-18系统镜像而开发的,由于目前的系统是没有硬件SPI的,
-目前采用模拟SPI进行开发的,因此墨水屏的刷新速度较慢;
-本例程是基于Jetson Nano进行开发的,例程均在Jetson Nano上进行了验证;
-本例程使用e-paper Driver HAT模块进行了验证,你可以在工程的examples\中查看对应的测试例程;
-
-2.管脚连接:
-管脚连接你可以在\lib\epdconfig.py中查看,这里也再重述一次:
-EPD    =>    Jetson Nano/RPI(BCM)
-VCC    ->    3.3
-GND    ->    GND
-DIN    ->    10(SPI0_MOSI)
-CLK    ->    11(SPI0_SCK)
-CS     ->    8(SPI0_CS0)
-DC     ->    25
-RST    ->    17
-BUSY   ->    24
-
-3.安装库:
-    sudo apt-get update
-    sudo apt-get install python3-pip
-    sudo apt-get install python3-pil
-    sudo apt-get install python3-numpy
-    sudo pip3 install Jetson.GPIO
-
-4.基本使用:
-由于本工程是一个综合工程,对于使用而言,你可能需要阅读以下内容:
-你可以在examples\目录中查看测试程序
-请注意你购买的是哪一款的墨水屏。
-栗子1:
-    如果你购买的5.83inch e-paper,那么你应该执行命令:
-    sudo python epd_5in83_test.py
-栗子2:
-    如果你购买的2.9inch e-paper (B),由于2.9寸的B型和C型是公用的驱动代码,
-    那么你应该执行命令:
-    sudo python epd_2in9bc_test.py
-    
-注意:对于epd_1in54_V2_test.py和epd_2in13_V2_test.py请注意你的屏幕背面是否贴有V2标识。

+ 0 - 56
Jetson Nano/python2/readme_EN.txt

@@ -1,56 +0,0 @@
-/*****************************************************************************
-* | File      	:   Readme_CN.txt
-* | Author      :   Waveshare team
-* | Function    :   Help with use
-* | Info        :
-*----------------
-* |	This version:   V1.0
-* | Date        :   2019-06-20
-* | Info        :   Here is an English version of the documentation for your quick use.
-******************************************************************************/
-This file is to help you use this routine.
-Since our ink screens are getting more and more, it is not convenient for our maintenance, so all the ink screen programs are made into one project.
-A brief description of the use of this project is here:
-
-1. Basic information:
-This routine was developed based on the jetson-nano-sd-r32.1-2019-03-18 system 
-image. Since the current system does not have a hardware SPI,Currently developed 
-with analog SPI, so the ink screen refresh rate is slower;
-This routine was developed based on the Jetson Nano and the routines were 
-verified on the Jetson Nano;
-This routine has been verified using the e-paper Driver HAT module. 
-You can view the corresponding test routines in the examples\ 
-of the project.
-
-2. Pin connection:
-Pin connections can be viewed in \lib\epdconfig.py and will be repeated here:
-EPD    =>    Jetson Nano/RPI(BCM)
-VCC    ->    3.3
-GND    ->    GND
-DIN    ->    10(SPI0_MOSI)
-CLK    ->    11(SPI0_SCK)
-CS     ->    8(SPI0_CS0)
-DC     ->    25
-RST    ->    17
-BUSY   ->    24
-
-3.Installation library
-    sudo apt-get update
-    sudo apt-get install python3-pip
-    sudo apt-get install python3-pil
-    sudo apt-get install python3-numpy
-    sudo pip3 install Jetson.GPIO
-
-4. Basic use:
-Since this project is a comprehensive project, you may need to read the following for use:
-You can view the test program in the examples\ directory.
-Please note which ink screen you purchased.
-Chestnut 1:
-     If you purchased 5.83inch e-paper, then you should execute the command:
-     Sudo python epd_5in83_test.py
-Chestnut 2:
-     If you buy a 2.9inch e-paper (B), since the 2.9-inch Type B and Type C are common driver codes,
-     Then you should execute the command:
-     Sudo python epd_2in9bc_test.py
-    
-Note: For epd_1in54_V2_test.py and epd_2in13_V2_test.py, please note that the V2 logo is attached to the back of your screen.

+ 0 - 87
Jetson Nano/python3/examples/epd_1in54_V2_test.py

@@ -1,87 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd1in54_V2
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd1in54_V2 Demo")
-    
-    epd = epd1in54_V2.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear(0xFF)
-    time.sleep(1)
-    
-    # Drawing on the image
-    print("1.Drawing on the image...")
-    image = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    
-    draw = ImageDraw.Draw(image)
-    font = ImageFont.truetype('../lib/Font.ttc', 24)
-    draw.rectangle((0, 10, 200, 34), fill = 0)
-    draw.text((8, 12), 'hello world', font = font, fill = 255)
-    draw.text((8, 36), u'微雪电子', font = font, fill = 0)
-    draw.line((16, 60, 56, 60), fill = 0)
-    draw.line((56, 60, 56, 110), fill = 0)
-    draw.line((16, 110, 56, 110), fill = 0)
-    draw.line((16, 110, 16, 60), fill = 0)
-    draw.line((16, 60, 56, 110), fill = 0)
-    draw.line((56, 60, 16, 110), fill = 0)
-    draw.arc((90, 60, 150, 120), 0, 360, fill = 0)
-    draw.rectangle((16, 130, 56, 180), fill = 0)
-    draw.chord((90, 130, 150, 190), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(image.rotate(90)))
-    time.sleep(2)
-    
-    # read bmp file 
-    print("2.read bmp file...")
-    image = Image.open('../pic/1in54.bmp')
-    epd.display(epd.getbuffer(image))
-    time.sleep(2)
-    
-    # read bmp file on window
-    print("3.read bmp file on window...")
-    epd.Clear(0xFF)
-    image1 = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    image1.paste(bmp, (50,50))    
-    epd.display(epd.getbuffer(image1))
-    time.sleep(2)
-    
-    # partial update
-    print("4.show time...")    
-    time_image = Image.new('1', (epd.width, epd.height), 255)
-    epd.displayPartBaseImage(epd.getbuffer(time_image))
-    
-    time_draw = ImageDraw.Draw(time_image)
-    num = 0
-    while (True):
-        time_draw.rectangle((10, 10, 120, 50), fill = 255)
-        time_draw.text((10, 10), time.strftime('%H:%M:%S'), font = font, fill = 0)
-        newimage = time_image.crop([10, 10, 120, 50])
-        time_image.paste(newimage, (10,10))  
-        epd.displayPart(epd.getbuffer(time_image))
-        num = num + 1
-        if(num == 10):
-            break
-    
-    print("Clear...")
-    epd.init()
-    epd.Clear(0xFF)
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 87
Jetson Nano/python3/examples/epd_1in54_test.py

@@ -1,87 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd1in54
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd1in54 Demo")
-    
-    epd = epd1in54.EPD()
-    print("init and Clear")
-    epd.init(epd.lut_full_update)
-    epd.Clear(0xFF)
-    
-    # Drawing on the image
-    print("1.Drawing on the image...")
-    image = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    
-    draw = ImageDraw.Draw(image)
-    font = ImageFont.truetype('../lib/Font.ttc', 24)
-    draw.rectangle((0, 10, 200, 34), fill = 0)
-    draw.text((8, 12), 'hello world', font = font, fill = 255)
-    draw.text((8, 36), u'微雪电子', font = font, fill = 0)
-    draw.line((16, 60, 56, 60), fill = 0)
-    draw.line((56, 60, 56, 110), fill = 0)
-    draw.line((16, 110, 56, 110), fill = 0)
-    draw.line((16, 110, 16, 60), fill = 0)
-    draw.line((16, 60, 56, 110), fill = 0)
-    draw.line((56, 60, 16, 110), fill = 0)
-    draw.arc((90, 60, 150, 120), 0, 360, fill = 0)
-    draw.rectangle((16, 130, 56, 180), fill = 0)
-    draw.chord((90, 130, 150, 190), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(image.rotate(90)))
-    time.sleep(2)
-    
-    # read bmp file 
-    print("2.read bmp file...")
-    image = Image.open('../pic/1in54.bmp')
-    epd.display(epd.getbuffer(image))
-    time.sleep(2)
-    
-    # read bmp file on window
-    print("3.read bmp file on window...")
-    epd.Clear(0xFF)
-    image1 = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    image1.paste(bmp, (50,50))    
-    epd.display(epd.getbuffer(image1))
-    time.sleep(2)
-    
-    # # partial update
-    print("4.show time...")
-    epd.init(epd.lut_partial_update)    
-    epd.Clear(0xFF)
-    
-    time_image = Image.new('1', (epd.width, epd.height), 255)
-    time_draw = ImageDraw.Draw(time_image)
-    num = 0
-    while (True):
-        time_draw.rectangle((10, 10, 120, 50), fill = 255)
-        time_draw.text((10, 10), time.strftime('%H:%M:%S'), font = font, fill = 0)
-        newimage = time_image.crop([10, 10, 120, 50])
-        time_image.paste(newimage, (10,10))  
-        epd.display(epd.getbuffer(time_image))
-        num = num + 1
-        if(num == 10):
-            break
-    
-    print("Clear...")
-    epd.init(epd.lut_full_update)
-    epd.Clear(0xFF)
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 72
Jetson Nano/python3/examples/epd_1in54c_test.py

@@ -1,72 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd1in54c
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd1in54c Demo")
-    
-    epd = epd1in54c.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    time.sleep(1)
-    
-    # Drawing on the image
-    print("1.Drawing on the image...")
-    blackimage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    yellowimage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    
-    font = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    drawblack = ImageDraw.Draw(blackimage)
-    drawyellow = ImageDraw.Draw(yellowimage)
-    drawblack.rectangle((0, 10, 200, 34), fill = 0)
-    drawblack.text((8, 12), 'hello world', font = font, fill = 255)
-    drawblack.text((8, 36), u'微雪电子', font = font, fill = 0)
-    drawblack.line((10, 100, 70, 100), fill = 0)
-    drawblack.line((40, 70, 40, 130), fill = 0)
-    
-    drawyellow.rectangle((10, 70, 70, 130), outline = 0)    
-    drawyellow.arc((80, 70, 140, 130), 0, 360, fill = 0)
-    drawyellow.chord((90, 80, 130, 120), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(blackimage),epd.getbuffer(yellowimage))
-    time.sleep(1)
-    
-    # read bmp file 
-    print("2.read bmp file...")
-    blackimage = Image.open('../pic/1in54c-b.bmp')
-    yellowimage = Image.open('../pic/1in54c-y.bmp')    
-    epd.display(epd.getbuffer(blackimage),epd.getbuffer(yellowimage))
-    time.sleep(1)
-    
-    # read bmp file on window
-    print("3.read bmp file on window...")
-    blackimage1 = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    yellowimage2 = Image.new('1', (epd.width, epd.height), 255)
-    
-    newimage = Image.open('../pic/100x100.bmp')
-    blackimage1.paste(newimage, (50,50))    
-    epd.display(epd.getbuffer(blackimage1), epd.getbuffer(yellowimage2))
-    
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 83
Jetson Nano/python3/examples/epd_2in13d_test.py

@@ -1,83 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd2in13d
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd2in13d Demo")
-    
-    epd = epd2in13d.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear(0xFF)
-    
-    font15 = ImageFont.truetype('../lib/Font.ttc', 15)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...")
-    Himage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Himage)
-    draw.rectangle([(0,0),(50,50)],outline = 0)
-    draw.rectangle([(55,0),(100,50)],fill = 0)
-    draw.line([(0,0),(50,50)], fill = 0,width = 1)
-    draw.line([(0,50),(50,0)], fill = 0,width = 1)
-    draw.chord((10, 60, 50, 100), 0, 360, fill = 0)
-    draw.ellipse((55, 60, 95, 100), outline = 0)
-    draw.pieslice((55, 60, 95, 100), 90, 180, outline = 0)
-    draw.pieslice((55, 60, 95, 100), 270, 360, fill = 0)
-    draw.polygon([(110,0),(110,50),(150,25)],outline = 0)
-    draw.polygon([(190,0),(190,50),(150,25)],fill = 0)
-    draw.text((110, 60), 'e-Paper demo', font = font15, fill = 0)
-    draw.text((110, 80), u'微雪电子', font = font15, fill = 0)
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-        
-    print("3.read bmp file")
-    Himage = Image.open('../pic/2in13d.bmp')
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    Himage2 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    Himage2.paste(bmp, (20,20))
-    epd.display(epd.getbuffer(Himage2))
-    time.sleep(2)
-    
-    # # partial update
-    print("5.show time...")
-    epd.init()    
-    epd.Clear(0xFF)
-    
-    time_image = Image.new('1', (epd.width, epd.height), 255)
-    time_draw = ImageDraw.Draw(time_image)
-    num = 0
-    while (True):
-        time_draw.rectangle((10, 10, 120, 50), fill = 255)
-        time_draw.text((10, 10), time.strftime('%H:%M:%S'), font = font24, fill = 0)
-        newimage = time_image.crop([10, 10, 120, 50])
-        time_image.paste(newimage, (10,10))  
-        epd.DisplayPartial(epd.getbuffer(time_image))
-        num = num + 1
-        if(num == 10):
-            break
-    
-    print("Clear...")
-    epd.Clear(0xFF)
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 98
Jetson Nano/python3/examples/epd_2in7b_test.py

@@ -1,98 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd2in7b
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd2in7b Demo")
-    
-    epd = epd2in7b.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    time.sleep(1)
-    
-    # Drawing on the image
-    print("Drawing")
-    blackimage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    redimage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...")
-    HBlackimage = Image.new('1', (epd.height, epd.width), 255)  # 298*126
-    HRedimage = Image.new('1', (epd.height, epd.width), 255)  # 298*126    
-    
-    drawblack = ImageDraw.Draw(HBlackimage)
-    drawred = ImageDraw.Draw(HRedimage)
-    drawblack.text((10, 0), 'hello world', font = font24, fill = 0)
-    drawblack.text((10, 20), '2.9inch e-Paper', font = font24, fill = 0)
-    drawblack.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    drawblack.line((20, 50, 70, 100), fill = 0)
-    drawblack.line((70, 50, 20, 100), fill = 0)
-    drawblack.rectangle((20, 50, 70, 100), outline = 0)    
-    drawred.line((165, 50, 165, 100), fill = 0)
-    drawred.line((140, 75, 190, 75), fill = 0)
-    drawred.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    drawred.rectangle((80, 50, 130, 100), fill = 0)
-    drawred.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRedimage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    LBlackimage = Image.new('1', (epd.width, epd.height), 255)  # 126*298
-    LRedimage = Image.new('1', (epd.width, epd.height), 255)  # 126*298
-    drawblack = ImageDraw.Draw(LBlackimage)
-    drawred = ImageDraw.Draw(LRedimage)
-    
-    drawblack.text((2, 0), 'hello world', font = font18, fill = 0)
-    drawblack.text((2, 20), '2.9inch epd', font = font18, fill = 0)
-    drawblack.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    drawblack.line((10, 90, 60, 140), fill = 0)
-    drawblack.line((60, 90, 10, 140), fill = 0)
-    drawblack.rectangle((10, 90, 60, 140), outline = 0)
-    drawred.line((95, 90, 95, 140), fill = 0)
-    drawred.line((70, 115, 120, 115), fill = 0)
-    drawred.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    drawred.rectangle((10, 150, 60, 200), fill = 0)
-    drawred.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(LBlackimage), epd.getbuffer(LRedimage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    HBlackimage = Image.open('../pic/2in7b-b.bmp')
-    HRedimage = Image.open('../pic/2in7b-r.bmp')
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRedimage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    blackimage1 = Image.new('1', (epd.height, epd.width), 255)  # 298*126
-    redimage1 = Image.new('1', (epd.height, epd.width), 255)  # 298*126    
-    newimage = Image.open('../pic/100x100.bmp')
-    blackimage1.paste(newimage, (50,10))    
-    epd.display(epd.getbuffer(blackimage1), epd.getbuffer(redimage1))
-    
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 102
Jetson Nano/python3/examples/epd_2in9_test.py

@@ -1,102 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd2in9
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd2in9 Demo")
-    
-    epd = epd2in9.EPD()
-    print("init and Clear")
-    epd.init(epd.lut_full_update)
-    epd.Clear(0xFF)
-    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...")
-    Himage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Himage)
-    draw.text((10, 0), 'hello world', font = font24, fill = 0)
-    draw.text((10, 20), '2.9inch e-Paper', font = font24, fill = 0)
-    draw.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    draw.line((20, 50, 70, 100), fill = 0)
-    draw.line((70, 50, 20, 100), fill = 0)
-    draw.rectangle((20, 50, 70, 100), outline = 0)
-    draw.line((165, 50, 165, 100), fill = 0)
-    draw.line((140, 75, 190, 75), fill = 0)
-    draw.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    draw.rectangle((80, 50, 130, 100), fill = 0)
-    draw.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    Limage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Limage)
-    draw.text((2, 0), 'hello world', font = font18, fill = 0)
-    draw.text((2, 20), '2.9inch epd', font = font18, fill = 0)
-    draw.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    draw.line((10, 90, 60, 140), fill = 0)
-    draw.line((60, 90, 10, 140), fill = 0)
-    draw.rectangle((10, 90, 60, 140), outline = 0)
-    draw.line((95, 90, 95, 140), fill = 0)
-    draw.line((70, 115, 120, 115), fill = 0)
-    draw.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    draw.rectangle((10, 150, 60, 200), fill = 0)
-    draw.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Limage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    Himage = Image.open('../pic/2in9.bmp')
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    Himage2 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    Himage2.paste(bmp, (50,10))
-    epd.display(epd.getbuffer(Himage2))
-    time.sleep(2)
-    
-    # partial update
-    print("5.show time")
-    epd.init(epd.lut_partial_update)    
-    epd.Clear(0xFF)
-    time_image = Image.new('1', (epd.height, epd.width), 255)
-    time_draw = ImageDraw.Draw(time_image)
-    num = 0
-    while (True):
-        time_draw.rectangle((10, 10, 120, 50), fill = 255)
-        time_draw.text((10, 10), time.strftime('%H:%M:%S'), font = font24, fill = 0)
-        newimage = time_image.crop([10, 10, 120, 50])
-        time_image.paste(newimage, (10,10))  
-        epd.display(epd.getbuffer(time_image))
-        
-        num = num + 1
-        if(num == 10):
-            break
-            
-    print("Clear...")
-    epd.init(epd.lut_full_update)
-    epd.Clear(0xFF)
-    
-    print("Goto Sleep...")
-    epd.sleep()
-    
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 101
Jetson Nano/python3/examples/epd_2in9d_test.py

@@ -1,101 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd2in9d
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd2in9d Demo")
-    
-    epd = epd2in9d.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear(0xFF)
-    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...")
-    Himage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Himage)
-    draw.text((10, 0), 'hello world', font = font24, fill = 0)
-    draw.text((10, 20), '2.9inch e-Paper d', font = font24, fill = 0)
-    draw.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    draw.line((20, 50, 70, 100), fill = 0)
-    draw.line((70, 50, 20, 100), fill = 0)
-    draw.rectangle((20, 50, 70, 100), outline = 0)
-    draw.line((165, 50, 165, 100), fill = 0)
-    draw.line((140, 75, 190, 75), fill = 0)
-    draw.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    draw.rectangle((80, 50, 130, 100), fill = 0)
-    draw.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    Limage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Limage)
-    draw.text((2, 0), 'hello world', font = font18, fill = 0)
-    draw.text((2, 20), '2.9inch epd d', font = font18, fill = 0)
-    draw.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    draw.line((10, 90, 60, 140), fill = 0)
-    draw.line((60, 90, 10, 140), fill = 0)
-    draw.rectangle((10, 90, 60, 140), outline = 0)
-    draw.line((95, 90, 95, 140), fill = 0)
-    draw.line((70, 115, 120, 115), fill = 0)
-    draw.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    draw.rectangle((10, 150, 60, 200), fill = 0)
-    draw.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Limage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    Himage = Image.open('../pic/2in9d.bmp')
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    Himage2 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    Himage2.paste(bmp, (50,10))
-    epd.display(epd.getbuffer(Himage2))
-    time.sleep(2)
-    
-    # # partial update
-    print("5.show time...")
-    epd.init()    
-    epd.Clear(0xFF)
-    
-    time_image = Image.new('1', (epd.width, epd.height), 255)
-    time_draw = ImageDraw.Draw(time_image)
-    num = 0
-    while (True):
-        time_draw.rectangle((10, 10, 120, 50), fill = 255)
-        time_draw.text((10, 10), time.strftime('%H:%M:%S'), font = font24, fill = 0)
-        newimage = time_image.crop([10, 10, 120, 50])
-        time_image.paste(newimage, (10,10))  
-        epd.display(epd.getbuffer(time_image))
-        num = num + 1
-        if(num == 10):
-            break
-    
-    print("Clear...")
-    epd.Clear(0xFF)
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 84
Jetson Nano/python3/examples/epd_4in2_test.py

@@ -1,84 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd4in2
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd4in2 Demo")
-    
-    epd = epd4in2.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...")
-    Himage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Himage)
-    draw.text((10, 0), 'hello world', font = font24, fill = 0)
-    draw.text((10, 20), '4.2inch e-Paper', font = font24, fill = 0)
-    draw.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    draw.line((20, 50, 70, 100), fill = 0)
-    draw.line((70, 50, 20, 100), fill = 0)
-    draw.rectangle((20, 50, 70, 100), outline = 0)
-    draw.line((165, 50, 165, 100), fill = 0)
-    draw.line((140, 75, 190, 75), fill = 0)
-    draw.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    draw.rectangle((80, 50, 130, 100), fill = 0)
-    draw.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    Limage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Limage)
-    draw.text((2, 0), 'hello world', font = font18, fill = 0)
-    draw.text((2, 20), '4.2inch epd', font = font18, fill = 0)
-    draw.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    draw.line((10, 90, 60, 140), fill = 0)
-    draw.line((60, 90, 10, 140), fill = 0)
-    draw.rectangle((10, 90, 60, 140), outline = 0)
-    draw.line((95, 90, 95, 140), fill = 0)
-    draw.line((70, 115, 120, 115), fill = 0)
-    draw.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    draw.rectangle((10, 150, 60, 200), fill = 0)
-    draw.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Limage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    Himage = Image.open('../pic/4in2.bmp')
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    Himage2 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    Himage2.paste(bmp, (50,10))
-    epd.display(epd.getbuffer(Himage2))
-    time.sleep(2)
-
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-    
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 95
Jetson Nano/python3/examples/epd_4in2bc_test.py

@@ -1,95 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd4in2bc
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd4in2bc Demo")
-    
-    epd = epd4in2bc.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    time.sleep(1)
-    
-    # Drawing on the image
-    print("Drawing")    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...") 
-    HBlackimage = Image.new('1', (epd.width, epd.height), 255)  # 298*126
-    HRYimage = Image.new('1', (epd.width, epd.height), 255)  # 298*126  ryimage: red or yellow image  
-    drawblack = ImageDraw.Draw(HBlackimage)
-    drawry = ImageDraw.Draw(HRYimage)
-    drawblack.text((10, 0), 'hello world', font = font24, fill = 0)
-    drawblack.text((10, 20), '4.2inch e-Paper bc', font = font24, fill = 0)
-    drawblack.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    drawblack.line((20, 50, 70, 100), fill = 0)
-    drawblack.line((70, 50, 20, 100), fill = 0)
-    drawblack.rectangle((20, 50, 70, 100), outline = 0)    
-    drawry.line((165, 50, 165, 100), fill = 0)
-    drawry.line((140, 75, 190, 75), fill = 0)
-    drawry.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    drawry.rectangle((80, 50, 130, 100), fill = 0)
-    drawry.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    LBlackimage = Image.new('1', (epd.height, epd.width), 255)  # 126*298
-    LRYimage = Image.new('1', (epd.height, epd.width), 255)  # 126*298
-    drawblack = ImageDraw.Draw(LBlackimage)
-    drawry = ImageDraw.Draw(LRYimage)
-    
-    drawblack.text((2, 0), 'hello world', font = font18, fill = 0)
-    drawblack.text((2, 20), '4.2inch epd bc', font = font18, fill = 0)
-    drawblack.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    drawblack.line((10, 90, 60, 140), fill = 0)
-    drawblack.line((60, 90, 10, 140), fill = 0)
-    drawblack.rectangle((10, 90, 60, 140), outline = 0)
-    drawry.line((95, 90, 95, 140), fill = 0)
-    drawry.line((70, 115, 120, 115), fill = 0)
-    drawry.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    drawry.rectangle((10, 150, 60, 200), fill = 0)
-    drawry.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(LBlackimage), epd.getbuffer(LRYimage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    HBlackimage = Image.open('../pic/4in2b-b.bmp')
-    HRYimage = Image.open('../pic/4in2b-r.bmp')
-    # HBlackimage = Image.open('../pic/4in2c-b.bmp')
-    # HRYimage = Image.open('../pic/4in2c-y.bmp')
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    blackimage1 = Image.new('1', (epd.width, epd.height), 255)  # 298*126
-    redimage1 = Image.new('1', (epd.width, epd.height), 255)  # 298*126    
-    newimage = Image.open('../pic/100x100.bmp')
-    blackimage1.paste(newimage, (50,10))    
-    epd.display(epd.getbuffer(blackimage1), epd.getbuffer(redimage1))
-    
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 84
Jetson Nano/python3/examples/epd_5in83_test.py

@@ -1,84 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd5in83
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd5in83 Demo")
-    
-    epd = epd5in83.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...")
-    Himage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Himage)
-    draw.text((10, 0), 'hello world', font = font24, fill = 0)
-    draw.text((10, 20), '5.83inch e-Paper', font = font24, fill = 0)
-    draw.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    draw.line((20, 50, 70, 100), fill = 0)
-    draw.line((70, 50, 20, 100), fill = 0)
-    draw.rectangle((20, 50, 70, 100), outline = 0)
-    draw.line((165, 50, 165, 100), fill = 0)
-    draw.line((140, 75, 190, 75), fill = 0)
-    draw.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    draw.rectangle((80, 50, 130, 100), fill = 0)
-    draw.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    Limage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Limage)
-    draw.text((2, 0), 'hello world', font = font18, fill = 0)
-    draw.text((2, 20), '5.83inch epd', font = font18, fill = 0)
-    draw.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    draw.line((10, 90, 60, 140), fill = 0)
-    draw.line((60, 90, 10, 140), fill = 0)
-    draw.rectangle((10, 90, 60, 140), outline = 0)
-    draw.line((95, 90, 95, 140), fill = 0)
-    draw.line((70, 115, 120, 115), fill = 0)
-    draw.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    draw.rectangle((10, 150, 60, 200), fill = 0)
-    draw.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Limage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    Himage = Image.open('../pic/5in83.bmp')
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    Himage2 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    bmp = Image.open('../pic/100x100.bmp')
-    Himage2.paste(bmp, (50,10))
-    epd.display(epd.getbuffer(Himage2))
-    time.sleep(2)
-
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-    
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

+ 0 - 93
Jetson Nano/python3/examples/epd_5in83bc_test.py

@@ -1,93 +0,0 @@
-#!/usr/bin/python
-# -*- coding:utf-8 -*-
-import sys
-sys.path.append(r'../lib')
-
-import epd5in83bc
-import epdconfig
-import time
-from PIL import Image,ImageDraw,ImageFont
-import traceback
-
-try:
-    print("epd5in83bc Demo")
-    
-    epd = epd5in83bc.EPD()
-    print("init and Clear")
-    epd.init()
-    epd.Clear()
-    time.sleep(1)
-    
-    # Drawing on the image
-    print("Drawing")    
-    font24 = ImageFont.truetype('../lib/Font.ttc', 24)
-    font18 = ImageFont.truetype('../lib/Font.ttc', 18)
-    
-    # Drawing on the Horizontal image
-    print("1.Drawing on the Horizontal image...") 
-    HBlackimage = Image.new('1', (epd.width, epd.height), 255)  # 298*126
-    HRYimage = Image.new('1', (epd.width, epd.height), 255)  # 298*126  ryimage: red or yellow image  
-    drawblack = ImageDraw.Draw(HBlackimage)
-    drawry = ImageDraw.Draw(HRYimage)
-    drawblack.text((10, 0), 'hello world', font = font24, fill = 0)
-    drawblack.text((10, 20), '5.83inch e-Paper bc', font = font24, fill = 0)
-    drawblack.text((150, 0), u'微雪电子', font = font24, fill = 0)    
-    drawblack.line((20, 50, 70, 100), fill = 0)
-    drawblack.line((70, 50, 20, 100), fill = 0)
-    drawblack.rectangle((20, 50, 70, 100), outline = 0)    
-    drawry.line((165, 50, 165, 100), fill = 0)
-    drawry.line((140, 75, 190, 75), fill = 0)
-    drawry.arc((140, 50, 190, 100), 0, 360, fill = 0)
-    drawry.rectangle((80, 50, 130, 100), fill = 0)
-    drawry.chord((200, 50, 250, 100), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    # Drawing on the Vertical image
-    print("2.Drawing on the Vertical image...")
-    LBlackimage = Image.new('1', (epd.height, epd.width), 255)  # 126*298
-    LRYimage = Image.new('1', (epd.height, epd.width), 255)  # 126*298
-    drawblack = ImageDraw.Draw(LBlackimage)
-    drawry = ImageDraw.Draw(LRYimage)
-    
-    drawblack.text((2, 0), 'hello world', font = font18, fill = 0)
-    drawblack.text((2, 20), '5.83inch epd bc', font = font18, fill = 0)
-    drawblack.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    drawblack.line((10, 90, 60, 140), fill = 0)
-    drawblack.line((60, 90, 10, 140), fill = 0)
-    drawblack.rectangle((10, 90, 60, 140), outline = 0)
-    drawry.line((95, 90, 95, 140), fill = 0)
-    drawry.line((70, 115, 120, 115), fill = 0)
-    drawry.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    drawry.rectangle((10, 150, 60, 200), fill = 0)
-    drawry.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(LBlackimage), epd.getbuffer(LRYimage))
-    time.sleep(2)
-    
-    print("3.read bmp file")
-    HBlackimage = Image.open('../pic/5in83bc-b.bmp')
-    HRYimage = Image.open('../pic/5in83bc-ry.bmp')
-    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
-    time.sleep(2)
-    
-    print("4.read bmp file on window")
-    blackimage1 = Image.new('1', (epd.width, epd.height), 255)  # 298*126
-    redimage1 = Image.new('1', (epd.width, epd.height), 255)  # 298*126    
-    newimage = Image.open('../pic/100x100.bmp')
-    blackimage1.paste(newimage, (50,10))    
-    epd.display(epd.getbuffer(blackimage1), epd.getbuffer(redimage1))
-    
-    print("Clear...")
-    epd.init()
-    epd.Clear()
-    
-    print("Goto Sleep...")
-    epd.sleep()
-        
-except IOError as e:
-    print(e)
-    
-except KeyboardInterrupt:    
-    print("ctrl + c:")
-    epdconfig.module_exit()
-    exit()

BIN=BIN
Jetson Nano/python3/lib/Font.ttc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd1in54.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd1in54_V2.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd1in54b.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd1in54c.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd2in13.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd2in13_V2.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd2in13bc.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd2in7.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd2in7b.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd2in9.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd2in9bc.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd2in9d.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd4in2.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd4in2bc.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epd7in5bc.cpython-36.pyc


BIN=BIN
Jetson Nano/python3/lib/__pycache__/epdconfig.cpython-36.pyc


+ 0 - 206
Jetson Nano/python3/lib/epd1in54_V2.py

@@ -1,206 +0,0 @@
-# *****************************************************************************
-# * | File        :	  epd1in54_V2.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V1
-# * | Date        :   2019-06-20
-# # | Info        :   python3 demo
-# -----------------------------------------------------------------------------
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and//or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 200
-EPD_HEIGHT      = 200
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-        
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 1):
-            epdconfig.delay_ms(100)
-        print("e-Paper busy release")
-
-    def TurnOnDisplay(self):
-        self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
-        self.send_data(0xF7)
-        self.send_command(0x20) # MASTER_ACTIVATION
-        
-        self.ReadBusy()
-    
-    def TurnOnDisplayPart(self):
-        self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
-        self.send_data(0xFF)
-        self.send_command(0x20) # MASTER_ACTIVATION
-        
-        self.ReadBusy()
-
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-            
-        # EPD hardware init start
-        self.reset()
-        
-        self.ReadBusy()
-        self.send_command(0x12) # SWRESET
-        self.ReadBusy()
-        
-        self.send_command(0x01) # DRIVER_OUTPUT_CONTROL
-        self.send_data(0xC7) # (EPD_HEIGHT - 1) & 0xFF
-        self.send_data(0x00) # ((EPD_HEIGHT - 1) >> 8) & 0xFF
-        self.send_data(0x01) # GD = 0 SM = 0 TB = 0
-        
-        self.send_command(0x11) # data entry mode
-        self.send_data(0x01)
-        
-        self.send_command(0x44) # set Ram-X address start//end position
-        self.send_data(0x00)
-        self.send_data(0x18) # 0x0C-->(18+1)*8=200
-        
-        self.send_command(0x45) # set Ram-Y address start//end position
-        self.send_data(0xC7) # 0xC7-->(199+1)=200
-        self.send_data(0x00)
-        self.send_data(0x00)
-        self.send_data(0x00)
-
-        self.send_command(0x3C) # BorderWavefrom
-        self.send_data(0x01)
-
-        self.send_command(0x18)
-        self.send_data(0x80)
-
-        self.send_command(0x22) # #Load Temperature and waveform setting.
-        self.send_data(0XB1)
-        self.send_command(0x20)
-
-        self.send_command(0x4E) # set RAM x address count to 0;
-        self.send_data(0x00)
-        self.send_command(0x4F) # set RAM y address count to 0X199;
-        self.send_data(0xC7)
-        self.send_data(0x00)
-        
-        self.ReadBusy()
-        
-    def Clear(self, color):
-        self.send_command(0x24)
-        for j in range(0, self.height):
-            for i in range(0, self.width // 8):
-                self.send_data(color)
-        self.TurnOnDisplay()
-        
-    def getbuffer(self, image):
-        buf = [0xFF] * ((self.width//8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        if(imwidth == self.width and imheight == self.height):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) // 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) // 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, image):
-        if (image == None):
-            return
-            
-        self.send_command(0x24)
-        for j in range(0, self.height):
-            for i in range(0, self.width // 8):
-                self.send_data(image[i + j * (self.width // 8)])   
-        self.TurnOnDisplay()
-        
-    def displayPartBaseImage(self, image):
-        if (image == None):
-            return
-            
-        self.send_command(0x24)
-        for j in range(0, self.height):
-            for i in range(0, self.width // 8):
-                self.send_data(image[i + j * (self.width // 8)])
-        
-        self.send_command(0x26)
-        for j in range(0, self.height):
-            for i in range(0, self.width // 8):
-                self.send_data(image[i + j * (self.width // 8)])
-                
-        self.TurnOnDisplayPart()
-        
-    def displayPart(self, image):
-        if (image == None):
-            return
-            
-        self.send_command(0x24)
-        for j in range(0, self.height):
-            for i in range(0, self.width // 8):
-                self.send_data(image[i + j * (self.width // 8)])
-                
-        self.TurnOnDisplayPart()
-        
-    def sleep(self):
-        self.send_command(0x10) # DEEP_SLEEP_MODE
-        self.send_data(0x01)
-        
-        epdconfig.module_exit()
-
-### END OF FILE ###
-

+ 0 - 315
Jetson Nano/python3/lib/epd2in13_V2.py

@@ -1,315 +0,0 @@
-# *****************************************************************************
-# * | File        :	  epd2in13_V2.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# # | Info        :   python3 demo
-# -----------------------------------------------------------------------------
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and//or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-import numpy as np
-
-# Display resolution
-EPD_WIDTH       = 122
-EPD_HEIGHT      = 250
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-        
-    FULL_UPDATE = 0
-    PART_UPDATE = 1
-    lut_full_update= [
-        0x80,0x60,0x40,0x00,0x00,0x00,0x00,             #LUT0: BB:     VS 0 ~7
-        0x10,0x60,0x20,0x00,0x00,0x00,0x00,             #LUT1: BW:     VS 0 ~7
-        0x80,0x60,0x40,0x00,0x00,0x00,0x00,             #LUT2: WB:     VS 0 ~7
-        0x10,0x60,0x20,0x00,0x00,0x00,0x00,             #LUT3: WW:     VS 0 ~7
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,             #LUT4: VCOM:   VS 0 ~7
-
-        0x03,0x03,0x00,0x00,0x02,                       # TP0 A~D RP0
-        0x09,0x09,0x00,0x00,0x02,                       # TP1 A~D RP1
-        0x03,0x03,0x00,0x00,0x02,                       # TP2 A~D RP2
-        0x00,0x00,0x00,0x00,0x00,                       # TP3 A~D RP3
-        0x00,0x00,0x00,0x00,0x00,                       # TP4 A~D RP4
-        0x00,0x00,0x00,0x00,0x00,                       # TP5 A~D RP5
-        0x00,0x00,0x00,0x00,0x00,                       # TP6 A~D RP6
-
-        0x15,0x41,0xA8,0x32,0x30,0x0A,
-    ]
-
-    lut_partial_update = [ #20 bytes
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,             #LUT0: BB:     VS 0 ~7
-        0x80,0x00,0x00,0x00,0x00,0x00,0x00,             #LUT1: BW:     VS 0 ~7
-        0x40,0x00,0x00,0x00,0x00,0x00,0x00,             #LUT2: WB:     VS 0 ~7
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,             #LUT3: WW:     VS 0 ~7
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,             #LUT4: VCOM:   VS 0 ~7
-
-        0x0A,0x00,0x00,0x00,0x00,                       # TP0 A~D RP0
-        0x00,0x00,0x00,0x00,0x00,                       # TP1 A~D RP1
-        0x00,0x00,0x00,0x00,0x00,                       # TP2 A~D RP2
-        0x00,0x00,0x00,0x00,0x00,                       # TP3 A~D RP3
-        0x00,0x00,0x00,0x00,0x00,                       # TP4 A~D RP4
-        0x00,0x00,0x00,0x00,0x00,                       # TP5 A~D RP5
-        0x00,0x00,0x00,0x00,0x00,                       # TP6 A~D RP6
-
-        0x15,0x41,0xA8,0x32,0x30,0x0A,
-    ]
-        
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        while(epdconfig.digital_read(self.busy_pin) == 1):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)    
-
-    def TurnOnDisplay(self):
-        self.send_command(0x22)
-        self.send_data(0xC7)
-        self.send_command(0x20)        
-        self.ReadBusy()
-        
-    def TurnOnDisplayPart(self):
-        self.send_command(0x22)
-        self.send_data(0x0c)
-        self.send_command(0x20)        
-        self.ReadBusy()
-        
-    def init(self, update):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        if(update == self.FULL_UPDATE):
-            self.ReadBusy()
-            self.send_command(0x12) # soft reset
-            self.ReadBusy()
-
-            self.send_command(0x74) #set analog block control
-            self.send_data(0x54)
-            self.send_command(0x7E) #set digital block control
-            self.send_data(0x3B)
-
-            self.send_command(0x01) #Driver output control
-            self.send_data(0xF9)
-            self.send_data(0x00)
-            self.send_data(0x00)
-
-            self.send_command(0x11) #data entry mode
-            self.send_data(0x01)
-
-            self.send_command(0x44) #set Ram-X address start//end position
-            self.send_data(0x00)
-            self.send_data(0x0F)    #0x0C-->(15+1)*8=128
-
-            self.send_command(0x45) #set Ram-Y address start//end position
-            self.send_data(0xF9)   #0xF9-->(249+1)=250
-            self.send_data(0x00)
-            self.send_data(0x00)
-            self.send_data(0x00)
-            
-            self.send_command(0x3C) #BorderWavefrom
-            self.send_data(0x03)
-
-            self.send_command(0x2C)     #VCOM Voltage
-            self.send_data(0x55)    #
-
-            self.send_command(0x03)
-            self.send_data(self.lut_full_update[70])
-
-            self.send_command(0x04) #
-            self.send_data(self.lut_full_update[71])
-            self.send_data(self.lut_full_update[72])
-            self.send_data(self.lut_full_update[73])
-
-            self.send_command(0x3A)     #Dummy Line
-            self.send_data(self.lut_full_update[74])
-            self.send_command(0x3B)     #Gate time
-            self.send_data(self.lut_full_update[75])
-
-            self.send_command(0x32)
-            for count in range(70):
-                self.send_data(self.lut_full_update[count])
-
-            self.send_command(0x4E)   # set RAM x address count to 0
-            self.send_data(0x00)
-            self.send_command(0x4F)   # set RAM y address count to 0X127
-            self.send_data(0xF9)
-            self.send_data(0x00)
-            self.ReadBusy()
-        else:
-            self.send_command(0x2C)     #VCOM Voltage
-            self.send_data(0x26)
-
-            self.ReadBusy()
-
-            self.send_command(0x32)
-            for count in range(70):
-                self.send_data(self.lut_partial_update[count])
-
-            self.send_command(0x37)
-            self.send_data(0x00)
-            self.send_data(0x00)
-            self.send_data(0x00)
-            self.send_data(0x00)
-            self.send_data(0x40)
-            self.send_data(0x00)
-            self.send_data(0x00)
-
-            self.send_command(0x22)
-            self.send_data(0xC0)
-            self.send_command(0x20)
-            self.ReadBusy()
-
-            self.send_command(0x3C) #BorderWavefrom
-            self.send_data(0x01)
-        return 0
-
-    def getbuffer(self, image):
-        if self.width%8 == 0:
-            linewidth = self.width//8
-        else:
-            linewidth = self.width//8 + 1
-         
-        buf = [0xFF] * (linewidth * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):                    
-                    if pixels[x, y] == 0:
-                        x = imwidth - x
-                        buf[x // 8 + y * linewidth] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        newy = imwidth - newy - 1
-                        buf[newx // 8 + newy*linewidth] &= ~(0x80 >> (y % 8))
-        return buf   
-        
-        
-    def display(self, image):
-        if self.width%8 == 0:
-            linewidth = self.width//8
-        else:
-            linewidth = self.width//8 + 1
-
-        self.send_command(0x24)
-        for j in range(0, self.height):
-            for i in range(0, linewidth):
-                self.send_data(image[i + j * linewidth])   
-        self.TurnOnDisplay()
-        
-    def displayPartial(self, image):
-        if self.width%8 == 0:
-            linewidth = self.width//8
-        else:
-            linewidth = self.width//8 + 1
-
-        self.send_command(0x24)
-        for j in range(0, self.height):
-            for i in range(0, linewidth):
-                self.send_data(image[i + j * linewidth])   
-                
-                
-        # self.send_command(0x26)
-        # for j in range(0, self.height):
-            # for i in range(0, linewidth):
-                # self.send_data(~image[i + j * linewidth])  
-        self.TurnOnDisplayPart()
-
-    def displayPartBaseImage(self, image):
-        if self.width%8 == 0:
-            linewidth = self.width//8
-        else:
-            linewidth = self.width//8 + 1
-
-        self.send_command(0x24)
-        for j in range(0, self.height):
-            for i in range(0, linewidth):
-                self.send_data(image[i + j * linewidth])   
-                
-                
-        self.send_command(0x26)
-        for j in range(0, self.height):
-            for i in range(0, linewidth):
-                self.send_data(image[i + j * linewidth])  
-        self.TurnOnDisplay()
-    
-    def Clear(self, color):
-        if self.width%8 == 0:
-            linewidth = self.width//8
-        else:
-            linewidth = self.width//8 + 1
-        # print(linewidth)
-        
-        self.send_command(0x24)
-        for j in range(0, self.height):
-            for i in range(0, linewidth):
-                self.send_data(color)   
-        self.TurnOnDisplay()
-
-    def sleep(self):
-        self.send_command(0x22) #POWER OFF
-        self.send_data(0xC3)
-        self.send_command(0x20)
-
-        self.send_command(0x10) #enter deep sleep
-        self.send_data(0x01)
-        epdconfig.delay_ms(100)
-
-        epdconfig.module_exit()
-
-### END OF FILE ###
-

+ 0 - 158
Jetson Nano/python3/lib/epd2in13bc.py

@@ -1,158 +0,0 @@
-# *****************************************************************************
-# * | File        :	  epd2in13bc.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# # | Info        :   python3 demo
-# -----------------------------------------------------------------------------
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and//or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 104
-EPD_HEIGHT      = 212
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)
-        print("e-Paper busy release")
-
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-            
-        self.reset()
-
-        self.send_command(0x06) # BOOSTER_SOFT_START
-        self.send_data(0x17)
-        self.send_data(0x17)
-        self.send_data(0x17)
-        
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-        
-        self.send_command(0x00) # PANEL_SETTING
-        self.send_data(0x8F)
-        
-        self.send_command(0x50) # VCOM_AND_DATA_INTERVAL_SETTING
-        self.send_data(0xF0)
-        
-        self.send_command(0x61) # RESOLUTION_SETTING
-        self.send_data(self.width & 0xff)
-        self.send_data(self.height >> 8)
-        self.send_data(self.height & 0xff)
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width//8) * self.height
-        buf = [0xFF] * ((self.width//8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) // 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) // 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, imageblack, imagered):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(imageblack[i])
-        self.send_command(0x92)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(imagered[i])
-        self.send_command(0x92)
-        
-        self.send_command(0x12) # REFRESH
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0xFF)
-        self.send_command(0x92) 
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0xFF)
-        self.send_command(0x92)
-        
-        self.send_command(0x12) # REFRESH
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0x02) # POWER_OFF
-        self.ReadBusy()
-        self.send_command(0x07) # DEEP_SLEEP
-        self.send_data(0xA5) # check code
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

+ 0 - 258
Jetson Nano/python3/lib/epd2in7.py

@@ -1,258 +0,0 @@
-# *****************************************************************************
-# * | File        :	  epd2in7.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# # | Info        :   python3 demo
-# -----------------------------------------------------------------------------
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and//or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 176
-EPD_HEIGHT      = 264
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_vcom_dc = [0x00, 0x00,
-        0x00, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x60, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x00, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-    ]
-    lut_ww = [
-        0x40, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x40, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0xA0, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_bw = [
-        0x40, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x40, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0xA0, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_bb = [
-        0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_wb = [
-        0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):        
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      #  0: idle, 1: busy
-            epdconfig.delay_ms(200)                
-        print("e-Paper busy release")
-
-    def set_lut(self):
-        self.send_command(0x20) # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcom_dc[count])
-        self.send_command(0x21) # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww[count])
-        self.send_command(0x22) # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw[count])
-        self.send_command(0x23) # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_bb[count])
-        self.send_command(0x24) # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_wb[count])
-            
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-            
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01) # POWER_SETTING
-        self.send_data(0x03) # VDS_EN, VDG_EN
-        self.send_data(0x00) # VCOM_HV, VGHL_LV[1], VGHL_LV[0]
-        self.send_data(0x2b) # VDH
-        self.send_data(0x2b) # VDL
-        self.send_data(0x09) # VDHR
-        
-        self.send_command(0x06) # BOOSTER_SOFT_START
-        self.send_data(0x07)
-        self.send_data(0x07)
-        self.send_data(0x17)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x60)
-        self.send_data(0xA5)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x89)
-        self.send_data(0xA5)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x90)
-        self.send_data(0x00)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x93)
-        self.send_data(0x2A)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0xA0)
-        self.send_data(0xA5)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0xA1)
-        self.send_data(0x00)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x73)
-        self.send_data(0x41)
-        
-        self.send_command(0x16) # PARTIAL_DISPLAY_REFRESH
-        self.send_data(0x00)
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-
-        self.send_command(0x00) # PANEL_SETTING
-        self.send_data(0xAF) # KW-BF   KWR-AF    BWROTP 0f
-        
-        self.send_command(0x30) # PLL_CONTROL
-        self.send_data(0x3A) # 3A 100HZ   29 150Hz 39 200HZ    31 171HZ
-        
-        self.send_command(0x82) # VCM_DC_SETTING_REGISTER
-        self.send_data(0x12)
-        self.set_lut()
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width//8) * self.height
-        buf = [0xFF] * ((self.width//8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) // 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) // 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, image):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0xFF)
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(image[i])
-        self.send_command(0x12) 
-        self.ReadBusy()
-        
-    def Clear(self, color):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0xFF)
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0xFF)
-        self.send_command(0x12) 
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0X50)
-        self.send_data(0xf7)
-        self.send_command(0X02)
-        self.send_command(0X07)
-        self.send_data(0xA5)
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

+ 0 - 266
Jetson Nano/python3/lib/epd2in7b.py

@@ -1,266 +0,0 @@
-# *****************************************************************************
-# * | File        :	  epd2in7b.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# # | Info        :   python3 demo
-# -----------------------------------------------------------------------------
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and//or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 176
-EPD_HEIGHT      = 264
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_vcom_dc = [
-        0x00, 0x00,
-        0x00, 0x1A, 0x1A, 0x00, 0x00, 0x01,
-        0x00, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x00, 0x0E, 0x01, 0x0E, 0x01, 0x10,
-        0x00, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x00, 0x04, 0x10, 0x00, 0x00, 0x05,
-        0x00, 0x03, 0x0E, 0x00, 0x00, 0x0A,
-        0x00, 0x23, 0x00, 0x00, 0x00, 0x01
-    ]
-
-    lut_ww = [
-        0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01,
-        0x40, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10,
-        0x80, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x00, 0x04, 0x10, 0x00, 0x00, 0x05,
-        0x00, 0x03, 0x0E, 0x00, 0x00, 0x0A,
-        0x00, 0x23, 0x00, 0x00, 0x00, 0x01
-    ]
-
-    # R22H    r
-    lut_bw = [
-        0xA0, 0x1A, 0x1A, 0x00, 0x00, 0x01,
-        0x00, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10,
-        0x90, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0xB0, 0x04, 0x10, 0x00, 0x00, 0x05,
-        0xB0, 0x03, 0x0E, 0x00, 0x00, 0x0A,
-        0xC0, 0x23, 0x00, 0x00, 0x00, 0x01
-    ]
-
-    # R23H    w
-    lut_bb = [
-        0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01,
-        0x40, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10,
-        0x80, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x00, 0x04, 0x10, 0x00, 0x00, 0x05,
-        0x00, 0x03, 0x0E, 0x00, 0x00, 0x0A,
-        0x00, 0x23, 0x00, 0x00, 0x00, 0x01
-    ]
-    # R24H    b
-    lut_wb = [
-        0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01,
-        0x20, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10,
-        0x10, 0x0A, 0x0A, 0x00, 0x00, 0x08,
-        0x00, 0x04, 0x10, 0x00, 0x00, 0x05,
-        0x00, 0x03, 0x0E, 0x00, 0x00, 0x0A,
-        0x00, 0x23, 0x00, 0x00, 0x00, 0x01
-    ]
-
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)
-        print("e-Paper busy release")
-        
-    def set_lut(self):
-        self.send_command(0x20)               # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcom_dc[count])
-        self.send_command(0x21)         # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww[count])
-        self.send_command(0x22)         # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw[count])
-        self.send_command(0x23)         # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_bb[count])
-        self.send_command(0x24)         # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_wb[count])
-            
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-            
-        self.reset()
-
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-
-        self.send_command(0x00) # PANEL_SETTING
-        self.send_data(0xaf) #KW-BF   KWR-AF    BWROTP 0f
-        
-        self.send_command(0x30) # PLL_CONTROL
-        self.send_data(0x3a) #3A 100HZ   29 150Hz 39 200HZ    31 171HZ
-
-        self.send_command(0x01) # POWER_SETTING
-        self.send_data(0x03) # VDS_EN, VDG_EN
-        self.send_data(0x00) # VCOM_HV, VGHL_LV[1], VGHL_LV[0]
-        self.send_data(0x2b) # VDH
-        self.send_data(0x2b) # VDL
-        self.send_data(0x09) # VDHR
-
-        self.send_command(0x06) # BOOSTER_SOFT_START
-        self.send_data(0x07)
-        self.send_data(0x07)
-        self.send_data(0x17)
-
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x60)
-        self.send_data(0xA5)
-
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x89)
-        self.send_data(0xA5)
-
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x90)
-        self.send_data(0x00)
-        
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x93)
-        self.send_data(0x2A)
-
-        # Power optimization
-        self.send_command(0xF8)
-        self.send_data(0x73)
-        self.send_data(0x41)
-
-        self.send_command(0x82) # VCM_DC_SETTING_REGISTER
-        self.send_data(0x12)                   
-        self.send_command(0x50) # VCOM_AND_DATA_INTERVAL_SETTING
-        self.send_data(0x87) # define by OTP
-
-        self.set_lut()
-
-        self.send_command(0x16) # PARTIAL_DISPLAY_REFRESH
-        self.send_data(0x00)
-        
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width//8) * self.height
-        buf = [0xFF] * ((self.width//8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) // 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) // 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, imageblack, imagered):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(~imageblack[i])
-        self.send_command(0x11)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(~imagered[i])
-        self.send_command(0x11)
-        
-        self.send_command(0x12) 
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0x00)
-        self.send_command(0x11) 
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0x00)
-        self.send_command(0x11)
-        
-        self.send_command(0x12) 
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0X50)
-        self.send_data(0xf7)
-        self.send_command(0X02)
-        self.send_command(0X07)
-        self.send_data(0xA5)
-### END OF FILE ###
-

+ 0 - 200
Jetson Nano/python3/lib/epd2in9.py

@@ -1,200 +0,0 @@
-# *****************************************************************************
-# * | File        :	  epd2in9.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# # | Info        :   python3 demo
-# -----------------------------------------------------------------------------
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and//or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import epdconfig
-
-# Display resolution
-EPD_WIDTH       = 128
-EPD_HEIGHT      = 296
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_full_update = [
-        0x50, 0xAA, 0x55, 0xAA, 0x11, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0xFF, 0xFF, 0x1F, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-    ]
-
-    lut_partial_update  = [
-        0x10, 0x18, 0x18, 0x08, 0x18, 0x18,
-        0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x13, 0x14, 0x44, 0x12,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-    ]
-        
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        while(epdconfig.digital_read(self.busy_pin) == 1):      #  0: idle, 1: busy
-            epdconfig.delay_ms(200) 
-
-    def TurnOnDisplay(self):
-        self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
-        self.send_data(0xC4)
-        self.send_command(0x20) # MASTER_ACTIVATION
-        self.send_command(0xFF) # TERMINATE_FRAME_READ_WRITE
-        
-        print("e-Paper busy")
-        self.ReadBusy()
-        print("e-Paper busy release")  
-
-    def SetWindow(self, x_start, y_start, x_end, y_end):
-        self.send_command(0x44) # SET_RAM_X_ADDRESS_START_END_POSITION
-        # x point must be the multiple of 8 or the last 3 bits will be ignored
-        self.send_data((x_start >> 3) & 0xFF)
-        self.send_data((x_end >> 3) & 0xFF)
-        self.send_command(0x45) # SET_RAM_Y_ADDRESS_START_END_POSITION
-        self.send_data(y_start & 0xFF)
-        self.send_data((y_start >> 8) & 0xFF)
-        self.send_data(y_end & 0xFF)
-        self.send_data((y_end >> 8) & 0xFF)
-
-    def SetCursor(self, x, y):
-        self.send_command(0x4E) # SET_RAM_X_ADDRESS_COUNTER
-        # x point must be the multiple of 8 or the last 3 bits will be ignored
-        self.send_data((x >> 3) & 0xFF)
-        self.send_command(0x4F) # SET_RAM_Y_ADDRESS_COUNTER
-        self.send_data(y & 0xFF)
-        self.send_data((y >> 8) & 0xFF)
-        self.ReadBusy()
-        
-    def init(self, lut):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01) # DRIVER_OUTPUT_CONTROL
-        self.send_data((EPD_HEIGHT - 1) & 0xFF)
-        self.send_data(((EPD_HEIGHT - 1) >> 8) & 0xFF)
-        self.send_data(0x00) # GD = 0 SM = 0 TB = 0
-        
-        self.send_command(0x0C) # BOOSTER_SOFT_START_CONTROL 
-        self.send_data(0xD7)
-        self.send_data(0xD6)
-        self.send_data(0x9D)
-        
-        self.send_command(0x2C) # WRITE_VCOM_REGISTER
-        self.send_data(0xA8) # VCOM 7C
-        
-        self.send_command(0x3A) # SET_DUMMY_LINE_PERIOD
-        self.send_data(0x1A) # 4 dummy lines per gate
-        
-        self.send_command(0x3B) # SET_GATE_TIME
-        self.send_data(0x08) # 2us per line
-        
-        self.send_command(0x11) # DATA_ENTRY_MODE_SETTING
-        self.send_data(0x03) # X increment Y increment
-        
-        self.send_command(0x32) # WRITE_LUT_REGISTER
-        for i in range(0, len(lut)):
-            self.send_data(lut[i])
-        # EPD hardware init end
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width//8) * self.height
-        buf = [0xFF] * ((self.width//8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) // 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) // 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, image):
-        if (image == None):
-            return            
-        self.SetWindow(0, 0, self.width - 1, self.height - 1)
-        for j in range(0, self.height):
-            self.SetCursor(0, j)
-            self.send_command(0x24) # WRITE_RAM
-            for i in range(0, self.width // 8):
-                self.send_data(image[i + j * (self.width // 8)])   
-        self.TurnOnDisplay()
-        
-    def Clear(self, color):
-        self.SetWindow(0, 0, self.width - 1, self.height - 1)
-        for j in range(0, self.height):
-            self.SetCursor(0, j)
-            self.send_command(0x24) # WRITE_RAM
-            for i in range(0, self.width // 8):
-                self.send_data(color)   
-        self.TurnOnDisplay()
-
-    def sleep(self):
-        self.send_command(0x10) # DEEP_SLEEP_MODE
-        self.send_data(0x01)
-        
-        epdconfig.module_exit()
-### END OF FILE ###
-

+ 0 - 350
Jetson Nano/python3/lib/epd2in9d.py

@@ -1,350 +0,0 @@
-# *****************************************************************************
-# * | File        :	  epd2in9d.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V2.0
-# * | Date        :   2019-06-20
-# # | Info        :   python3 demo
-# -----------------------------------------------------------------------------
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and//or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-from PIL import Image
-import RPi.GPIO as GPIO
-
-# Display resolution
-EPD_WIDTH       = 128
-EPD_HEIGHT      = 296
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_vcomDC = [  
-        0x00, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x60, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x00, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00,
-    ]
-
-    lut_ww = [  
-        0x40, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x40, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0xA0, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bw = [  
-        0x40, 0x17, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x0F, 0x0F, 0x00, 0x00, 0x03,
-        0x40, 0x0A, 0x01, 0x00, 0x00, 0x01,
-        0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_wb = [
-        0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bb = [ 
-        0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
-        0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
-        0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
-        0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    
-    lut_vcom1 = [  
-        0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00,
-    ]
-
-    lut_ww1 = [  
-        0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bw1 = [  
-        0x80, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_wb1 = [
-        0x40, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-
-    lut_bb1 = [ 
-        0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-        
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):
-        print("e-Paper busy")
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            self.send_command(0x71)
-            epdconfig.delay_ms(100)  
-        print("e-Paper busy release")
-    def TurnOnDisplay(self):
-        self.send_command(0x12)
-        epdconfig.delay_ms(10)
-        self.ReadBusy()
-        
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01)	# POWER SETTING
-        self.send_data(0x03)
-        self.send_data(0x00)
-        self.send_data(0x2b)
-        self.send_data(0x2b)
-        self.send_data(0x03)
-
-        self.send_command(0x06)	# boost soft start
-        self.send_data(0x17) # A
-        self.send_data(0x17) # B
-        self.send_data(0x17) # C
-
-        self.send_command(0x04)
-        self.ReadBusy()
-
-        self.send_command(0x00)	# panel setting
-        self.send_data(0xbf) # LUT from OTP,128x296
-        self.send_data(0x0d) # VCOM to 0V fast
-
-        self.send_command(0x30)	#PLL setting
-        self.send_data(0x3a)     # 3a 100HZ   29 150Hz 39 200HZ	31 171HZ
-
-        self.send_command(0x61)	# resolution setting
-        self.send_data(self.width)
-        self.send_data((self.height >> 8) & 0xff)
-        self.send_data(self.height& 0xff)
-
-        self.send_command(0x82)	# vcom_DC setting
-        self.send_data(0x28)
-        return 0
-        
-    def SetFullReg(self):
-        self.send_command(0x82)
-        self.send_data(0x00)
-        self.send_command(0X50)
-        self.send_data(0x97)
-        
-        self.send_command(0x20)         # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcomDC[count])
-        self.send_command(0x21)         # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww[count])
-        self.send_command(0x22)         # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw[count])
-        self.send_command(0x23)         # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_wb[count])
-        self.send_command(0x24)         # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_bb[count])
-    
-    def SetPartReg(self):
-        self.send_command(0x82)
-        self.send_data(0x03)
-        self.send_command(0X50)
-        self.send_data(0x47)
-        
-        self.send_command(0x20)         # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcom1[count])
-        self.send_command(0x21)         # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww1[count])
-        self.send_command(0x22)         # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw1[count])
-        self.send_command(0x23)         # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_wb1[count])
-        self.send_command(0x24)         # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_bb1[count])
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width//8) * self.height
-        buf = [0xFF] * ((self.width//8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) // 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) // 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, image):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0x00)
-        epdconfig.delay_ms(10)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(image[i])
-        epdconfig.delay_ms(10)
-        
-        self.SetFullReg()
-        self.TurnOnDisplay()
-        
-    def DisplayPartial(self, image):
-        self.SetPartReg()
-        self.send_command(0x91)
-        self.send_command(0x90)
-        self.send_data(0)
-        self.send_data(self.width - 1)
-
-        self.send_data(0)
-        self.send_data(0)
-        self.send_data(self.height // 256)
-        self.send_data(self.height % 256 - 1)
-        self.send_data(0x28)
-            
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(image[i])
-        epdconfig.delay_ms(10)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(~image[i])
-        epdconfig.delay_ms(10)
-          
-        self.TurnOnDisplay()
-        
-    def Clear(self, color):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0x00)
-        epdconfig.delay_ms(10)
-        
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0xFF)
-        epdconfig.delay_ms(10)
-        
-        self.SetFullReg()
-        self.TurnOnDisplay()
-
-    def sleep(self):
-        self.send_command(0X50)
-        self.send_data(0xf7)
-        self.send_command(0X02)         #power off
-        self.send_command(0X07)         #deep sleep  
-        self.send_data(0xA5)
-        
-        epdconfig.module_exit()
-
-### END OF FILE ###
-

+ 0 - 240
Jetson Nano/python3/lib/epd4in2.py

@@ -1,240 +0,0 @@
-# *****************************************************************************
-# * | File        :	  epd4in2.py
-# * | Author      :   Waveshare team
-# * | Function    :   Electronic paper driver
-# * | Info        :
-# *----------------
-# * | This version:   V4.0
-# * | Date        :   2019-06-20
-# # | Info        :   python3 demo
-# -----------------------------------------------------------------------------
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and//or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-
-import epdconfig
-from PIL import Image
-import RPi.GPIO as GPIO
-
-# Display resolution
-EPD_WIDTH       = 400
-EPD_HEIGHT      = 300
-
-class EPD:
-    def __init__(self):
-        self.reset_pin = epdconfig.RST_PIN
-        self.dc_pin = epdconfig.DC_PIN
-        self.busy_pin = epdconfig.BUSY_PIN
-        self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_WIDTH
-        self.height = EPD_HEIGHT
-
-    lut_vcom0 = [
-    0x00, 0x17, 0x00, 0x00, 0x00, 0x02,        
-    0x00, 0x17, 0x17, 0x00, 0x00, 0x02,        
-    0x00, 0x0A, 0x01, 0x00, 0x00, 0x01,        
-    0x00, 0x0E, 0x0E, 0x00, 0x00, 0x02,        
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,        
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,        
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_ww = [
-    0x40, 0x17, 0x00, 0x00, 0x00, 0x02,
-    0x90, 0x17, 0x17, 0x00, 0x00, 0x02,
-    0x40, 0x0A, 0x01, 0x00, 0x00, 0x01,
-    0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_bw = [
-    0x40, 0x17, 0x00, 0x00, 0x00, 0x02,
-    0x90, 0x17, 0x17, 0x00, 0x00, 0x02,
-    0x40, 0x0A, 0x01, 0x00, 0x00, 0x01,
-    0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_wb = [
-    0x80, 0x17, 0x00, 0x00, 0x00, 0x02,
-    0x90, 0x17, 0x17, 0x00, 0x00, 0x02,
-    0x80, 0x0A, 0x01, 0x00, 0x00, 0x01,
-    0x50, 0x0E, 0x0E, 0x00, 0x00, 0x02,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    lut_bb = [
-    0x80, 0x17, 0x00, 0x00, 0x00, 0x02,
-    0x90, 0x17, 0x17, 0x00, 0x00, 0x02,
-    0x80, 0x0A, 0x01, 0x00, 0x00, 0x01,
-    0x50, 0x0E, 0x0E, 0x00, 0x00, 0x02,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    ]
-    
-    # Hardware reset
-    def reset(self):
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200) 
-        epdconfig.digital_write(self.reset_pin, 0)
-        epdconfig.delay_ms(10)
-        epdconfig.digital_write(self.reset_pin, 1)
-        epdconfig.delay_ms(200)   
-
-    def send_command(self, command):
-        epdconfig.digital_write(self.dc_pin, 0)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([command])
-        epdconfig.digital_write(self.cs_pin, 1)
-
-    def send_data(self, data):
-        epdconfig.digital_write(self.dc_pin, 1)
-        epdconfig.digital_write(self.cs_pin, 0)
-        epdconfig.spi_writebyte([data])
-        epdconfig.digital_write(self.cs_pin, 1)
-        
-    def ReadBusy(self):        
-        while(epdconfig.digital_read(self.busy_pin) == 0):      # 0: idle, 1: busy
-            epdconfig.delay_ms(100)    
-
-    def set_lut(self):
-        self.send_command(0x20)               # vcom
-        for count in range(0, 44):
-            self.send_data(self.lut_vcom0[count])
-            
-        self.send_command(0x21)         # ww --
-        for count in range(0, 42):
-            self.send_data(self.lut_ww[count])
-            
-        self.send_command(0x22)         # bw r
-        for count in range(0, 42):
-            self.send_data(self.lut_bw[count])
-            
-        self.send_command(0x23)         # wb w
-        for count in range(0, 42):
-            self.send_data(self.lut_bb[count])
-            
-        self.send_command(0x24)         # bb b
-        for count in range(0, 42):
-            self.send_data(self.lut_wb[count])
-            
-    def init(self):
-        if (epdconfig.module_init() != 0):
-            return -1
-        # EPD hardware init start
-        self.reset()
-        
-        self.send_command(0x01) # POWER SETTING
-        self.send_data(0x03) # VDS_EN, VDG_EN
-        self.send_data(0x00) # VCOM_HV, VGHL_LV[1], VGHL_LV[0]
-        self.send_data(0x2b) # VDH
-        self.send_data(0x2b) # VDL
-        
-        self.send_command(0x06) # boost soft start
-        self.send_data(0x17)
-        self.send_data(0x17)
-        self.send_data(0x17)
-        
-        self.send_command(0x04) # POWER_ON
-        self.ReadBusy()
-        
-        self.send_command(0x00) # panel setting
-        self.send_data(0xbf) # KW-BF   KWR-AF  BWROTP 0f
-        self.send_data(0x0d)
-        
-        self.send_command(0x30) # PLL setting
-        self.send_data(0x3c) # 3A 100HZ   29 150Hz 39 200HZ  31 171HZ
-
-        self.send_command(0x61)	# resolution setting
-        self.send_data(0x01)
-        self.send_data(0x90) # 128
-        self.send_data(0x01)		
-        self.send_data(0x2c)
-
-        self.send_command(0x82)	# vcom_DC setting
-        self.send_data(0x28)
-
-        self.send_command(0X50)	# VCOM AND DATA INTERVAL SETTING
-        self.send_data(0x97) # 97white border 77black border		VBDF 17|D7 VBDW 97 VBDB 57		VBDF F7 VBDW 77 VBDB 37  VBDR B7
-    
-        self.set_lut()
-        # EPD hardware init end
-        return 0
-
-    def getbuffer(self, image):
-        # print "bufsiz = ",(self.width//8) * self.height
-        buf = [0xFF] * ((self.width//8) * self.height)
-        image_monocolor = image.convert('1')
-        imwidth, imheight = image_monocolor.size
-        pixels = image_monocolor.load()
-        # print "imwidth = %d, imheight = %d",imwidth,imheight
-        if(imwidth == self.width and imheight == self.height):
-            print("Horizontal")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    # Set the bits for the column of pixels at the current position.
-                    if pixels[x, y] == 0:
-                        buf[(x + y * self.width) // 8] &= ~(0x80 >> (x % 8))
-        elif(imwidth == self.height and imheight == self.width):
-            print("Vertical")
-            for y in range(imheight):
-                for x in range(imwidth):
-                    newx = y
-                    newy = self.height - x - 1
-                    if pixels[x, y] == 0:
-                        buf[(newx + newy*self.width) // 8] &= ~(0x80 >> (y % 8))
-        return buf
-
-    def display(self, image):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0xFF)
-            
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(image[i])
-            
-        self.send_command(0x12) 
-        self.ReadBusy()
-        
-    def Clear(self):
-        self.send_command(0x10)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0xFF)
-            
-        self.send_command(0x13)
-        for i in range(0, self.width * self.height // 8):
-            self.send_data(0xFF)
-            
-        self.send_command(0x12) 
-        self.ReadBusy()
-
-    def sleep(self):
-        self.send_command(0x02) # POWER_OFF
-        self.ReadBusy()
-        self.send_command(0x07) # DEEP_SLEEP
-        self.send_data(0XA5)
-        
-        epdconfig.module_exit()
-        
-### END OF FILE ###
-

+ 0 - 97
Jetson Nano/python3/lib/epdconfig.py

@@ -1,97 +0,0 @@
-# /*****************************************************************************
-# * | File        :	  epdconfig.py
-# * | Author      :   Waveshare team
-# * | Function    :   Hardware underlying interface
-# * | Info        :
-# *----------------
-# * | This version:   V1.0
-# * | Date        :   2019-06-06
-# * | Info        :   
-# ******************************************************************************
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documnetation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to  whom the Software is
-# furished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-import Jetson.GPIO as GPIO
-import time
-
-import ctypes
-# import spidev
-
-# Pin definition
-RST_PIN         = 17
-DC_PIN          = 25
-CS_PIN          = 8
-BUSY_PIN        = 24
-
-# SPI device, bus = 0, device = 0
-# SPI = spidev.SpiDev(0, 0)
-
-clib = ctypes.cdll.LoadLibrary
-spi = clib('../lib/sysfs_software_spi.so')
-# gpio2 = clib('../lib/sysfs_gpio.so')
-
-def digital_write(pin, value):
-    GPIO.output(pin, value)
-
-def digital_read(pin):
-    return GPIO.input(BUSY_PIN)
-    # return gpio2.SYSFS_GPIO_Read(15)
-    
-def delay_ms(delaytime):
-    time.sleep(delaytime / 1000.0)
-
-def spi_writebyte(data):
-    # SPI.writebytes(data)
-    spi.SYSFS_software_spi_transfer(data[0])
-
-def module_init():
-    # print("module_init")
-    GPIO.setmode(GPIO.BCM)
-    GPIO.setwarnings(False)
-    # print("RST_PIN")
-    GPIO.setup(RST_PIN, GPIO.OUT)
-    # print("DC_PIN")
-    GPIO.setup(DC_PIN, GPIO.OUT)
-    # print("CS_PIN")
-    GPIO.setup(CS_PIN, GPIO.OUT)
-    # print("BUSY_PIN")
-    GPIO.setup(BUSY_PIN, GPIO.IN)
-    # SPI.max_speed_hz = 2000000
-    # SPI.mode = 0b00
-    
-    # gpio2.SYSFS_GPIO_Export(15)
-    # gpio2.SYSFS_GPIO_Direction(15, 0)
-    
-    spi.SYSFS_software_spi_begin()
-    return 0
-
-    
-def module_exit():
-    print("spi end")
-    spi.SYSFS_software_spi_end()
-    
-    print("close 5V, Module enters 0 power consumption ...")
-    GPIO.output(RST_PIN, 0)
-    GPIO.output(DC_PIN, 0)
-    
-    GPIO.cleanup()
-    
-    
-
-### END OF FILE ###

BIN=BIN
Jetson Nano/python3/lib/sysfs_gpio.so


BIN=BIN
Jetson Nano/python3/lib/sysfs_software_spi.so


BIN=BIN
Jetson Nano/python3/pic/100x100.bmp


BIN=BIN
Jetson Nano/python3/pic/1in54.bmp


BIN=BIN
Jetson Nano/python3/pic/1in54b-b.bmp


BIN=BIN
Jetson Nano/python3/pic/1in54b-r.bmp


BIN=BIN
Jetson Nano/python3/pic/1in54c-b.bmp


BIN=BIN
Jetson Nano/python3/pic/1in54c-y.bmp


BIN=BIN
Jetson Nano/python3/pic/2in13-v2.bmp


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio