libEinkShield_mbedcli_ARM_KL25Z

Dependents:   EInkShield_HelloWorld EinkShield_HelloWorld_ARM_KL25Z

Fork of libEinkShield_mbedcli_ARM_KL25Z by kevin tseng

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

Import programEinkShield_HelloWorld_ARM_KL25Z

EInkShield_HelloWorld

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.

EinkShield.h

Committer:
jauming
Date:
2018-08-21
Revision:
0:4e696f5cac60

File content as of revision 0:4e696f5cac60:

/*
Copyright (c) 2017-2018, E Ink Holdings Inc., All Rights Reserved
SPDX-License-Identifier: LicenseRef-PBL

This file and the related binary are licensed under the Permissive Binary 
License, Version 1.0 (the "License"); you may not use these files except in 
compliance with the License.

You may obtain a copy of the License here: 
LICENSE-permissive-binary-license-1.0.txt and at
https://www.mbed.com/licenses/PBL-1.0

See the License for the specific language governing permissions and limitations 
under the License.
*/
/**
 * \mainpage EinkShield usage sample code
 * \code
 * #include "mbed.h"
 * #include "EinkShield.h"
 * #include "image3.h"
 * int main() {        
 *     EinkShield epd(EL029TR1,
 *                  D7,
 *                  D6,
 *                  D5,
 *                  D10,
 *                  D2,
 *                  D13,
 *                  D11);        
 *     epd.EPD_Init();   
 *     epd.EPD_Display_Red();
 *     wait_ms(2000); 
 *     while(1) {  
 *        epd.EPD_Display_KWR(sale2_KW, sale2_R);
 *        wait_ms(2000); 
 *    } 
 * }
 * \endcode
 */
#ifndef EINK_SHIELD_H
#define EINK_SHIELD_H

typedef enum {
    EL029TR1,  
} EPD_driver;


/** @class EinkShield EinkShield.h */
/** class EinkShield for mbed-os */
class EinkShield {
private:
    DigitalOut bsi  ;//(D7);
    DigitalOut rstn ;//(D6);
    DigitalIn  busyn;//(D5);
    DigitalOut csb  ;//(D10);
    DigitalOut dc   ;//(D2);
    DigitalOut scl  ;//(D13);
    DigitalOut sda  ;//(D11);
       
    EPD_driver driver;
 
public:
   /**
    *    Constructor to set pin assignment and driver
    *    @param driver select different size display driver for EinkShield, for example: EL029TR1
    *    @param bsi_pin bus selection pin
    *    @param rstn_pin reset pin, L: driver will reset when low
    *    @param busyn_pin busy pin, L: driver is busy
    *    @param csb_pin chip-select pin
    *    @param dc_pin data/command pin
    *    @param scl_pin serial clock pin
    *    @param sda_pin serial data pin
    *    @return none
    */ 
    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);
   /**
    *    Driver initial
    *    @param none
    *    @return none
    */          
    void EPD_Init(void);
   /**
    *    Display image with color: black, white and red.
    *    <pre>
    *    Resolution of EL029TR1 is 128x296.
    *    Pixel data alignment is from left to right and from top to bottom.
    *
    *    <STRONG>img_kw</STRONG> point to black and white raw pixel data of image, 
    *    1 bit per pixel, 0 = black, 1 = white,  
    *    Total size of img_kw is 128x296/8 = 4736 bytes for EL029TR1.
    *
    *    <STRONG>img_r</STRONG> point to red raw pixel data of image, 
    *    1 bit per pixel, 0 = red, 1 = reserved, 
    *    Total size of img_r is 128x296/8 = 4736 bytes for EL029TR1.
    *    </pre>
    *    
    *    @param img_kw <pre>point to black and white raw pixel data of image, 
    *    1 bit per pixel, 0 = black, 1 = white,</pre>
    *  
    *    @param img_r <pre>point to red raw pixel data of image, 
    *    1 bit per pixel, 0 = red, 1 = reserved,</pre>
    *    
    *    
    *    @return none
    */   
    void EPD_Display_KWR(unsigned char const *img_kw, unsigned char const *img_r);
   /**
    *    Display full screen red
    *    
    *    @param none
    *    @return none
    */   
    void EPD_Display_Red(void);          
};



#endif