E_paper, E_ink, Screen size 1.54", resolution 200x200, 4 wire spi, Waveshare, Black and White, Kl25Z, 8 wire print connector, supply 3.3 Volt, IL0373 Controller, font size is 8, 12, 16 and 24.
epdif.h@2:d7fc318a1528, 2018-03-27 (annotated)
- Committer:
- GerritPathuis
- Date:
- Tue Mar 27 17:36:34 2018 +0000
- Revision:
- 2:d7fc318a1528
- Parent:
- 1:d27a7e06c233
- Child:
- 5:3b7204bd6832
Tussenstand
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GerritPathuis | 0:665e04c85d8d | 1 | /** |
GerritPathuis | 0:665e04c85d8d | 2 | * @filename : epdif.h |
GerritPathuis | 0:665e04c85d8d | 3 | * @brief : Header file of epdif.cpp providing EPD interface functions |
GerritPathuis | 0:665e04c85d8d | 4 | * Users have to implement all the functions in epdif.cpp |
GerritPathuis | 0:665e04c85d8d | 5 | * @author : Yehui from Waveshare |
GerritPathuis | 0:665e04c85d8d | 6 | * |
GerritPathuis | 0:665e04c85d8d | 7 | * Copyright (C) Waveshare August 10 2017 |
GerritPathuis | 0:665e04c85d8d | 8 | * |
GerritPathuis | 0:665e04c85d8d | 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
GerritPathuis | 0:665e04c85d8d | 10 | * of this software and associated documnetation files (the "Software"), to deal |
GerritPathuis | 0:665e04c85d8d | 11 | * in the Software without restriction, including without limitation the rights |
GerritPathuis | 0:665e04c85d8d | 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
GerritPathuis | 0:665e04c85d8d | 13 | * copies of the Software, and to permit persons to whom the Software is |
GerritPathuis | 0:665e04c85d8d | 14 | * furished to do so, subject to the following conditions: |
GerritPathuis | 0:665e04c85d8d | 15 | * |
GerritPathuis | 0:665e04c85d8d | 16 | * The above copyright notice and this permission notice shall be included in |
GerritPathuis | 0:665e04c85d8d | 17 | * all copies or substantial portions of the Software. |
GerritPathuis | 0:665e04c85d8d | 18 | * |
GerritPathuis | 0:665e04c85d8d | 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
GerritPathuis | 0:665e04c85d8d | 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
GerritPathuis | 0:665e04c85d8d | 21 | * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
GerritPathuis | 0:665e04c85d8d | 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
GerritPathuis | 0:665e04c85d8d | 23 | * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
GerritPathuis | 0:665e04c85d8d | 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
GerritPathuis | 0:665e04c85d8d | 25 | * THE SOFTWARE. |
GerritPathuis | 0:665e04c85d8d | 26 | */ |
GerritPathuis | 0:665e04c85d8d | 27 | |
GerritPathuis | 0:665e04c85d8d | 28 | #ifndef EPDIF_H |
GerritPathuis | 0:665e04c85d8d | 29 | #define EPDIF_H |
GerritPathuis | 0:665e04c85d8d | 30 | |
GerritPathuis | 0:665e04c85d8d | 31 | |
GerritPathuis | 0:665e04c85d8d | 32 | // Pin definition |
GerritPathuis | 1:d27a7e06c233 | 33 | #define RST_PIN 0 |
GerritPathuis | 1:d27a7e06c233 | 34 | #define DC_PIN 1 |
GerritPathuis | 1:d27a7e06c233 | 35 | #define CS_PIN 2 |
GerritPathuis | 1:d27a7e06c233 | 36 | #define BUSY_PIN 0 |
GerritPathuis | 1:d27a7e06c233 | 37 | |
GerritPathuis | 1:d27a7e06c233 | 38 | #define HIGH 1 |
GerritPathuis | 1:d27a7e06c233 | 39 | #define LOW 0 |
GerritPathuis | 0:665e04c85d8d | 40 | |
GerritPathuis | 2:d7fc318a1528 | 41 | #include "mbed.h" |
GerritPathuis | 2:d7fc318a1528 | 42 | DigitalOut reset_pin(PTC17); |
GerritPathuis | 2:d7fc318a1528 | 43 | DigitalOut dc_pin(PTD5); |
GerritPathuis | 2:d7fc318a1528 | 44 | DigitalOut cs_pin(PTD0); |
GerritPathuis | 2:d7fc318a1528 | 45 | DigitalIn busy_pin(PTA13); |
GerritPathuis | 2:d7fc318a1528 | 46 | SPI epaper(PTD2,PTD3,PTD1); //MOSI, MISO, CLK |
GerritPathuis | 2:d7fc318a1528 | 47 | |
GerritPathuis | 0:665e04c85d8d | 48 | class EpdIf { |
GerritPathuis | 0:665e04c85d8d | 49 | public: |
GerritPathuis | 0:665e04c85d8d | 50 | EpdIf(void); |
GerritPathuis | 0:665e04c85d8d | 51 | ~EpdIf(void); |
GerritPathuis | 0:665e04c85d8d | 52 | |
GerritPathuis | 0:665e04c85d8d | 53 | static int IfInit(void); |
GerritPathuis | 0:665e04c85d8d | 54 | static void DigitalWrite(int pin, int value); |
GerritPathuis | 0:665e04c85d8d | 55 | static int DigitalRead(int pin); |
GerritPathuis | 0:665e04c85d8d | 56 | static void DelayMs(unsigned int delaytime); |
GerritPathuis | 0:665e04c85d8d | 57 | static void SpiTransfer(unsigned char data); |
GerritPathuis | 0:665e04c85d8d | 58 | }; |
GerritPathuis | 0:665e04c85d8d | 59 | |
GerritPathuis | 0:665e04c85d8d | 60 | #endif |
GerritPathuis | 0:665e04c85d8d | 61 |