ffgdg

Dependencies:   mbed EPD_GDE021A1

Committer:
bheemarao
Date:
Thu Jan 23 10:29:26 2020 +0000
Revision:
0:2cd7d842ca5c
rev1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bheemarao 0:2cd7d842ca5c 1 #include "mbed.h"
bheemarao 0:2cd7d842ca5c 2 #include "EPD_GDE021A1.h"
bheemarao 0:2cd7d842ca5c 3
bheemarao 0:2cd7d842ca5c 4 #define EPD_CS PA_15
bheemarao 0:2cd7d842ca5c 5 #define EPD_DC PB_11
bheemarao 0:2cd7d842ca5c 6 #define EPD_RESET PB_2
bheemarao 0:2cd7d842ca5c 7 #define EPD_BUSY PA_8
bheemarao 0:2cd7d842ca5c 8 #define EPD_POWER PB_10
bheemarao 0:2cd7d842ca5c 9 #define EPD_SPI_MOSI PB_5
bheemarao 0:2cd7d842ca5c 10 #define EPD_SPI_MISO PB_4
bheemarao 0:2cd7d842ca5c 11 #define EPD_SPI_SCK PB_3
bheemarao 0:2cd7d842ca5c 12
bheemarao 0:2cd7d842ca5c 13 EPD_GDE021A1 epd(EPD_CS, EPD_DC, EPD_RESET, EPD_BUSY, EPD_POWER, EPD_SPI_MOSI, EPD_SPI_MISO, EPD_SPI_SCK);
bheemarao 0:2cd7d842ca5c 14
bheemarao 0:2cd7d842ca5c 15 DigitalOut led1(LED1);
bheemarao 0:2cd7d842ca5c 16
bheemarao 0:2cd7d842ca5c 17 //width 48
bheemarao 0:2cd7d842ca5c 18 //height 26
bheemarao 0:2cd7d842ca5c 19 static uint8_t Battery_img[] = {
bheemarao 0:2cd7d842ca5c 20 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
bheemarao 0:2cd7d842ca5c 21 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
bheemarao 0:2cd7d842ca5c 22 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f,
bheemarao 0:2cd7d842ca5c 23 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x0c,
bheemarao 0:2cd7d842ca5c 24 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08,
bheemarao 0:2cd7d842ca5c 25 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08,
bheemarao 0:2cd7d842ca5c 26 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08,
bheemarao 0:2cd7d842ca5c 27 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08,
bheemarao 0:2cd7d842ca5c 28 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x18,
bheemarao 0:2cd7d842ca5c 29 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38,
bheemarao 0:2cd7d842ca5c 30 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38,
bheemarao 0:2cd7d842ca5c 31 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38,
bheemarao 0:2cd7d842ca5c 32 0xfe, 0xff, 0xff, 0x3f, 0xff, 0x39,
bheemarao 0:2cd7d842ca5c 33 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38,
bheemarao 0:2cd7d842ca5c 34 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38,
bheemarao 0:2cd7d842ca5c 35 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38,
bheemarao 0:2cd7d842ca5c 36 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x38,
bheemarao 0:2cd7d842ca5c 37 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x18,
bheemarao 0:2cd7d842ca5c 38 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08,
bheemarao 0:2cd7d842ca5c 39 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08,
bheemarao 0:2cd7d842ca5c 40 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08,
bheemarao 0:2cd7d842ca5c 41 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x0c,
bheemarao 0:2cd7d842ca5c 42 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x0c,
bheemarao 0:2cd7d842ca5c 43 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f,
bheemarao 0:2cd7d842ca5c 44 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
bheemarao 0:2cd7d842ca5c 45 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
bheemarao 0:2cd7d842ca5c 46 };
bheemarao 0:2cd7d842ca5c 47
bheemarao 0:2cd7d842ca5c 48 int main()
bheemarao 0:2cd7d842ca5c 49 {
bheemarao 0:2cd7d842ca5c 50 led1 = 1;
bheemarao 0:2cd7d842ca5c 51
bheemarao 0:2cd7d842ca5c 52 epd.Clear(EPD_COLOR_WHITE);
bheemarao 0:2cd7d842ca5c 53 epd.DisplayStringAtLine(5, (uint8_t*)"MBED", CENTER_MODE);
bheemarao 0:2cd7d842ca5c 54 epd.DisplayStringAtLine(3, (uint8_t*)"Epaper display", LEFT_MODE);
bheemarao 0:2cd7d842ca5c 55 epd.DisplayStringAtLine(2, (uint8_t*)"demo", LEFT_MODE);
bheemarao 0:2cd7d842ca5c 56 epd.DrawImage(130, 0, 48, 26, Battery_img);
bheemarao 0:2cd7d842ca5c 57 epd.DrawRect(50, 4, 60, 4);
bheemarao 0:2cd7d842ca5c 58 epd.RefreshDisplay();
bheemarao 0:2cd7d842ca5c 59 wait(2);
bheemarao 0:2cd7d842ca5c 60
bheemarao 0:2cd7d842ca5c 61 while(1) {
bheemarao 0:2cd7d842ca5c 62 led1 = !led1;
bheemarao 0:2cd7d842ca5c 63 wait(1);
bheemarao 0:2cd7d842ca5c 64 }
bheemarao 0:2cd7d842ca5c 65 }