Skip to main content

Driver library to GDEY075Z08 e-paper display

Project description

GDEY075Z08 Driver

What's this

I was doing some hobby project when I found that my newly bought e-ink display has no driver implemented in python, which is the best choice for me to accomplish the project

PINs

To use this library, you have to follow some hard-coded rules, which I know is not good, but I'm too lazy to improve

+-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
| BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
|     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
|   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |
|   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |
|   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | ALT5 | TxD     | 15  | 14  |
|     |     |      0v |      |   |  9 || 10 | 1 | ALT5 | RxD     | 16  | 15  |
|  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
|  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
|  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
|     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
|  10 |  12 |    MOSI | ALT0 | 0 | 19 || 20 |   |      | 0v      |     |     |
|   9 |  13 |    MISO | ALT0 | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
|  11 |  14 |    SCLK | ALT0 | 0 | 23 || 24 | 1 | OUT  | CE0     | 10  | 8   |
|     |     |      0v |      |   | 25 || 26 | 1 | OUT  | CE1     | 11  | 7   |
|   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
|   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
|   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
|  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
|  19 |  24 | GPIO.24 |  OUT | 1 | 35 || 36 | 1 | OUT  | GPIO.27 | 27  | 16  |
|  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
|     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
+-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
  • VCC -> 3.3
  • GND -> GND
  • DIN -> MOSI
  • CLK -> SCLK
  • CS -> 24 (Physical, BCM: CE0, 8)
  • D/C -> 22 (Physical, BCM: 25)
  • RES -> 11 (Physical, BCM: 17)
  • BUSY -> 18 (Physical, BCM: 24)

How to use

Here's an example

from gdey075z08_driver import driver
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
#import imagedata

EPD_WIDTH = 800
EPD_HEIGHT = 480


def main(epd):
    # For simplicity, the arguments are explicit numerical coordinates
    image = Image.new('L', (EPD_WIDTH, EPD_HEIGHT), 255)    # 255: clear the frame
    draw = ImageDraw.Draw(image)
    font = ImageFont.truetype('/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf', 24)
    draw.rectangle((0, 6, 640, 40), fill = 127)
    draw.text((200, 10), 'e-Paper demo', font = font, fill = 255)
    draw.rectangle((200, 80, 600, 280), fill = 127)
    draw.chord((240, 120, 580, 220), 0, 360, fill = 255)
    draw.rectangle((20, 80, 160, 280), fill = 0)
    draw.chord((40, 80, 180, 220), 0, 360, fill = 127)
    epd.display_frame(epd.get_frame_buffer(image))

    #image = Image.open('800x480.bmp')
    #epd.display_frame(epd.get_frame_buffer(image))

    # You can get frame buffer from an image or import the buffer directly:
    #epd.display_frame(imagedata.MONOCOLOR_BITMAP)

if __name__ == '__main__':
    epd = driver.EPD()
    epd.init()
    try:
        main(epd)
    finally:
        epd.sleep()

If you break your display when using this library, please raise an issue so that I won't break my own

License

MIT License

Copyright (c) 2023 zhufucdev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation 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
furnished 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 FOR 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gdey075z08_driver-0.0.4-1.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

gdey075z08_driver-0.0.4-1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file gdey075z08_driver-0.0.4-1.tar.gz.

File metadata

  • Download URL: gdey075z08_driver-0.0.4-1.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for gdey075z08_driver-0.0.4-1.tar.gz
Algorithm Hash digest
SHA256 25e2b1ca30e810bce9baf27736a0758c01f892c361ea7d46def33f29c72be41f
MD5 05d42eee7e77326954c776e64fac9fb1
BLAKE2b-256 296ffeaf4fe6418c81f562cd06505c51eb434dccf072796e712f5204e1edb03b

See more details on using hashes here.

File details

Details for the file gdey075z08_driver-0.0.4-1-py3-none-any.whl.

File metadata

File hashes

Hashes for gdey075z08_driver-0.0.4-1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b793580d550938edd1ce840f47008d3b5ccf4736217c94a126f1145847059b6
MD5 08d6e9dbe05a303c88cfb8c17f552312
BLAKE2b-256 4a20a9336d96a154477058d0e8f138ccc013addfc2e4200316c004543208459e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page