Reference
Last revision 2026/01/23
Driver
To make the e-ink display work properly, we have to install function library. The library provides the driving program of e-ink display and sample code. The library only supports Python at present. We will provide more libraries under users' requirement later.
To integrate Rock 4se, installation is required beforehandlibmraa
Access the /boot/hw_intfc.conf file and modify it as follows:

- For V1.0:
command: git clone https://github.com/DFRobot/DFRobot_RPi_Display
- For V2.0:
command: git clone https://github.com/DFRobot/DFRobot_RPi_Display_V2
- For V3.0:
command: git clone https://github.com/cdjq/DFRobot_RPi_Eink_Display_V3
API Description
- epaper.clear(self, color)
@Function description: clear the screen, remove the content in buffer display.
@Parameter color: color. Value epaper.WHITE, epaper.BLACK
- epaper.flush(self, mode)
@Function description: select refresh mode
@Parameter mode:refresh mode
epaper.FULL:refresh fully
epaper.PART:refresh partially
Calling functions about geometrical figure
- epaper.setLineWidth(self, w)
@Function description: set the line width of the figure
@parameter w: line width
- epaper.pixel(self, x, y, color)
@Fucntion description:draw a point
@(parameter1, parameter2) (x, y):position of the point(row, column)
@parameter3 color:color of the point. Value epaper.BLACK, epaper.WHITE
- epaper.VLine(self, x, y, h, color)
@Function description: draw a vertical line
@(parameter1,parameter2) (x, y): starting point of the vertical line.
@ parameter3 h:height of vertical line
@ parameter4 color:line color, value epaper.BLACK, epaper.WHITE.
- epaper.HLine(self, x, y, w, color)
@Function description: draw a horizontal line
@(parameter1,parameter2) (x, y): starting point of the horizontal line
@parameter3 w:width of horizontal line
@parameter4 color: line color, value epaper.BLACK, epaper.WHITE.
- epaper.line(self, x, y, x1, y1, color)
@Function description:draw a line arbitrarily
@(parameter1,parameter2) (x, y): starting point of the line
@(parameter3,parameter4) (x1, y1): ending point of the line
@ parameter 4 color: line color, value epaper.BLACK, epaper.WHITE.
- epaper.triangle(self, x, y, x1, y1, x2, y2, color)
@Function description: draw a triangle
@(parameter1,parameter2) (x, y): the position of the first apex of the triangle
@(parameter3,parameter4) (x1, y1):the position of the second apex of the triangle
@(parameter5,parameter6) (x2, y2): the position of the third apex of the triangle
@parameter7 color:triangle color, value epaper.BLACK, epaper.WHITE.
- epaper.fillTriangle(self, x, y, x1, y1, x2, y2, color)
@Fucnton description: draw a filled triangle
@(parameter1,parameter2) (x, y): the position of the first apex of the triangle
@(parameter3,parameter4) (x1, y1):the position of the second apex of the triangle
@(parameter5,parameter6) (x2, y2): the position of the third apex of the triangle
@parameter7 color:triangle color, value epaper.BLACK, epaper.WHITE.
- epaper.rect(self, x, y, w, h, color)
@Function description: draw a rectangle
@(parameter1,parameter2) (x, y): the position of the upper-left apex of the rectangle
@paramter3 w: rectangle width
@parameter4 h:rectangle height
@parameter5 color:rectangle color value epaper.BLACK, epaper.WHITE.
- epaper.fillRect(self, x, y, w, h, color)
@Function description: draw a filled rectangle
@(parameter1,parameter2) (x, y): the position of the upper-left apex of the rectangle
@paramter3 w: rectangle width
@parameter4 h:rectangle height
@parameter5 color:rectangle color value epaper.BLACK, epaper.WHITE.
- epaper.circleHelper(self, x, y, r, quadrant, color)
@Function description:draw an arc in a quadrant
@(paramter1,paramter2) (x, y): the position of the certer point of the circle
@parameter3 r:radius of the circle
@parameter4 quadrant:quadrant. For value, refer to the define related to quadrant in class.
@paramter5 color:color,value epaper.BLACK, epaper.WHITE.
- epaper.fillCircleHelper(self, x, y, r, quadrant, color)
@Function description:draw a sector in a quadrant
@(parameter1,parameter2) (x, y): the position of the center point of the circle
@parameter3 r:radius of the circle
@parameter4 quadrant:quadrant. Value 1,2,3,4
@parameter5 color:sector color, value epaper.BLACK, epaper.WHITE.
- epaper.circle(self, x, y, r, color)
@Function description:draw a circle
@(parameter1,parameter2) (x, y): the position of the center point
@parameter3 r: radius of the circle
@parameter4 color:color of the circle. Value epaper.BLACK, epaper.WHITE。
- epaper.fillCircle(self, x, y, r, color)
@Function description: draw a filled circle
@(parameter1,parameter2) (x, y): the position of the center point
@parameter3 r:radius of the circle
@parameter4 color:color of the circle, value epaper.BLACK, epaper.WHITE.
- epaper.roundRect(self, x, y, w, h, r, color)
@Function description:draw a rounded rectangle
@(parameter1,parameter2) (x, y): the crossing point of the extension lines of adjacent sides at the upper-left corner.
@parameter3 w: the width of the rounded rectangle
@parameter4 h:the height of the rounded rectangle
@parameter5 r:the radius of the rounded rectangle
@parameter6 color:the color of the rounded rectangle, value epaper.BLACK, epaper.WHITE.
- epaper.fillRoundRect(self, x, y, w, h, r, color)
@Function description:draw a filled rounded rectangle
@(parameter1,parameter2) (x, y):
@parameter3 w:width
@parameter4 h:height
@parameter5 r:radius of the circle
@parameter6 color:color, value epaper.BLACK, epaper.WHITE。
Calling functions about bitmap display
- epaper.setBitmapSize(self, size)
@Function display:set the size of the bitmap
@parameter size:size of the bitmap that is going to be magnified. value 1,2,...the bitmap is doubled in the screen by default
- epaper.setBitmapFmt(self, fmt)
@Function description: set the scan mode of the bitmap
@parameter fmt:scan mode.The default one is BITMAP_TBMLLR in screen.
BITMAP_TBMLLR:scan from top to bottom. The high byte in array will be printed at left,low byte, right. For example, the first byte 0xf0 in the bitmap will be printed like this:[*] [*] [*] [*] [] [] [] []
BITMAP_TBMRLL:scan from top to bottom, right to left
BITMAP_BTMLLR:scan from bottom to top, left to right
BITMAP_BTMRLL:scan from bottom to top, right to left
BITMAP_LRMTLB:scan from left to right, print from top to bottom
BITMAP_LRMBLT:scan from left to right, bottom to top
BITMAP_RLMTLB:scan from right to left, top to bottom
BIMTAP_RLMBLT:scan from right to left, bottom to top
BITMAP_UNKNOW:unknown bitmap scan
- epaper.bitmap(self, x, y, bitmap, w, h, color, background)
@Function description:draw bitmap displayed in the form of array.
@(parameter1,parameter2) (x, y): the upper-left vertices of the displayed bitmap
@parameter3 bitmap:array
@parameter4 w:width
@parameter5 h:height
@parameter6 color:color, black by default
@parameter7 background:background color, white by default
- epaper.bitmapFile(self, x, y, path)
@Function description:display the file of the bitmap
@(parameter1,parameter2) (x, y): the upper-left vertices of the displayed bitmap
@parmaeter3 path:bitmap file path
Calling functions about font display
- epaper.setExFonts(self, obj)
@Function description:create the class of font expansion
@parameter obj:one class of FreetypeHelper or other class meeting the requirement.
- epaper.setTextCursor(self, x, y)
@Functon description:set initial position of the font display
@(parameter1,parameter2) (x, y): the position of the cursor
- epaper.setTextFormat(self, size, color, background, intervalRow = 2, intervalCol = 0)
@Function description:set font format
@parameter1 size:font size. Value 1,2,3,...
@parameter2 color: font color. Value epaper.BLACK, epaper.WHITE.
@parameter3 background: font background color, white by default
@parameter4 intervalRow:row-spacing, default space: 2
@parameter5 intervalCol:column-spacing, default space: 0
- epaper.setDisLowerLimite(self, limite)
@Function description:set font weight
@parameter1 limite: range 0~255
- epaper.setExFontsFmt(self, width, height)
@Function:set the width and height of the expansion font
@parameter1 width:width
@parameter2 height:height
- epaper.printStr(self, c)
@Function description:display a character string
@parameter c:character string
- epaper.printStrLn(self, c)
@Function description:display a character string and feed lines.
@parameter c:character string
Dataset
GDEH0213B1 V3.1 Product Specification
Principle
Although E-ink display is a very popular type of electronic paper display technology, due to the imaging principle, there are also some defects including screen splash and afterimage issue. After repeatedly turning the page, the ink will remain, which causes the afterimage problem. To deal with that, manufactures designed the full refresh function, however, another issue occurred: the screen will flashes for a while when refreshing fully.
Compatibility Test
| MCU | Work Well |
|---|---|
| Raspberry Pi 4 | √ |
| Raspberry Pi 3B | √ |
| Raspberry Pi 3B+ | √ |
| Raspberry Pi Zero W | √ |
| aspberry Pi 2B+ | √ |
Dimension Diagram
- Pin-spacing: 2.54mm
- Board Size: 66.5mm × 31 mm
- Thickness: 1.6mm
More Documents
Attention: if you want to alter the customized font and language, you have to download the GPL ttf file from the internet, place it to /DFRobot_RPi_Display/examples/resources, then call the file in the programs.
Was this article helpful?
