libEinkShield_mbedcli_ARM_KL25Z

The actual display component with e-paper and Mbed board

/media/uploads/jauming/imag1222_1k_2.png

Key Features

  • SPI interface to EPD display
  • Gray level support(Black, White and Red)
  • Flash memory - 128MB
  • One GPIO connected to LED
  • Four push buttons for user feedback

Peripherals/IOs

/media/uploads/jauming/2a_peripherals_ios_mbed-driving-board-function-500_switches.jpg

Pinout

/media/uploads/jauming/mbed_pinout_v05.png

Typical connection

  • Compatible with Arduino Headers /media/uploads/jauming/3_simple_procedures_how_to_connect_the_component_to_the_main_board_compatible_with_arduino_headers_typical_connection.jpg

Datasheet

Program and Library

[Repository '/users/jauming/code/EinkShield_HelloWorld/' not found]

Import librarylibEinkShield_mbedcli_ARM_KL25Z

libEinkShield_mbedcli_ARM_KL25Z

Import librarylibEinkShield_mbedcli_ARM_K22F

libEinkShield_mbedcli_ARM_K22F

Import librarylibEinkShield_mbedcli_ARM_NUCLEO_F446RE

libEinkShield_mbedcli_ARM_NUCLEO_F446RE

Import library

Public Member Functions

EinkShield (EPD_driver driver, PinName bsi_pin, PinName rstn_pin, PinName busyn_pin, PinName csb_pin, PinName dc_pin, PinName scl_pin, PinName sda_pin)
Constructor to set pin assignment and driver.
void EPD_Init (void)
Driver initial.
void EPD_Display_KWR (unsigned char const *img_kw, unsigned char const *img_r)
Display image with color: black, white and red.
void EPD_Display_Red (void)
Display full screen red.
Committer:
jauming
Date:
Tue Aug 21 02:18:23 2018 +0000
Revision:
0:4e696f5cac60
libEinkShield_mbedcli_ARM_KL25Z

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jauming 0:4e696f5cac60 1 /*
jauming 0:4e696f5cac60 2 Copyright (c) 2017-2018, E Ink Holdings Inc., All Rights Reserved
jauming 0:4e696f5cac60 3 SPDX-License-Identifier: LicenseRef-PBL
jauming 0:4e696f5cac60 4
jauming 0:4e696f5cac60 5 This file and the related binary are licensed under the Permissive Binary
jauming 0:4e696f5cac60 6 License, Version 1.0 (the "License"); you may not use these files except in
jauming 0:4e696f5cac60 7 compliance with the License.
jauming 0:4e696f5cac60 8
jauming 0:4e696f5cac60 9 You may obtain a copy of the License here:
jauming 0:4e696f5cac60 10 LICENSE-permissive-binary-license-1.0.txt and at
jauming 0:4e696f5cac60 11 https://www.mbed.com/licenses/PBL-1.0
jauming 0:4e696f5cac60 12
jauming 0:4e696f5cac60 13 See the License for the specific language governing permissions and limitations
jauming 0:4e696f5cac60 14 under the License.
jauming 0:4e696f5cac60 15 */
jauming 0:4e696f5cac60 16 /**
jauming 0:4e696f5cac60 17 * \mainpage EinkShield usage sample code
jauming 0:4e696f5cac60 18 * \code
jauming 0:4e696f5cac60 19 * #include "mbed.h"
jauming 0:4e696f5cac60 20 * #include "EinkShield.h"
jauming 0:4e696f5cac60 21 * #include "image3.h"
jauming 0:4e696f5cac60 22 * int main() {
jauming 0:4e696f5cac60 23 * EinkShield epd(EL029TR1,
jauming 0:4e696f5cac60 24 * D7,
jauming 0:4e696f5cac60 25 * D6,
jauming 0:4e696f5cac60 26 * D5,
jauming 0:4e696f5cac60 27 * D10,
jauming 0:4e696f5cac60 28 * D2,
jauming 0:4e696f5cac60 29 * D13,
jauming 0:4e696f5cac60 30 * D11);
jauming 0:4e696f5cac60 31 * epd.EPD_Init();
jauming 0:4e696f5cac60 32 * epd.EPD_Display_Red();
jauming 0:4e696f5cac60 33 * wait_ms(2000);
jauming 0:4e696f5cac60 34 * while(1) {
jauming 0:4e696f5cac60 35 * epd.EPD_Display_KWR(sale2_KW, sale2_R);
jauming 0:4e696f5cac60 36 * wait_ms(2000);
jauming 0:4e696f5cac60 37 * }
jauming 0:4e696f5cac60 38 * }
jauming 0:4e696f5cac60 39 * \endcode
jauming 0:4e696f5cac60 40 */
jauming 0:4e696f5cac60 41 #ifndef EINK_SHIELD_H
jauming 0:4e696f5cac60 42 #define EINK_SHIELD_H
jauming 0:4e696f5cac60 43
jauming 0:4e696f5cac60 44 typedef enum {
jauming 0:4e696f5cac60 45 EL029TR1,
jauming 0:4e696f5cac60 46 } EPD_driver;
jauming 0:4e696f5cac60 47
jauming 0:4e696f5cac60 48
jauming 0:4e696f5cac60 49 /** @class EinkShield EinkShield.h */
jauming 0:4e696f5cac60 50 /** class EinkShield for mbed-os */
jauming 0:4e696f5cac60 51 class EinkShield {
jauming 0:4e696f5cac60 52 private:
jauming 0:4e696f5cac60 53 DigitalOut bsi ;//(D7);
jauming 0:4e696f5cac60 54 DigitalOut rstn ;//(D6);
jauming 0:4e696f5cac60 55 DigitalIn busyn;//(D5);
jauming 0:4e696f5cac60 56 DigitalOut csb ;//(D10);
jauming 0:4e696f5cac60 57 DigitalOut dc ;//(D2);
jauming 0:4e696f5cac60 58 DigitalOut scl ;//(D13);
jauming 0:4e696f5cac60 59 DigitalOut sda ;//(D11);
jauming 0:4e696f5cac60 60
jauming 0:4e696f5cac60 61 EPD_driver driver;
jauming 0:4e696f5cac60 62
jauming 0:4e696f5cac60 63 public:
jauming 0:4e696f5cac60 64 /**
jauming 0:4e696f5cac60 65 * Constructor to set pin assignment and driver
jauming 0:4e696f5cac60 66 * @param driver select different size display driver for EinkShield, for example: EL029TR1
jauming 0:4e696f5cac60 67 * @param bsi_pin bus selection pin
jauming 0:4e696f5cac60 68 * @param rstn_pin reset pin, L: driver will reset when low
jauming 0:4e696f5cac60 69 * @param busyn_pin busy pin, L: driver is busy
jauming 0:4e696f5cac60 70 * @param csb_pin chip-select pin
jauming 0:4e696f5cac60 71 * @param dc_pin data/command pin
jauming 0:4e696f5cac60 72 * @param scl_pin serial clock pin
jauming 0:4e696f5cac60 73 * @param sda_pin serial data pin
jauming 0:4e696f5cac60 74 * @return none
jauming 0:4e696f5cac60 75 */
jauming 0:4e696f5cac60 76 EinkShield(EPD_driver driver,
jauming 0:4e696f5cac60 77 PinName bsi_pin,
jauming 0:4e696f5cac60 78 PinName rstn_pin,
jauming 0:4e696f5cac60 79 PinName busyn_pin,
jauming 0:4e696f5cac60 80 PinName csb_pin,
jauming 0:4e696f5cac60 81 PinName dc_pin,
jauming 0:4e696f5cac60 82 PinName scl_pin,
jauming 0:4e696f5cac60 83 PinName sda_pin);
jauming 0:4e696f5cac60 84 /**
jauming 0:4e696f5cac60 85 * Driver initial
jauming 0:4e696f5cac60 86 * @param none
jauming 0:4e696f5cac60 87 * @return none
jauming 0:4e696f5cac60 88 */
jauming 0:4e696f5cac60 89 void EPD_Init(void);
jauming 0:4e696f5cac60 90 /**
jauming 0:4e696f5cac60 91 * Display image with color: black, white and red.
jauming 0:4e696f5cac60 92 * <pre>
jauming 0:4e696f5cac60 93 * Resolution of EL029TR1 is 128x296.
jauming 0:4e696f5cac60 94 * Pixel data alignment is from left to right and from top to bottom.
jauming 0:4e696f5cac60 95 *
jauming 0:4e696f5cac60 96 * <STRONG>img_kw</STRONG> point to black and white raw pixel data of image,
jauming 0:4e696f5cac60 97 * 1 bit per pixel, 0 = black, 1 = white,
jauming 0:4e696f5cac60 98 * Total size of img_kw is 128x296/8 = 4736 bytes for EL029TR1.
jauming 0:4e696f5cac60 99 *
jauming 0:4e696f5cac60 100 * <STRONG>img_r</STRONG> point to red raw pixel data of image,
jauming 0:4e696f5cac60 101 * 1 bit per pixel, 0 = red, 1 = reserved,
jauming 0:4e696f5cac60 102 * Total size of img_r is 128x296/8 = 4736 bytes for EL029TR1.
jauming 0:4e696f5cac60 103 * </pre>
jauming 0:4e696f5cac60 104 *
jauming 0:4e696f5cac60 105 * @param img_kw <pre>point to black and white raw pixel data of image,
jauming 0:4e696f5cac60 106 * 1 bit per pixel, 0 = black, 1 = white,</pre>
jauming 0:4e696f5cac60 107 *
jauming 0:4e696f5cac60 108 * @param img_r <pre>point to red raw pixel data of image,
jauming 0:4e696f5cac60 109 * 1 bit per pixel, 0 = red, 1 = reserved,</pre>
jauming 0:4e696f5cac60 110 *
jauming 0:4e696f5cac60 111 *
jauming 0:4e696f5cac60 112 * @return none
jauming 0:4e696f5cac60 113 */
jauming 0:4e696f5cac60 114 void EPD_Display_KWR(unsigned char const *img_kw, unsigned char const *img_r);
jauming 0:4e696f5cac60 115 /**
jauming 0:4e696f5cac60 116 * Display full screen red
jauming 0:4e696f5cac60 117 *
jauming 0:4e696f5cac60 118 * @param none
jauming 0:4e696f5cac60 119 * @return none
jauming 0:4e696f5cac60 120 */
jauming 0:4e696f5cac60 121 void EPD_Display_Red(void);
jauming 0:4e696f5cac60 122 };
jauming 0:4e696f5cac60 123
jauming 0:4e696f5cac60 124
jauming 0:4e696f5cac60 125
jauming 0:4e696f5cac60 126 #endif