1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/EPD.h Sun May 19 22:06:40 2013 +0000
1.3 @@ -0,0 +1,86 @@
1.4 +// Copyright 2013 Pervasive Displays, Inc.
1.5 +// Copyright 2013 Embedded Artists AB
1.6 +//
1.7 +// Licensed under the Apache License, Version 2.0 (the "License");
1.8 +// you may not use this file except in compliance with the License.
1.9 +// You may obtain a copy of the License at:
1.10 +//
1.11 +// http://www.apache.org/licenses/LICENSE-2.0
1.12 +//
1.13 +// Unless required by applicable law or agreed to in writing,
1.14 +// software distributed under the License is distributed on an
1.15 +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
1.16 +// express or implied. See the License for the specific language
1.17 +// governing permissions and limitations under the License.
1.18 +
1.19 +#ifndef __EPD_H__
1.20 +#define __EPD_H__
1.21 +
1.22 +#include "bsp.h"
1.23 +
1.24 +//TODO
1.25 +#define PROGMEM /*const*/
1.26 +
1.27 +// if more SRAM available (8 kBytes)
1.28 +#define EPD_ENABLE_EXTRA_SRAM 1
1.29 +
1.30 +//typedef enum {
1.31 +// LOW=0,
1.32 +// HIGH=1
1.33 +//} EPD_pinstate;
1.34 +
1.35 +typedef enum {
1.36 + EPD_1_44, // 128 x 96
1.37 + EPD_2_0, // 200 x 96
1.38 + EPD_2_7 // 264 x 176
1.39 +} EPD_size;
1.40 +
1.41 +typedef enum { // Image pixel -> Display pixel
1.42 + EPD_compensate, // B -> W, W -> B (Current Image)
1.43 + EPD_white, // B -> N, W -> W (Current Image)
1.44 + EPD_inverse, // B -> N, W -> B (New Image)
1.45 + EPD_normal // B -> B, W -> W (New Image)
1.46 +} EPD_stage;
1.47 +
1.48 +typedef struct
1.49 +{
1.50 + EPD_size size;
1.51 + uint16_t stage_time;
1.52 + uint16_t factored_stage_time;
1.53 + uint16_t lines_per_display;
1.54 + uint16_t dots_per_line;
1.55 + uint16_t bytes_per_line;
1.56 + uint16_t bytes_per_scan;
1.57 + PROGMEM const uint8_t *gate_source;
1.58 + uint16_t gate_source_length;
1.59 + PROGMEM const uint8_t *channel_select;
1.60 + uint16_t channel_select_length;
1.61 + uint8_t filler;
1.62 +} COG_Parameters_t;
1.63 +
1.64 +
1.65 +void EPD_init(EPD_size size);
1.66 +void EPD_begin(void);
1.67 +void EPD_end(void);
1.68 +
1.69 +// set temperature
1.70 +void EPD_setFactor(int16_t temperature);
1.71 +
1.72 +// clear display (anything -> white)
1.73 +void EPD_clear(void);
1.74 +
1.75 +// assuming a clear (white) screen output an image (PROGMEM data)
1.76 +void EPD_image(PROGMEM const uint8_t *image);
1.77 +
1.78 +// change from old image to new image (PROGMEM data)
1.79 +void EPD_image_progmem(PROGMEM const uint8_t *old_image, PROGMEM const uint8_t *new_image);
1.80 +
1.81 +#if defined(EPD_ENABLE_EXTRA_SRAM)
1.82 +// change from old image to new image (SRAM version)
1.83 +void EPD_image_sram(const uint8_t *old_image, const uint8_t *new_image);
1.84 +#endif
1.85 +
1.86 +
1.87 +#endif //__EPD_H__
1.88 +
1.89 +