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 <stdint.h> 20 21 typedef enum { 22 FALSE=0, 23 TRUE=1 24 } bool; 25 26 typedef enum { 27 LOW=0, 28 HIGH=1 29 } EPD_pinstate; 30 31 typedef enum { 32 EPD_1_44, // 128 x 96 33 EPD_2_0, // 200 x 96 34 EPD_2_7 // 264 x 176 35 } EPD_size; 36 37 typedef enum { // Image pixel -> Display pixel 38 EPD_compensate, // B -> W, W -> B (Current Image) 39 EPD_white, // B -> N, W -> W (Current Image) 40 EPD_inverse, // B -> N, W -> B (New Image) 41 EPD_normal // B -> B, W -> W (New Image) 42 } EPD_stage; 43 44 typedef struct 45 { 46 EPD_size size; 47 uint16_t stage_time; 48 uint16_t factored_stage_time; 49 uint16_t lines_per_display; 50 uint16_t dots_per_line; 51 uint16_t bytes_per_line; 52 uint16_t bytes_per_scan; 53 const uint8_t *gate_source; 54 uint16_t gate_source_length; 55 const uint8_t *channel_select; 56 uint16_t channel_select_length; 57 uint8_t filler; 58 } COG_Parameters_t; 59 60 61 void EPD_init(EPD_size size); 62 void EPD_begin(void); 63 void EPD_end(void); 64 65 // set temperature 66 void EPD_setFactor(int16_t temperature); 67 68 // clear display (anything -> white) 69 void EPD_clear(void); 70 71 // assuming a clear (white) screen output an image 72 void EPD_image(const uint8_t *image); 73 74 // change from old image to new image 75 void EPD_image_change(const uint8_t *old_image, const uint8_t *new_image); 76 77 78 #endif //__EPD_H__ 79 80