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