Come from standard seeed epaper, but adding SPI signal in construtor
Fork of seeedstudio-epaper by
Diff: EPD.cpp
- Revision:
- 1:2f62e2b80305
- Parent:
- 0:6ac5ba1343bf
- Child:
- 2:c5bb7d34974d
diff -r 6ac5ba1343bf -r 2f62e2b80305 EPD.cpp --- a/EPD.cpp Thu Jul 17 14:15:53 2014 +0000 +++ b/EPD.cpp Fri Jul 18 09:20:24 2014 +0000 @@ -1,3 +1,5 @@ +// TODO: update copyright notice + // Copyright 2013 Pervasive Displays, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,6 @@ #include "EPD.h" #include <mbed.h> -// delays - more consistent naming -#define Delay_ms(ms) delay(ms) -#define Delay_us(us) delayMicroseconds(us) - // inline arrays #define ARRAY(type, ...) ((type[]){__VA_ARGS__}) #define CU8(...) (ARRAY(const uint8_t, __VA_ARGS__)) @@ -30,9 +28,6 @@ Timer timer; SPI spi(p20, p22, p25); - -Serial pq(USBTX, USBRX); - static void SPI_put(uint8_t c); static void SPI_put_wait(uint8_t c, DigitalIn busy_pin); static void SPI_send(DigitalOut cs_pin, const uint8_t *buffer, uint16_t length); @@ -145,13 +140,8 @@ wait_ms(5); // wait for COG to become ready - - - pq.printf("waiting..."); while (this->EPD_Pin_BUSY) { } - - pq.printf(" OK!\n"); // channel select wait_us(10); @@ -390,7 +380,7 @@ { for (uint8_t line = from_line; line < to_line; line++) { - this->line(line, &image[line * this->bytes_per_line], 0, true, stage); + this->line(line, &image[(line - from_line) * this->bytes_per_line], 0, true, stage); } } @@ -476,12 +466,10 @@ } SPI_put_wait(pixels, this->EPD_Pin_BUSY); - //wait_us(1); } else { SPI_put_wait(fixed_value, this->EPD_Pin_BUSY); - //wait_ms(1); } } @@ -496,7 +484,6 @@ { SPI_put_wait(0x00, this->EPD_Pin_BUSY); } - //wait_ms(10); } // odd pixels @@ -533,7 +520,6 @@ { SPI_put_wait(fixed_value, this->EPD_Pin_BUSY); } - //wait_ms(10); } if (this->filler)