test publish repo

Dependencies:   EPD_GDE021A1 mbed

Committer:
cristimih
Date:
Tue Jun 14 15:11:51 2016 +0000
Revision:
1:c39089c2bf65
Parent:
0:f08a30229da2
added comment

Who changed what in which revision?

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