-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
2,846 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
#define CALEPD_VERSION "1.0.2" | ||
#define CALEPD_VERSION "1.0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// 7.5 HD 880*528 b/w Controller: ?? | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include "freertos/FreeRTOS.h" | ||
#include "esp_system.h" | ||
#include <stdint.h> | ||
#include <math.h> | ||
#include "sdkconfig.h" | ||
#include "esp_log.h" | ||
#include <string> | ||
#include <epd.h> | ||
#include <Adafruit_GFX.h> | ||
#include <epdspi.h> | ||
#include "soc/rtc_wdt.h" | ||
#include <gdew_colors.h> | ||
|
||
#define GDEW075HD_WIDTH 880 | ||
#define GDEW075HD_HEIGHT 528 | ||
|
||
// EPD comment: Pixel number expressed in bytes; this is neither the buffer size nor the size of the buffer in the controller | ||
// We are not adding page support so here this is our Buffer size | ||
#define GDEW075HD_BUFFER_SIZE (uint32_t(GDEW075HD_WIDTH) * uint32_t(GDEW075HD_HEIGHT) / 8) | ||
// 8 pix of this color in a buffer byte: | ||
#define GDEW075HD_8PIX_BLACK 0x00 | ||
#define GDEW075HD_8PIX_WHITE 0xFF | ||
|
||
class Gdew075HD : public Epd | ||
{ | ||
public: | ||
|
||
Gdew075HD(EpdSpi& IO); | ||
uint8_t colors_supported = 1; | ||
|
||
void drawPixel(int16_t x, int16_t y, uint16_t color); // Override GFX own drawPixel method | ||
|
||
// EPD tests | ||
void init(bool debug = false); | ||
|
||
// Partial update of rectangle from buffer to screen, does not power off | ||
void updateWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h, bool using_rotation); | ||
void fillScreen(uint16_t color); | ||
void update(); | ||
|
||
private: | ||
EpdSpi& IO; | ||
|
||
uint8_t _buffer[GDEW075HD_BUFFER_SIZE]; | ||
bool _using_partial_mode = false; | ||
bool _initial = true; | ||
|
||
uint16_t _setPartialRamArea(uint16_t x, uint16_t y, uint16_t xe, uint16_t ye); | ||
void _wakeUp(); | ||
void _sleep(); | ||
void _waitBusy(const char* message); | ||
void _rotate(uint16_t& x, uint16_t& y, uint16_t& w, uint16_t& h); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include "freertos/FreeRTOS.h" | ||
#include "esp_system.h" | ||
#include <stdint.h> | ||
#include <math.h> | ||
#include "sdkconfig.h" | ||
#include "esp_log.h" | ||
#include <string> | ||
#include <epdParallel.h> | ||
#include <Adafruit_GFX.h> | ||
#include <epdspi.h> | ||
#include "epd_driver.h" | ||
#include "L58Touch.h" // Touch interface | ||
|
||
#define HAS_16_LEVELS_GRAY 1 | ||
#define ED047TC1_WIDTH 960 | ||
#define ED047TC1_HEIGHT 540 | ||
|
||
// COLOR defines (Only 8 but actually this epapers have 16 levels) | ||
#define EPD_WHITE 255 | ||
#define EPD_WHITISH 223 | ||
#define EPD_SLGRAY 200 | ||
#define EPD_LGRAY 150 | ||
#define EPD_GRAY 100 | ||
#define EPD_DGRAY 50 | ||
#define EPD_SDGRAY 25 | ||
#define EPD_BLACK 0 | ||
|
||
|
||
class Ed047TC1t : public EpdParallel | ||
{ | ||
public: | ||
Ed047TC1t(L58Touch& ts); | ||
|
||
uint8_t *framebuffer; | ||
uint8_t colors_supported = 1; | ||
|
||
void drawPixel(int16_t x, int16_t y, uint16_t color); // Override GFX own drawPixel method | ||
|
||
void init(bool debug = false); | ||
void clearScreen(); | ||
void clearArea(Rect_t area); | ||
void powerOn(); | ||
void powerOff(); | ||
|
||
void fillScreen(uint16_t color); | ||
void update(enum DrawMode mode = BLACK_ON_WHITE); | ||
// Partial update of rectangle from buffer to screen, does not power off | ||
void updateWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h, enum DrawMode mode = BLACK_ON_WHITE, bool using_rotation = true); | ||
|
||
// Touch methods | ||
void touchLoop(); | ||
void registerTouchHandler(void(*fn)(TPoint point, TEvent e)); | ||
void(*_touchHandler)(TPoint point, TEvent e) = nullptr; | ||
void displayRotation(uint8_t rotation); // Rotates both Epd & Touch | ||
|
||
private: | ||
L58Touch& Touch; | ||
|
||
bool color = false; | ||
bool _initial = true; | ||
bool _debug_buffer = false; | ||
void _rotate(uint16_t& x, uint16_t& y, uint16_t& w, uint16_t& h); | ||
}; |
Oops, something went wrong.