test publish repo

Dependencies:   EPD_GDE021A1 mbed

Committer:
cristimih
Date:
Tue Jun 14 15:05:38 2016 +0000
Revision:
0:f08a30229da2
Child:
1:c39089c2bf65
test

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