1 // Copyright 2013 Pervasive Displays, Inc. 2 // Copyright 2013 Embedded Artists AB 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at: 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, 11 // software distributed under the License is distributed on an 12 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 // express or implied. See the License for the specific language 14 // governing permissions and limitations under the License. 15 16 #ifndef __EPD_H__ 17 #define __EPD_H__ 18 19 #include "bsp.h" 20 21 //TODO 22 #define PROGMEM /*const*/ 23 24 // if more SRAM available (8 kBytes) 25 #define EPD_ENABLE_EXTRA_SRAM 1 26 27 //typedef enum { 28 // LOW=0, 29 // HIGH=1 30 //} EPD_pinstate; 31 32 typedef enum { 33 EPD_1_44, // 128 x 96 34 EPD_2_0, // 200 x 96 35 EPD_2_7 // 264 x 176 36 } EPD_size; 37 38 typedef enum { // Image pixel -> Display pixel 39 EPD_compensate, // B -> W, W -> B (Current Image) 40 EPD_white, // B -> N, W -> W (Current Image) 41 EPD_inverse, // B -> N, W -> B (New Image) 42 EPD_normal // B -> B, W -> W (New Image) 43 } EPD_stage; 44 45 typedef struct 46 { 47 EPD_size size; 48 uint16_t stage_time; 49 uint16_t factored_stage_time; 50 uint16_t lines_per_display; 51 uint16_t dots_per_line; 52 uint16_t bytes_per_line; 53 uint16_t bytes_per_scan; 54 PROGMEM const uint8_t *gate_source; 55 uint16_t gate_source_length; 56 PROGMEM const uint8_t *channel_select; 57 uint16_t channel_select_length; 58 uint8_t filler; 59 } COG_Parameters_t; 60 61 62 void EPD_init(EPD_size size); 63 void EPD_begin(void); 64 void EPD_end(void); 65 66 // set temperature 67 void EPD_setFactor(int16_t temperature); 68 69 // clear display (anything -> white) 70 void EPD_clear(void); 71 72 // assuming a clear (white) screen output an image (PROGMEM data) 73 void EPD_image(PROGMEM const uint8_t *image); 74 75 // change from old image to new image (PROGMEM data) 76 void EPD_image_progmem(PROGMEM const uint8_t *old_image, PROGMEM const uint8_t *new_image); 77 78 #if defined(EPD_ENABLE_EXTRA_SRAM) 79 // change from old image to new image (SRAM version) 80 void EPD_image_sram(const uint8_t *old_image, const uint8_t *new_image); 81 #endif 82 83 84 #endif //__EPD_H__ 85 86