first commit
This commit is contained in:
40
ESP32_WAVESHARE_7x5/Ecran.h
Normal file
40
ESP32_WAVESHARE_7x5/Ecran.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef Ecran_h
|
||||
#define Ecran_h
|
||||
#include "common.h"
|
||||
#define ENABLE_GxEPD2_display 1
|
||||
#include <GxEPD2_3C.h>
|
||||
#define GxEPD2_750c_Z08_IS_3C true
|
||||
#include <U8g2_for_Adafruit_GFX.h>
|
||||
#include "epaper_fonts.h"
|
||||
#include <SPI.h> // Built-in
|
||||
|
||||
#define SCREEN_WIDTH 800 // Set for landscape mode
|
||||
#define SCREEN_HEIGHT 480
|
||||
|
||||
enum alignment {LEFT, RIGHT, CENTER};
|
||||
|
||||
|
||||
class Ecran {
|
||||
public:
|
||||
Ecran();
|
||||
void setDisplay(GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT / 2> *display);
|
||||
void initialise(void);
|
||||
void clear(void);
|
||||
void drawString(int x, int y, String text, alignment align, uint16_t color = GxEPD_BLACK);
|
||||
void drawStringMaxWidth(int x, int y, unsigned int text_width, String text, alignment align);
|
||||
void arrow(int x, int y, int asize, float aangle, int pwidth, int plength);
|
||||
void drawAngledLine(int x, int y, int x1, int y1, int size, int color);
|
||||
void replaceFullBlack(const uint8_t *bitmap, uint8_t * new_bitmap, int largeur, int hauteur, int tailleCarre);
|
||||
void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint8_t scale, bool inverted);
|
||||
void drawScaledBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint8_t scale);
|
||||
void drawScaledInvertedBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color, uint8_t scale);
|
||||
uint16_t bilinearInterpolation(int16_t x, int16_t y, int16_t width, int16_t height, uint16_t color, float fx, float fy);
|
||||
void drawArc(int16_t x, int16_t y, int16_t radius, int16_t start_angle, int16_t end_angle, uint16_t color);
|
||||
|
||||
private:
|
||||
public:
|
||||
GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT / 2> * _display; // GDEW075Z08 800x480, GD7965
|
||||
U8G2_FOR_ADAFRUIT_GFX fonts; // Select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user