Waveshare e-Paper Driver Library

repository·master·Indexed 23 days ago

https://github.com/waveshareteam/e-paper

Driver code and example demonstrations for Waveshare e-Paper displays. Supports multiple platforms including Raspberry Pi, Jetson Nano, Arduino (UNO R3, UNO R4, MEGA2560), and STM32 (STM32F103ZET6). The library includes a hardware interface layer for GPIO and SPI management, a GUI drawing API for shapes, bitmaps, and text, and pre-defined ASCII and Chinese fonts.

Tokens
35.1K
Snippets
83
Records
271
Agent score
63%

What's inside waveshareteam/e-paper

  1. Available platform demos for Jetson Nano, Raspberry Pi, Arduino, and STM32

    master

    The repository provides demo code for several hardware platforms:

    • RaspberryPi_JetsonNano: Supports both C and Python implementations.
    • Arduino:
      • Arduino UNO R3 (Note: Latest screens may not have example code for this model).
      • Arduino UNO R4.
    • STM32:
      • STM32F103ZET6.

    For additional documentation and information, visit the official Waveshare website: https://www.waveshare.com

  2. System Requirements and Environment

    master

    This demo project is optimized for the following environment:

    • OS: Ubuntu 20.04 Server_20220718
    • Hardware: Sunrise X3 PI (routines verified on this platform)
    • Module: e-paper Driver HAT

    Library Installation: The system comes with built-in libraries required for these routines, so no additional library installation is necessary.

  3. Project Directory Structure Overview

    master

    Understanding the project layout helps in locating drivers, configurations, and examples:

    • Config/: Hardware interface layer (GPIO, Delay, Module Init/Exit).
    • lib/GUI/: Image processing and drawing functions (GUI_Paint.c/.h).
    • lib/Fonts/: ASCII and Chinese font definitions.
    • lib/E-paper/: The core e-Paper driver functions.
    • Examples/: Test programs demonstrating specific usage methods.
  4. Overview of the library directory structure

    master

    The project is organized into several functional layers:

    • lib/Config/: Hardware interface layer. Contains definitions for data types, GPIO, and module lifecycle (DEV_Module_Init/Exit).
    • lib/GUI/: Image processing and drawing functions. Located in GUI_Paint.c(.h), it provides tools for creating shapes, flipping/mirroring images, setting pixels, clearing the screen, and drawing text (English/Chinese), lines, circles, and bitmaps.
    • lib/Fonts/: Font definitions for ASCII and Chinese characters.
    • lib/e-paper/: The core e-Paper driver functions.
    • Examples/: Test programs demonstrating how to use the library.
  5. Use GUI_Paint and Fonts for drawing

    master

    The project includes a GUI layer and font library for rendering content on the screen.

    GUI_Paint (GUI_Paint.c/.h): Provides functions for drawing:

    • Points
    • Lines
    • Rectangles
    • Circles
    • Filled shapes
    • Text (using the provided fonts)

    Fonts (Fonts/): Supported font sizes and dimensions:

    Ascii Fonts:

    • font8: 5x8
    • font12: 7x12
    • font16: 11x16
    • font20: 14x20
    • font24: 17x24

    Chinese (CN) Fonts:

    • font12CN: 16x21
    • font24CN: 32x41
  6. Image and Graphics Processing (GUI directory)

    master

    The GUI\ directory (via GUI_Paint.c/.h) provides functions for rendering content on the e-paper screen:

    • Image Processing: Creating, flipping, and mirroring graphics; setting individual pixels; clearing the screen.
    • Drawing primitives: Drawing points, lines, boxes, circles, and numbers.
    • Text Rendering: Supports both English (Ascii) and Chinese characters.
    • Bitmaps: Functions to display pre-defined bitmap images.
    • Time Display: A common function for displaying time on the screen.
  7. Use GUI and Font libraries for e-Paper displays

    master

    The project provides several libraries for drawing and text rendering located in \lib\:

    Image Processing (\lib\GUI\)

    Found in GUI_Paint.c(.h), these functions allow for:

    • Graphics Manipulation: Creating, flipping, mirroring, setting pixels, and clearing screens.
    • Drawing: Drawing points, lines, boxes, circles, Chinese characters, English characters, and numbers.
    • Display: Functions to display bitmaps and common time displays.

    Fonts (\lib\Fonts\)

    Available fonts include:

    • Ascii: Font8 (5x8), Font12 (7x12), Font16 (11x16), Font20 (14x20), Font24 (17x24).
    • Chinese: font12CN (16x21), font24CN (32x41).