Library to control the EM027BS013 ePaper display from Pervasive Display.

Dependencies:   LM75B

Dependents:   app_epaper_EM027BS013_LPC1549 lpc4088_ebb_epaper EaEpaper_EM027BS013 app_epaper_EM027BS013 ... more

Committer:
embeddedartists
Date:
Tue Jul 22 11:59:06 2014 +0000
Revision:
0:9297e33f50cf
First version of library for the EM027BS013 ePaper display.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 0:9297e33f50cf 1 /*
embeddedartists 0:9297e33f50cf 2 * Copyright 2014 Embedded Artists AB
embeddedartists 0:9297e33f50cf 3 *
embeddedartists 0:9297e33f50cf 4 * Licensed under the Apache License, Version 2.0 (the "License");
embeddedartists 0:9297e33f50cf 5 * you may not use this file except in compliance with the License.
embeddedartists 0:9297e33f50cf 6 * You may obtain a copy of the License at
embeddedartists 0:9297e33f50cf 7 *
embeddedartists 0:9297e33f50cf 8 * http://www.apache.org/licenses/LICENSE-2.0
embeddedartists 0:9297e33f50cf 9 *
embeddedartists 0:9297e33f50cf 10 * Unless required by applicable law or agreed to in writing, software
embeddedartists 0:9297e33f50cf 11 * distributed under the License is distributed on an "AS IS" BASIS,
embeddedartists 0:9297e33f50cf 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
embeddedartists 0:9297e33f50cf 13 * See the License for the specific language governing permissions and
embeddedartists 0:9297e33f50cf 14 * limitations under the License.
embeddedartists 0:9297e33f50cf 15 */
embeddedartists 0:9297e33f50cf 16
embeddedartists 0:9297e33f50cf 17 /******************************************************************************
embeddedartists 0:9297e33f50cf 18 * Includes
embeddedartists 0:9297e33f50cf 19 *****************************************************************************/
embeddedartists 0:9297e33f50cf 20
embeddedartists 0:9297e33f50cf 21 #include "mbed.h"
embeddedartists 0:9297e33f50cf 22 #include "EM027BS013.h"
embeddedartists 0:9297e33f50cf 23
embeddedartists 0:9297e33f50cf 24 #include "Pervasive_Displays_small_EPD.h"
embeddedartists 0:9297e33f50cf 25
embeddedartists 0:9297e33f50cf 26 /******************************************************************************
embeddedartists 0:9297e33f50cf 27 * Global variables
embeddedartists 0:9297e33f50cf 28 *****************************************************************************/
embeddedartists 0:9297e33f50cf 29
embeddedartists 0:9297e33f50cf 30 //PinName SEC01; // GND
embeddedartists 0:9297e33f50cf 31 //PinName SEC02; // 3v3
embeddedartists 0:9297e33f50cf 32 PinName SEC03;
embeddedartists 0:9297e33f50cf 33 PinName SEC04;
embeddedartists 0:9297e33f50cf 34 PinName SEC05;
embeddedartists 0:9297e33f50cf 35 PinName SEC06;
embeddedartists 0:9297e33f50cf 36 PinName SEC07;
embeddedartists 0:9297e33f50cf 37 PinName SEC08;
embeddedartists 0:9297e33f50cf 38 PinName SEC09;
embeddedartists 0:9297e33f50cf 39 PinName SEC10;
embeddedartists 0:9297e33f50cf 40 PinName SEC11;
embeddedartists 0:9297e33f50cf 41 PinName SEC12;
embeddedartists 0:9297e33f50cf 42 PinName SEC13;
embeddedartists 0:9297e33f50cf 43 PinName SEC14;
embeddedartists 0:9297e33f50cf 44
embeddedartists 0:9297e33f50cf 45 /******************************************************************************
embeddedartists 0:9297e33f50cf 46 * Defines and typedefs
embeddedartists 0:9297e33f50cf 47 *****************************************************************************/
embeddedartists 0:9297e33f50cf 48
embeddedartists 0:9297e33f50cf 49 EM027BS013::EM027BS013(PinName sec03_SpiSCK,
embeddedartists 0:9297e33f50cf 50 PinName sec04_SpiMOSI,
embeddedartists 0:9297e33f50cf 51 PinName sec05_SpiMISO,
embeddedartists 0:9297e33f50cf 52 PinName sec06_EpdCS,
embeddedartists 0:9297e33f50cf 53 PinName sec07_EpdBusy,
embeddedartists 0:9297e33f50cf 54 PinName sec08_EpdBorder,
embeddedartists 0:9297e33f50cf 55 PinName sec09_I2cSCL,
embeddedartists 0:9297e33f50cf 56 PinName sec10_I2cSDA,
embeddedartists 0:9297e33f50cf 57 PinName sec11_FlashCS,
embeddedartists 0:9297e33f50cf 58 PinName sec12_EpdReset,
embeddedartists 0:9297e33f50cf 59 PinName sec13_EpdPanelOn,
embeddedartists 0:9297e33f50cf 60 PinName sec14_EpdDischarge)
embeddedartists 0:9297e33f50cf 61 {
embeddedartists 0:9297e33f50cf 62 initialized = false;
embeddedartists 0:9297e33f50cf 63
embeddedartists 0:9297e33f50cf 64 SEC03 = sec03_SpiSCK;
embeddedartists 0:9297e33f50cf 65 SEC04 = sec04_SpiMOSI;
embeddedartists 0:9297e33f50cf 66 SEC05 = sec05_SpiMISO;
embeddedartists 0:9297e33f50cf 67 SEC06 = sec06_EpdCS;
embeddedartists 0:9297e33f50cf 68 SEC07 = sec07_EpdBusy;
embeddedartists 0:9297e33f50cf 69 SEC08 = sec08_EpdBorder;
embeddedartists 0:9297e33f50cf 70 SEC09 = sec09_I2cSCL;
embeddedartists 0:9297e33f50cf 71 SEC10 = sec10_I2cSDA;
embeddedartists 0:9297e33f50cf 72 SEC11 = sec11_FlashCS;
embeddedartists 0:9297e33f50cf 73 SEC12 = sec12_EpdReset;
embeddedartists 0:9297e33f50cf 74 SEC13 = sec13_EpdPanelOn;
embeddedartists 0:9297e33f50cf 75 SEC14 = sec14_EpdDischarge;
embeddedartists 0:9297e33f50cf 76 }
embeddedartists 0:9297e33f50cf 77
embeddedartists 0:9297e33f50cf 78 void EM027BS013::init(void)
embeddedartists 0:9297e33f50cf 79 {
embeddedartists 0:9297e33f50cf 80 if (!initialized) {
embeddedartists 0:9297e33f50cf 81 EPD_display_init();
embeddedartists 0:9297e33f50cf 82 initialized = true;
embeddedartists 0:9297e33f50cf 83 }
embeddedartists 0:9297e33f50cf 84 }
embeddedartists 0:9297e33f50cf 85
embeddedartists 0:9297e33f50cf 86 void EM027BS013::drawImage(uint8_t * image)
embeddedartists 0:9297e33f50cf 87 {
embeddedartists 0:9297e33f50cf 88 init();
embeddedartists 0:9297e33f50cf 89 EPD_display_from_pointer(EPD_270, NULL, image);
embeddedartists 0:9297e33f50cf 90 }
embeddedartists 0:9297e33f50cf 91