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