Library for Waveshare 2.7" tri-colour e-Paper display.

Dependents:   ePD_2_7b_example

Committer:
mdroberts1243
Date:
Fri Dec 06 23:24:50 2019 +0000
Revision:
0:9e6a8e3cd8de
First commit of code modified from Kanjia examples for 2.13" Waveshare example

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mdroberts1243 0:9e6a8e3cd8de 1 /**
mdroberts1243 0:9e6a8e3cd8de 2 * @filename : epdif.h
mdroberts1243 0:9e6a8e3cd8de 3 * @brief : Header file of epdif.cpp providing EPD interface functions
mdroberts1243 0:9e6a8e3cd8de 4 * Users have to implement all the functions in epdif.cpp
mdroberts1243 0:9e6a8e3cd8de 5 * @author : Yehui from Waveshare
mdroberts1243 0:9e6a8e3cd8de 6 *
mdroberts1243 0:9e6a8e3cd8de 7 * Copyright (C) Waveshare August 10 2017
mdroberts1243 0:9e6a8e3cd8de 8 *
mdroberts1243 0:9e6a8e3cd8de 9 * Permission is hereby granted, free of charge, to any person obtaining a copy
mdroberts1243 0:9e6a8e3cd8de 10 * of this software and associated documnetation files (the "Software"), to deal
mdroberts1243 0:9e6a8e3cd8de 11 * in the Software without restriction, including without limitation the rights
mdroberts1243 0:9e6a8e3cd8de 12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
mdroberts1243 0:9e6a8e3cd8de 13 * copies of the Software, and to permit persons to whom the Software is
mdroberts1243 0:9e6a8e3cd8de 14 * furished to do so, subject to the following conditions:
mdroberts1243 0:9e6a8e3cd8de 15 *
mdroberts1243 0:9e6a8e3cd8de 16 * The above copyright notice and this permission notice shall be included in
mdroberts1243 0:9e6a8e3cd8de 17 * all copies or substantial portions of the Software.
mdroberts1243 0:9e6a8e3cd8de 18 *
mdroberts1243 0:9e6a8e3cd8de 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
mdroberts1243 0:9e6a8e3cd8de 20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
mdroberts1243 0:9e6a8e3cd8de 21 * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
mdroberts1243 0:9e6a8e3cd8de 22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
mdroberts1243 0:9e6a8e3cd8de 23 * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
mdroberts1243 0:9e6a8e3cd8de 24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
mdroberts1243 0:9e6a8e3cd8de 25 * THE SOFTWARE.
mdroberts1243 0:9e6a8e3cd8de 26 */
mdroberts1243 0:9e6a8e3cd8de 27
mdroberts1243 0:9e6a8e3cd8de 28 /*
mdroberts1243 0:9e6a8e3cd8de 29 * Modified by Kenji Arai / JH1PJL
mdroberts1243 0:9e6a8e3cd8de 30 *
mdroberts1243 0:9e6a8e3cd8de 31 * http://www.page.sannet.ne.jp/kenjia/index.html
mdroberts1243 0:9e6a8e3cd8de 32 * http://mbed.org/users/kenjiArai/
mdroberts1243 0:9e6a8e3cd8de 33 * Created: April 27th, 2019
mdroberts1243 0:9e6a8e3cd8de 34 * Revised: April 30th, 2019
mdroberts1243 0:9e6a8e3cd8de 35 *
mdroberts1243 0:9e6a8e3cd8de 36 * Refrence software
mdroberts1243 0:9e6a8e3cd8de 37 * https://github.com/waveshare/e-Paper
mdroberts1243 0:9e6a8e3cd8de 38 * https://os.mbed.com/users/imachooon/code/epd1in54/
mdroberts1243 0:9e6a8e3cd8de 39 *
mdroberts1243 0:9e6a8e3cd8de 40 * Technical documents
mdroberts1243 0:9e6a8e3cd8de 41 * https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT_(B)
mdroberts1243 0:9e6a8e3cd8de 42 *
mdroberts1243 0:9e6a8e3cd8de 43 * Product
mdroberts1243 0:9e6a8e3cd8de 44 * http://akizukidenshi.com/catalog/g/gP-13757/
mdroberts1243 0:9e6a8e3cd8de 45 * https://www.waveshare.com/2.13inch-e-paper-hat-b.htm
mdroberts1243 0:9e6a8e3cd8de 46 *
mdroberts1243 0:9e6a8e3cd8de 47 */
mdroberts1243 0:9e6a8e3cd8de 48
mdroberts1243 0:9e6a8e3cd8de 49 #ifndef EPDIF_H
mdroberts1243 0:9e6a8e3cd8de 50 #define EPDIF_H
mdroberts1243 0:9e6a8e3cd8de 51
mdroberts1243 0:9e6a8e3cd8de 52 #include "mbed.h"
mdroberts1243 0:9e6a8e3cd8de 53
mdroberts1243 0:9e6a8e3cd8de 54 class EpdIf
mdroberts1243 0:9e6a8e3cd8de 55 {
mdroberts1243 0:9e6a8e3cd8de 56 public:
mdroberts1243 0:9e6a8e3cd8de 57 EpdIf(void);
mdroberts1243 0:9e6a8e3cd8de 58 EpdIf(PinName mosi,
mdroberts1243 0:9e6a8e3cd8de 59 PinName miso,
mdroberts1243 0:9e6a8e3cd8de 60 PinName sclk,
mdroberts1243 0:9e6a8e3cd8de 61 PinName cs,
mdroberts1243 0:9e6a8e3cd8de 62 PinName dc,
mdroberts1243 0:9e6a8e3cd8de 63 PinName rst,
mdroberts1243 0:9e6a8e3cd8de 64 PinName busy,
mdroberts1243 0:9e6a8e3cd8de 65 PinName pwr);
mdroberts1243 0:9e6a8e3cd8de 66 ~EpdIf(void)
mdroberts1243 0:9e6a8e3cd8de 67 {
mdroberts1243 0:9e6a8e3cd8de 68 ;
mdroberts1243 0:9e6a8e3cd8de 69 }
mdroberts1243 0:9e6a8e3cd8de 70
mdroberts1243 0:9e6a8e3cd8de 71 int IfInit(void);
mdroberts1243 0:9e6a8e3cd8de 72 void DigitalWrite(DigitalOut* pin, int value);
mdroberts1243 0:9e6a8e3cd8de 73 int DigitalRead(DigitalIn* pin);
mdroberts1243 0:9e6a8e3cd8de 74 void DelayMs(unsigned int delaytime);
mdroberts1243 0:9e6a8e3cd8de 75 void SpiTransfer(unsigned char data);
mdroberts1243 0:9e6a8e3cd8de 76
mdroberts1243 0:9e6a8e3cd8de 77 SPI* m_spi;
mdroberts1243 0:9e6a8e3cd8de 78 DigitalOut* m_cs;
mdroberts1243 0:9e6a8e3cd8de 79 DigitalOut* m_dc;
mdroberts1243 0:9e6a8e3cd8de 80 DigitalOut* m_rst;
mdroberts1243 0:9e6a8e3cd8de 81 DigitalIn* m_busy;
mdroberts1243 0:9e6a8e3cd8de 82 DigitalOut* m_pwr;
mdroberts1243 0:9e6a8e3cd8de 83 };
mdroberts1243 0:9e6a8e3cd8de 84
mdroberts1243 0:9e6a8e3cd8de 85 #endif