![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
EPD
Dependencies: mbed-STM32F103C8T6 mbed
epd.h@0:1d2c0afef43c, 2017-12-29 (annotated)
- Committer:
- spin7ion
- Date:
- Fri Dec 29 22:35:18 2017 +0000
- Revision:
- 0:1d2c0afef43c
test;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
spin7ion | 0:1d2c0afef43c | 1 | #ifndef EPD_H |
spin7ion | 0:1d2c0afef43c | 2 | #define EPD_H |
spin7ion | 0:1d2c0afef43c | 3 | |
spin7ion | 0:1d2c0afef43c | 4 | // Display resolution |
spin7ion | 0:1d2c0afef43c | 5 | #define EPD_WIDTH 128 |
spin7ion | 0:1d2c0afef43c | 6 | #define EPD_HEIGHT 296 |
spin7ion | 0:1d2c0afef43c | 7 | |
spin7ion | 0:1d2c0afef43c | 8 | // EPD2IN9 commands |
spin7ion | 0:1d2c0afef43c | 9 | #define DRIVER_OUTPUT_CONTROL 0x01 |
spin7ion | 0:1d2c0afef43c | 10 | #define BOOSTER_SOFT_START_CONTROL 0x0C |
spin7ion | 0:1d2c0afef43c | 11 | #define GATE_SCAN_START_POSITION 0x0F |
spin7ion | 0:1d2c0afef43c | 12 | #define DEEP_SLEEP_MODE 0x10 |
spin7ion | 0:1d2c0afef43c | 13 | #define DATA_ENTRY_MODE_SETTING 0x11 |
spin7ion | 0:1d2c0afef43c | 14 | #define SW_RESET 0x12 |
spin7ion | 0:1d2c0afef43c | 15 | #define TEMPERATURE_SENSOR_CONTROL 0x1A |
spin7ion | 0:1d2c0afef43c | 16 | #define MASTER_ACTIVATION 0x20 |
spin7ion | 0:1d2c0afef43c | 17 | #define DISPLAY_UPDATE_CONTROL_1 0x21 |
spin7ion | 0:1d2c0afef43c | 18 | #define DISPLAY_UPDATE_CONTROL_2 0x22 |
spin7ion | 0:1d2c0afef43c | 19 | #define WRITE_RAM 0x24 |
spin7ion | 0:1d2c0afef43c | 20 | #define WRITE_VCOM_REGISTER 0x2C |
spin7ion | 0:1d2c0afef43c | 21 | #define WRITE_LUT_REGISTER 0x32 |
spin7ion | 0:1d2c0afef43c | 22 | #define SET_DUMMY_LINE_PERIOD 0x3A |
spin7ion | 0:1d2c0afef43c | 23 | #define SET_GATE_TIME 0x3B |
spin7ion | 0:1d2c0afef43c | 24 | #define BORDER_WAVEFORM_CONTROL 0x3C |
spin7ion | 0:1d2c0afef43c | 25 | #define SET_RAM_X_ADDRESS_START_END_POSITION 0x44 |
spin7ion | 0:1d2c0afef43c | 26 | #define SET_RAM_Y_ADDRESS_START_END_POSITION 0x45 |
spin7ion | 0:1d2c0afef43c | 27 | #define SET_RAM_X_ADDRESS_COUNTER 0x4E |
spin7ion | 0:1d2c0afef43c | 28 | #define SET_RAM_Y_ADDRESS_COUNTER 0x4F |
spin7ion | 0:1d2c0afef43c | 29 | #define TERMINATE_FRAME_READ_WRITE 0xFF |
spin7ion | 0:1d2c0afef43c | 30 | |
spin7ion | 0:1d2c0afef43c | 31 | #define BACKGROUND_BLACK 0x00 |
spin7ion | 0:1d2c0afef43c | 32 | #define BACKGROUND_WHITE 0xFF |
spin7ion | 0:1d2c0afef43c | 33 | |
spin7ion | 0:1d2c0afef43c | 34 | const unsigned char lut_full_update[] = |
spin7ion | 0:1d2c0afef43c | 35 | { |
spin7ion | 0:1d2c0afef43c | 36 | 0x02, 0x02, 0x01, 0x11, 0x12, 0x12, 0x22, 0x22, |
spin7ion | 0:1d2c0afef43c | 37 | 0x66, 0x69, 0x69, 0x59, 0x58, 0x99, 0x99, 0x88, |
spin7ion | 0:1d2c0afef43c | 38 | 0x00, 0x00, 0x00, 0x00, 0xF8, 0xB4, 0x13, 0x51, |
spin7ion | 0:1d2c0afef43c | 39 | 0x35, 0x51, 0x51, 0x19, 0x01, 0x00 |
spin7ion | 0:1d2c0afef43c | 40 | }; |
spin7ion | 0:1d2c0afef43c | 41 | |
spin7ion | 0:1d2c0afef43c | 42 | const unsigned char lut_partial_update[] = |
spin7ion | 0:1d2c0afef43c | 43 | { |
spin7ion | 0:1d2c0afef43c | 44 | 0x10, 0x18, 0x18, 0x08, 0x18, 0x18, 0x08, 0x00, |
spin7ion | 0:1d2c0afef43c | 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
spin7ion | 0:1d2c0afef43c | 46 | 0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12, |
spin7ion | 0:1d2c0afef43c | 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
spin7ion | 0:1d2c0afef43c | 48 | }; |
spin7ion | 0:1d2c0afef43c | 49 | |
spin7ion | 0:1d2c0afef43c | 50 | /*static unsigned char lut_full_update[] = {0x32,0x02,0x02,0x01,0x11,0x12,0x12,0x22,0x22,0x66,0x69,0x69,0x59,0x58,0x99,0x99,0x88,0x00,0x00,0x00 |
spin7ion | 0:1d2c0afef43c | 51 | ,0x00,0xF8,0xB4,0x13,0x51,0x35,0x51,0x51,0x19,0x01,0x00}; |
spin7ion | 0:1d2c0afef43c | 52 | static unsigned char lut_partial_update[] = {0x32,0x10,0x18,0x18,0x08,0x18,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
spin7ion | 0:1d2c0afef43c | 53 | ,0x00,0x13,0x14,0x44,0x12,0x00,0x00,0x00,0x00,0x00,0x00};*/ |
spin7ion | 0:1d2c0afef43c | 54 | |
spin7ion | 0:1d2c0afef43c | 55 | const unsigned char FONT8x8[97][8] = { |
spin7ion | 0:1d2c0afef43c | 56 | 0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00, // columns, rows, num_bytes_per_char |
spin7ion | 0:1d2c0afef43c | 57 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // space 0x20 |
spin7ion | 0:1d2c0afef43c | 58 | 0x30,0x78,0x78,0x30,0x30,0x00,0x30,0x00, // ! |
spin7ion | 0:1d2c0afef43c | 59 | 0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00, // " |
spin7ion | 0:1d2c0afef43c | 60 | 0x6C,0x6C,0xFE,0x6C,0xFE,0x6C,0x6C,0x00, // # |
spin7ion | 0:1d2c0afef43c | 61 | 0x18,0x3E,0x60,0x3C,0x06,0x7C,0x18,0x00, // $ |
spin7ion | 0:1d2c0afef43c | 62 | 0x00,0x63,0x66,0x0C,0x18,0x33,0x63,0x00, // % |
spin7ion | 0:1d2c0afef43c | 63 | 0x1C,0x36,0x1C,0x3B,0x6E,0x66,0x3B,0x00, // & |
spin7ion | 0:1d2c0afef43c | 64 | 0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00, // ' |
spin7ion | 0:1d2c0afef43c | 65 | 0x0C,0x18,0x30,0x30,0x30,0x18,0x0C,0x00, // ( |
spin7ion | 0:1d2c0afef43c | 66 | 0x30,0x18,0x0C,0x0C,0x0C,0x18,0x30,0x00, // ) |
spin7ion | 0:1d2c0afef43c | 67 | 0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00, // * |
spin7ion | 0:1d2c0afef43c | 68 | 0x00,0x30,0x30,0xFC,0x30,0x30,0x00,0x00, // + |
spin7ion | 0:1d2c0afef43c | 69 | 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x30, // , |
spin7ion | 0:1d2c0afef43c | 70 | 0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00, // - |
spin7ion | 0:1d2c0afef43c | 71 | 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00, // . |
spin7ion | 0:1d2c0afef43c | 72 | 0x03,0x06,0x0C,0x18,0x30,0x60,0x40,0x00, // / (forward slash) |
spin7ion | 0:1d2c0afef43c | 73 | 0x3E,0x63,0x63,0x6B,0x63,0x63,0x3E,0x00, // 0 0x30 |
spin7ion | 0:1d2c0afef43c | 74 | 0x18,0x38,0x58,0x18,0x18,0x18,0x7E,0x00, // 1 |
spin7ion | 0:1d2c0afef43c | 75 | 0x3C,0x66,0x06,0x1C,0x30,0x66,0x7E,0x00, // 2 |
spin7ion | 0:1d2c0afef43c | 76 | 0x3C,0x66,0x06,0x1C,0x06,0x66,0x3C,0x00, // 3 |
spin7ion | 0:1d2c0afef43c | 77 | 0x0E,0x1E,0x36,0x66,0x7F,0x06,0x0F,0x00, // 4 |
spin7ion | 0:1d2c0afef43c | 78 | 0x7E,0x60,0x7C,0x06,0x06,0x66,0x3C,0x00, // 5 |
spin7ion | 0:1d2c0afef43c | 79 | 0x1C,0x30,0x60,0x7C,0x66,0x66,0x3C,0x00, // 6 |
spin7ion | 0:1d2c0afef43c | 80 | 0x7E,0x66,0x06,0x0C,0x18,0x18,0x18,0x00, // 7 |
spin7ion | 0:1d2c0afef43c | 81 | 0x3C,0x66,0x66,0x3C,0x66,0x66,0x3C,0x00, // 8 |
spin7ion | 0:1d2c0afef43c | 82 | 0x3C,0x66,0x66,0x3E,0x06,0x0C,0x38,0x00, // 9 |
spin7ion | 0:1d2c0afef43c | 83 | 0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x00, // : |
spin7ion | 0:1d2c0afef43c | 84 | 0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x30, // ; |
spin7ion | 0:1d2c0afef43c | 85 | 0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00, // < |
spin7ion | 0:1d2c0afef43c | 86 | 0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00, // = |
spin7ion | 0:1d2c0afef43c | 87 | 0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00, // > |
spin7ion | 0:1d2c0afef43c | 88 | 0x3C,0x66,0x06,0x0C,0x18,0x00,0x18,0x00, // ? |
spin7ion | 0:1d2c0afef43c | 89 | 0x3E,0x63,0x6F,0x69,0x6F,0x60,0x3E,0x00, // @ 0x40 |
spin7ion | 0:1d2c0afef43c | 90 | 0x18,0x3C,0x66,0x66,0x7E,0x66,0x66,0x00, // A |
spin7ion | 0:1d2c0afef43c | 91 | 0x7E,0x33,0x33,0x3E,0x33,0x33,0x7E,0x00, // B |
spin7ion | 0:1d2c0afef43c | 92 | 0x1E,0x33,0x60,0x60,0x60,0x33,0x1E,0x00, // C |
spin7ion | 0:1d2c0afef43c | 93 | 0x7C,0x36,0x33,0x33,0x33,0x36,0x7C,0x00, // D |
spin7ion | 0:1d2c0afef43c | 94 | 0x7F,0x31,0x34,0x3C,0x34,0x31,0x7F,0x00, // E |
spin7ion | 0:1d2c0afef43c | 95 | 0x7F,0x31,0x34,0x3C,0x34,0x30,0x78,0x00, // F |
spin7ion | 0:1d2c0afef43c | 96 | 0x1E,0x33,0x60,0x60,0x67,0x33,0x1F,0x00, // G |
spin7ion | 0:1d2c0afef43c | 97 | 0x66,0x66,0x66,0x7E,0x66,0x66,0x66,0x00, // H |
spin7ion | 0:1d2c0afef43c | 98 | 0x3C,0x18,0x18,0x18,0x18,0x18,0x3C,0x00, // I |
spin7ion | 0:1d2c0afef43c | 99 | 0x0F,0x06,0x06,0x06,0x66,0x66,0x3C,0x00, // J |
spin7ion | 0:1d2c0afef43c | 100 | 0x73,0x33,0x36,0x3C,0x36,0x33,0x73,0x00, // K |
spin7ion | 0:1d2c0afef43c | 101 | 0x78,0x30,0x30,0x30,0x31,0x33,0x7F,0x00, // L |
spin7ion | 0:1d2c0afef43c | 102 | 0x63,0x77,0x7F,0x7F,0x6B,0x63,0x63,0x00, // M |
spin7ion | 0:1d2c0afef43c | 103 | 0x63,0x73,0x7B,0x6F,0x67,0x63,0x63,0x00, // N |
spin7ion | 0:1d2c0afef43c | 104 | 0x3E,0x63,0x63,0x63,0x63,0x63,0x3E,0x00, // O |
spin7ion | 0:1d2c0afef43c | 105 | 0x7E,0x33,0x33,0x3E,0x30,0x30,0x78,0x00, // P 0x50 |
spin7ion | 0:1d2c0afef43c | 106 | 0x3C,0x66,0x66,0x66,0x6E,0x3C,0x0E,0x00, // Q |
spin7ion | 0:1d2c0afef43c | 107 | 0x7E,0x33,0x33,0x3E,0x36,0x33,0x73,0x00, // R |
spin7ion | 0:1d2c0afef43c | 108 | 0x3C,0x66,0x30,0x18,0x0C,0x66,0x3C,0x00, // S |
spin7ion | 0:1d2c0afef43c | 109 | 0x7E,0x5A,0x18,0x18,0x18,0x18,0x3C,0x00, // T |
spin7ion | 0:1d2c0afef43c | 110 | 0x66,0x66,0x66,0x66,0x66,0x66,0x7E,0x00, // U |
spin7ion | 0:1d2c0afef43c | 111 | 0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00, // V |
spin7ion | 0:1d2c0afef43c | 112 | 0x63,0x63,0x63,0x6B,0x7F,0x77,0x63,0x00, // W |
spin7ion | 0:1d2c0afef43c | 113 | 0x63,0x63,0x36,0x1C,0x1C,0x36,0x63,0x00, // X |
spin7ion | 0:1d2c0afef43c | 114 | 0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00, // Y |
spin7ion | 0:1d2c0afef43c | 115 | 0x7F,0x63,0x46,0x0C,0x19,0x33,0x7F,0x00, // Z |
spin7ion | 0:1d2c0afef43c | 116 | 0x3C,0x30,0x30,0x30,0x30,0x30,0x3C,0x00, // [ |
spin7ion | 0:1d2c0afef43c | 117 | 0x60,0x30,0x18,0x0C,0x06,0x03,0x01,0x00, // \ (back slash) |
spin7ion | 0:1d2c0afef43c | 118 | 0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00, // ] |
spin7ion | 0:1d2c0afef43c | 119 | 0x08,0x1C,0x36,0x63,0x00,0x00,0x00,0x00, // ^ |
spin7ion | 0:1d2c0afef43c | 120 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, // _ |
spin7ion | 0:1d2c0afef43c | 121 | 0x18,0x18,0x0C,0x00,0x00,0x00,0x00,0x00, // ` 0x60 |
spin7ion | 0:1d2c0afef43c | 122 | 0x00,0x00,0x3C,0x06,0x3E,0x66,0x3B,0x00, // a |
spin7ion | 0:1d2c0afef43c | 123 | 0x70,0x30,0x3E,0x33,0x33,0x33,0x6E,0x00, // b |
spin7ion | 0:1d2c0afef43c | 124 | 0x00,0x00,0x3C,0x66,0x60,0x66,0x3C,0x00, // c |
spin7ion | 0:1d2c0afef43c | 125 | 0x0E,0x06,0x3E,0x66,0x66,0x66,0x3B,0x00, // d |
spin7ion | 0:1d2c0afef43c | 126 | 0x00,0x00,0x3C,0x66,0x7E,0x60,0x3C,0x00, // e |
spin7ion | 0:1d2c0afef43c | 127 | 0x1C,0x36,0x30,0x78,0x30,0x30,0x78,0x00, // f |
spin7ion | 0:1d2c0afef43c | 128 | 0x00,0x00,0x3B,0x66,0x66,0x3E,0x06,0x7C, // g |
spin7ion | 0:1d2c0afef43c | 129 | 0x70,0x30,0x36,0x3B,0x33,0x33,0x73,0x00, // h |
spin7ion | 0:1d2c0afef43c | 130 | 0x18,0x00,0x38,0x18,0x18,0x18,0x3C,0x00, // i |
spin7ion | 0:1d2c0afef43c | 131 | 0x06,0x00,0x06,0x06,0x06,0x66,0x66,0x3C, // j |
spin7ion | 0:1d2c0afef43c | 132 | 0x70,0x30,0x33,0x36,0x3C,0x36,0x73,0x00, // k |
spin7ion | 0:1d2c0afef43c | 133 | 0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00, // l |
spin7ion | 0:1d2c0afef43c | 134 | 0x00,0x00,0x66,0x7F,0x7F,0x6B,0x63,0x00, // m |
spin7ion | 0:1d2c0afef43c | 135 | 0x00,0x00,0x7C,0x66,0x66,0x66,0x66,0x00, // n |
spin7ion | 0:1d2c0afef43c | 136 | 0x00,0x00,0x3C,0x66,0x66,0x66,0x3C,0x00, // o |
spin7ion | 0:1d2c0afef43c | 137 | 0x00,0x00,0x6E,0x33,0x33,0x3E,0x30,0x78, // p |
spin7ion | 0:1d2c0afef43c | 138 | 0x00,0x00,0x3B,0x66,0x66,0x3E,0x06,0x0F, // q |
spin7ion | 0:1d2c0afef43c | 139 | 0x00,0x00,0x6E,0x3B,0x33,0x30,0x78,0x00, // r |
spin7ion | 0:1d2c0afef43c | 140 | 0x00,0x00,0x3E,0x60,0x3C,0x06,0x7C,0x00, // s |
spin7ion | 0:1d2c0afef43c | 141 | 0x08,0x18,0x3E,0x18,0x18,0x1A,0x0C,0x00, // t |
spin7ion | 0:1d2c0afef43c | 142 | 0x00,0x00,0x66,0x66,0x66,0x66,0x3B,0x00, // u |
spin7ion | 0:1d2c0afef43c | 143 | 0x00,0x00,0x66,0x66,0x66,0x3C,0x18,0x00, // v |
spin7ion | 0:1d2c0afef43c | 144 | 0x00,0x00,0x63,0x6B,0x7F,0x7F,0x36,0x00, // w |
spin7ion | 0:1d2c0afef43c | 145 | 0x00,0x00,0x63,0x36,0x1C,0x36,0x63,0x00, // x |
spin7ion | 0:1d2c0afef43c | 146 | 0x00,0x00,0x66,0x66,0x66,0x3E,0x06,0x7C, // y |
spin7ion | 0:1d2c0afef43c | 147 | 0x00,0x00,0x7E,0x4C,0x18,0x32,0x7E,0x00, // z |
spin7ion | 0:1d2c0afef43c | 148 | 0x0E,0x18,0x18,0x70,0x18,0x18,0x0E,0x00, // { |
spin7ion | 0:1d2c0afef43c | 149 | 0x0C,0x0C,0x0C,0x00,0x0C,0x0C,0x0C,0x00, // | |
spin7ion | 0:1d2c0afef43c | 150 | 0x70,0x18,0x18,0x0E,0x18,0x18,0x70,0x00, // } |
spin7ion | 0:1d2c0afef43c | 151 | 0x3B,0x6E,0x00,0x00,0x00,0x00,0x00,0x00, // ~ |
spin7ion | 0:1d2c0afef43c | 152 | 0x1C,0x36,0x36,0x1C,0x00,0x00,0x00,0x00}; // DEL |
spin7ion | 0:1d2c0afef43c | 153 | |
spin7ion | 0:1d2c0afef43c | 154 | unsigned char img[EPD_WIDTH][EPD_HEIGHT]; |
spin7ion | 0:1d2c0afef43c | 155 | |
spin7ion | 0:1d2c0afef43c | 156 | #endif /* EPD2IN9_H */ |