EpdWaitForIdle()

Library Description ›› EPD ›› Common ›› Control ››
… visits
Parent Previous Next

Syntax

EpdWaitForIdle()

Overview

Wait until driver IC is idle.


This procedure waits on the BUSY pin, which the controller drives to indicate whether it's ready to accept a new command.
Almost all EPD controllers expose a BUSY pin specifically for this purpose — a new command must not be issued while the controller is still mid-refresh, or the in-progress update can be corrupted.


In normal use, the library calls this internally wherever it's actually needed, so most users will never need to call it directly — but it's useful to know it exists.


This library supports two ways of handling BUSY, selected via the EpdIdle configuration option:

$define EpdIdle SW

SW mode (default) — After an update-related command is sent to the EPD, the library waits for the BUSY pin to clear before returning, blocking code execution for the duration.
The calling code simply continues normally once the command completes; no BUSY handling of your own is required.


IRQ mode — The command is sent and control returns immediately, without waiting for BUSY.
Your program is free to do other work in the meantime. It's then up to you to determine when the controller has actually finished — either by polling the BUSY pin periodically, or by wiring it to a hardware interrupt and resuming EPD-related work when that interrupt fires.
The key difference is simply this: in IRQ mode, the command itself never waits on BUSY — how you detect completion afterward is entirely your choice.

Note: SW mode is the library's default and is recommended unless your application specifically needs the MCU free to do other work during a refresh.
Getting BUSY handling wrong is a common source of intermittent, hard-to-reproduce glitches in EPD projects — particularly when timing is managed manually, or when code is ported over from display types (like most TFTs) where every write completes synchronously and no such wait is ever needed.


            EpdWaitForIdle()

Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps