Add an eInk display to your own project!
On this Page:
Follow these steps to add Mikroe eInk Click P2 driver to your project:
- Download the latest release .zip file - get project files
- Include project object(s) in your top-object-file - adjust your top-level file
- Add your own display code
Additional pages:
- Main Page - Return to the top of this repo
Go to the project Releases page expand the Assets heading to see the demo-archive-set.zip file link. Click on it to download the .zip file. Unpack it and move the files into your project.
Lastly you'll start the objects and then add your writte to display code.
You now need to add eInk objects to your project.
- isp_eInk_click.spin2 - the new click driver code. It also includes the fonts
You simply include them with something like:
OBJ { Objects Used by this Object }
eInkDisplay : "isp_eInk_click" ' include the driver, fonts
Starting eInk driver object in Spin2 is also pretty simple:
CON { click module io pins }
' our Click module is on 16-31!
EINK_CLICK_PINGROUP = eInkDisplay.PINS_P16_P31
' we are using a 2.13" eInk display
EINK_DISPLAY_TYPE = eInkDisplay.DS_eink213
PUB main() | ok
'' DEMO let's see what our radio hears!
' tell object where the module is connected
ok := eInkDisplay.start(EINK_DISPLAY_TYPE, EINK_CLICK_PINGROUP)
if not ok
debug("* SPI FAILED to start")
else
debug("* SPI started OK")
... and do your app stuff from here on ...
eInkDisplay.stop() ' if you wish to shutdown COGs and release motor pins
You are now at the ... and do your app stuff from here on ...
section of this page.
From here on, just use any of the Public Methods found in the interface description. Here's a quick (maybe partial) summary:
Method Signature | Purpose |
---|---|
PUB start(eDisplayType, eClickBasePin) : ok | Specify the eval board connect location for the EINK click and start SPI ** eDisplayType** is [DS_eink154, DS_eink200, DS_eink213, or DS_eink290] eClickBasePin is [PINS_P0_P15, PINS_P16_P31, or PINS_P32_P47] |
PUB stop() | Stop the EINK Click SPI Object |
PUB resetDevice() | Reset the EINK device |
PUB displaySize() : widthInPix, heightInPix | Return display size in pixels NOTE: only valid is device is successfully started! (ensure start() is called, first and that it is successful!) |
PUB displayType() : eDisplayType | Return display size in pixels NOTE: only valid is device is successfully started! (ensure start() is called, first and that it is successful!) ** eDisplayType** is [DS_eink154, DS_eink200, DS_eink213, or DS_eink290] |
WRITE DIRECTLY TO DISPLAY | |
PUB fillScreen(color) | Fill Display with {color} |
PUB displayImage(pImageBffr) | Write image bitmap to Display |
PUB displayTextAtXY(X, Y, pText) | Write zstr to Display at device row, column |
WRITE TO BUFFER | (NOTE: when all buffer writes done call flushToDisplay() to commit) |
PUB setFont(orientation, color, eFont) | Set font configuration |
PUB setBackground(color) | Fill Frame Buffer with {color} |
PUB setTextAtXY(X, Y, pText) | Write zstr to Frame Buffer at device row, column |
PUB fillRegionAt(X, Y, color, width, height) | Fill region of Frame Buffer with color |
PUB borderAtXY(X, Y, color, thickness, width, height) | Draw border of thinkness* into Frame Buffer |
PUB lineAtXY(fmX, fmY, toX, toY, color) | Draw line into Frame Buffer |
PUB circleAtXY(X, Y, diameter, color) | Draw circle into Frame Buffer |
PUB placeImageAtXY(X, Y, pImgBits, imgWidth, imgHeight, rotation) | Overlay image bits* of color into Frame Buffer |
PUB flushToDisplay() | Flush Frame Buffer content to Display |
- thickness - of the
borderAtXY()
method may not yet be working... - See Create bitmaps for display on your eInk device for creating bitmaps to use with
placeImageAtXY()
.
Have Fun!
If you like my work and/or this has helped you in some way then feel free to help me out for a couple of ☕'s or 🍕 slices!
Parallax, Propeller Spin, and the Parallax and Propeller Hat logos are trademarks of Parallax Inc., dba Parallax Semiconductor
Licensed under the MIT License.
Follow these links for more information: