1 // Copyright 2013 Pervasive Displays, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at: 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, 10 // software distributed under the License is distributed on an 11 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 // express or implied. See the License for the specific language 13 // governing permissions and limitations under the License. 14 15 #ifndef __Display_COG_Process_H_ 16 #define __Display_COG_Process_H_ 17 18 /****************************************************************************** 19 * Includes 20 *****************************************************************************/ 21 22 #include "bsp.h" 23 24 /****************************************************************************** 25 * Defines and typedefs 26 *****************************************************************************/ 27 #define BLACK0 (0x03) 28 #define BLACK1 (0x0C) 29 #define BLACK2 (0x30) 30 #define BLACK3 (0xc0) 31 #define WHITE0 (0x02) 32 #define WHITE1 (0x08) 33 #define WHITE2 (0x20) 34 #define WHITE3 (0x80) 35 36 #define NOTHING (0x00) 37 #define SCANON (0xC0) 38 #define __LineDataSize 111 39 40 /* 41 enum 42 { 43 _5ms, 44 _10ms, 45 _25ms, 46 _30ms, 47 _40ms, 48 _120ms, 49 _150ms, 50 _300ms 51 }; 52 */ 53 54 typedef enum 55 { 56 EPDType_144 = 0, //1.44" display 57 EPDType_200 = 1, //2.0" display 58 EPDType_270 = 2 //2.7" display 59 } EPDType_t; 60 #define EPD_TYPE_144 0 61 #define EPD_TYPE_200 1 62 #define EPD_TYPE_270 2 63 64 typedef struct 65 { 66 uint8_t Even[16]; 67 uint8_t Scan[24]; 68 uint8_t Odd [16]; 69 } COG_144_LineData_t; 70 71 typedef struct 72 { 73 uint8_t Even[25]; 74 uint8_t Scan[24]; 75 uint8_t Odd [25]; 76 uint8_t DummyData; 77 } COG_20_LineData_t; 78 79 typedef struct 80 { 81 uint8_t Even[33]; 82 uint8_t Scan[44]; 83 uint8_t Odd [33]; 84 uint8_t DummyData; 85 } COG_27_LineData_t; 86 87 typedef union 88 { 89 union 90 { 91 COG_144_LineData_t COG_144LineData; 92 COG_20_LineData_t COG_20LineData; 93 COG_27_LineData_t COG_27LineData; 94 } LineDatas; 95 uint8_t uint8[__LineDataSize]; 96 } COG_LineDataPacket_t; 97 98 typedef struct 99 { 100 uint8_t ChannelSelect[8]; 101 uint8_t VoltageLevel; 102 uint16_t HORIZONTAL; 103 uint16_t VERTICAL; 104 uint8_t DataLineSize; 105 uint16_t FrameTime; 106 uint16_t StageTime; 107 } COG_Parameters_t; 108 109 extern const COG_Parameters_t COG_Parameters[3]; 110 111 /****************************************************************************** 112 * Prototypes 113 *****************************************************************************/ 114 void epd_HwInit(void); 115 void epd_PowerOn(void); 116 void epd_InitializeDriver(uint8_t EPDIndex); 117 void epd_Display(uint8_t *pNewImg, uint8_t *pPrevImg); 118 void epd_PowerOff(void); 119 120 #endif //__Display_COG_Process_H_