Merge pull request #1 from osdomotics/master

level up
master
Denis Knauf 2018-03-10 22:29:08 +01:00 committed by GitHub
commit 76ccd1ea13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 20934 additions and 0 deletions

View File

@ -0,0 +1,63 @@
# Set this to the name of your sketch (without extension .pde)
SKETCH=sketch
EXE=arduino-example
all: $(EXE)
CONTIKI=../../..
# Contiki IPv6 configuration
CONTIKI_WITH_IPV6 = 1
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
PROJECT_SOURCEFILES += ${SKETCH}.cpp epd1in54.cpp epdif.cpp epdpaint.cpp font8.c font24.c font20.c font16.c font12.c imagedata.cpp
# automatically build RESTful resources
REST_RESOURCES_DIR = ./resources
REST_RESOURCES_DIR_COMMON = ../resources-common
REST_RESOURCES_FILES= $(notdir \
$(shell find $(REST_RESOURCES_DIR) -name '*.c') \
$(shell find $(REST_RESOURCES_DIR_COMMON) -name '*.c') \
)
PROJECTDIRS += $(REST_RESOURCES_DIR) $(REST_RESOURCES_DIR_COMMON)
PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES)
# variable for Makefile.include
ifneq ($(TARGET), minimal-net)
CFLAGS += -DUIP_CONF_IPV6_RPL=1
else
# minimal-net does not support RPL under Linux and is mostly used to test CoAP only
${info INFO: compiling without RPL}
CFLAGS += -DUIP_CONF_IPV6_RPL=0
CFLAGS += -DHARD_CODED_ADDRESS=\"fdfd::10\"
${info INFO: compiling with large buffers}
CFLAGS += -DUIP_CONF_BUFFER_SIZE=2048
CFLAGS += -DREST_MAX_CHUNK_SIZE=1024
CFLAGS += -DCOAP_MAX_HEADER_SIZE=640
endif
# linker optimizations
SMALL=1
# REST Engine shall use Erbium CoAP implementation
APPS += er-coap
APPS += rest-engine
APPS += arduino
include $(CONTIKI)/Makefile.include
include $(CONTIKI)/apps/arduino/Makefile.include
$(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c
(cd $(CONTIKI)/tools && $(MAKE) tunslip6)
connect-router: $(CONTIKI)/tools/tunslip6
sudo $(CONTIKI)/tools/tunslip6 aaaa::1/64
connect-router-cooja: $(CONTIKI)/tools/tunslip6
sudo $(CONTIKI)/tools/tunslip6 -a 127.0.0.1 aaaa::1/64
connect-minimal:
sudo ip address add fdfd::1/64 dev tap0

View File

@ -0,0 +1,13 @@
Arduino compatibility example
=============================
make clean TARGET=osd-merkur-256 flash
This example shows that it is now possible to re-use arduino sketches in
Contiki. This example documents the necessary magic. Arduino specifies
two routines, `setup` and `loop`. Before `setup` is called, the
framework initializes hardware. In original Arduino, all this is done in
a `main` function (in C). For contiki we define a process that does the
same.
See the documentation file in apps/contiki-compat/README.md

View File

@ -0,0 +1,53 @@
[file_prefs]
final_new_line=true
ensure_convert_new_lines=false
strip_trailing_spaces=false
replace_tabs=false
[indentation]
indent_width=4
indent_type=1
indent_hard_tab_width=8
detect_indent=false
detect_indent_width=false
indent_mode=2
[project]
name=arduino-epaper
base_path=/home/harald/install/osd-contiki/examples/osd/arduino-epaper15/
description=
file_patterns=
[long line marker]
long_line_behaviour=1
long_line_column=72
[files]
current_page=0
FILE_NAME_0=1339;C++;0;EUTF-8;1;1;0;%2Fhome%2Fharald%2Finstall%2Fosd-contiki%2Fexamples%2Fosd%2Farduino-bodenheizung%2Fsketch.pde;0;4
[VTE]
last_dir=/home/harald
[build-menu]
NF_00_LB=_Make
NF_00_CM=make TARGET=osd-merkur-256
NF_00_WD=
NF_01_LB=Make flash
NF_01_CM=make TARGET=osd-merkur-256 flash
NF_01_WD=
NF_03_LB=Make Clean
NF_03_CM=make clean TARGET=osd-merkur-256
NF_03_WD=
C++FT_00_LB=_Kompilieren
C++FT_00_CM=make TARGET=osd-merkur-256
C++FT_00_WD=
C++FT_01_LB=_Erstellen
C++FT_01_CM=make TARGET=osd-merkur-256 flash
C++FT_01_WD=
filetypes=C++;
[editor]
line_wrapping=false
line_break_column=72
auto_continue_multiline=true

View File

@ -0,0 +1,2 @@
#include <arduino-process.h>
AUTOSTART_PROCESSES(&arduino_sketch);

View File

@ -0,0 +1,142 @@
/**
* @filename : epd1in54-demo.ino
* @brief : 1.54inch e-paper display demo
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare September 5 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <SPI.h>
#include <epd1in54.h>
#include <epdpaint.h>
#include "imagedata.h"
#define COLORED 0
#define UNCOLORED 1
/**
* Due to RAM not enough in Arduino UNO, a frame buffer is not allowed.
* In this case, a smaller image buffer is allocated and you have to
* update a partial display several times.
* 1 byte = 8 pixels, therefore you have to set 8*N pixels at a time.
*/
unsigned char image[1024];
Paint paint(image, 0, 0); // width should be the multiple of 8
Epd epd;
unsigned long time_start_ms;
unsigned long time_now_s;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
if (epd.Init(lut_full_update) != 0) {
Serial.print("e-Paper init failed");
return;
}
/**
* there are 2 memory areas embedded in the e-paper display
* and once the display is refreshed, the memory area will be auto-toggled,
* i.e. the next action of SetFrameMemory will set the other memory area
* therefore you have to clear the frame memory twice.
*/
epd.ClearFrameMemory(0xFF); // bit set = white, bit reset = black
epd.DisplayFrame();
epd.ClearFrameMemory(0xFF); // bit set = white, bit reset = black
epd.DisplayFrame();
paint.SetRotate(ROTATE_0);
paint.SetWidth(200);
paint.SetHeight(24);
/* For simplicity, the arguments are explicit numerical coordinates */
paint.Clear(COLORED);
paint.DrawStringAt(30, 4, "Hello world!", &Font16, UNCOLORED);
epd.SetFrameMemory(paint.GetImage(), 0, 10, paint.GetWidth(), paint.GetHeight());
paint.Clear(UNCOLORED);
paint.DrawStringAt(30, 4, "e-Paper Demo", &Font16, COLORED);
epd.SetFrameMemory(paint.GetImage(), 0, 30, paint.GetWidth(), paint.GetHeight());
paint.SetWidth(64);
paint.SetHeight(64);
paint.Clear(UNCOLORED);
paint.DrawRectangle(0, 0, 40, 50, COLORED);
paint.DrawLine(0, 0, 40, 50, COLORED);
paint.DrawLine(40, 0, 0, 50, COLORED);
epd.SetFrameMemory(paint.GetImage(), 16, 60, paint.GetWidth(), paint.GetHeight());
paint.Clear(UNCOLORED);
paint.DrawCircle(32, 32, 30, COLORED);
epd.SetFrameMemory(paint.GetImage(), 120, 60, paint.GetWidth(), paint.GetHeight());
paint.Clear(UNCOLORED);
paint.DrawFilledRectangle(0, 0, 40, 50, COLORED);
epd.SetFrameMemory(paint.GetImage(), 16, 130, paint.GetWidth(), paint.GetHeight());
paint.Clear(UNCOLORED);
paint.DrawFilledCircle(32, 32, 30, COLORED);
epd.SetFrameMemory(paint.GetImage(), 120, 130, paint.GetWidth(), paint.GetHeight());
epd.DisplayFrame();
delay(2000);
if (epd.Init(lut_partial_update) != 0) {
Serial.print("e-Paper init failed");
return;
}
/**
* there are 2 memory areas embedded in the e-paper display
* and once the display is refreshed, the memory area will be auto-toggled,
* i.e. the next action of SetFrameMemory will set the other memory area
* therefore you have to set the frame memory and refresh the display twice.
*/
epd.SetFrameMemory(IMAGE_DATA);
epd.DisplayFrame();
epd.SetFrameMemory(IMAGE_DATA);
epd.DisplayFrame();
time_start_ms = millis();
}
void loop() {
// put your main code here, to run repeatedly:
time_now_s = (millis() - time_start_ms) / 1000;
char time_string[] = {'0', '0', ':', '0', '0', '\0'};
time_string[0] = time_now_s / 60 / 10 + '0';
time_string[1] = time_now_s / 60 % 10 + '0';
time_string[3] = time_now_s % 60 / 10 + '0';
time_string[4] = time_now_s % 60 % 10 + '0';
paint.SetWidth(32);
paint.SetHeight(96);
paint.SetRotate(ROTATE_270);
paint.Clear(UNCOLORED);
paint.DrawStringAt(0, 4, time_string, &Font24, COLORED);
epd.SetFrameMemory(paint.GetImage(), 80, 72, paint.GetWidth(), paint.GetHeight());
epd.DisplayFrame();
delay(500);
}

View File

@ -0,0 +1,344 @@
/**
* @filename : imagedata.cpp
* @brief : data file for epd demo
*
* Copyright (C) Waveshare September 5 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "imagedata.h"
#include <avr/pgmspace.h>
const unsigned char IMAGE_DATA[] PROGMEM = {
/* 0X00,0X01,0XC8,0X00,0XC8,0X00, */
0XFF,0XFF,0XFF,0XFF,0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copyright (C) Waveshare September 5 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
extern const unsigned char IMAGE_DATA[];
/* FILE END */

View File

@ -0,0 +1,279 @@
/**
* @filename : epd1in54.cpp
* @brief : Implements for e-paper library
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare September 5 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <stdlib.h>
#include "epd1in54.h"
Epd::~Epd() {
};
Epd::Epd() {
reset_pin = RST_PIN;
dc_pin = DC_PIN;
cs_pin = CS_PIN;
busy_pin = BUSY_PIN;
width = EPD_WIDTH;
height = EPD_HEIGHT;
};
int Epd::Init(const unsigned char* lut) {
/* this calls the peripheral hardware interface, see epdif */
if (IfInit() != 0) {
return -1;
}
/* EPD hardware init start */
this->lut = lut;
Reset();
SendCommand(DRIVER_OUTPUT_CONTROL);
SendData((EPD_HEIGHT - 1) & 0xFF);
SendData(((EPD_HEIGHT - 1) >> 8) & 0xFF);
SendData(0x00); // GD = 0; SM = 0; TB = 0;
SendCommand(BOOSTER_SOFT_START_CONTROL);
SendData(0xD7);
SendData(0xD6);
SendData(0x9D);
SendCommand(WRITE_VCOM_REGISTER);
SendData(0xA8); // VCOM 7C
SendCommand(SET_DUMMY_LINE_PERIOD);
SendData(0x1A); // 4 dummy lines per gate
SendCommand(SET_GATE_TIME);
SendData(0x08); // 2us per line
SendCommand(DATA_ENTRY_MODE_SETTING);
SendData(0x03); // X increment; Y increment
SetLut(this->lut);
/* EPD hardware init end */
return 0;
}
/**
* @brief: basic function for sending commands
*/
void Epd::SendCommand(unsigned char command) {
DigitalWrite(dc_pin, LOW);
SpiTransfer(command);
}
/**
* @brief: basic function for sending data
*/
void Epd::SendData(unsigned char data) {
DigitalWrite(dc_pin, HIGH);
SpiTransfer(data);
}
/**
* @brief: Wait until the busy_pin goes LOW
*/
void Epd::WaitUntilIdle(void) {
while(DigitalRead(busy_pin) == HIGH) { //LOW: idle, HIGH: busy
DelayMs(100);
}
}
/**
* @brief: module reset.
* often used to awaken the module in deep sleep,
* see Epd::Sleep();
*/
void Epd::Reset(void) {
DigitalWrite(reset_pin, LOW); //module reset
DelayMs(200);
DigitalWrite(reset_pin, HIGH);
DelayMs(200);
}
/**
* @brief: set the look-up table register
*/
void Epd::SetLut(const unsigned char* lut) {
this->lut = lut;
SendCommand(WRITE_LUT_REGISTER);
/* the length of look-up table is 30 bytes */
for (int i = 0; i < 30; i++) {
SendData(this->lut[i]);
}
}
/**
* @brief: put an image buffer to the frame memory.
* this won't update the display.
*/
void Epd::SetFrameMemory(
const unsigned char* image_buffer,
int x,
int y,
int image_width,
int image_height
) {
int x_end;
int y_end;
if (
image_buffer == NULL ||
x < 0 || image_width < 0 ||
y < 0 || image_height < 0
) {
return;
}
/* x point must be the multiple of 8 or the last 3 bits will be ignored */
x &= 0xF8;
image_width &= 0xF8;
if (x + image_width >= this->width) {
x_end = this->width - 1;
} else {
x_end = x + image_width - 1;
}
if (y + image_height >= this->height) {
y_end = this->height - 1;
} else {
y_end = y + image_height - 1;
}
SetMemoryArea(x, y, x_end, y_end);
SetMemoryPointer(x, y);
SendCommand(WRITE_RAM);
/* send the image data */
for (int j = 0; j < y_end - y + 1; j++) {
for (int i = 0; i < (x_end - x + 1) / 8; i++) {
SendData(image_buffer[i + j * (image_width / 8)]);
}
}
}
/**
* @brief: put an image buffer to the frame memory.
* this won't update the display.
*
* Question: When do you use this function instead of
* void SetFrameMemory(
* const unsigned char* image_buffer,
* int x,
* int y,
* int image_width,
* int image_height
* );
* Answer: SetFrameMemory with parameters only reads image data
* from the RAM but not from the flash in AVR chips (for AVR chips,
* you have to use the function pgm_read_byte to read buffers
* from the flash).
*/
void Epd::SetFrameMemory(const unsigned char* image_buffer) {
SetMemoryArea(0, 0, this->width - 1, this->height - 1);
SetMemoryPointer(0, 0);
SendCommand(WRITE_RAM);
/* send the image data */
for (int i = 0; i < this->width / 8 * this->height; i++) {
SendData(pgm_read_byte(&image_buffer[i]));
}
}
/**
* @brief: clear the frame memory with the specified color.
* this won't update the display.
*/
void Epd::ClearFrameMemory(unsigned char color) {
SetMemoryArea(0, 0, this->width - 1, this->height - 1);
SetMemoryPointer(0, 0);
SendCommand(WRITE_RAM);
/* send the color data */
for (int i = 0; i < this->width / 8 * this->height; i++) {
SendData(color);
}
}
/**
* @brief: update the display
* there are 2 memory areas embedded in the e-paper display
* but once this function is called,
* the the next action of SetFrameMemory or ClearFrame will
* set the other memory area.
*/
void Epd::DisplayFrame(void) {
SendCommand(DISPLAY_UPDATE_CONTROL_2);
SendData(0xC4);
SendCommand(MASTER_ACTIVATION);
SendCommand(TERMINATE_FRAME_READ_WRITE);
WaitUntilIdle();
}
/**
* @brief: private function to specify the memory area for data R/W
*/
void Epd::SetMemoryArea(int x_start, int y_start, int x_end, int y_end) {
SendCommand(SET_RAM_X_ADDRESS_START_END_POSITION);
/* x point must be the multiple of 8 or the last 3 bits will be ignored */
SendData((x_start >> 3) & 0xFF);
SendData((x_end >> 3) & 0xFF);
SendCommand(SET_RAM_Y_ADDRESS_START_END_POSITION);
SendData(y_start & 0xFF);
SendData((y_start >> 8) & 0xFF);
SendData(y_end & 0xFF);
SendData((y_end >> 8) & 0xFF);
}
/**
* @brief: private function to specify the start point for data R/W
*/
void Epd::SetMemoryPointer(int x, int y) {
SendCommand(SET_RAM_X_ADDRESS_COUNTER);
/* x point must be the multiple of 8 or the last 3 bits will be ignored */
SendData((x >> 3) & 0xFF);
SendCommand(SET_RAM_Y_ADDRESS_COUNTER);
SendData(y & 0xFF);
SendData((y >> 8) & 0xFF);
WaitUntilIdle();
}
/**
* @brief: After this command is transmitted, the chip would enter the
* deep-sleep mode to save power.
* The deep sleep mode would return to standby by hardware reset.
* You can use Epd::Init() to awaken
*/
void Epd::Sleep() {
SendCommand(DEEP_SLEEP_MODE);
WaitUntilIdle();
}
const unsigned char lut_full_update[] =
{
0x02, 0x02, 0x01, 0x11, 0x12, 0x12, 0x22, 0x22,
0x66, 0x69, 0x69, 0x59, 0x58, 0x99, 0x99, 0x88,
0x00, 0x00, 0x00, 0x00, 0xF8, 0xB4, 0x13, 0x51,
0x35, 0x51, 0x51, 0x19, 0x01, 0x00
};
const unsigned char lut_partial_update[] =
{
0x10, 0x18, 0x18, 0x08, 0x18, 0x18, 0x08, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* END OF FILE */

View File

@ -0,0 +1,100 @@
/**
* @filename : epd1in54.h
* @brief : Header file for e-paper display library epd1in54.cpp
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare September 5 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef EPD1IN54_H
#define EPD1IN54_H
#include "epdif.h"
// Display resolution
#define EPD_WIDTH 200
#define EPD_HEIGHT 200
// EPD1IN54 commands
#define DRIVER_OUTPUT_CONTROL 0x01
#define BOOSTER_SOFT_START_CONTROL 0x0C
#define GATE_SCAN_START_POSITION 0x0F
#define DEEP_SLEEP_MODE 0x10
#define DATA_ENTRY_MODE_SETTING 0x11
#define SW_RESET 0x12
#define TEMPERATURE_SENSOR_CONTROL 0x1A
#define MASTER_ACTIVATION 0x20
#define DISPLAY_UPDATE_CONTROL_1 0x21
#define DISPLAY_UPDATE_CONTROL_2 0x22
#define WRITE_RAM 0x24
#define WRITE_VCOM_REGISTER 0x2C
#define WRITE_LUT_REGISTER 0x32
#define SET_DUMMY_LINE_PERIOD 0x3A
#define SET_GATE_TIME 0x3B
#define BORDER_WAVEFORM_CONTROL 0x3C
#define SET_RAM_X_ADDRESS_START_END_POSITION 0x44
#define SET_RAM_Y_ADDRESS_START_END_POSITION 0x45
#define SET_RAM_X_ADDRESS_COUNTER 0x4E
#define SET_RAM_Y_ADDRESS_COUNTER 0x4F
#define TERMINATE_FRAME_READ_WRITE 0xFF
extern const unsigned char lut_full_update[];
extern const unsigned char lut_partial_update[];
class Epd : EpdIf {
public:
long width;
long height;
Epd();
~Epd();
int Init(const unsigned char* lut);
void SendCommand(unsigned char command);
void SendData(unsigned char data);
void WaitUntilIdle(void);
void Reset(void);
void SetFrameMemory(
const unsigned char* image_buffer,
int x,
int y,
int image_width,
int image_height
);
void SetFrameMemory(const unsigned char* image_buffer);
void ClearFrameMemory(unsigned char color);
void DisplayFrame(void);
void Sleep(void);
private:
unsigned int reset_pin;
unsigned int dc_pin;
unsigned int cs_pin;
unsigned int busy_pin;
const unsigned char* lut;
void SetLut(const unsigned char* lut);
void SetMemoryArea(int x_start, int y_start, int x_end, int y_end);
void SetMemoryPointer(int x, int y);
};
#endif /* EPD1IN54_H */
/* END OF FILE */

View File

@ -0,0 +1,64 @@
/**
* @filename : epdif.cpp
* @brief : Implements EPD interface functions
* Users have to implement all the functions in epdif.cpp
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare August 10 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "epdif.h"
#include <SPI.h>
EpdIf::EpdIf() {
};
EpdIf::~EpdIf() {
};
void EpdIf::DigitalWrite(int pin, int value) {
digitalWrite(pin, value);
}
int EpdIf::DigitalRead(int pin) {
return digitalRead(pin);
}
void EpdIf::DelayMs(unsigned int delaytime) {
delay(delaytime);
}
void EpdIf::SpiTransfer(unsigned char data) {
digitalWrite(CS_PIN, LOW);
SPI.transfer(data);
digitalWrite(CS_PIN, HIGH);
}
int EpdIf::IfInit(void) {
pinMode(CS_PIN, OUTPUT);
pinMode(RST_PIN, OUTPUT);
pinMode(DC_PIN, OUTPUT);
pinMode(BUSY_PIN, INPUT);
SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE0));
SPI.begin();
return 0;
}

View File

@ -0,0 +1,51 @@
/**
* @filename : epdif.h
* @brief : Header file of epdif.cpp providing EPD interface functions
* Users have to implement all the functions in epdif.cpp
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare August 10 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef EPDIF_H
#define EPDIF_H
#include <Arduino.h>
// Pin definition
#define RST_PIN 19
#define DC_PIN 20
#define CS_PIN 10
#define BUSY_PIN 14
class EpdIf {
public:
EpdIf(void);
~EpdIf(void);
static int IfInit(void);
static void DigitalWrite(int pin, int value);
static int DigitalRead(int pin);
static void DelayMs(unsigned int delaytime);
static void SpiTransfer(unsigned char data);
};
#endif

View File

@ -0,0 +1,342 @@
/**
* @filename : epdpaint.cpp
* @brief : Paint tools
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare September 9 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <avr/pgmspace.h>
#include "epdpaint.h"
Paint::Paint(unsigned char* image, int width, int height) {
this->rotate = ROTATE_0;
this->image = image;
/* 1 byte = 8 pixels, so the width should be the multiple of 8 */
this->width = width % 8 ? width + 8 - (width % 8) : width;
this->height = height;
}
Paint::~Paint() {
}
/**
* @brief: clear the image
*/
void Paint::Clear(int colored) {
for (int x = 0; x < this->width; x++) {
for (int y = 0; y < this->height; y++) {
DrawAbsolutePixel(x, y, colored);
}
}
}
/**
* @brief: this draws a pixel by absolute coordinates.
* this function won't be affected by the rotate parameter.
*/
void Paint::DrawAbsolutePixel(int x, int y, int colored) {
if (x < 0 || x >= this->width || y < 0 || y >= this->height) {
return;
}
if (IF_INVERT_COLOR) {
if (colored) {
image[(x + y * this->width) / 8] |= 0x80 >> (x % 8);
} else {
image[(x + y * this->width) / 8] &= ~(0x80 >> (x % 8));
}
} else {
if (colored) {
image[(x + y * this->width) / 8] &= ~(0x80 >> (x % 8));
} else {
image[(x + y * this->width) / 8] |= 0x80 >> (x % 8);
}
}
}
/**
* @brief: Getters and Setters
*/
unsigned char* Paint::GetImage(void) {
return this->image;
}
int Paint::GetWidth(void) {
return this->width;
}
void Paint::SetWidth(int width) {
this->width = width % 8 ? width + 8 - (width % 8) : width;
}
int Paint::GetHeight(void) {
return this->height;
}
void Paint::SetHeight(int height) {
this->height = height;
}
int Paint::GetRotate(void) {
return this->rotate;
}
void Paint::SetRotate(int rotate){
this->rotate = rotate;
}
/**
* @brief: this draws a pixel by the coordinates
*/
void Paint::DrawPixel(int x, int y, int colored) {
int point_temp;
if (this->rotate == ROTATE_0) {
if(x < 0 || x >= this->width || y < 0 || y >= this->height) {
return;
}
DrawAbsolutePixel(x, y, colored);
} else if (this->rotate == ROTATE_90) {
if(x < 0 || x >= this->height || y < 0 || y >= this->width) {
return;
}
point_temp = x;
x = this->width - y;
y = point_temp;
DrawAbsolutePixel(x, y, colored);
} else if (this->rotate == ROTATE_180) {
if(x < 0 || x >= this->width || y < 0 || y >= this->height) {
return;
}
x = this->width - x;
y = this->height - y;
DrawAbsolutePixel(x, y, colored);
} else if (this->rotate == ROTATE_270) {
if(x < 0 || x >= this->height || y < 0 || y >= this->width) {
return;
}
point_temp = x;
x = y;
y = this->height - point_temp;
DrawAbsolutePixel(x, y, colored);
}
}
/**
* @brief: this draws a charactor on the frame buffer but not refresh
*/
void Paint::DrawCharAt(int x, int y, char ascii_char, sFONT* font, int colored) {
int i, j;
unsigned int char_offset = (ascii_char - ' ') * font->Height * (font->Width / 8 + (font->Width % 8 ? 1 : 0));
const unsigned char* ptr = &font->table[char_offset];
for (j = 0; j < font->Height; j++) {
for (i = 0; i < font->Width; i++) {
if (pgm_read_byte(ptr) & (0x80 >> (i % 8))) {
DrawPixel(x + i, y + j, colored);
}
if (i % 8 == 7) {
ptr++;
}
}
if (font->Width % 8 != 0) {
ptr++;
}
}
}
/**
* @brief: this displays a string on the frame buffer but not refresh
*/
void Paint::DrawStringAt(int x, int y, const char* text, sFONT* font, int colored) {
const char* p_text = text;
unsigned int counter = 0;
int refcolumn = x;
/* Send the string character by character on EPD */
while (*p_text != 0) {
/* Display one character on EPD */
DrawCharAt(refcolumn, y, *p_text, font, colored);
/* Decrement the column position by 16 */
refcolumn += font->Width;
/* Point on the next character */
p_text++;
counter++;
}
}
/**
* @brief: this draws a line on the frame buffer
*/
void Paint::DrawLine(int x0, int y0, int x1, int y1, int colored) {
/* Bresenham algorithm */
int dx = x1 - x0 >= 0 ? x1 - x0 : x0 - x1;
int sx = x0 < x1 ? 1 : -1;
int dy = y1 - y0 <= 0 ? y1 - y0 : y0 - y1;
int sy = y0 < y1 ? 1 : -1;
int err = dx + dy;
while((x0 != x1) && (y0 != y1)) {
DrawPixel(x0, y0 , colored);
if (2 * err >= dy) {
err += dy;
x0 += sx;
}
if (2 * err <= dx) {
err += dx;
y0 += sy;
}
}
}
/**
* @brief: this draws a horizontal line on the frame buffer
*/
void Paint::DrawHorizontalLine(int x, int y, int line_width, int colored) {
int i;
for (i = x; i < x + line_width; i++) {
DrawPixel(i, y, colored);
}
}
/**
* @brief: this draws a vertical line on the frame buffer
*/
void Paint::DrawVerticalLine(int x, int y, int line_height, int colored) {
int i;
for (i = y; i < y + line_height; i++) {
DrawPixel(x, i, colored);
}
}
/**
* @brief: this draws a rectangle
*/
void Paint::DrawRectangle(int x0, int y0, int x1, int y1, int colored) {
int min_x, min_y, max_x, max_y;
min_x = x1 > x0 ? x0 : x1;
max_x = x1 > x0 ? x1 : x0;
min_y = y1 > y0 ? y0 : y1;
max_y = y1 > y0 ? y1 : y0;
DrawHorizontalLine(min_x, min_y, max_x - min_x + 1, colored);
DrawHorizontalLine(min_x, max_y, max_x - min_x + 1, colored);
DrawVerticalLine(min_x, min_y, max_y - min_y + 1, colored);
DrawVerticalLine(max_x, min_y, max_y - min_y + 1, colored);
}
/**
* @brief: this draws a filled rectangle
*/
void Paint::DrawFilledRectangle(int x0, int y0, int x1, int y1, int colored) {
int min_x, min_y, max_x, max_y;
int i;
min_x = x1 > x0 ? x0 : x1;
max_x = x1 > x0 ? x1 : x0;
min_y = y1 > y0 ? y0 : y1;
max_y = y1 > y0 ? y1 : y0;
for (i = min_x; i <= max_x; i++) {
DrawVerticalLine(i, min_y, max_y - min_y + 1, colored);
}
}
/**
* @brief: this draws a circle
*/
void Paint::DrawCircle(int x, int y, int radius, int colored) {
/* Bresenham algorithm */
int x_pos = -radius;
int y_pos = 0;
int err = 2 - 2 * radius;
int e2;
do {
DrawPixel(x - x_pos, y + y_pos, colored);
DrawPixel(x + x_pos, y + y_pos, colored);
DrawPixel(x + x_pos, y - y_pos, colored);
DrawPixel(x - x_pos, y - y_pos, colored);
e2 = err;
if (e2 <= y_pos) {
err += ++y_pos * 2 + 1;
if(-x_pos == y_pos && e2 <= x_pos) {
e2 = 0;
}
}
if (e2 > x_pos) {
err += ++x_pos * 2 + 1;
}
} while (x_pos <= 0);
}
/**
* @brief: this draws a filled circle
*/
void Paint::DrawFilledCircle(int x, int y, int radius, int colored) {
/* Bresenham algorithm */
int x_pos = -radius;
int y_pos = 0;
int err = 2 - 2 * radius;
int e2;
do {
DrawPixel(x - x_pos, y + y_pos, colored);
DrawPixel(x + x_pos, y + y_pos, colored);
DrawPixel(x + x_pos, y - y_pos, colored);
DrawPixel(x - x_pos, y - y_pos, colored);
DrawHorizontalLine(x + x_pos, y + y_pos, 2 * (-x_pos) + 1, colored);
DrawHorizontalLine(x + x_pos, y - y_pos, 2 * (-x_pos) + 1, colored);
e2 = err;
if (e2 <= y_pos) {
err += ++y_pos * 2 + 1;
if(-x_pos == y_pos && e2 <= x_pos) {
e2 = 0;
}
}
if(e2 > x_pos) {
err += ++x_pos * 2 + 1;
}
} while(x_pos <= 0);
}
/* END OF FILE */

View File

@ -0,0 +1,75 @@
/**
* @filename : epdpaint.h
* @brief : Header file for epdpaint.cpp
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare July 28 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef EPDPAINT_H
#define EPDPAINT_H
// Display orientation
#define ROTATE_0 0
#define ROTATE_90 1
#define ROTATE_180 2
#define ROTATE_270 3
// Color inverse. 1 or 0 = set or reset a bit if set a colored pixel
#define IF_INVERT_COLOR 1
#include "fonts.h"
class Paint {
public:
Paint(unsigned char* image, int width, int height);
~Paint();
void Clear(int colored);
int GetWidth(void);
void SetWidth(int width);
int GetHeight(void);
void SetHeight(int height);
int GetRotate(void);
void SetRotate(int rotate);
unsigned char* GetImage(void);
void DrawAbsolutePixel(int x, int y, int colored);
void DrawPixel(int x, int y, int colored);
void DrawCharAt(int x, int y, char ascii_char, sFONT* font, int colored);
void DrawStringAt(int x, int y, const char* text, sFONT* font, int colored);
void DrawLine(int x0, int y0, int x1, int y1, int colored);
void DrawHorizontalLine(int x, int y, int width, int colored);
void DrawVerticalLine(int x, int y, int height, int colored);
void DrawRectangle(int x0, int y0, int x1, int y1, int colored);
void DrawFilledRectangle(int x0, int y0, int x1, int y1, int colored);
void DrawCircle(int x, int y, int radius, int colored);
void DrawFilledCircle(int x, int y, int radius, int colored);
private:
unsigned char* image;
int width;
int height;
int rotate;
};
#endif
/* END OF FILE */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,75 @@
/**
******************************************************************************
* @file fonts.h
* @author MCD Application Team
* @version V1.0.0
* @date 18-February-2014
* @brief Header for fonts.c file
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __FONTS_H
#define __FONTS_H
/* Max size of bitmap will based on a font24 (17x24) */
#define MAX_HEIGHT_FONT 24
#define MAX_WIDTH_FONT 17
#define OFFSET_BITMAP 54
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
typedef struct _tFont
{
const uint8_t *table;
int16_t Width;
int16_t Height;
} sFONT;
extern sFONT Font24;
extern sFONT Font20;
extern sFONT Font16;
extern sFONT Font12;
extern sFONT Font8;
#ifdef __cplusplus
}
#endif
#endif /* __FONTS_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -0,0 +1,344 @@
/**
* @filename : imagedata.cpp
* @brief : data file for epd demo
*
* Copyright (C) Waveshare September 5 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "imagedata.h"
#include <avr/pgmspace.h>
const unsigned char IMAGE_DATA[] PROGMEM = {
/* 0X00,0X01,0XC8,0X00,0XC8,0X00, */
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XF1,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0X8F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF1,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XF1,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XF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,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF1,0XFF,0XF8,0X80,0X00,
0X00,0X04,0X1F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XF1,0XFF,0XFF,0X00,0X00,0X00,0X02,0X3F,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF1,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF1,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF1,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
};

View File

@ -0,0 +1,30 @@
/**
* @filename : imagedata.h
* @brief : head file for imagedata.cpp
*
* Copyright (C) Waveshare September 5 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
extern const unsigned char IMAGE_DATA[];
/* FILE END */

View File

@ -0,0 +1,279 @@
/**
* @filename : epd1in54.cpp
* @brief : Implements for e-paper library
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare September 5 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <stdlib.h>
#include "epd1in54.h"
Epd::~Epd() {
};
Epd::Epd() {
reset_pin = RST_PIN;
dc_pin = DC_PIN;
cs_pin = CS_PIN;
busy_pin = BUSY_PIN;
width = EPD_WIDTH;
height = EPD_HEIGHT;
};
int Epd::Init(const unsigned char* lut) {
/* this calls the peripheral hardware interface, see epdif */
if (IfInit() != 0) {
return -1;
}
/* EPD hardware init start */
this->lut = lut;
Reset();
SendCommand(DRIVER_OUTPUT_CONTROL);
SendData((EPD_HEIGHT - 1) & 0xFF);
SendData(((EPD_HEIGHT - 1) >> 8) & 0xFF);
SendData(0x00); // GD = 0; SM = 0; TB = 0;
SendCommand(BOOSTER_SOFT_START_CONTROL);
SendData(0xD7);
SendData(0xD6);
SendData(0x9D);
SendCommand(WRITE_VCOM_REGISTER);
SendData(0xA8); // VCOM 7C
SendCommand(SET_DUMMY_LINE_PERIOD);
SendData(0x1A); // 4 dummy lines per gate
SendCommand(SET_GATE_TIME);
SendData(0x08); // 2us per line
SendCommand(DATA_ENTRY_MODE_SETTING);
SendData(0x03); // X increment; Y increment
SetLut(this->lut);
/* EPD hardware init end */
return 0;
}
/**
* @brief: basic function for sending commands
*/
void Epd::SendCommand(unsigned char command) {
DigitalWrite(dc_pin, LOW);
SpiTransfer(command);
}
/**
* @brief: basic function for sending data
*/
void Epd::SendData(unsigned char data) {
DigitalWrite(dc_pin, HIGH);
SpiTransfer(data);
}
/**
* @brief: Wait until the busy_pin goes LOW
*/
void Epd::WaitUntilIdle(void) {
while(DigitalRead(busy_pin) == HIGH) { //LOW: idle, HIGH: busy
DelayMs(100);
}
}
/**
* @brief: module reset.
* often used to awaken the module in deep sleep,
* see Epd::Sleep();
*/
void Epd::Reset(void) {
DigitalWrite(reset_pin, LOW); //module reset
DelayMs(200);
DigitalWrite(reset_pin, HIGH);
DelayMs(200);
}
/**
* @brief: set the look-up table register
*/
void Epd::SetLut(const unsigned char* lut) {
this->lut = lut;
SendCommand(WRITE_LUT_REGISTER);
/* the length of look-up table is 30 bytes */
for (int i = 0; i < 30; i++) {
SendData(this->lut[i]);
}
}
/**
* @brief: put an image buffer to the frame memory.
* this won't update the display.
*/
void Epd::SetFrameMemory(
const unsigned char* image_buffer,
int x,
int y,
int image_width,
int image_height
) {
int x_end;
int y_end;
if (
image_buffer == NULL ||
x < 0 || image_width < 0 ||
y < 0 || image_height < 0
) {
return;
}
/* x point must be the multiple of 8 or the last 3 bits will be ignored */
x &= 0xF8;
image_width &= 0xF8;
if (x + image_width >= this->width) {
x_end = this->width - 1;
} else {
x_end = x + image_width - 1;
}
if (y + image_height >= this->height) {
y_end = this->height - 1;
} else {
y_end = y + image_height - 1;
}
SetMemoryArea(x, y, x_end, y_end);
SetMemoryPointer(x, y);
SendCommand(WRITE_RAM);
/* send the image data */
for (int j = 0; j < y_end - y + 1; j++) {
for (int i = 0; i < (x_end - x + 1) / 8; i++) {
SendData(image_buffer[i + j * (image_width / 8)]);
}
}
}
/**
* @brief: put an image buffer to the frame memory.
* this won't update the display.
*
* Question: When do you use this function instead of
* void SetFrameMemory(
* const unsigned char* image_buffer,
* int x,
* int y,
* int image_width,
* int image_height
* );
* Answer: SetFrameMemory with parameters only reads image data
* from the RAM but not from the flash in AVR chips (for AVR chips,
* you have to use the function pgm_read_byte to read buffers
* from the flash).
*/
void Epd::SetFrameMemory(const unsigned char* image_buffer) {
SetMemoryArea(0, 0, this->width - 1, this->height - 1);
SetMemoryPointer(0, 0);
SendCommand(WRITE_RAM);
/* send the image data */
for (int i = 0; i < this->width / 8 * this->height; i++) {
SendData(pgm_read_byte(&image_buffer[i]));
}
}
/**
* @brief: clear the frame memory with the specified color.
* this won't update the display.
*/
void Epd::ClearFrameMemory(unsigned char color) {
SetMemoryArea(0, 0, this->width - 1, this->height - 1);
SetMemoryPointer(0, 0);
SendCommand(WRITE_RAM);
/* send the color data */
for (int i = 0; i < this->width / 8 * this->height; i++) {
SendData(color);
}
}
/**
* @brief: update the display
* there are 2 memory areas embedded in the e-paper display
* but once this function is called,
* the the next action of SetFrameMemory or ClearFrame will
* set the other memory area.
*/
void Epd::DisplayFrame(void) {
SendCommand(DISPLAY_UPDATE_CONTROL_2);
SendData(0xC4);
SendCommand(MASTER_ACTIVATION);
SendCommand(TERMINATE_FRAME_READ_WRITE);
WaitUntilIdle();
}
/**
* @brief: private function to specify the memory area for data R/W
*/
void Epd::SetMemoryArea(int x_start, int y_start, int x_end, int y_end) {
SendCommand(SET_RAM_X_ADDRESS_START_END_POSITION);
/* x point must be the multiple of 8 or the last 3 bits will be ignored */
SendData((x_start >> 3) & 0xFF);
SendData((x_end >> 3) & 0xFF);
SendCommand(SET_RAM_Y_ADDRESS_START_END_POSITION);
SendData(y_start & 0xFF);
SendData((y_start >> 8) & 0xFF);
SendData(y_end & 0xFF);
SendData((y_end >> 8) & 0xFF);
}
/**
* @brief: private function to specify the start point for data R/W
*/
void Epd::SetMemoryPointer(int x, int y) {
SendCommand(SET_RAM_X_ADDRESS_COUNTER);
/* x point must be the multiple of 8 or the last 3 bits will be ignored */
SendData((x >> 3) & 0xFF);
SendCommand(SET_RAM_Y_ADDRESS_COUNTER);
SendData(y & 0xFF);
SendData((y >> 8) & 0xFF);
WaitUntilIdle();
}
/**
* @brief: After this command is transmitted, the chip would enter the
* deep-sleep mode to save power.
* The deep sleep mode would return to standby by hardware reset.
* You can use Epd::Init() to awaken
*/
void Epd::Sleep() {
SendCommand(DEEP_SLEEP_MODE);
WaitUntilIdle();
}
const unsigned char lut_full_update[] =
{
0x02, 0x02, 0x01, 0x11, 0x12, 0x12, 0x22, 0x22,
0x66, 0x69, 0x69, 0x59, 0x58, 0x99, 0x99, 0x88,
0x00, 0x00, 0x00, 0x00, 0xF8, 0xB4, 0x13, 0x51,
0x35, 0x51, 0x51, 0x19, 0x01, 0x00
};
const unsigned char lut_partial_update[] =
{
0x10, 0x18, 0x18, 0x08, 0x18, 0x18, 0x08, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* END OF FILE */

View File

@ -0,0 +1,100 @@
/**
* @filename : epd1in54.h
* @brief : Header file for e-paper display library epd1in54.cpp
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare September 5 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef EPD1IN54_H
#define EPD1IN54_H
#include "epdif.h"
// Display resolution
#define EPD_WIDTH 200
#define EPD_HEIGHT 200
// EPD1IN54 commands
#define DRIVER_OUTPUT_CONTROL 0x01
#define BOOSTER_SOFT_START_CONTROL 0x0C
#define GATE_SCAN_START_POSITION 0x0F
#define DEEP_SLEEP_MODE 0x10
#define DATA_ENTRY_MODE_SETTING 0x11
#define SW_RESET 0x12
#define TEMPERATURE_SENSOR_CONTROL 0x1A
#define MASTER_ACTIVATION 0x20
#define DISPLAY_UPDATE_CONTROL_1 0x21
#define DISPLAY_UPDATE_CONTROL_2 0x22
#define WRITE_RAM 0x24
#define WRITE_VCOM_REGISTER 0x2C
#define WRITE_LUT_REGISTER 0x32
#define SET_DUMMY_LINE_PERIOD 0x3A
#define SET_GATE_TIME 0x3B
#define BORDER_WAVEFORM_CONTROL 0x3C
#define SET_RAM_X_ADDRESS_START_END_POSITION 0x44
#define SET_RAM_Y_ADDRESS_START_END_POSITION 0x45
#define SET_RAM_X_ADDRESS_COUNTER 0x4E
#define SET_RAM_Y_ADDRESS_COUNTER 0x4F
#define TERMINATE_FRAME_READ_WRITE 0xFF
extern const unsigned char lut_full_update[];
extern const unsigned char lut_partial_update[];
class Epd : EpdIf {
public:
unsigned long width;
unsigned long height;
Epd();
~Epd();
int Init(const unsigned char* lut);
void SendCommand(unsigned char command);
void SendData(unsigned char data);
void WaitUntilIdle(void);
void Reset(void);
void SetFrameMemory(
const unsigned char* image_buffer,
int x,
int y,
int image_width,
int image_height
);
void SetFrameMemory(const unsigned char* image_buffer);
void ClearFrameMemory(unsigned char color);
void DisplayFrame(void);
void Sleep(void);
private:
unsigned int reset_pin;
unsigned int dc_pin;
unsigned int cs_pin;
unsigned int busy_pin;
const unsigned char* lut;
void SetLut(const unsigned char* lut);
void SetMemoryArea(int x_start, int y_start, int x_end, int y_end);
void SetMemoryPointer(int x, int y);
};
#endif /* EPD1IN54_H */
/* END OF FILE */

View File

@ -0,0 +1,64 @@
/**
* @filename : epdif.cpp
* @brief : Implements EPD interface functions
* Users have to implement all the functions in epdif.cpp
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare August 10 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "epdif.h"
#include <spi.h>
EpdIf::EpdIf() {
};
EpdIf::~EpdIf() {
};
void EpdIf::DigitalWrite(int pin, int value) {
digitalWrite(pin, value);
}
int EpdIf::DigitalRead(int pin) {
return digitalRead(pin);
}
void EpdIf::DelayMs(unsigned int delaytime) {
delay(delaytime);
}
void EpdIf::SpiTransfer(unsigned char data) {
digitalWrite(CS_PIN, LOW);
SPI.transfer(data);
digitalWrite(CS_PIN, HIGH);
}
int EpdIf::IfInit(void) {
pinMode(CS_PIN, OUTPUT);
pinMode(RST_PIN, OUTPUT);
pinMode(DC_PIN, OUTPUT);
pinMode(BUSY_PIN, INPUT);
SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE0));
SPI.begin();
return 0;
}

View File

@ -0,0 +1,51 @@
/**
* @filename : epdif.h
* @brief : Header file of epdif.cpp providing EPD interface functions
* Users have to implement all the functions in epdif.cpp
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare August 10 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef EPDIF_H
#define EPDIF_H
#include <arduino.h>
// Pin definition
#define RST_PIN 8
#define DC_PIN 9
#define CS_PIN 10
#define BUSY_PIN 7
class EpdIf {
public:
EpdIf(void);
~EpdIf(void);
static int IfInit(void);
static void DigitalWrite(int pin, int value);
static int DigitalRead(int pin);
static void DelayMs(unsigned int delaytime);
static void SpiTransfer(unsigned char data);
};
#endif

View File

@ -0,0 +1,342 @@
/**
* @filename : epdpaint.cpp
* @brief : Paint tools
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare September 9 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <avr/pgmspace.h>
#include "epdpaint.h"
Paint::Paint(unsigned char* image, int width, int height) {
this->rotate = ROTATE_0;
this->image = image;
/* 1 byte = 8 pixels, so the width should be the multiple of 8 */
this->width = width % 8 ? width + 8 - (width % 8) : width;
this->height = height;
}
Paint::~Paint() {
}
/**
* @brief: clear the image
*/
void Paint::Clear(int colored) {
for (int x = 0; x < this->width; x++) {
for (int y = 0; y < this->height; y++) {
DrawAbsolutePixel(x, y, colored);
}
}
}
/**
* @brief: this draws a pixel by absolute coordinates.
* this function won't be affected by the rotate parameter.
*/
void Paint::DrawAbsolutePixel(int x, int y, int colored) {
if (x < 0 || x >= this->width || y < 0 || y >= this->height) {
return;
}
if (IF_INVERT_COLOR) {
if (colored) {
image[(x + y * this->width) / 8] |= 0x80 >> (x % 8);
} else {
image[(x + y * this->width) / 8] &= ~(0x80 >> (x % 8));
}
} else {
if (colored) {
image[(x + y * this->width) / 8] &= ~(0x80 >> (x % 8));
} else {
image[(x + y * this->width) / 8] |= 0x80 >> (x % 8);
}
}
}
/**
* @brief: Getters and Setters
*/
unsigned char* Paint::GetImage(void) {
return this->image;
}
int Paint::GetWidth(void) {
return this->width;
}
void Paint::SetWidth(int width) {
this->width = width % 8 ? width + 8 - (width % 8) : width;
}
int Paint::GetHeight(void) {
return this->height;
}
void Paint::SetHeight(int height) {
this->height = height;
}
int Paint::GetRotate(void) {
return this->rotate;
}
void Paint::SetRotate(int rotate){
this->rotate = rotate;
}
/**
* @brief: this draws a pixel by the coordinates
*/
void Paint::DrawPixel(int x, int y, int colored) {
int point_temp;
if (this->rotate == ROTATE_0) {
if(x < 0 || x >= this->width || y < 0 || y >= this->height) {
return;
}
DrawAbsolutePixel(x, y, colored);
} else if (this->rotate == ROTATE_90) {
if(x < 0 || x >= this->height || y < 0 || y >= this->width) {
return;
}
point_temp = x;
x = this->width - y;
y = point_temp;
DrawAbsolutePixel(x, y, colored);
} else if (this->rotate == ROTATE_180) {
if(x < 0 || x >= this->width || y < 0 || y >= this->height) {
return;
}
x = this->width - x;
y = this->height - y;
DrawAbsolutePixel(x, y, colored);
} else if (this->rotate == ROTATE_270) {
if(x < 0 || x >= this->height || y < 0 || y >= this->width) {
return;
}
point_temp = x;
x = y;
y = this->height - point_temp;
DrawAbsolutePixel(x, y, colored);
}
}
/**
* @brief: this draws a charactor on the frame buffer but not refresh
*/
void Paint::DrawCharAt(int x, int y, char ascii_char, sFONT* font, int colored) {
int i, j;
unsigned int char_offset = (ascii_char - ' ') * font->Height * (font->Width / 8 + (font->Width % 8 ? 1 : 0));
const unsigned char* ptr = &font->table[char_offset];
for (j = 0; j < font->Height; j++) {
for (i = 0; i < font->Width; i++) {
if (pgm_read_byte(ptr) & (0x80 >> (i % 8))) {
DrawPixel(x + i, y + j, colored);
}
if (i % 8 == 7) {
ptr++;
}
}
if (font->Width % 8 != 0) {
ptr++;
}
}
}
/**
* @brief: this displays a string on the frame buffer but not refresh
*/
void Paint::DrawStringAt(int x, int y, const char* text, sFONT* font, int colored) {
const char* p_text = text;
unsigned int counter = 0;
int refcolumn = x;
/* Send the string character by character on EPD */
while (*p_text != 0) {
/* Display one character on EPD */
DrawCharAt(refcolumn, y, *p_text, font, colored);
/* Decrement the column position by 16 */
refcolumn += font->Width;
/* Point on the next character */
p_text++;
counter++;
}
}
/**
* @brief: this draws a line on the frame buffer
*/
void Paint::DrawLine(int x0, int y0, int x1, int y1, int colored) {
/* Bresenham algorithm */
int dx = x1 - x0 >= 0 ? x1 - x0 : x0 - x1;
int sx = x0 < x1 ? 1 : -1;
int dy = y1 - y0 <= 0 ? y1 - y0 : y0 - y1;
int sy = y0 < y1 ? 1 : -1;
int err = dx + dy;
while((x0 != x1) && (y0 != y1)) {
DrawPixel(x0, y0 , colored);
if (2 * err >= dy) {
err += dy;
x0 += sx;
}
if (2 * err <= dx) {
err += dx;
y0 += sy;
}
}
}
/**
* @brief: this draws a horizontal line on the frame buffer
*/
void Paint::DrawHorizontalLine(int x, int y, int line_width, int colored) {
int i;
for (i = x; i < x + line_width; i++) {
DrawPixel(i, y, colored);
}
}
/**
* @brief: this draws a vertical line on the frame buffer
*/
void Paint::DrawVerticalLine(int x, int y, int line_height, int colored) {
int i;
for (i = y; i < y + line_height; i++) {
DrawPixel(x, i, colored);
}
}
/**
* @brief: this draws a rectangle
*/
void Paint::DrawRectangle(int x0, int y0, int x1, int y1, int colored) {
int min_x, min_y, max_x, max_y;
min_x = x1 > x0 ? x0 : x1;
max_x = x1 > x0 ? x1 : x0;
min_y = y1 > y0 ? y0 : y1;
max_y = y1 > y0 ? y1 : y0;
DrawHorizontalLine(min_x, min_y, max_x - min_x + 1, colored);
DrawHorizontalLine(min_x, max_y, max_x - min_x + 1, colored);
DrawVerticalLine(min_x, min_y, max_y - min_y + 1, colored);
DrawVerticalLine(max_x, min_y, max_y - min_y + 1, colored);
}
/**
* @brief: this draws a filled rectangle
*/
void Paint::DrawFilledRectangle(int x0, int y0, int x1, int y1, int colored) {
int min_x, min_y, max_x, max_y;
int i;
min_x = x1 > x0 ? x0 : x1;
max_x = x1 > x0 ? x1 : x0;
min_y = y1 > y0 ? y0 : y1;
max_y = y1 > y0 ? y1 : y0;
for (i = min_x; i <= max_x; i++) {
DrawVerticalLine(i, min_y, max_y - min_y + 1, colored);
}
}
/**
* @brief: this draws a circle
*/
void Paint::DrawCircle(int x, int y, int radius, int colored) {
/* Bresenham algorithm */
int x_pos = -radius;
int y_pos = 0;
int err = 2 - 2 * radius;
int e2;
do {
DrawPixel(x - x_pos, y + y_pos, colored);
DrawPixel(x + x_pos, y + y_pos, colored);
DrawPixel(x + x_pos, y - y_pos, colored);
DrawPixel(x - x_pos, y - y_pos, colored);
e2 = err;
if (e2 <= y_pos) {
err += ++y_pos * 2 + 1;
if(-x_pos == y_pos && e2 <= x_pos) {
e2 = 0;
}
}
if (e2 > x_pos) {
err += ++x_pos * 2 + 1;
}
} while (x_pos <= 0);
}
/**
* @brief: this draws a filled circle
*/
void Paint::DrawFilledCircle(int x, int y, int radius, int colored) {
/* Bresenham algorithm */
int x_pos = -radius;
int y_pos = 0;
int err = 2 - 2 * radius;
int e2;
do {
DrawPixel(x - x_pos, y + y_pos, colored);
DrawPixel(x + x_pos, y + y_pos, colored);
DrawPixel(x + x_pos, y - y_pos, colored);
DrawPixel(x - x_pos, y - y_pos, colored);
DrawHorizontalLine(x + x_pos, y + y_pos, 2 * (-x_pos) + 1, colored);
DrawHorizontalLine(x + x_pos, y - y_pos, 2 * (-x_pos) + 1, colored);
e2 = err;
if (e2 <= y_pos) {
err += ++y_pos * 2 + 1;
if(-x_pos == y_pos && e2 <= x_pos) {
e2 = 0;
}
}
if(e2 > x_pos) {
err += ++x_pos * 2 + 1;
}
} while(x_pos <= 0);
}
/* END OF FILE */

View File

@ -0,0 +1,75 @@
/**
* @filename : epdpaint.h
* @brief : Header file for epdpaint.cpp
* @author : Yehui from Waveshare
*
* Copyright (C) Waveshare July 28 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef EPDPAINT_H
#define EPDPAINT_H
// Display orientation
#define ROTATE_0 0
#define ROTATE_90 1
#define ROTATE_180 2
#define ROTATE_270 3
// Color inverse. 1 or 0 = set or reset a bit if set a colored pixel
#define IF_INVERT_COLOR 1
#include "fonts.h"
class Paint {
public:
Paint(unsigned char* image, int width, int height);
~Paint();
void Clear(int colored);
int GetWidth(void);
void SetWidth(int width);
int GetHeight(void);
void SetHeight(int height);
int GetRotate(void);
void SetRotate(int rotate);
unsigned char* GetImage(void);
void DrawAbsolutePixel(int x, int y, int colored);
void DrawPixel(int x, int y, int colored);
void DrawCharAt(int x, int y, char ascii_char, sFONT* font, int colored);
void DrawStringAt(int x, int y, const char* text, sFONT* font, int colored);
void DrawLine(int x0, int y0, int x1, int y1, int colored);
void DrawHorizontalLine(int x, int y, int width, int colored);
void DrawVerticalLine(int x, int y, int height, int colored);
void DrawRectangle(int x0, int y0, int x1, int y1, int colored);
void DrawFilledRectangle(int x0, int y0, int x1, int y1, int colored);
void DrawCircle(int x, int y, int radius, int colored);
void DrawFilledCircle(int x, int y, int radius, int colored);
private:
unsigned char* image;
int width;
int height;
int rotate;
};
#endif
/* END OF FILE */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,75 @@
/**
******************************************************************************
* @file fonts.h
* @author MCD Application Team
* @version V1.0.0
* @date 18-February-2014
* @brief Header for fonts.c file
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __FONTS_H
#define __FONTS_H
/* Max size of bitmap will based on a font24 (17x24) */
#define MAX_HEIGHT_FONT 24
#define MAX_WIDTH_FONT 17
#define OFFSET_BITMAP 54
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
typedef struct _tFont
{
const uint8_t *table;
uint16_t Width;
uint16_t Height;
} sFONT;
extern sFONT Font24;
extern sFONT Font20;
extern sFONT Font16;
extern sFONT Font12;
extern sFONT Font8;
#ifdef __cplusplus
}
#endif
#endif /* __FONTS_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -0,0 +1,91 @@
/*
* Copyright (c) 2010, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*
*/
#ifndef PROJECT_RPL_WEB_CONF_H_
#define PROJECT_RPL_WEB_CONF_H_
#define LOOP_INTERVAL (1* CLOCK_SECOND)
/* For Debug: Dont allow MCU sleeping between channel checks */
#undef RDC_CONF_MCU_SLEEP
#define RDC_CONF_MCU_SLEEP 0
/* Increase rpl-border-router IP-buffer when using more than 64. */
//#undef REST_MAX_CHUNK_SIZE
//#define REST_MAX_CHUNK_SIZE 64
/* Estimate your header size, especially when using Proxy-Uri. */
/*
#undef COAP_MAX_HEADER_SIZE
#define COAP_MAX_HEADER_SIZE 70
*/
/* The IP buffer size must fit all other hops, in particular the border router. */
//#undef UIP_CONF_BUFFER_SIZE
//#define UIP_CONF_BUFFER_SIZE 256
/* Multiplies with chunk size, be aware of memory constraints. */
#undef COAP_MAX_OPEN_TRANSACTIONS
#define COAP_MAX_OPEN_TRANSACTIONS 4
/* Must be <= open transaction number, default is COAP_MAX_OPEN_TRANSACTIONS-1. */
/*
#undef COAP_MAX_OBSERVERS
#define COAP_MAX_OBSERVERS 2
*/
/* Filtering .well-known/core per query can be disabled to save space. */
/*
#undef COAP_LINK_FORMAT_FILTERING
#define COAP_LINK_FORMAT_FILTERING 0
*/
/*
#undef LLSEC802154_CONF_ENABLED
#define LLSEC802154_CONF_ENABLED 1
#undef NETSTACK_CONF_FRAMER
#define NETSTACK_CONF_FRAMER noncoresec_framer
#undef NETSTACK_CONF_LLSEC
#define NETSTACK_CONF_LLSEC noncoresec_driver
#undef NONCORESEC_CONF_SEC_LVL
#define NONCORESEC_CONF_SEC_LVL 1
#define NONCORESEC_CONF_KEY { 0x00 , 0x01 , 0x02 , 0x03 , \
0x04 , 0x05 , 0x06 , 0x07 , \
0x08 , 0x09 , 0x0A , 0x0B , \
0x0C , 0x0D , 0x0E , 0x0F }
*/
#endif /* PROJECT_RPL_WEB_CONF_H_ */

View File

@ -0,0 +1,104 @@
/*
* Copyright (c) 2013, Institute for Pervasive Computing, ETH Zurich
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*/
/**
* \file
* Door resource
* \author
* Harald Pichler <harald@the-develop.net>
*/
#include "contiki.h"
#include <string.h>
#include "rest-engine.h"
#include "Arduino.h"
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
static void res_post_put_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
/* A simple getter example. Returns the reading from the sensor with a simple etag */
RESOURCE(res_led,
"title=\"LED: , POST/PUT mode=on|off\";rt=\"Control\"",
res_get_handler,
res_post_put_handler,
res_post_put_handler,
NULL);
extern uint8_t led_pin;
extern uint8_t led_status;
static void
res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
{
unsigned int accept = -1;
REST.get_header_accept(request, &accept);
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
REST.set_header_content_type(response, REST.type.TEXT_PLAIN);
snprintf((char *)buffer, REST_MAX_CHUNK_SIZE, "%d", led_status);
REST.set_response_payload(response, buffer, strlen((char *)buffer));
} else if(accept == REST.type.APPLICATION_JSON) {
REST.set_header_content_type(response, REST.type.APPLICATION_JSON);
snprintf((char *)buffer, REST_MAX_CHUNK_SIZE, "{'led':%d}", led_status);
REST.set_response_payload(response, buffer, strlen((char *)buffer));
} else {
REST.set_response_status(response, REST.status.NOT_ACCEPTABLE);
const char *msg = "Supporting content-types text/plain and application/json";
REST.set_response_payload(response, msg, strlen(msg));
}
}
static void
res_post_put_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
{
size_t len = 0;
const char *mode = NULL;
int success = 1;
if(success && (len = REST.get_post_variable(request, "mode", &mode))) {
if(strncmp(mode, "on", len) == 0) {
digitalWrite(led_pin, LOW);
led_status=1;
} else if(strncmp(mode, "off", len) == 0) {
digitalWrite(led_pin, HIGH);
led_status=0;
} else {
success = 0;
}
} else {
success = 0;
} if(!success) {
REST.set_response_status(response, REST.status.BAD_REQUEST);
}
}

View File

@ -0,0 +1,108 @@
/*
* Sample e-paper arduino sketch using contiki features.
* We turn the LED off
*
* Note that for a normal arduino sketch you won't have to include any
* of the contiki-specific files here, the sketch should just work.
*/
extern "C" {
#include "arduino-process.h"
#include "rest-engine.h"
#include "net/netstack.h"
#include <SPI.h>
#include <epd1in54.h>
#include <epdpaint.h>
#include "imagedata.h"
extern resource_t res_led, res_battery, res_cputemp;
uint8_t led_pin=4;
uint8_t led_status;
}
#define COLORED 0
#define UNCOLORED 1
unsigned char image[1024];
Paint paint(image, 0, 0); // width should be the multiple of 8
Epd epd;
long second=-3;
void setup (void)
{
// switch off the led
pinMode(led_pin, OUTPUT);
digitalWrite(led_pin, HIGH);
led_status=0;
// init coap resourcen
rest_init_engine ();
#pragma GCC diagnostic ignored "-Wwrite-strings"
rest_activate_resource (&res_led, "s/led");
rest_activate_resource (&res_battery, "s/battery");
rest_activate_resource (&res_cputemp, "s/cputemp");
#pragma GCC diagnostic pop
// NETSTACK_MAC.off(1);
// mcu_sleep_set(128);
printf("e-Paper init");
// e-paper init
if (epd.Init(lut_full_update) != 0) {
printf(" failed");
return;
}
/**
* there are 2 memory areas embedded in the e-paper display
* and once the display is refreshed, the memory area will be auto-toggled,
* i.e. the next action of SetFrameMemory will set the other memory area
* therefore you have to clear the frame memory twice.
*/
epd.ClearFrameMemory(0xFF); // bit set = white, bit reset = black
epd.DisplayFrame();
epd.ClearFrameMemory(0xFF); // bit set = white, bit reset = black
epd.DisplayFrame();
}
void loop (void)
{
char time_string[] = {'0', '0', ':', '0', '0', '\0'};
second ++;
if(second==-2){
if (epd.Init(lut_partial_update) != 0) {
printf("e-Paper init failed");
return;
}
}
if(second==-1){
epd.SetFrameMemory(IMAGE_DATA);
epd.DisplayFrame();
}
if(second==0){
epd.SetFrameMemory(IMAGE_DATA);
epd.DisplayFrame();
}
if(second > 0){
time_string[0] = second / 60 / 10 + '0';
time_string[1] = second / 60 % 10 + '0';
time_string[3] = second % 60 / 10 + '0';
time_string[4] = second % 60 % 10 + '0';
paint.SetWidth(32);
paint.SetHeight(96);
paint.SetRotate(ROTATE_270);
paint.Clear(UNCOLORED);
paint.DrawStringAt(0, 4, time_string, &Font24, COLORED);
epd.SetFrameMemory(paint.GetImage(), 80, 72, paint.GetWidth(), paint.GetHeight());
epd.DisplayFrame();
}
printf("%d ",second);
}