Reference

Last revision 2025/12/27

Learn about API functions for drawing on ink screens, including methods for initializing, clearing screens, and rendering various shapes and lines.

API Description

/*!
 * @Function:  Set and initializeCS pin of font and ink screen
 *
 * @Parameter   busy:  BUSY pin of ink screen
 *         D7: Available pin(directly plug in)
 */
void begin(const char busy);
/*!
 * @Function: Clear the screen and set the screen to the specified color.
 *
 * @Paremeter   mode: refresh way
 *        PART:  Part refreshment
 *        FULL: Full refreshment
 */
void flush(uint8_t mode);
/*!
 * @Function: Display picture
 *
 * @Paremeter   pic      Black-and White picture
 */
void drawPicture(const unsigned char *pic);
/*!
 * @Function: Display character string
 *
 * @Parameter   x: Abscissa
 *        y: Ordinate
 *        size: Font size
 *        ch: Characters for display
 *        color: Black/White
 */
void disString(uint8_t x, uint8_t y, uint8_t size, char *ch, uint8_t color);
/*!
 * @Function: Fill in the screen
 * @Parameter    color: Fill in the color
 */
void fillScreen(uint16_t color);
/*!
 * @Function: Draw pixel
 * @Parameter   x: Abscissa
 *        y: Ordinate
 */
void drawPixel(int16_t x, int16_t y, uint16_t color);
/*!
 * @Function: Draw lines
 *
 * @Parameter   x0:  The abscissa of the starting point
 *        y0: The ordinate of the starting point
 *        x1: The abscissa of the ending point
 *        y1: The ordinate of the ending point
 *        color: The color of the line
 */
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
/*!
 * @Function: Draw a horizontal line
 *
 * @Parameter   x: The x-axis of the starting point
 *        y: The y-axis of the starting point
 *        width:  the length of the line
 */
void drawHLine(int16_t x, int16_t y, int16_t width, uint16_t color);
/*!
 * @Function: Draw an vertical line
 *
 * @Parameter   x: The x-axis of the starting point
 *        y: The y-axis of the starting point
 *        height: The length of the line
 */
void drawVLine(int16_t x, int16_t y, int16_t height, uint16_t color);
/*!
 * @Function: Draw rectangles
 *
 * @Parameter   x: The x-axis of the starting point
 *        y: The y-axis of the starting point
 *        width: The length of rectangle
 *        height: The width of rectangle
 *
void drawRect(int16_t x, int16_t y, int16_t width, int16_t height, uint16_t color);
/*!
 * @Function: Draw a filled rectangle
 * @Parameter   x: The x-axis of starting point
 *        y: The y-axis of starting point
 *        width: The length of filled rectangle
 *        height: The width of filled rectangle
 */
void fillRect(int16_t x, int16_t y, int16_t width, int16_t height, uint16_t color);
/*!
 * @Function: Draw a circle
 *
 * @Parameter   x: The abscissa of center
 *        y: The ordinate of center
 *        r: radius
 */
void drawCircle(int16_t x, int16_t y, int16_t r, uint16_t color);
/*!
 * @Function: Draw a filled circle
 *
 * @Parameter   x: The abscissa of center
 *        y: The ordinate of center
 *        r: Radius
 */
void fillCircle(int16_t x, int16_t y, int16_t r, uint16_t color);
/*!
 * @Function: Draw an triangle
 *
 * @Parameter   x0: The abscissa of first point
 *        y0: The ordinate of first point
 *        x1: The abscissa of second point
 *        y1: The ordinate of second point
 *        x2: The abscissa of third point
 *        y2: The ordinate of third point
 */
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
/*!
 * @Function: Draw a filled triangle
 *
 * @Parameter   x0: The abscissa of first point
 *        y0: The ordinate of first point
 *        x1: The abscissa of second point
 *        y1: The ordinate of second point
 *        x2: The abscissa of third point
 *        y2: The ordinate of third point
 */
void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
/*!
 * @Function: Draw a rounded rectangle
 *
 * @Parameter   x: The x-axis of starting point
 *        y: The y-axis of starting point
 *        width: The length of rounded rectangle
 *        height: The width of rounded rectangle
 *        r: radius
 */
void drawRoundRect(int16_t x, int16_t y, int16_t width, int16_t height, int16_t r, uint16_t color);
/*!
 * @Funciton: Draw a filled rounded rectangle
 *
 * @Parameter  x: The x-axis of starting point
 *        y: The y-axis of starting point
 *        width: The length of rounded rectangle
 *        height: The width of rounded rectangle
 *        r: radius
 */
void fillRoundRect(int16_t x, int16_t y, int16_t width, int16_t height, int16_t r, uint16_t color);

Was this article helpful?

ON THIS PAGE

TOP