Reference
The article serves as a reference for the DFRobot ePaper Library, outlining various API functions for initializing and manipulating ePaper displays. It highlights the supported font lattices, color options, and provides code snippets to demonstrate drawing and displaying capabilities, such as drawing shapes, filling rectangles, and displaying text on the ePaper screen.
Library
API List
At present, this module only supports the simplified Chinese of 1616 lattice and the ASCII characters of 168 lattice. For more fonts, font sizes will be updated later.
#include "DFRobot_IL0376F_SPI.h"
DFRobot_IL0376F_SPI eink; //Create an ePaper object
/*
* @Function:Set and initializeCS pin of font and ink screen.
* @Parameter1 cs_W21:CS pin of ink screen.
* D3: Available Pin.
* D4: Available Pin.
* @Parameter2 cs_GT30: Font CS pin.
* D5: Available Pin.
* D6: Available Pin.
* @Parameter3 dc:DC pin of ink screen.
* D8: Available pin.
* @Parameter4 busy: Busy pin of ink screen.
* D7: Available pin.
*/
void begin(const char cs_W21, const char cs_GT30, const char dc, busy);
/*
* @Function: Clear the screen and set the screen to the specified color
* @Parameter color: Color
*/
InkScreen_Error clear(uint8_t color);
/*
* @Function: Display picture(212*104), Picture colors can be red, white, black.
* @Parameter1 pic_bw: Black and white picture
* @parameter2 pic_red: Red picture
*/
void drawPicture(const unsigned char *pic_bw, const unsigned char *pic_red);
/*
* @Function: Refresh the screen
*/
void flush(void);
/*
* @Function; Display the character string.
* @Parameter1 (x,y):Coordinate (x∈(0,211),y∈(0,103).
* @Parameter2 ch:Import character string.
* @Parameter3 color:Red/Black/White
*/
void disString(uint8_t x, uint8_t y, char *ch, uint8_t color);
/*
* @Function: Drawing points
* @Parameter1 (x,y):Coordinate (x∈(0,211),y∈(0,103).
* @Parameter2 color:Red/Black/White
*/
InkScreen_Error drawPoint(const unsigned char x, const unsigned char y, const unsigned char color);
/*
* @Function: Drawing lines.
* @Parameter1 [(x1,y1),(x2,y2)]:Line endpoint coordinates (x1/x2∈(0,211),y1/y2∈(0,103)).
* @Parameter2 color: Red/Black/White
*/
InkScreen_Error drawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint8_t color);
/*
* @Function: Drawing rectangle box
* @Parameter1 (x1,x2):Starting abscissa (x1/x2∈(0,211)).
* @Parameter2 (y1,y2): Starting ordinate (y1/y2∈(0,103)).
* @Parameter3 color:Red/Black/White.
*/
InkScreen_Error drawRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint8_t color);
/*
* @Function: Filling rectangle.
* @Parameter1 (x1,x2):Starting abscissa (x1/x2∈(0,211)).
* @Paremeter2 (y1,y2):Starting ordinate (y1/y2∈(0,103)).
* @Parameter3 color: Red/Black/White.
*/
InkScreen_Error drawFillRect(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint8_t color);
/*
* @Function:Draw a rounded border or fill a circle.
* @Parameter1 (xc,yc): Center coordiante (xc∈(0,211),yc∈(0,103).
* @Parameter2 r: radius (r<=52).
* @Parameter3 fill: 0:Drawing a circle border 1: Filling circle.
* @Parameter4 color: Red/Black/White.
*/
InkScreen_Error drawCircle(uint16_t xc, uint16_t yc, uint16_t r, uint16_t fill, uint8_t color);
Was this article helpful?
