![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
k
Dependencies: EPD_GDE021A1 mbed
Fork of DISCO-L053C8_ePD_demo by
main.cpp@0:306e008a65d3, 2017-06-01 (annotated)
- Committer:
- flawless
- Date:
- Thu Jun 01 12:33:16 2017 +0000
- Revision:
- 0:306e008a65d3
- Child:
- 1:842cd88170e2
q
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
flawless | 0:306e008a65d3 | 1 | #include "mbed.h" |
flawless | 0:306e008a65d3 | 2 | #include "EPD_GDE021A1.h" |
flawless | 0:306e008a65d3 | 3 | |
flawless | 0:306e008a65d3 | 4 | #define EPD_CS PA_15 |
flawless | 0:306e008a65d3 | 5 | #define EPD_DC PB_11 |
flawless | 0:306e008a65d3 | 6 | #define EPD_RESET PB_2 |
flawless | 0:306e008a65d3 | 7 | #define EPD_BUSY PA_8 |
flawless | 0:306e008a65d3 | 8 | #define EPD_POWER PB_10 |
flawless | 0:306e008a65d3 | 9 | #define EPD_SPI_MOSI PB_5 |
flawless | 0:306e008a65d3 | 10 | #define EPD_SPI_MISO PB_4 |
flawless | 0:306e008a65d3 | 11 | #define EPD_SPI_SCK PB_3 |
flawless | 0:306e008a65d3 | 12 | |
flawless | 0:306e008a65d3 | 13 | EPD_GDE021A1 epd(EPD_CS, EPD_DC, EPD_RESET, EPD_BUSY, EPD_POWER, EPD_SPI_MOSI, EPD_SPI_MISO, EPD_SPI_SCK); |
flawless | 0:306e008a65d3 | 14 | |
flawless | 0:306e008a65d3 | 15 | DigitalOut led1(LED1); |
flawless | 0:306e008a65d3 | 16 | |
flawless | 0:306e008a65d3 | 17 | //width 48 |
flawless | 0:306e008a65d3 | 18 | //height 26 |
flawless | 0:306e008a65d3 | 19 | static uint8_t Battery_img[] = { |
flawless | 0:306e008a65d3 | 20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
flawless | 0:306e008a65d3 | 21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
flawless | 0:306e008a65d3 | 22 | 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, |
flawless | 0:306e008a65d3 | 23 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x0c, |
flawless | 0:306e008a65d3 | 24 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08, |
flawless | 0:306e008a65d3 | 25 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08, |
flawless | 0:306e008a65d3 | 26 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08, |
flawless | 0:306e008a65d3 | 27 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08, |
flawless | 0:306e008a65d3 | 28 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x18, |
flawless | 0:306e008a65d3 | 29 | 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38, |
flawless | 0:306e008a65d3 | 30 | 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38, |
flawless | 0:306e008a65d3 | 31 | 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38, |
flawless | 0:306e008a65d3 | 32 | 0xfe, 0xff, 0xff, 0x3f, 0xff, 0x39, |
flawless | 0:306e008a65d3 | 33 | 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38, |
flawless | 0:306e008a65d3 | 34 | 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38, |
flawless | 0:306e008a65d3 | 35 | 0xfe, 0xff, 0xff, 0x3f, 0x10, 0x38, |
flawless | 0:306e008a65d3 | 36 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x38, |
flawless | 0:306e008a65d3 | 37 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x18, |
flawless | 0:306e008a65d3 | 38 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08, |
flawless | 0:306e008a65d3 | 39 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08, |
flawless | 0:306e008a65d3 | 40 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x08, |
flawless | 0:306e008a65d3 | 41 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x0c, |
flawless | 0:306e008a65d3 | 42 | 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x0c, |
flawless | 0:306e008a65d3 | 43 | 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, |
flawless | 0:306e008a65d3 | 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
flawless | 0:306e008a65d3 | 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
flawless | 0:306e008a65d3 | 46 | }; |
flawless | 0:306e008a65d3 | 47 | |
flawless | 0:306e008a65d3 | 48 | int main() |
flawless | 0:306e008a65d3 | 49 | { |
flawless | 0:306e008a65d3 | 50 | led1 = 1; |
flawless | 0:306e008a65d3 | 51 | |
flawless | 0:306e008a65d3 | 52 | epd.Clear(EPD_COLOR_WHITE); |
flawless | 0:306e008a65d3 | 53 | // epd.DisplayStringAtLine(5, (uint8_t*)"HUEMBED", CENTER_MODE); |
flawless | 0:306e008a65d3 | 54 | // epd.DisplayStringAtLine(2, (uint8_t*)"demo", LEFT_MODE); |
flawless | 0:306e008a65d3 | 55 | // epd.DrawImage(130, 0, 48, 26, Battery_img); |
flawless | 0:306e008a65d3 | 56 | // epd.DrawRect(50, 4, 60, 4); |
flawless | 0:306e008a65d3 | 57 | // epd.RefreshDisplay(); |
flawless | 0:306e008a65d3 | 58 | wait(2); |
flawless | 0:306e008a65d3 | 59 | uint8_t i = 30; |
flawless | 0:306e008a65d3 | 60 | while(1) { |
flawless | 0:306e008a65d3 | 61 | led1 = !led1; |
flawless | 0:306e008a65d3 | 62 | epd.Clear(EPD_COLOR_WHITE); |
flawless | 0:306e008a65d3 | 63 | epd.DisplayStringAtLine(5, (uint8_t*)"HUEMBED", CENTER_MODE); |
flawless | 0:306e008a65d3 | 64 | epd.DisplayStringAtLine(3, (uint8_t*)i, CENTER_MODE); |
flawless | 0:306e008a65d3 | 65 | epd.RefreshDisplay(); |
flawless | 0:306e008a65d3 | 66 | i++; |
flawless | 0:306e008a65d3 | 67 | wait(2); |
flawless | 0:306e008a65d3 | 68 | } |
flawless | 0:306e008a65d3 | 69 | } |