diff --git a/CLAUDE.md b/CLAUDE.md index b8dc2d7..f1e65ab 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,14 +1,30 @@ # Waveshare 2.9" E-Paper LVGL Project ## Goal Summary -- Extend the native waveshare_epaper component of esphome to support 2-bit grayscale -- Only concerned with this one target board: `2.90inv2-r2` +- Waveshare 2.9" Touch ePaper HAT driving LVGL UI via ESPHome on ESP32 +- 2-bit grayscale display support implemented via custom ESPHome component +- Touchscreen integration in progress ## Hardware - ESP32-WROOM-32 (nodemcu-32s board) -- Waveshare 2.9inch Touch ePaper HAT (296x128, 2-bit grayscale) -- Display model string: `2.90inv2-r2` (SSD1680 controller) -- Pin mapping: SCLK=GPIO23, MOSI=GPIO22, CS=GPIO19, DC=GPIO18, BUSY=GPIO4, RST=GPIO5 +- Waveshare 2.9inch Touch ePaper HAT (296x128, SSD1680 display, GT1151 touchscreen) + +### Pin Mapping +| Function | ESP Pin | HAT Pin | +|--- |--- |--- | +| Display SCLK | GPIO18 | Pin23/GPIO11/SPI0_SCLK | +| Display MOSI | GPIO23 | Pin19/GPIO10/SPI0_MOSI | +| Display CS | GPIO19 | Pin24/GPIO8/SPI0_CE0 | +| Display DC | GPIO17 | Pin22/GPIO25 | +| Display BUSY | GPIO4 | Pin24/GPIO24 | +| Display RST | GPIO5 | Pin11/GPIO17/SPI1_CE1 | +| Touch SDA | GPIO21 | Pin3/GPIO2/I2C1_SDA | +| Touch SCL | GPIO22 | Pin5/GPIO3/I2C1_SCL | +| Touch RST | GPIO15 | Pin13/GPIO27 | +| Touch INT | GPIO16 | Pin15/GPIO22 | + +Note: GPIO15 (Touch RST) is an ESP32 strapping pin, but only affects boot log +output (LOW silences it). No impact on UART download mode or OTA flashing. ## Software - ESPHome 2026.1.0 @@ -16,37 +32,41 @@ - Project directory: ~/Projects/waveshare-panel ## Current Status -- Display working correctly via ESPHome's native display library -- LVGL rendering confirmed working (black background visible) -- Custom component `waveshare_epaper_2bit` created and flashed, working identically to built-in driver -- Custom model name: `2.90inv2-r2-2bpp` +- 2-bit grayscale fully working via custom component `waveshare_epaper_2bit` +- LVGL rendering working, 4-shade colorspace confirmed +- Bayer ordered dithering implemented for gradient smoothing +- Touchscreen wiring complete, driver integration in progress -## Known Issues / Quirks -- LVGL color depth is hardcoded to 16-bit (RGB565) in ESPHome — only supported value -- Display renders in 1-bit monochrome despite panel supporting 2-bit grayscale -- Colors are inverted by default (bg_color: 0x000000 produces white background) -- Resolved: original timeout errors were caused by on_draw_end hammering the display +## Grayscale Implementation +Custom component model name: `2.90inv2-r2-2bpp` -## Working LVGL Config -- refer to the file waveshare-test.yaml - -## Goal: 2-bit Grayscale Support -The SSD1680 controller supports 4-shade grayscale via two bitplanes: -- Register 0x24: bitplane 1 -- Register 0x26: bitplane 2 +Key implementation details: +- Gray4 waveform LUT loaded via register 0x32 on every display() call +- Activation uses 0xC7 (custom LUT), not 0xF7 (which reloads OTP LUT) +- Always does full refresh — partial update removed from 2bpp class +- Second bitplane buffer (`buffer2_`) allocated in `initialize()` +Confirmed bitplane table for this panel with Gray4 LUT: | 0x24 | 0x26 | Result | |------|------|------------| -| 1 | 1 | White | -| 1 | 0 | Light grey | -| 0 | 1 | Dark grey | -| 0 | 0 | Black | +| 0 | 0 | White | +| 1 | 0 | Light grey | +| 0 | 1 | Dark grey | +| 1 | 1 | Black | -The ESPHome driver only writes to 0x24, discarding grayscale information. -The real problem is upstream — RGB565 is converted to 1-bit before display() is -called, so grayscale data is lost before the driver even sees it. Next step is to -find where this conversion happens in the ESPHome display pipeline so the patch -can preserve grayscale information through to the two-bitplane write. +Color convention: 0xFFFFFF=white, 0x000000=black (no inversion). +LVGL 4-shade palette: 0xFFFFFF, 0xAAAAAA, 0x555555, 0x000000 + +Dithering: 4×4 Bayer ordered dither, bias = bayer*2 - 15 (±15 range). +Amplitude chosen to keep 0xAAAAAA and 0x555555 as solid fills. + +## Touchscreen +- Controller: ICNT86X (I2C address 0x48; 0x30 also ACKs, likely DFU/bootloader interface) +- Custom component: `custom_components/icnt86x/` (ESPHome has no native ICNT86X driver) +- Touch count at register 0x1001, touch data at 0x1002 (7 bytes/point), clear by writing 0x00 to 0x1001 +- Waveshare's own driver inverts both axes: X = 295 - raw_x, Y = 127 - raw_y +- INT pulse is very brief (sub-ms); component works in polling mode regardless +- Coordinate transform (mirror_x, mirror_y, swap_xy) to be confirmed after first flash ## Relevant Files - Custom component: `custom_components/waveshare_epaper_2bit/` @@ -54,6 +74,6 @@ can preserve grayscale information through to the two-bitplane write. - `display.py` — component schema and model registration - `waveshare_epaper_2bit.cpp` — driver implementation - `waveshare_epaper_2bit.h` — header +- Main config: `waveshare-test.yaml` (pin table here is source of truth) - Build cache: `.esphome/build/waveshare-epaper-test/src/esphome/components/` - ESPHome source (venv): ~/Code/esphome-2026.1.0/ -- Applicable ESPHome source is copied into .esphome/build by the build system at compile time diff --git a/custom_components/icnt86x/__init__.py b/custom_components/icnt86x/__init__.py new file mode 100644 index 0000000..7d054f7 --- /dev/null +++ b/custom_components/icnt86x/__init__.py @@ -0,0 +1,6 @@ +import esphome.codegen as cg + +CODEOWNERS = ["@andrewmv"] +DEPENDENCIES = ["i2c"] + +icnt86x_ns = cg.esphome_ns.namespace("icnt86x") diff --git a/custom_components/icnt86x/touchscreen/__init__.py b/custom_components/icnt86x/touchscreen/__init__.py new file mode 100644 index 0000000..391816a --- /dev/null +++ b/custom_components/icnt86x/touchscreen/__init__.py @@ -0,0 +1,32 @@ +from esphome import pins +import esphome.codegen as cg +from esphome.components import i2c, touchscreen +import esphome.config_validation as cv +from esphome.const import CONF_ID, CONF_INTERRUPT_PIN, CONF_RESET_PIN + +from .. import icnt86x_ns + +ICNT86XTouchscreen = icnt86x_ns.class_( + "ICNT86XTouchscreen", + touchscreen.Touchscreen, + i2c.I2CDevice, +) + +CONFIG_SCHEMA = touchscreen.TOUCHSCREEN_SCHEMA.extend( + { + cv.GenerateID(): cv.declare_id(ICNT86XTouchscreen), + cv.Optional(CONF_INTERRUPT_PIN): pins.internal_gpio_input_pin_schema, + cv.Optional(CONF_RESET_PIN): pins.gpio_output_pin_schema, + } +).extend(i2c.i2c_device_schema(0x48)) + + +async def to_code(config): + var = cg.new_Pvariable(config[CONF_ID]) + await touchscreen.register_touchscreen(var, config) + await i2c.register_i2c_device(var, config) + + if interrupt_pin := config.get(CONF_INTERRUPT_PIN): + cg.add(var.set_interrupt_pin(await cg.gpio_pin_expression(interrupt_pin))) + if reset_pin := config.get(CONF_RESET_PIN): + cg.add(var.set_reset_pin(await cg.gpio_pin_expression(reset_pin))) diff --git a/custom_components/icnt86x/touchscreen/icnt86x_touchscreen.cpp b/custom_components/icnt86x/touchscreen/icnt86x_touchscreen.cpp new file mode 100644 index 0000000..e86ac2f --- /dev/null +++ b/custom_components/icnt86x/touchscreen/icnt86x_touchscreen.cpp @@ -0,0 +1,131 @@ +#include "icnt86x_touchscreen.h" +#include "esphome/core/log.h" + +namespace esphome { +namespace icnt86x { + +static const char *const TAG = "icnt86x.touchscreen"; + +static const uint16_t REG_VERSION = 0x000A; +static const uint16_t REG_TOUCH_CNT = 0x1001; +static const uint16_t REG_TOUCH_DAT = 0x1002; + +static const uint8_t MAX_TOUCHES = 2; +static const uint8_t BYTES_PER_TOUCH = 7; + +// Observed event codes from protocol analysis +static const uint8_t EVENT_MOVE = 0x02; +static const uint8_t EVENT_DOWN = 0x03; +// 0x04 = idle/no-contact — chip reports count=1 with this code when untouched + +void ICNT86XTouchscreen::setup() { + if (this->reset_pin_ != nullptr) { + this->reset_pin_->setup(); + // Drive INT low before and during reset release. Many touch controllers + // sample INT at reset release to select interrupt output mode; if INT is + // left pulled high by the level shifter the chip comes up with INT disabled. + if (this->interrupt_pin_ != nullptr) { + this->interrupt_pin_->pin_mode(gpio::FLAG_OUTPUT); + this->interrupt_pin_->digital_write(false); + } + this->reset_pin_->digital_write(true); + delay(100); + this->reset_pin_->digital_write(false); + delay(100); + this->reset_pin_->digital_write(true); // INT still driven low at release + } + + // Allow chip 100ms to boot, then reconfigure INT as input before attaching ISR + this->set_timeout(100, [this]() { this->setup_internal_(); }); +} + +void ICNT86XTouchscreen::setup_internal_() { + if (this->interrupt_pin_ != nullptr) { + this->interrupt_pin_->setup(); // reconfigure as input after driving low during reset + } + + uint8_t ver[4]; + if (!this->read_reg16_(REG_VERSION, ver, sizeof(ver))) { + this->mark_failed(); + ESP_LOGE(TAG, "Failed to communicate with ICNT86X at 0x%02X", this->address_); + return; + } + + ESP_LOGI(TAG, "ICNT86X IC version: %02X%02X, FW version: %02X%02X", + ver[0], ver[1], ver[2], ver[3]); + + if (this->interrupt_pin_ != nullptr) { + this->attach_interrupt_(this->interrupt_pin_, gpio::INTERRUPT_FALLING_EDGE); + } + + this->setup_done_ = true; +} + +void ICNT86XTouchscreen::update_touches() { + // In polling mode loop() never runs, so is_touched_ is never reset between + // cycles. Reset it here so send_touches_() can detect the press→release + // transition via !is_touched_ && was_touched_. + this->is_touched_ = false; + + if (!this->setup_done_) { + this->skip_update_ = true; + return; + } + + uint8_t count = 0; + if (!this->read_reg16_(REG_TOUCH_CNT, &count, 1)) { + this->status_set_warning(); + this->skip_update_ = true; + return; + } + + this->write_reg16_(REG_TOUCH_CNT, 0x00); + + // Always allow send_touches_() to run — even with zero touches it needs to + // fire to propagate the release event when !is_touched_ && was_touched_. + this->skip_update_ = false; + + if (count == 0 || count > MAX_TOUCHES) + return; + + uint8_t data[MAX_TOUCHES * BYTES_PER_TOUCH]; + if (!this->read_reg16_(REG_TOUCH_DAT, data, count * BYTES_PER_TOUCH)) { + this->status_set_warning(); + this->skip_update_ = true; + return; + } + + for (uint8_t i = 0; i < count; i++) { + // Per-point layout (7 bytes): [id, x_lo, x_hi, y_lo, y_hi, pressure, event] + const uint8_t *p = &data[i * BYTES_PER_TOUCH]; + uint8_t event = p[6]; + if (event != EVENT_DOWN && event != EVENT_MOVE) + continue; + uint8_t id = p[0]; + int16_t x = ((uint16_t)p[2] << 8) | p[1]; + int16_t y = ((uint16_t)p[4] << 8) | p[3]; + this->add_raw_touch_position_(id, x, y); + } +} + +bool ICNT86XTouchscreen::read_reg16_(uint16_t reg, uint8_t *data, size_t len) { + uint8_t reg_buf[2] = {(uint8_t)(reg >> 8), (uint8_t)(reg & 0xFF)}; + if (this->write(reg_buf, 2) != i2c::ERROR_OK) + return false; + return this->read(data, len) == i2c::ERROR_OK; +} + +bool ICNT86XTouchscreen::write_reg16_(uint16_t reg, uint8_t value) { + uint8_t buf[3] = {(uint8_t)(reg >> 8), (uint8_t)(reg & 0xFF), value}; + return this->write(buf, 3) == i2c::ERROR_OK; +} + +void ICNT86XTouchscreen::dump_config() { + ESP_LOGCONFIG(TAG, "ICNT86X Touchscreen:"); + LOG_I2C_DEVICE(this); + LOG_PIN(" Interrupt Pin: ", this->interrupt_pin_); + LOG_PIN(" Reset Pin: ", this->reset_pin_); +} + +} // namespace icnt86x +} // namespace esphome diff --git a/custom_components/icnt86x/touchscreen/icnt86x_touchscreen.h b/custom_components/icnt86x/touchscreen/icnt86x_touchscreen.h new file mode 100644 index 0000000..357fe95 --- /dev/null +++ b/custom_components/icnt86x/touchscreen/icnt86x_touchscreen.h @@ -0,0 +1,33 @@ +#pragma once + +#include "esphome/components/i2c/i2c.h" +#include "esphome/components/touchscreen/touchscreen.h" +#include "esphome/core/component.h" +#include "esphome/core/hal.h" + +namespace esphome { +namespace icnt86x { + +class ICNT86XTouchscreen : public touchscreen::Touchscreen, public i2c::I2CDevice { + public: + void setup() override; + void dump_config() override; + bool can_proceed() override { return this->setup_done_; } + + void set_interrupt_pin(InternalGPIOPin *pin) { this->interrupt_pin_ = pin; } + void set_reset_pin(GPIOPin *pin) { this->reset_pin_ = pin; } + + protected: + void update_touches() override; + void setup_internal_(); + + bool read_reg16_(uint16_t reg, uint8_t *data, size_t len); + bool write_reg16_(uint16_t reg, uint8_t value); + + InternalGPIOPin *interrupt_pin_{nullptr}; + GPIOPin *reset_pin_{nullptr}; + bool setup_done_{false}; +}; + +} // namespace icnt86x +} // namespace esphome diff --git a/docs/Touch_e-Paper_Code/Version_CN.txt b/docs/Touch_e-Paper_Code/Version_CN.txt new file mode 100644 index 0000000..62a35cc --- /dev/null +++ b/docs/Touch_e-Paper_Code/Version_CN.txt @@ -0,0 +1,4 @@ +2021-03-03:新创建。 +2021-06-05:新添加 2.9inch Touch e-Paper HAT 例程。 +2022-04-13:新添加 2.13inch_V3 Touch e-Paper HAT 例程。 +2023-08-14:新添加 2.13inch_V4 Touch e-Paper HAT 例程。 diff --git a/docs/Touch_e-Paper_Code/Version_EN.txt b/docs/Touch_e-Paper_Code/Version_EN.txt new file mode 100644 index 0000000..65d8d36 --- /dev/null +++ b/docs/Touch_e-Paper_Code/Version_EN.txt @@ -0,0 +1,4 @@ +2021-03-03: newly built. +2021-06-05: Added 2.9inch Touch e-paper HAT routine. +2022-04-13: Added 2.13inch_V3 Touch e-paper HAT routine. +2023-08-14: Added 2.13inch_V4 Touch e-paper HAT routine. \ No newline at end of file diff --git a/docs/Touch_e-Paper_Code/c/Makefile b/docs/Touch_e-Paper_Code/c/Makefile new file mode 100644 index 0000000..7f569d5 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/Makefile @@ -0,0 +1,65 @@ +DIR_Config = ./lib/Config +DIR_Driver = ./lib/Driver +DIR_GUI = ./lib/GUI +DIR_FONTS = ./lib/Fonts +DIR_EPD = ./lib/EPD +DIR_Examples = ./examples +DIR_BIN = ./bin + +OBJ_C = $(wildcard ${DIR_Driver}/*.c ${DIR_GUI}/*.c ${DIR_EPD}/*.c ${DIR_Config}/*.c ${DIR_Examples}/*.c ${DIR_FONTS}/*.c ) +OBJ_O = $(patsubst %.c,${DIR_BIN}/%.o,$(notdir ${OBJ_C})) + +TARGET = main + +# USELIB = USE_BCM2835_LIB +# USELIB = USE_WIRINGPI_LIB +USELIB = USE_LGPIO_LIB +# USELIB = USE_GPIOD_LIB + +DEBUG = -D $(USELIB) + +ifeq ($(USELIB), USE_BCM2835_LIB) + LIB = -lbcm2835 -lm + OBJ_O := $(filter-out ${DIR_BIN}/RPI_gpiod.o ${DIR_BIN}/dev_hardware_SPI.o ${DIR_BIN}/dev_hardware_i2c.o, ${OBJ_O}) +else ifeq ($(USELIB), USE_WIRINGPI_LIB) + LIB = -lwiringPi -lm + OBJ_O := $(filter-out ${DIR_BIN}/RPI_gpiod.o ${DIR_BIN}/dev_hardware_SPI.o ${DIR_BIN}/dev_hardware_i2c.o, ${OBJ_O}) +else ifeq ($(USELIB), USE_LGPIO_LIB) + LIB += -llgpio -lm + OBJ_O := $(filter-out ${DIR_BIN}/RPI_gpiod.o ${DIR_BIN}/dev_hardware_SPI.o ${DIR_BIN}/dev_hardware_i2c.o, ${OBJ_O}) +else ifeq ($(USELIB), USE_GPIOD_LIB) + LIB = -lgpiod -lm +endif +LIB += -lpthread + +CC = gcc +MSG = -g -O0 -Wall +CFLAGS += $(MSG) $(DEBUG) + +${TARGET}:${OBJ_O} + $(CC) $(CFLAGS) $(OBJ_O) -o $@ $(LIB) + +$(shell mkdir -p $(DIR_BIN)) + +${DIR_BIN}/%.o:$(DIR_Examples)/%.c + $(CC) $(CFLAGS) -c $< -o $@ -I $(DIR_Config) -I $(DIR_Driver) -I $(DIR_EPD) -I $(DIR_GUI) + +${DIR_BIN}/%.o:$(DIR_Driver)/%.c + $(CC) $(CFLAGS) -c $< -o $@ -I $(DIR_Config) $(DEBUG) + +${DIR_BIN}/%.o:$(DIR_EPD)/%.c + $(CC) $(CFLAGS) -c $< -o $@ -I $(DIR_Config) $(DEBUG) + +${DIR_BIN}/%.o:$(DIR_FONTS)/%.c + $(CC) $(CFLAGS) -c $< -o $@ $(DEBUG) + +${DIR_BIN}/%.o:$(DIR_GUI)/%.c + $(CC) $(CFLAGS) -c $< -o $@ -I $(DIR_Config) $(DEBUG) + +${DIR_BIN}/%.o:$(DIR_Config)/%.c + $(CC) $(CFLAGS) -c $< -o $@ $(LIB) + + +clean : + rm $(DIR_BIN)/*.* + rm $(TARGET) diff --git a/docs/Touch_e-Paper_Code/c/bin/2in13_TestCode.o b/docs/Touch_e-Paper_Code/c/bin/2in13_TestCode.o new file mode 100644 index 0000000..0a7d72d Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/2in13_TestCode.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/2in13_TestCode_V3.o b/docs/Touch_e-Paper_Code/c/bin/2in13_TestCode_V3.o new file mode 100644 index 0000000..d01414a Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/2in13_TestCode_V3.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/2in13_TestCode_V4.o b/docs/Touch_e-Paper_Code/c/bin/2in13_TestCode_V4.o new file mode 100644 index 0000000..d10219e Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/2in13_TestCode_V4.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/2in9_TestCode.o b/docs/Touch_e-Paper_Code/c/bin/2in9_TestCode.o new file mode 100644 index 0000000..80966f3 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/2in9_TestCode.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/DEV_Config.o b/docs/Touch_e-Paper_Code/c/bin/DEV_Config.o new file mode 100644 index 0000000..6aa18d0 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/DEV_Config.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/EPD_2in13_V2.o b/docs/Touch_e-Paper_Code/c/bin/EPD_2in13_V2.o new file mode 100644 index 0000000..e61f77b Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/EPD_2in13_V2.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/EPD_2in13_V3.o b/docs/Touch_e-Paper_Code/c/bin/EPD_2in13_V3.o new file mode 100644 index 0000000..e09c440 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/EPD_2in13_V3.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/EPD_2in13_V4.o b/docs/Touch_e-Paper_Code/c/bin/EPD_2in13_V4.o new file mode 100644 index 0000000..87261a7 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/EPD_2in13_V4.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/EPD_2in9_V2.o b/docs/Touch_e-Paper_Code/c/bin/EPD_2in9_V2.o new file mode 100644 index 0000000..7b12191 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/EPD_2in9_V2.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/GT1151.o b/docs/Touch_e-Paper_Code/c/bin/GT1151.o new file mode 100644 index 0000000..ab55ec5 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/GT1151.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/GUI_BMPfile.o b/docs/Touch_e-Paper_Code/c/bin/GUI_BMPfile.o new file mode 100644 index 0000000..863abab Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/GUI_BMPfile.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/GUI_Paint.o b/docs/Touch_e-Paper_Code/c/bin/GUI_Paint.o new file mode 100644 index 0000000..10b9331 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/GUI_Paint.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/ICNT86X.o b/docs/Touch_e-Paper_Code/c/bin/ICNT86X.o new file mode 100644 index 0000000..3615bfc Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/ICNT86X.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/font12.o b/docs/Touch_e-Paper_Code/c/bin/font12.o new file mode 100644 index 0000000..d29ffb3 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/font12.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/font12CN.o b/docs/Touch_e-Paper_Code/c/bin/font12CN.o new file mode 100644 index 0000000..1831f90 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/font12CN.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/font16.o b/docs/Touch_e-Paper_Code/c/bin/font16.o new file mode 100644 index 0000000..d2feafa Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/font16.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/font20.o b/docs/Touch_e-Paper_Code/c/bin/font20.o new file mode 100644 index 0000000..6419465 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/font20.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/font24.o b/docs/Touch_e-Paper_Code/c/bin/font24.o new file mode 100644 index 0000000..598b660 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/font24.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/font24CN.o b/docs/Touch_e-Paper_Code/c/bin/font24CN.o new file mode 100644 index 0000000..b262f03 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/font24CN.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/font8.o b/docs/Touch_e-Paper_Code/c/bin/font8.o new file mode 100644 index 0000000..3c12f50 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/font8.o differ diff --git a/docs/Touch_e-Paper_Code/c/bin/main.o b/docs/Touch_e-Paper_Code/c/bin/main.o new file mode 100644 index 0000000..37c58d1 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/bin/main.o differ diff --git a/docs/Touch_e-Paper_Code/c/examples/2in13_TestCode.c b/docs/Touch_e-Paper_Code/c/examples/2in13_TestCode.c new file mode 100644 index 0000000..8abcdb1 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/examples/2in13_TestCode.c @@ -0,0 +1,263 @@ +#include "Test.h" +#include "EPD_2in13_V2.h" +#include "GT1151.h" + +extern GT1151_Dev Dev_Now, Dev_Old; +extern int IIC_Address; +static pthread_t t1; +UBYTE flag_t = 1; + +char *PhotoPath_S[7] = {"./pic/2in13/Photo_1_0.bmp", + "./pic/2in13/Photo_1_1.bmp", "./pic/2in13/Photo_1_2.bmp", "./pic/2in13/Photo_1_3.bmp", "./pic/2in13/Photo_1_4.bmp", + "./pic/2in13/Photo_1_5.bmp", "./pic/2in13/Photo_1_6.bmp", + }; +char *PhotoPath_L[7] = {"./pic/2in13/Photo_2_0.bmp", + "./pic/2in13/Photo_2_1.bmp", "./pic/2in13/Photo_2_2.bmp", "./pic/2in13/Photo_2_3.bmp", "./pic/2in13/Photo_2_4.bmp", + "./pic/2in13/Photo_2_5.bmp", "./pic/2in13/Photo_2_6.bmp", + }; +char *PagePath[4] = {"./pic/2in13/Menu.bmp", "./pic/2in13/White_board.bmp", "./pic/2in13/Photo_1.bmp", "./pic/2in13/Photo_2.bmp"}; + + +void Handler(int signo) +{ + //System Exit + printf("\r\nHandler:exit\r\n"); + EPD_2IN13_V2_Sleep(); + DEV_Delay_ms(2000); + flag_t = 0; + pthread_join(t1, NULL); + DEV_ModuleExit(); + exit(0); +} + +void *pthread_irq(void *arg) +{ + while(flag_t) { + if(DEV_Digital_Read(INT) == 0) { + Dev_Now.Touch = 1; + } + else { + Dev_Now.Touch = 0; + } + DEV_Delay_ms(0.01); + } + printf("thread:exit\r\n"); + pthread_exit(NULL); +} + +void Show_Photo_Small(UBYTE small) +{ + for(UBYTE t=1; t<5; t++) { + // printf("t= %d , small= %d \r\n", t, small); + if(small*2+t > 6) + GUI_ReadBmp(PhotoPath_S[0], (t-1)/2*45+2, (t%2)*124+2); + else + GUI_ReadBmp(PhotoPath_S[small*2+t], (t-1)/2*45+2, (t%2)*124+2); + } +} + +void Show_Photo_Large(UBYTE large) +{ + if(large > 6) + GUI_ReadBmp(PhotoPath_L[0], 2, 2); + else + GUI_ReadBmp(PhotoPath_L[large], 2, 2); +} + +int TestCode_2in13(void) +{ + IIC_Address = 0x14; + + UDOUBLE i=0, j=0, k=0; + UBYTE Page=0, Photo_L=0, Photo_S=0; + UBYTE ReFlag=0, SelfFlag=0; + signal(SIGINT, Handler); + DEV_ModuleInit(); + + pthread_create(&t1, NULL, pthread_irq, NULL); + + EPD_2IN13_V2_Init(EPD_2IN13_V2_FULL); + + EPD_2IN13_V2_Clear(); + + GT_Init(); + DEV_Delay_ms(100); + //Create a new image cache + UBYTE *BlackImage; + UWORD Imagesize = ((EPD_2IN13_V2_WIDTH % 8 == 0)? (EPD_2IN13_V2_WIDTH / 8 ): (EPD_2IN13_V2_WIDTH / 8 + 1)) * EPD_2IN13_V2_HEIGHT; + if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) { + printf("Failed to apply for black memory...\r\n"); + return -1; + } + printf("Paint_NewImage\r\n"); + Paint_NewImage(BlackImage, EPD_2IN13_V2_WIDTH, EPD_2IN13_V2_HEIGHT, 0, WHITE); + Paint_SelectImage(BlackImage); + Paint_SetMirroring(MIRROR_HORIZONTAL); + Paint_Clear(WHITE); + GUI_ReadBmp("./pic/2in13/Menu.bmp", 0, 0); + EPD_2IN13_V2_DisplayPartBaseImage(BlackImage); + EPD_2IN13_V2_Init(EPD_2IN13_V2_PART); + + while(1) { + // k++; + if(i > 12 || ReFlag == 1) { + if(Page == 1 && SelfFlag != 1) + EPD_2IN13_V2_DisplayPart(BlackImage); + else + EPD_2IN13_V2_DisplayPart_Wait(BlackImage); + i = 0; + k = 0; + j++; + ReFlag = 0; + printf("*** Draw Refresh ***\r\n"); + }else if(k++>30000000 && i>0 && Page == 1) { + EPD_2IN13_V2_DisplayPart(BlackImage); + i = 0; + k = 0; + j++; + printf("*** Overtime Refresh ***\r\n"); + }else if(j > 100 || SelfFlag) { + SelfFlag = 0; + j = 0; + EPD_2IN13_V2_Init(EPD_2IN13_V2_FULL); + EPD_2IN13_V2_DisplayPartBaseImage(BlackImage); + EPD_2IN13_V2_Init(EPD_2IN13_V2_PART); + printf("--- Self Refresh ---\r\n"); + } + + if(GT_Scan()==1 || (Dev_Now.X[0] == Dev_Old.X[0] && Dev_Now.Y[0] == Dev_Old.Y[0])) { // No new touch + // printf("%d %d \r\n", j, SelfFlag); + // printf("No new touch \r\n"); + continue; + } + + if(Dev_Now.TouchpointFlag) { + i++; + Dev_Now.TouchpointFlag = 0; + + if(Page == 0 && ReFlag == 0) { //main menu + if(Dev_Now.X[0] > 29 && Dev_Now.X[0] < 92 && Dev_Now.Y[0] > 56 && Dev_Now.Y[0] < 95) { + printf("Photo ...\r\n"); + Page = 2; + GUI_ReadBmp(PagePath[Page], 0, 0); + Show_Photo_Small(Photo_S); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 29 && Dev_Now.X[0] < 92 && Dev_Now.Y[0] > 153 && Dev_Now.Y[0] < 193) { + printf("Draw ...\r\n"); + Page = 1; + GUI_ReadBmp(PagePath[Page], 0, 0); + ReFlag = 1; + } + } + + if(Page == 1 && ReFlag == 0) { //white board + Paint_DrawPoint(Dev_Now.X[0], Dev_Now.Y[0], BLACK, Dev_Now.S[0]/8+1, DOT_STYLE_DFT); + + if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 118 && Dev_Now.Y[0] > 6 && Dev_Now.Y[0] < 30) { + printf("Home ...\r\n"); + Page = 1; + GUI_ReadBmp(PagePath[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 118 && Dev_Now.Y[0] > 113 && Dev_Now.Y[0] < 136) { + printf("Clear ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 118 && Dev_Now.Y[0] > 220 && Dev_Now.Y[0] < 242) { + printf("Refresh ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + } + + if(Page == 2 && ReFlag == 0) { //photo menu + if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 113 && Dev_Now.Y[0] < 136) { + printf("Home ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 57 && Dev_Now.Y[0] < 78) { + printf("Next page ...\r\n"); + Photo_S++; + if(Photo_S > 2) // 6 photos is a maximum of three pages + Photo_S=0; + ReFlag = 2; + } + else if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 169 && Dev_Now.Y[0] < 190) { + printf("Last page ...\r\n"); + if(Photo_S == 0) + printf("Top page ...\r\n"); + else { + Photo_S--; + ReFlag = 2; + } + } + else if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 220 && Dev_Now.Y[0] < 242) { + printf("Refresh ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + else if(Dev_Now.X[0] > 2 && Dev_Now.X[0] < 90 && Dev_Now.Y[0] > 2 && Dev_Now.Y[0] < 248 && ReFlag == 0) { + printf("Select photo ...\r\n"); + Page = 3; + GUI_ReadBmp(PagePath[Page], 0, 0); + Photo_L = Dev_Now.X[0]/46*2 + 2-Dev_Now.Y[0]/124 + Photo_S*2; + Show_Photo_Large(Photo_L); + ReFlag = 1; + } + if(ReFlag == 2) { // Refresh small photo + ReFlag = 1; + GUI_ReadBmp(PagePath[Page], 0, 0); + Show_Photo_Small(Photo_S); // show small photo + } + } + + if(Page == 3 && ReFlag == 0) { //view the photo + if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 4 && Dev_Now.Y[0] < 25) { + printf("Photo menu ...\r\n"); + Page = 2; + GUI_ReadBmp(PagePath[Page], 0, 0); + Show_Photo_Small(Photo_S); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 57 && Dev_Now.Y[0] < 78) { + printf("Next photo ...\r\n"); + Photo_L++; + if(Photo_L > 6) + Photo_L=1; + ReFlag = 2; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 113 && Dev_Now.Y[0] < 136) { + printf("Home ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 169 && Dev_Now.Y[0] < 190) { + printf("Last page ...\r\n"); + if(Photo_L == 1) + printf("Top photo ...\r\n"); + else { + Photo_L--; + ReFlag = 2; + } + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 220 && Dev_Now.Y[0] < 242) { + printf("Refresh photo ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + if(ReFlag == 2) { // Refresh large photo + ReFlag = 1; + Show_Photo_Large(Photo_L); + } + } + + } + } + return 0; +} diff --git a/docs/Touch_e-Paper_Code/c/examples/2in13_TestCode_V3.c b/docs/Touch_e-Paper_Code/c/examples/2in13_TestCode_V3.c new file mode 100644 index 0000000..b0bb51f --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/examples/2in13_TestCode_V3.c @@ -0,0 +1,264 @@ +#include "Test.h" +#include "EPD_2in13_V3.h" +#include "GT1151.h" + +extern GT1151_Dev Dev_Now, Dev_Old; +extern int IIC_Address; +static pthread_t t1_2in13_V3; +UBYTE flag_t_2in13_V3 = 1; + +char *PhotoPath_S_2in13_V3[7] = {"./pic/2in13/Photo_1_0.bmp", + "./pic/2in13/Photo_1_1.bmp", "./pic/2in13/Photo_1_2.bmp", "./pic/2in13/Photo_1_3.bmp", "./pic/2in13/Photo_1_4.bmp", + "./pic/2in13/Photo_1_5.bmp", "./pic/2in13/Photo_1_6.bmp", + }; +char *PhotoPath_L_2in13_V3[7] = {"./pic/2in13/Photo_2_0.bmp", + "./pic/2in13/Photo_2_1.bmp", "./pic/2in13/Photo_2_2.bmp", "./pic/2in13/Photo_2_3.bmp", "./pic/2in13/Photo_2_4.bmp", + "./pic/2in13/Photo_2_5.bmp", "./pic/2in13/Photo_2_6.bmp", + }; +char *PagePath_2in13_V3[4] = {"./pic/2in13/Menu.bmp", "./pic/2in13/White_board.bmp", "./pic/2in13/Photo_1.bmp", "./pic/2in13/Photo_2.bmp"}; + + +void Handler_2in13_V3(int signo) +{ + //System Exit + printf("\r\nHandler:exit\r\n"); + EPD_2in13_V3_Sleep(); + DEV_Delay_ms(2000); + flag_t_2in13_V3 = 0; + pthread_join(t1_2in13_V3, NULL); + DEV_ModuleExit(); + exit(0); +} + +void *pthread_irq_2in13_V3(void *arg) +{ + while(flag_t_2in13_V3) { + if(DEV_Digital_Read(INT) == 0) { + Dev_Now.Touch = 1; + } + else { + Dev_Now.Touch = 0; + } + DEV_Delay_ms(0.01); + } + printf("thread:exit\r\n"); + pthread_exit(NULL); +} + +void Show_Photo_Small_2in13_V3(UBYTE small) +{ + for(UBYTE t=1; t<5; t++) { + // printf("t= %d , small= %d \r\n", t, small); + if(small*2+t > 6) + GUI_ReadBmp(PhotoPath_S_2in13_V3[0], (t-1)/2*45+2, (t%2)*124+2); + else + GUI_ReadBmp(PhotoPath_S_2in13_V3[small*2+t], (t-1)/2*45+2, (t%2)*124+2); + } +} + +void Show_Photo_Large_2in13_V3(UBYTE large) +{ + if(large > 6) + GUI_ReadBmp(PhotoPath_L_2in13_V3[0], 2, 2); + else + GUI_ReadBmp(PhotoPath_L_2in13_V3[large], 2, 2); +} + +int TestCode_2in13_V3(void) +{ + IIC_Address = 0x14; + + UDOUBLE i=0, j=0, k=0; + UBYTE Page=0, Photo_L=0, Photo_S=0; + UBYTE ReFlag=0, SelfFlag=0; + signal(SIGINT, Handler_2in13_V3); + DEV_ModuleInit(); + + pthread_create(&t1_2in13_V3, NULL, pthread_irq_2in13_V3, NULL); + + EPD_2in13_V3_Init(EPD_2IN13_V3_FULL); + + EPD_2in13_V3_Clear(); + + GT_Init(); + DEV_Delay_ms(100); + //Create a new image cache + UBYTE *BlackImage; + UWORD Imagesize = ((EPD_2in13_V3_WIDTH % 8 == 0)? (EPD_2in13_V3_WIDTH / 8 ): (EPD_2in13_V3_WIDTH / 8 + 1)) * EPD_2in13_V3_HEIGHT; + if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) { + printf("Failed to apply for black memory...\r\n"); + return -1; + } + printf("Paint_NewImage\r\n"); + Paint_NewImage(BlackImage, EPD_2in13_V3_WIDTH, EPD_2in13_V3_HEIGHT, 0, WHITE); + Paint_SelectImage(BlackImage); + Paint_SetMirroring(MIRROR_ORIGIN); + Paint_Clear(WHITE); + GUI_ReadBmp("./pic/2in13/Menu.bmp", 0, 0); + EPD_2in13_V3_Display(BlackImage); + EPD_2in13_V3_Init(EPD_2IN13_V3_PART); + EPD_2in13_V3_Display_Partial_Wait(BlackImage); + + while(1) { + // k++; + if(i > 12 || ReFlag == 1) { + if(Page == 1 && SelfFlag != 1) + EPD_2in13_V3_Display_Partial(BlackImage); + else + EPD_2in13_V3_Display_Partial_Wait(BlackImage); + i = 0; + k = 0; + j++; + ReFlag = 0; + printf("*** Draw Refresh ***\r\n"); + }else if(k++>30000000 && i>0 && Page == 1) { + EPD_2in13_V3_Display_Partial(BlackImage); + i = 0; + k = 0; + j++; + printf("*** Overtime Refresh ***\r\n"); + }else if(j > 100 || SelfFlag) { + SelfFlag = 0; + j = 0; + EPD_2in13_V3_Init(EPD_2IN13_V3_FULL); + EPD_2in13_V3_Display_Base(BlackImage); + EPD_2in13_V3_Init(EPD_2IN13_V3_PART); + printf("--- Self Refresh ---\r\n"); + } + + if(GT_Scan()==1 || (Dev_Now.X[0] == Dev_Old.X[0] && Dev_Now.Y[0] == Dev_Old.Y[0])) { // No new touch + // printf("%d %d \r\n", j, SelfFlag); + // printf("No new touch \r\n"); + continue; + } + + if(Dev_Now.TouchpointFlag) { + i++; + Dev_Now.TouchpointFlag = 0; + + if(Page == 0 && ReFlag == 0) { //main menu + if(Dev_Now.X[0] > 29 && Dev_Now.X[0] < 92 && Dev_Now.Y[0] > 56 && Dev_Now.Y[0] < 95) { + printf("Photo ...\r\n"); + Page = 2; + GUI_ReadBmp(PagePath_2in13_V3[Page], 0, 0); + Show_Photo_Small_2in13_V3(Photo_S); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 29 && Dev_Now.X[0] < 92 && Dev_Now.Y[0] > 153 && Dev_Now.Y[0] < 193) { + printf("Draw ...\r\n"); + Page = 1; + GUI_ReadBmp(PagePath_2in13_V3[Page], 0, 0); + ReFlag = 1; + } + } + + if(Page == 1 && ReFlag == 0) { //white board + Paint_DrawPoint(Dev_Now.X[0], Dev_Now.Y[0], BLACK, Dev_Now.S[0]/8+1, DOT_STYLE_DFT); + + if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 118 && Dev_Now.Y[0] > 6 && Dev_Now.Y[0] < 30) { + printf("Home ...\r\n"); + Page = 1; + GUI_ReadBmp(PagePath_2in13_V3[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 118 && Dev_Now.Y[0] > 113 && Dev_Now.Y[0] < 136) { + printf("Clear ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath_2in13_V3[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 118 && Dev_Now.Y[0] > 220 && Dev_Now.Y[0] < 242) { + printf("Refresh ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + } + + if(Page == 2 && ReFlag == 0) { //photo menu + if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 113 && Dev_Now.Y[0] < 136) { + printf("Home ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath_2in13_V3[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 57 && Dev_Now.Y[0] < 78) { + printf("Next page ...\r\n"); + Photo_S++; + if(Photo_S > 2) // 6 photos is a maximum of three pages + Photo_S=0; + ReFlag = 2; + } + else if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 169 && Dev_Now.Y[0] < 190) { + printf("Last page ...\r\n"); + if(Photo_S == 0) + printf("Top page ...\r\n"); + else { + Photo_S--; + ReFlag = 2; + } + } + else if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 220 && Dev_Now.Y[0] < 242) { + printf("Refresh ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + else if(Dev_Now.X[0] > 2 && Dev_Now.X[0] < 90 && Dev_Now.Y[0] > 2 && Dev_Now.Y[0] < 248 && ReFlag == 0) { + printf("Select photo ...\r\n"); + Page = 3; + GUI_ReadBmp(PagePath_2in13_V3[Page], 0, 0); + Photo_L = Dev_Now.X[0]/46*2 + 2-Dev_Now.Y[0]/124 + Photo_S*2; + Show_Photo_Large_2in13_V3(Photo_L); + ReFlag = 1; + } + if(ReFlag == 2) { // Refresh small photo + ReFlag = 1; + GUI_ReadBmp(PagePath_2in13_V3[Page], 0, 0); + Show_Photo_Small_2in13_V3(Photo_S); // show small photo + } + } + + if(Page == 3 && ReFlag == 0) { //view the photo + if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 4 && Dev_Now.Y[0] < 25) { + printf("Photo menu ...\r\n"); + Page = 2; + GUI_ReadBmp(PagePath_2in13_V3[Page], 0, 0); + Show_Photo_Small_2in13_V3(Photo_S); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 57 && Dev_Now.Y[0] < 78) { + printf("Next photo ...\r\n"); + Photo_L++; + if(Photo_L > 6) + Photo_L=1; + ReFlag = 2; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 113 && Dev_Now.Y[0] < 136) { + printf("Home ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath_2in13_V3[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 169 && Dev_Now.Y[0] < 190) { + printf("Last page ...\r\n"); + if(Photo_L == 1) + printf("Top photo ...\r\n"); + else { + Photo_L--; + ReFlag = 2; + } + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 220 && Dev_Now.Y[0] < 242) { + printf("Refresh photo ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + if(ReFlag == 2) { // Refresh large photo + ReFlag = 1; + Show_Photo_Large_2in13_V3(Photo_L); + } + } + + } + } + return 0; +} diff --git a/docs/Touch_e-Paper_Code/c/examples/2in13_TestCode_V4.c b/docs/Touch_e-Paper_Code/c/examples/2in13_TestCode_V4.c new file mode 100644 index 0000000..36650d3 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/examples/2in13_TestCode_V4.c @@ -0,0 +1,264 @@ +#include "Test.h" +#include "EPD_2in13_V4.h" +#include "GT1151.h" + +extern GT1151_Dev Dev_Now, Dev_Old; +extern int IIC_Address; +static pthread_t t1_2in13_V4; +UBYTE flag_t_2in13_V4 = 1; + +char *PhotoPath_S_2in13_V4[7] = {"./pic/2in13/Photo_1_0.bmp", + "./pic/2in13/Photo_1_1.bmp", "./pic/2in13/Photo_1_2.bmp", "./pic/2in13/Photo_1_3.bmp", "./pic/2in13/Photo_1_4.bmp", + "./pic/2in13/Photo_1_5.bmp", "./pic/2in13/Photo_1_6.bmp", + }; +char *PhotoPath_L_2in13_V4[7] = {"./pic/2in13/Photo_2_0.bmp", + "./pic/2in13/Photo_2_1.bmp", "./pic/2in13/Photo_2_2.bmp", "./pic/2in13/Photo_2_3.bmp", "./pic/2in13/Photo_2_4.bmp", + "./pic/2in13/Photo_2_5.bmp", "./pic/2in13/Photo_2_6.bmp", + }; +char *PagePath_2in13_V4[4] = {"./pic/2in13/Menu.bmp", "./pic/2in13/White_board.bmp", "./pic/2in13/Photo_1.bmp", "./pic/2in13/Photo_2.bmp"}; + + +void Handler_2in13_V4(int signo) +{ + //System Exit + printf("\r\nHandler:exit\r\n"); + EPD_2in13_V4_Sleep(); + DEV_Delay_ms(2000); + flag_t_2in13_V4 = 0; + pthread_join(t1_2in13_V4, NULL); + DEV_ModuleExit(); + exit(0); +} + +void *pthread_irq_2in13_V4(void *arg) +{ + while(flag_t_2in13_V4) { + if(DEV_Digital_Read(INT) == 0) { + Dev_Now.Touch = 1; + } + else { + Dev_Now.Touch = 0; + } + DEV_Delay_ms(0.01); + } + printf("thread:exit\r\n"); + pthread_exit(NULL); +} + +void Show_Photo_Small_2in13_V4(UBYTE small) +{ + for(UBYTE t=1; t<5; t++) { + // printf("t= %d , small= %d \r\n", t, small); + if(small*2+t > 6) + GUI_ReadBmp(PhotoPath_S_2in13_V4[0], (t-1)/2*45+2, (t%2)*124+2); + else + GUI_ReadBmp(PhotoPath_S_2in13_V4[small*2+t], (t-1)/2*45+2, (t%2)*124+2); + } +} + +void Show_Photo_Large_2in13_V4(UBYTE large) +{ + if(large > 6) + GUI_ReadBmp(PhotoPath_L_2in13_V4[0], 2, 2); + else + GUI_ReadBmp(PhotoPath_L_2in13_V4[large], 2, 2); +} + +int TestCode_2in13_V4(void) +{ + IIC_Address = 0x14; + + UDOUBLE i=0, j=0, k=0; + UBYTE Page=0, Photo_L=0, Photo_S=0; + UBYTE ReFlag=0, SelfFlag=0; + signal(SIGINT, Handler_2in13_V4); + DEV_ModuleInit(); + + pthread_create(&t1_2in13_V4, NULL, pthread_irq_2in13_V4, NULL); + + EPD_2in13_V4_Init(EPD_2IN13_V4_FULL); + + EPD_2in13_V4_Clear(); + + GT_Init(); + DEV_Delay_ms(100); + //Create a new image cache + UBYTE *BlackImage; + UWORD Imagesize = ((EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1)) * EPD_2in13_V4_HEIGHT; + if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) { + printf("Failed to apply for black memory...\r\n"); + return -1; + } + printf("Paint_NewImage\r\n"); + Paint_NewImage(BlackImage, EPD_2in13_V4_WIDTH, EPD_2in13_V4_HEIGHT, 0, WHITE); + Paint_SelectImage(BlackImage); + Paint_SetMirroring(MIRROR_ORIGIN); + Paint_Clear(WHITE); + GUI_ReadBmp("./pic/2in13/Menu.bmp", 0, 0); + EPD_2in13_V4_Display(BlackImage); + EPD_2in13_V4_Init(EPD_2IN13_V4_PART); + EPD_2in13_V4_Display_Partial_Wait(BlackImage); + + while(1) { + // k++; + if(i > 12 || ReFlag == 1) { + if(Page == 1 && SelfFlag != 1) + EPD_2in13_V4_Display_Partial(BlackImage); + else + EPD_2in13_V4_Display_Partial_Wait(BlackImage); + i = 0; + k = 0; + j++; + ReFlag = 0; + printf("*** Draw Refresh ***\r\n"); + }else if(k++>30000000 && i>0 && Page == 1) { + EPD_2in13_V4_Display_Partial(BlackImage); + i = 0; + k = 0; + j++; + printf("*** Overtime Refresh ***\r\n"); + }else if(j > 100 || SelfFlag) { + SelfFlag = 0; + j = 0; + EPD_2in13_V4_Init(EPD_2IN13_V4_FULL); + EPD_2in13_V4_Display_Base(BlackImage); + EPD_2in13_V4_Init(EPD_2IN13_V4_PART); + printf("--- Self Refresh ---\r\n"); + } + + if(GT_Scan()==1 || (Dev_Now.X[0] == Dev_Old.X[0] && Dev_Now.Y[0] == Dev_Old.Y[0])) { // No new touch + // printf("%d %d \r\n", j, SelfFlag); + // printf("No new touch \r\n"); + continue; + } + + if(Dev_Now.TouchpointFlag) { + i++; + Dev_Now.TouchpointFlag = 0; + + if(Page == 0 && ReFlag == 0) { //main menu + if(Dev_Now.X[0] > 29 && Dev_Now.X[0] < 92 && Dev_Now.Y[0] > 56 && Dev_Now.Y[0] < 95) { + printf("Photo ...\r\n"); + Page = 2; + GUI_ReadBmp(PagePath_2in13_V4[Page], 0, 0); + Show_Photo_Small_2in13_V4(Photo_S); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 29 && Dev_Now.X[0] < 92 && Dev_Now.Y[0] > 153 && Dev_Now.Y[0] < 193) { + printf("Draw ...\r\n"); + Page = 1; + GUI_ReadBmp(PagePath_2in13_V4[Page], 0, 0); + ReFlag = 1; + } + } + + if(Page == 1 && ReFlag == 0) { //white board + Paint_DrawPoint(Dev_Now.X[0], Dev_Now.Y[0], BLACK, Dev_Now.S[0]/8+1, DOT_STYLE_DFT); + + if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 118 && Dev_Now.Y[0] > 6 && Dev_Now.Y[0] < 30) { + printf("Home ...\r\n"); + Page = 1; + GUI_ReadBmp(PagePath_2in13_V4[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 118 && Dev_Now.Y[0] > 113 && Dev_Now.Y[0] < 136) { + printf("Clear ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath_2in13_V4[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 118 && Dev_Now.Y[0] > 220 && Dev_Now.Y[0] < 242) { + printf("Refresh ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + } + + if(Page == 2 && ReFlag == 0) { //photo menu + if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 113 && Dev_Now.Y[0] < 136) { + printf("Home ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath_2in13_V4[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 57 && Dev_Now.Y[0] < 78) { + printf("Next page ...\r\n"); + Photo_S++; + if(Photo_S > 2) // 6 photos is a maximum of three pages + Photo_S=0; + ReFlag = 2; + } + else if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 169 && Dev_Now.Y[0] < 190) { + printf("Last page ...\r\n"); + if(Photo_S == 0) + printf("Top page ...\r\n"); + else { + Photo_S--; + ReFlag = 2; + } + } + else if(Dev_Now.X[0] > 97 && Dev_Now.X[0] < 119 && Dev_Now.Y[0] > 220 && Dev_Now.Y[0] < 242) { + printf("Refresh ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + else if(Dev_Now.X[0] > 2 && Dev_Now.X[0] < 90 && Dev_Now.Y[0] > 2 && Dev_Now.Y[0] < 248 && ReFlag == 0) { + printf("Select photo ...\r\n"); + Page = 3; + GUI_ReadBmp(PagePath_2in13_V4[Page], 0, 0); + Photo_L = Dev_Now.X[0]/46*2 + 2-Dev_Now.Y[0]/124 + Photo_S*2; + Show_Photo_Large_2in13_V4(Photo_L); + ReFlag = 1; + } + if(ReFlag == 2) { // Refresh small photo + ReFlag = 1; + GUI_ReadBmp(PagePath_2in13_V4[Page], 0, 0); + Show_Photo_Small_2in13_V4(Photo_S); // show small photo + } + } + + if(Page == 3 && ReFlag == 0) { //view the photo + if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 4 && Dev_Now.Y[0] < 25) { + printf("Photo menu ...\r\n"); + Page = 2; + GUI_ReadBmp(PagePath_2in13_V4[Page], 0, 0); + Show_Photo_Small_2in13_V4(Photo_S); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 57 && Dev_Now.Y[0] < 78) { + printf("Next photo ...\r\n"); + Photo_L++; + if(Photo_L > 6) + Photo_L=1; + ReFlag = 2; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 113 && Dev_Now.Y[0] < 136) { + printf("Home ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath_2in13_V4[Page], 0, 0); + ReFlag = 1; + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 169 && Dev_Now.Y[0] < 190) { + printf("Last page ...\r\n"); + if(Photo_L == 1) + printf("Top photo ...\r\n"); + else { + Photo_L--; + ReFlag = 2; + } + } + else if(Dev_Now.X[0] > 96 && Dev_Now.X[0] < 117 && Dev_Now.Y[0] > 220 && Dev_Now.Y[0] < 242) { + printf("Refresh photo ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + if(ReFlag == 2) { // Refresh large photo + ReFlag = 1; + Show_Photo_Large_2in13_V4(Photo_L); + } + } + + } + } + return 0; +} diff --git a/docs/Touch_e-Paper_Code/c/examples/2in9_TestCode.c b/docs/Touch_e-Paper_Code/c/examples/2in9_TestCode.c new file mode 100644 index 0000000..f0418f5 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/examples/2in9_TestCode.c @@ -0,0 +1,364 @@ +#include "Test.h" +#include "EPD_2in9_V2.h" +#include "ICNT86X.h" +#include "time.h" + +extern ICNT86_Dev ICNT86_Dev_Now, ICNT86_Dev_Old; +extern int IIC_Address; +static pthread_t t1, t2; +UBYTE flag_2in9=1, dis_lock=1, dis_flag=1; +UBYTE *BlackImage, *BlackImage_ASYNC; + +char *PhotoPath_S_2in9[10] = {"./pic/2in9/Photo_1_0.bmp", + "./pic/2in9/Photo_1_1.bmp", "./pic/2in9/Photo_1_2.bmp", "./pic/2in9/Photo_1_3.bmp", "./pic/2in9/Photo_1_4.bmp", + "./pic/2in9/Photo_1_5.bmp", "./pic/2in9/Photo_1_6.bmp", "./pic/2in9/Photo_1_7.bmp", "./pic/2in9/Photo_1_8.bmp", + "./pic/2in9/Photo_1_9.bmp", + }; +char *PhotoPath_L_2in9[10] = {"./pic/2in9/Photo_2_0.bmp", + "./pic/2in9/Photo_2_1.bmp", "./pic/2in9/Photo_2_2.bmp", "./pic/2in9/Photo_2_3.bmp", "./pic/2in9/Photo_2_4.bmp", + "./pic/2in9/Photo_2_5.bmp", "./pic/2in9/Photo_2_6.bmp", "./pic/2in9/Photo_2_7.bmp", "./pic/2in9/Photo_2_8.bmp", + "./pic/2in9/Photo_2_9.bmp", + }; +char *PagePath_2in9[4] = {"./pic/2in9/Menu.bmp", "./pic/2in9/White_board.bmp", "./pic/2in9/Photo_1.bmp", "./pic/2in9/Photo_2.bmp"}; + + +void Handler_2in9(int signo) +{ + //System Exit + printf("\r\nHandler_2in9:exit\r\n"); + EPD_2IN9_V2_Sleep(); + DEV_Delay_ms(1000); + flag_2in9 = 0; + pthread_join(t1, NULL); + pthread_join(t2, NULL); + DEV_ModuleExit(); + exit(0); +} + +void *pthread_irq_2in9(void *arg) +{ + while(flag_2in9) { + if(DEV_Digital_Read(INT) == 0) { + ICNT86_Dev_Now.Touch = 1; + // printf("!"); + } + else { + ICNT86_Dev_Now.Touch = 0; + } + DEV_Delay_ms(0.01); + } + printf("thread1:exit\r\n"); + pthread_exit(NULL); +} + +void *pthread_dis_2in9(void *arg) +{ + while(flag_2in9) { + if(dis_flag) { + dis_lock = 1; + EPD_2IN9_V2_Display_Partial(BlackImage_ASYNC); + dis_flag = 0; + dis_lock = 0; + printf("ASYNC display over, unlock \r\n"); + } + else { + dis_lock = 0; + } + // DEV_Delay_ms(0.01); + } + + printf("thread2:exit\r\n"); + pthread_exit(NULL); +} + +void Show_Photo_Small_2in9(UBYTE small) +{ + for(UBYTE t=1; t<7; t++) { + // printf("t= %d , small= %d \r\n", t, small); + if(small*3+t > 9) // Max image is 9 + GUI_ReadBmp(PhotoPath_S_2in9[0], (t-1)%3*98+2, (t-1)/3*48+2); + else { + // printf("x is %d, y is %d \r\n", (t-1)%3*98, (t-1)/3*48); + GUI_ReadBmp(PhotoPath_S_2in9[small*3+t], (t-1)%3*98+2, (t-1)/3*48+2); + } + } +} + +void Show_Photo_Large_2in9(UBYTE large) +{ + if(large > 9) // Max image is 9 + GUI_ReadBmp(PhotoPath_L_2in9[0], 2, 2); + else + GUI_ReadBmp(PhotoPath_L_2in9[large], 2, 2); +} + +void Get_Current_Time(PAINT_TIME *pTime) +{ + time_t t; + struct tm *nowtime; + + time(&t); + nowtime = localtime(&t); + + pTime->Year = nowtime->tm_year + 1900; + pTime->Month = nowtime->tm_mon + 1; + pTime->Day = nowtime->tm_mday; + pTime->Hour = nowtime->tm_hour; + pTime->Min = nowtime->tm_min; +} + + +int Test4gray_2in9(void) +{ + EPD_2IN9_V2_Gray4_Init(); + UWORD Imagesize = ((EPD_2IN9_V2_WIDTH % 4 == 0)? (EPD_2IN9_V2_WIDTH / 4 ): (EPD_2IN9_V2_WIDTH / 4 + 1)) * EPD_2IN9_V2_HEIGHT; + if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) { + printf("Failed to apply for black memory...\r\n"); + return -1; + } + Paint_NewImage(BlackImage, EPD_2IN9_V2_WIDTH, EPD_2IN9_V2_HEIGHT, 0, WHITE); + Paint_SetScale(4); + Paint_Clear(WHITE); + GUI_ReadBmp_4Gray("./pic/2in9/2in9_Scale.bmp", 0, 0); + EPD_2IN9_V2_4GrayDisplay(BlackImage); + DEV_Delay_ms(3000); + free(BlackImage); +} + + +int TestCode_2in9(void) +{ + IIC_Address = 0x48; + + UDOUBLE i=0, j=0, k=0; + UBYTE Page=0, Photo_L=0, Photo_S=0; + UBYTE ReFlag=0, SelfFlag=0; + signal(SIGINT, Handler_2in9); + DEV_ModuleInit(); + + pthread_create(&t1, NULL, pthread_irq_2in9, NULL); + + /* + Because the touch display requires a relatively fast refresh speed, the default + needs to use partial refresh, and four gray levels cannot be used in this mode. + Here, only four gray level picture refresh demonstration is used + */ + // Test4gray_2in9(); + + EPD_2IN9_V2_Init(); + + EPD_2IN9_V2_Clear(); + + ICNT_Init(); + DEV_Delay_ms(100); + //Create a new image cache + UWORD Imagesize = ((EPD_2IN9_V2_WIDTH % 8 == 0)? (EPD_2IN9_V2_WIDTH / 8 ): (EPD_2IN9_V2_WIDTH / 8 + 1)) * EPD_2IN9_V2_HEIGHT; + if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) { + printf("Failed to apply for black memory...\r\n"); + return -1; + } + if((BlackImage_ASYNC = (UBYTE *)malloc(Imagesize)) == NULL) { + printf("Failed to apply for black memory...\r\n"); + return -1; + } + printf("Paint_NewImage\r\n"); + Paint_NewImage(BlackImage, EPD_2IN9_V2_WIDTH, EPD_2IN9_V2_HEIGHT, 90, WHITE); + Paint_SelectImage(BlackImage); + Paint_Clear(WHITE); + GUI_ReadBmp("./pic/2in9/Menu.bmp", 0, 0); + + PAINT_TIME sPaint_time, sPaint_time_f; + Get_Current_Time(&sPaint_time); + Get_Current_Time(&sPaint_time_f); + Paint_DrawTime(210, 45, &sPaint_time, &Font24, WHITE, WHITE); + Paint_DrawDate(212, 80, &sPaint_time, &Font12, WHITE, WHITE); + + EPD_2IN9_V2_Display_Base(BlackImage); + memcpy(BlackImage_ASYNC, BlackImage, Imagesize); + pthread_create(&t2, NULL, pthread_dis_2in9, NULL); + while(1) { + // k++; + if(i > 30 || ReFlag == 1) { + if(Page == 0) { + Get_Current_Time(&sPaint_time); + Paint_ClearWindows(210, 40, 290, 100, BLACK); + Paint_DrawTime(212, 45, &sPaint_time, &Font24, WHITE, WHITE); + Paint_DrawDate(212, 80, &sPaint_time, &Font12, WHITE, WHITE); + } + + if(Page == 1 && SelfFlag != 1 && dis_lock != 1) { + memcpy(BlackImage_ASYNC, BlackImage, Imagesize); + dis_flag = 1; + + i = 0; + k = 0; + j++; + ReFlag = 0; + printf("*** Draw Refresh ***\r\n"); + } + else if(!dis_lock){ + EPD_2IN9_V2_Display_Partial_Wait(BlackImage); + + i = 0; + k = 0; + j++; + ReFlag = 0; + printf("*** Touch Refresh ***\r\n"); + } + }else if(k++>50000000 && i>0 && Page == 1) { + EPD_2IN9_V2_Display_Partial(BlackImage); + i = 0; + k = 0; + j++; + printf("*** Overtime Refresh ***\r\n"); + }else if(j > 100 || SelfFlag) { + SelfFlag = 0; + j = 0; + EPD_2IN9_V2_Init(); + EPD_2IN9_V2_Display_Base(BlackImage); + printf("--- Self Refresh ---\r\n"); + } + + if(Page == 0 && ReFlag == 0) { //main menu + Get_Current_Time(&sPaint_time_f); + if(sPaint_time_f.Min != sPaint_time.Min) { + ReFlag = 1; + } + } + + + if(ICNT_Scan()==1 || (ICNT86_Dev_Now.X[0] == ICNT86_Dev_Old.X[0] && ICNT86_Dev_Now.Y[0] == ICNT86_Dev_Old.Y[0])) { // No new touch + // printf("%d %d \r\n", j, SelfFlag); + // printf("No new touch \r\n"); + continue; + } + + if(ICNT86_Dev_Now.TouchCount) { + i++; + if(Page == 0 && ReFlag == 0) { //main menu + if(ICNT86_Dev_Now.X[0] > 119 && ICNT86_Dev_Now.X[0] < 152 && ICNT86_Dev_Now.Y[0] > 31 && ICNT86_Dev_Now.Y[0] < 96) { + printf("Photo ...\r\n"); + Page = 2; + GUI_ReadBmp(PagePath_2in9[Page], 0, 0); + Show_Photo_Small_2in9(Photo_S); + ReFlag = 1; + } + else if(ICNT86_Dev_Now.X[0] > 39 && ICNT86_Dev_Now.X[0] < 80 && ICNT86_Dev_Now.Y[0] > 31 && ICNT86_Dev_Now.Y[0] < 96) { + printf("Draw ...\r\n"); + Page = 1; + GUI_ReadBmp(PagePath_2in9[Page], 0, 0); + ReFlag = 1; + } + } + + if(Page == 1 && ReFlag == 0) { //white board + // Paint_DrawPoint(ICNT86_Dev_Now.X[0], ICNT86_Dev_Now.Y[0], BLACK, ICNT86_Dev_Now.P[0]/8+1, DOT_STYLE_DFT); + Paint_DrawPoint(ICNT86_Dev_Now.X[0], ICNT86_Dev_Now.Y[0], BLACK, 3, DOT_STYLE_DFT); + + if(ICNT86_Dev_Now.X[0] > 136 && ICNT86_Dev_Now.X[0] < 159 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Home ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath_2in9[Page], 0, 0); + ReFlag = 1; + } + else if(ICNT86_Dev_Now.X[0] > 266 && ICNT86_Dev_Now.X[0] < 289 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Clear ...\r\n"); + Page = 1; + GUI_ReadBmp(PagePath_2in9[Page], 0, 0); + ReFlag = 1; + } + else if(ICNT86_Dev_Now.X[0] > 5 && ICNT86_Dev_Now.X[0] < 27 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Refresh ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + } + + if(Page == 2 && ReFlag == 0) { //photo menu + if(ICNT86_Dev_Now.X[0] > 135 && ICNT86_Dev_Now.X[0] < 160 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Home ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath_2in9[Page], 0, 0); + ReFlag = 1; + } + else if(ICNT86_Dev_Now.X[0] > 203 && ICNT86_Dev_Now.X[0] < 224 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Next page ...\r\n"); + Photo_S++; + if(Photo_S > 2) // 9 photos is a maximum of three pages + Photo_S=0; + ReFlag = 2; + } + else if(ICNT86_Dev_Now.X[0] > 71 && ICNT86_Dev_Now.X[0] < 92 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Last page ...\r\n"); + if(Photo_S == 0) + printf("Top page ...\r\n"); + else { + Photo_S--; + ReFlag = 2; + } + } + else if(ICNT86_Dev_Now.X[0] > 5 && ICNT86_Dev_Now.X[0] < 27 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Refresh ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + else if(ICNT86_Dev_Now.X[0] > 2 && ICNT86_Dev_Now.X[0] < 293 && ICNT86_Dev_Now.Y[0] > 2 && ICNT86_Dev_Now.Y[0] < 96 && ReFlag == 0) { + printf("Select photo ...\r\n"); + Page = 3; + GUI_ReadBmp(PagePath_2in9[Page], 0, 0); + Photo_L = ICNT86_Dev_Now.X[0]/96 + ICNT86_Dev_Now.Y[0]/48*3 + Photo_S*3 + 1; + Show_Photo_Large_2in9(Photo_L); + ReFlag = 1; + } + if(ReFlag == 2) { // Refresh small photo + ReFlag = 1; + GUI_ReadBmp(PagePath_2in9[Page], 0, 0); + Show_Photo_Small_2in9(Photo_S); // show small photo + } + } + + if(Page == 3 && ReFlag == 0) { //view the photo + if(ICNT86_Dev_Now.X[0] > 268 && ICNT86_Dev_Now.X[0] < 289 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Photo menu ...\r\n"); + Page = 2; + GUI_ReadBmp(PagePath_2in9[Page], 0, 0); + Show_Photo_Small_2in9(Photo_S); + ReFlag = 1; + } + else if(ICNT86_Dev_Now.X[0] > 203 && ICNT86_Dev_Now.X[0] < 224 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Next photo ...\r\n"); + Photo_L++; + if(Photo_L > 9) + Photo_L=1; + ReFlag = 2; + } + else if(ICNT86_Dev_Now.X[0] > 135 && ICNT86_Dev_Now.X[0] < 160 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Home ...\r\n"); + Page = 0; + GUI_ReadBmp(PagePath_2in9[Page], 0, 0); + ReFlag = 1; + } + else if(ICNT86_Dev_Now.X[0] > 71 && ICNT86_Dev_Now.X[0] < 92 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Last page ...\r\n"); + if(Photo_L == 1) + printf("Top photo ...\r\n"); + else { + Photo_L--; + ReFlag = 2; + } + } + else if(ICNT86_Dev_Now.X[0] > 5 && ICNT86_Dev_Now.X[0] < 27 && ICNT86_Dev_Now.Y[0] > 101 && ICNT86_Dev_Now.Y[0] < 124) { + printf("Refresh photo ...\r\n"); + SelfFlag = 1; + ReFlag = 1; + } + if(ReFlag == 2) { // Refresh large photo + ReFlag = 1; + Show_Photo_Large_2in9(Photo_L); + } + } + + } + } + return 0; +} diff --git a/docs/Touch_e-Paper_Code/c/examples/Test.h b/docs/Touch_e-Paper_Code/c/examples/Test.h new file mode 100644 index 0000000..079dec7 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/examples/Test.h @@ -0,0 +1,15 @@ +#ifndef _MAIN_H_ +#define _MAIN_H_ + +#include //exit() +#include //signal() +#include //pthread_create() +#include "GUI_Paint.h" +#include "GUI_BMPfile.h" + +int TestCode_2in13(void); +int TestCode_2in13_V3(void); +int TestCode_2in13_V4(void); +int TestCode_2in9(void); + +#endif \ No newline at end of file diff --git a/docs/Touch_e-Paper_Code/c/examples/main.c b/docs/Touch_e-Paper_Code/c/examples/main.c new file mode 100644 index 0000000..3fcaeda --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/examples/main.c @@ -0,0 +1,10 @@ +#include "Test.h" + +int main() +{ + // TestCode_2in13(); + // TestCode_2in13_V3(); + // TestCode_2in13_V4(); + TestCode_2in9(); + return 0; +} diff --git a/docs/Touch_e-Paper_Code/c/lib/Config/DEV_Config.c b/docs/Touch_e-Paper_Code/c/lib/Config/DEV_Config.c new file mode 100644 index 0000000..fecd39d --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Config/DEV_Config.c @@ -0,0 +1,342 @@ +/***************************************************************************** +* | File : DEV_Config.c +* | Author : Waveshare team +* | Function : Hardware underlying interface +* | Info : +*---------------- +* | This version: V2.0 +* | Date : 2020-06-17 +* | Info : Basic version +* +******************************************************************************/ +#include "DEV_Config.h" +#include +#include + +#if USE_LGPIO_LIB +int GPIO_Handle; +int SPI_Handle; +int IIC_Handle; +#endif + +/** + * GPIO +**/ +int EPD_RST_PIN; +int EPD_DC_PIN; +int EPD_CS_PIN; +int EPD_BUSY_PIN; +int IIC_Address; + + +uint32_t fd; +/***************************************** + GPIO +*****************************************/ +void DEV_Digital_Write(UWORD Pin, UBYTE Value) +{ +#ifdef USE_BCM2835_LIB + bcm2835_gpio_write(Pin, Value); +#elif USE_WIRINGPI_LIB + digitalWrite(Pin, Value); +#elif USE_LGPIO_LIB + lgGpioWrite(GPIO_Handle, Pin, Value); +#elif USE_GPIOD_LIB + GPIOD_Write(Pin, Value); +#endif +} + +UBYTE DEV_Digital_Read(UWORD Pin) +{ + UBYTE Read_value = 0; +#ifdef USE_BCM2835_LIB + Read_value = bcm2835_gpio_lev(Pin); +#elif USE_WIRINGPI_LIB + Read_value = digitalRead(Pin); +#elif USE_LGPIO_LIB + Read_value = lgGpioRead(GPIO_Handle,Pin); +#elif USE_GPIOD_LIB + Read_value = GPIOD_Read(Pin); +#endif + return Read_value; +} + +void DEV_GPIO_Mode(UWORD Pin, UWORD Mode) +{ +#ifdef USE_BCM2835_LIB + if(Mode == 0 || Mode == BCM2835_GPIO_FSEL_INPT){ + bcm2835_gpio_fsel(Pin, BCM2835_GPIO_FSEL_INPT); + }else { + bcm2835_gpio_fsel(Pin, BCM2835_GPIO_FSEL_OUTP); + } +#elif USE_WIRINGPI_LIB + if(Mode == 0 || Mode == INPUT) { + pinMode(Pin, INPUT); + pullUpDnControl(Pin, PUD_UP); + } else { + pinMode(Pin, OUTPUT); + // Debug (" %d OUT \r\n",Pin); + } +#elif USE_LGPIO_LIB + if(Mode == 0 || Mode == LG_SET_INPUT){ + lgGpioClaimInput(GPIO_Handle,LFLAGS,Pin); + // Debug("IN Pin = %d\r\n",Pin); + }else{ + lgGpioClaimOutput(GPIO_Handle, LFLAGS, Pin, LG_LOW); + // Debug("OUT Pin = %d\r\n",Pin); + } +#elif USE_GPIOD_LIB + if(Mode == 0 || Mode == GPIOD_IN){ + GPIOD_Direction(Pin, GPIOD_IN); + // Debug("IN Pin = %d\r\n",Pin); + }else{ + GPIOD_Direction(Pin, GPIOD_OUT); + // Debug("OUT Pin = %d\r\n",Pin); + } +#endif +} + +/** + * delay x ms +**/ +void DEV_Delay_ms(UDOUBLE xms) +{ +#ifdef USE_BCM2835_LIB + bcm2835_delay(xms); +#elif USE_WIRINGPI_LIB + delay(xms); +#elif USE_LGPIO_LIB + lguSleep(xms/1000.0); +#elif USE_GPIOD_LIB + UDOUBLE i; + for(i=0; i < xms; i++){ + usleep(1000); + } +#endif +} + +static void DEV_GPIO_Init(void) +{ + EPD_RST_PIN = 17; + EPD_DC_PIN = 25; + EPD_CS_PIN = 8; + EPD_BUSY_PIN = 24; + + DEV_GPIO_Mode(EPD_RST_PIN, 1); + DEV_GPIO_Mode(EPD_DC_PIN, 1); + DEV_GPIO_Mode(EPD_CS_PIN, 1); + DEV_GPIO_Mode(EPD_BUSY_PIN, 0); + + DEV_Digital_Write(EPD_CS_PIN, 1); + + DEV_GPIO_Mode(TRST, 1); + DEV_GPIO_Mode(INT, 0); +} + +/****************************************************************************** +function: Module Initialize, the library and initialize the pins, SPI protocol +parameter: +Info: +******************************************************************************/ +UBYTE DEV_ModuleInit(void) +{ + #ifdef USE_BCM2835_LIB + if(!bcm2835_init()) { + printf("bcm2835 init failed !!! \r\n"); + return 1; + } else { + printf("bcm2835 init success !!! \r\n"); + } + + DEV_GPIO_Init(); + + bcm2835_i2c_begin(); + bcm2835_i2c_setSlaveAddress(IIC_Address); + // bcm2835_i2c_setClockDivider(BCM2835_I2C_CLOCK_DIVIDER_2500); + + bcm2835_spi_begin(); //Start spi interface, set spi pin for the reuse function + bcm2835_spi_setBitOrder(BCM2835_SPI_BIT_ORDER_MSBFIRST); //High first transmission + bcm2835_spi_setDataMode(BCM2835_SPI_MODE0); //spi mode 0 + bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_32); //Frequency + bcm2835_spi_chipSelect(BCM2835_SPI_CS0); //set CE0 + bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS0, LOW); //enable cs0 +#elif USE_WIRINGPI_LIB + // if(wiringPiSetup() < 0) {//use wiringpi Pin number table + if(wiringPiSetupGpio() < 0) { //use BCM2835 Pin number table + printf("set wiringPi lib failed !!! \r\n"); + return 1; + } else { + printf("set wiringPi lib success !!! \r\n"); + } + // GPIO Config + DEV_GPIO_Init(); + + // wiringPiSPISetup(0,10000000); + wiringPiSPISetupMode(0, 10000000, 0); + fd = wiringPiI2CSetup(IIC_Address); + + DEV_HARDWARE_I2C_begin("/dev/i2c-1"); + DEV_HARDWARE_I2C_setSlaveAddress(IIC_Address); +#elif USE_LGPIO_LIB + char buffer[NUM_MAXBUF]; + FILE *fp; + + fp = popen("cat /proc/cpuinfo | grep 'Raspberry Pi 5'", "r"); + if (fp == NULL) { + Debug("It is not possible to determine the model of the Raspberry PI\n"); + return -1; + } + + if(fgets(buffer, sizeof(buffer), fp) != NULL) + { + GPIO_Handle = lgGpiochipOpen(4); + if (GPIO_Handle < 0) + { + Debug( "gpiochip4 Export Failed\n"); + return -1; + } + } + else + { + GPIO_Handle = lgGpiochipOpen(0); + if (GPIO_Handle < 0) + { + Debug( "gpiochip0 Export Failed\n"); + return -1; + } + } + SPI_Handle = lgSpiOpen(0, 0, 10000000, 0); + IIC_Handle = lgI2cOpen(1,IIC_Address,0); + DEV_GPIO_Init(); +#elif USE_GPIOD_LIB + GPIOD_Export(); + DEV_GPIO_Init(); + + DEV_HARDWARE_I2C_begin("/dev/i2c-1"); + DEV_HARDWARE_I2C_setSlaveAddress(IIC_Address); + + DEV_HARDWARE_SPI_begin("/dev/spidev0.0"); + DEV_HARDWARE_SPI_setSpeed(10000000); +#endif + return 0; +} + +/** + * SPI +**/ +void DEV_SPI_WriteByte(uint8_t Value) +{ +#ifdef USE_BCM2835_LIB + bcm2835_spi_transfer(Value); +#elif USE_WIRINGPI_LIB + wiringPiSPIDataRW(0, &Value, 1); +#elif USE_LGPIO_LIB + lgSpiWrite(SPI_Handle,(char*)&Value, 1); +#elif USE_GPIOD_LIB + DEV_HARDWARE_SPI_TransferByte(Value); +#endif +} + +void DEV_SPI_Write_nByte(uint8_t *pData, uint32_t Len) +{ +#ifdef USE_BCM2835_LIB + char rData[Len]; + bcm2835_spi_transfernb(pData, rData, Len); +#elif USE_WIRINGPI_LIB + wiringPiSPIDataRW(0, pData, Len); +#elif USE_LGPIO_LIB + lgSpiWrite(SPI_Handle,(char*)pData, Len); +#elif USE_GPIOD_LIB + DEV_HARDWARE_SPI_Transfer(pData, Len); +#endif +} + +UBYTE I2C_Write_Byte(UWORD Reg, char *Data, UBYTE len) +{ + char wbuf[50]={(Reg>>8)&0xff, Reg&0xff}; + for(UBYTE i=0; i 1) + printf("wiringPi I2C WARING \r\n"); + wiringPiI2CWriteReg16(fd, wbuf[0], wbuf[1] | (wbuf[2]<<8)); +#elif USE_LGPIO_LIB + lgI2cWriteDevice(IIC_Handle, wbuf, len+2); +#elif USE_GPIOD_LIB + DEV_HARDWARE_I2C_write(wbuf, len+2); +#endif + + return 0; +} + +#ifdef USE_WIRINGPI_LIB +static I2C_Write_WiringPi(UWORD Reg) +{ + wiringPiI2CWriteReg8(fd, (Reg>>8) & 0xff, Reg & 0xff); +} +#endif + +UBYTE I2C_Read_Byte(UWORD Reg, char *Data, UBYTE len) +{ + char *rbuf = Data; + +#ifdef USE_BCM2835_LIB + I2C_Write_Byte(Reg, 0, 0); + if(bcm2835_i2c_read(rbuf, len) != BCM2835_I2C_REASON_OK) { + printf("READ ERROR \r\n"); + return -1; + } +#elif USE_WIRINGPI_LIB + I2C_Write_WiringPi(Reg); + for(UBYTE i=0; i +#elif USE_WIRINGPI_LIB + #include + #include + #include + #include "dev_hardware_i2c.h" +#elif USE_LGPIO_LIB + #include + #define LFLAGS 0 + #define NUM_MAXBUF 4 +#elif USE_GPIOD_LIB + #include "RPI_gpiod.h" + #include "dev_hardware_i2c.h" + #include "dev_hardware_SPI.h" +#endif + +#include +#include +#include +#include +#include +#include "Debug.h" + +// #define IIC_Address 0x14 +// #define IIC_Address_Read 0x29 +// #define IIC_Address_Write 0x28 + +/** + * data +**/ +#define UBYTE uint8_t +#define UWORD uint16_t +#define UDOUBLE uint32_t + +//TP Define +#define TRST 22 +#define INT 27 + +#define TRST_0 DEV_Digital_Write(TRST, 0) +#define TRST_1 DEV_Digital_Write(TRST, 1) + +#define INT_0 DEV_Digital_Write(INT, 0) +#define INT_1 DEV_Digital_Write(INT, 1) + +/** + * GPIOI config +**/ +extern int EPD_RST_PIN; +extern int EPD_DC_PIN; +extern int EPD_CS_PIN; +extern int EPD_BUSY_PIN; + +/*------------------------------------------------------------------------------------------------------*/ + +UBYTE DEV_ModuleInit(void); +void DEV_ModuleExit(void); + +void DEV_GPIO_Mode(UWORD Pin, UWORD Mode); +void DEV_Delay_ms(UDOUBLE xms); + +void DEV_Digital_Write(UWORD Pin, UBYTE Value); +UBYTE DEV_Digital_Read(UWORD Pin); + +void DEV_SPI_WriteByte(UBYTE Value); +void DEV_SPI_Write_nByte(uint8_t *pData, uint32_t Len); + +UBYTE I2C_Write_Byte(UWORD Reg, char *Data, UBYTE len); +UBYTE I2C_Read_Byte(UWORD Reg, char *Data, UBYTE len); +#endif diff --git a/docs/Touch_e-Paper_Code/c/lib/Config/Debug.h b/docs/Touch_e-Paper_Code/c/lib/Config/Debug.h new file mode 100644 index 0000000..b92a411 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Config/Debug.h @@ -0,0 +1,47 @@ +/***************************************************************************** +* | File : Debug.h +* | Author : Waveshare team +* | Function : debug with printf +* | Info : +* Image scanning +* Please use progressive scanning to generate images or fonts +*---------------- +* | This version: V2.0 +* | Date : 2020-06-17 +* | Info : +* 1.USE_DEBUG -> DEBUG, If you need to see the debug information, +* clear the execution: make DEBUG=-DDEBUG +# +# 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 __DEBUG_H +#define __DEBUG_H + +#include + +#if 1 + #define Debug(__info,...) printf("Debug: " __info,##__VA_ARGS__) +#else + #define Debug(__info,...) +#endif + +#endif + diff --git a/docs/Touch_e-Paper_Code/c/lib/Config/RPI_gpiod.c b/docs/Touch_e-Paper_Code/c/lib/Config/RPI_gpiod.c new file mode 100644 index 0000000..130ca69 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Config/RPI_gpiod.c @@ -0,0 +1,170 @@ +/***************************************************************************** +* | File : RPI_GPIOD.c +* | Author : Waveshare team +* | Function : Drive GPIO +* | Info : Read and write gpio +*---------------- +* | This version: V1.0 +* | Date : 2023-11-15 +* | Info : Basic version +* +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documnetation files (the "Software"), to deal +# GPIOD_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 folGPIOD_LOWing conditions: +# +# The above copyright notice and this permission notice shall be included GPIOD_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. GPIOD_IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY WHETHER GPIOD_IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# GPIOD_OUT OF OR GPIOD_IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS GPIOD_IN +# THE SOFTWARE. +# +******************************************************************************/ +#include "RPI_gpiod.h" +#include +#include +#include +#include +#include +#include +#include +#include + +struct gpiod_chip *gpiochip; +struct gpiod_line *gpioline; +int ret; + +int GPIOD_Export() +{ + char buffer[NUM_MAXBUF]; + FILE *fp; + + fp = popen("cat /proc/cpuinfo | grep 'Raspberry Pi 5'", "r"); + if (fp == NULL) { + GPIOD_Debug("It is not possible to determine the model of the Raspberry PI\n"); + return -1; + } + + if(fgets(buffer, sizeof(buffer), fp) != NULL) + { + gpiochip = gpiod_chip_open("/dev/gpiochip4"); + if (gpiochip == NULL) + { + GPIOD_Debug( "gpiochip4 Export Failed\n"); + return -1; + } + } + else + { + gpiochip = gpiod_chip_open("/dev/gpiochip0"); + if (gpiochip == NULL) + { + GPIOD_Debug( "gpiochip0 Export Failed\n"); + return -1; + } + } + + + return 0; +} + +int GPIOD_Unexport(int Pin) +{ + gpioline = gpiod_chip_get_line(gpiochip, Pin); + if (gpioline == NULL) + { + GPIOD_Debug( "Export Failed: Pin%d\n", Pin); + return -1; + } + + gpiod_line_release(gpioline); + + GPIOD_Debug( "Unexport: Pin%d\r\n", Pin); + + return 0; +} + +int GPIOD_Unexport_GPIO(void) +{ + gpiod_line_release(gpioline); + gpiod_chip_close(gpiochip); + + return 0; +} + +int GPIOD_Direction(int Pin, int Dir) +{ + gpioline = gpiod_chip_get_line(gpiochip, Pin); + if (gpioline == NULL) + { + GPIOD_Debug( "Export Failed: Pin%d\n", Pin); + return -1; + } + + if(Dir == GPIOD_IN) + { + ret = gpiod_line_request_input(gpioline, "gpio"); + if (ret != 0) + { + GPIOD_Debug( "Export Failed: Pin%d\n", Pin); + return -1; + } + GPIOD_Debug("Pin%d:intput\r\n", Pin); + } + else + { + ret = gpiod_line_request_output(gpioline, "gpio", 0); + if (ret != 0) + { + GPIOD_Debug( "Export Failed: Pin%d\n", Pin); + return -1; + } + GPIOD_Debug("Pin%d:Output\r\n", Pin); + } + return 0; +} + +int GPIOD_Read(int Pin) +{ + gpioline = gpiod_chip_get_line(gpiochip, Pin); + if (gpioline == NULL) + { + GPIOD_Debug( "Export Failed: Pin%d\n", Pin); + return -1; + } + + ret = gpiod_line_get_value(gpioline); + if (ret < 0) + { + GPIOD_Debug( "failed to read value!\n"); + return -1; + } + + return(ret); +} + +int GPIOD_Write(int Pin, int value) +{ + gpioline = gpiod_chip_get_line(gpiochip, Pin); + if (gpioline == NULL) + { + GPIOD_Debug( "Export Failed: Pin%d\n", Pin); + return -1; + } + + ret = gpiod_line_set_value(gpioline, value); + if (ret != 0) + { + GPIOD_Debug( "failed to write value! : Pin%d\n", Pin); + return -1; + } + return 0; +} diff --git a/docs/Touch_e-Paper_Code/c/lib/Config/RPI_gpiod.h b/docs/Touch_e-Paper_Code/c/lib/Config/RPI_gpiod.h new file mode 100644 index 0000000..60712fe --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Config/RPI_gpiod.h @@ -0,0 +1,88 @@ +/***************************************************************************** +* | File : gpiod.h +* | Author : Waveshare team +* | Function : Drive GPIO +* | Info : Read and write gpio +*---------------- +* | This version: V1.0 +* | Date : 2023-11-15 +* | Info : Basic version +*d +# +# 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: +#D +# 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. +# +************************D******************************************************/ +#ifndef __GPIOD_ +#define __GPIOD_ + +#include +#include + +#define GPIOD_IN 0 +#define GPIOD_OUT 1 + +#define GPIOD_LOW 0 +#define GPIOD_HIGH 1 + +#define NUM_MAXBUF 4 +#define DIR_MAXSIZ 60 + +#define GPIOD_DEBUG 0 +#if GPIOD_DEBUG + #define GPIOD_Debug(__info,...) printf("Debug: " __info,##__VA_ARGS__) +#else + #define GPIOD_Debug(__info,...) +#endif + +// BCM GPIO for Jetson nano +#define GPIO4 4 // 7, 4 +#define GPIO17 7 // 11, 17 +#define GPIO18 18 // 12, 18 +#define GPIO27 27 // 13, 27 +#define GPIO22 22 // 15, 22 +#define GPIO23 23 // 16, 23 +#define GPIO24 24 // 18, 24 +#define SPI0_MOSI 10 // 19, 10 +#define SPI0_MISO 9 // 21, 9 +#define GPIO25 28 // 22, 25 +#define SPI0_SCK 11 // 23, 11 +#define SPI0_CS0 8 // 24, 8 +#define SPI0_CS1 7 // 26, 7 +#define GPIO5 5 // 29, 5 +#define GPIO6 6 // 31, 6 +#define GPIO12 12 // 32, 12 +#define GPIO13 13 // 33, 13 +#define GPIO19 19 // 35, 19 +#define GPIO16 16 // 36, 16 +#define GPIO26 26 // 37, 26 +#define GPIO20 20 // 38, 20 +#define GPIO21 21 // 40, 21 + +extern struct gpiod_chip *gpiochip; +extern struct gpiod_line *gpioline; +extern int ret; + +int GPIOD_Export(); +int GPIOD_Unexport(int Pin); +int GPIOD_Unexport_GPIO(void); +int GPIOD_Direction(int Pin, int Dir); +int GPIOD_Read(int Pin); +int GPIOD_Write(int Pin, int value); + +#endif \ No newline at end of file diff --git a/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_SPI.c b/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_SPI.c new file mode 100644 index 0000000..4738b7b --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_SPI.c @@ -0,0 +1,363 @@ +/***************************************************************************** +* | File : dev_hardware_SPI.c +* | Author : Waveshare team +* | Function : Read and write /dev/SPI, hardware SPI +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2019-06-26 +* | Info : Basic version +* +# +# 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 "dev_hardware_SPI.h" + + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +HARDWARE_SPI hardware_SPI; + +static uint8_t bits = 8; + +#define SPI_CS_HIGH 0x04 //Chip select high +#define SPI_LSB_FIRST 0x08 //LSB +#define SPI_3WIRE 0x10 //3-wire mode SI and SO same line +#define SPI_LOOP 0x20 //Loopback mode +#define SPI_NO_CS 0x40 //A single device occupies one SPI bus, so there is no chip select +#define SPI_READY 0x80 //Slave pull low to stop data transmission + +struct spi_ioc_transfer tr; + + +/****************************************************************************** +function: SPI port initialization +parameter: + SPI_device : Device name +Info: + /dev/spidev0.0 + /dev/spidev0.1 +******************************************************************************/ +void DEV_HARDWARE_SPI_begin(char *SPI_device) +{ + //device + int ret = 0; + if((hardware_SPI.fd = open(SPI_device, O_RDWR )) < 0) { + perror("Failed to open SPI device.\n"); + DEV_HARDWARE_SPI_Debug("Failed to open SPI device\r\n"); + exit(1); + } else { + DEV_HARDWARE_SPI_Debug("open : %s\r\n", SPI_device); + } + hardware_SPI.mode = 0; + + ret = ioctl(hardware_SPI.fd, SPI_IOC_WR_BITS_PER_WORD, &bits); + if (ret == -1) { + DEV_HARDWARE_SPI_Debug("can't set bits per word\r\n"); + } + + ret = ioctl(hardware_SPI.fd, SPI_IOC_RD_BITS_PER_WORD, &bits); + if (ret == -1) { + DEV_HARDWARE_SPI_Debug("can't get bits per word\r\n"); + } + tr.bits_per_word = bits; + + DEV_HARDWARE_SPI_Mode(SPI_MODE_0); + DEV_HARDWARE_SPI_ChipSelect(SPI_CS_Mode_LOW); + DEV_HARDWARE_SPI_SetBitOrder(SPI_BIT_ORDER_LSBFIRST); + DEV_HARDWARE_SPI_setSpeed(20000000); + DEV_HARDWARE_SPI_SetDataInterval(0); +} + +void DEV_HARDWARE_SPI_beginSet(char *SPI_device, SPIMode mode, uint32_t speed) +{ + //device + int ret = 0; + hardware_SPI.mode = 0; + if((hardware_SPI.fd = open(SPI_device, O_RDWR )) < 0) { + perror("Failed to open SPI device.\n"); + exit(1); + } else { + DEV_HARDWARE_SPI_Debug("open : %s\r\n", SPI_device); + } + + ret = ioctl(hardware_SPI.fd, SPI_IOC_WR_BITS_PER_WORD, &bits); + if (ret == -1) + DEV_HARDWARE_SPI_Debug("can't set bits per word\r\n"); + + ret = ioctl(hardware_SPI.fd, SPI_IOC_RD_BITS_PER_WORD, &bits); + if (ret == -1) + DEV_HARDWARE_SPI_Debug("can't get bits per word\r\n"); + + DEV_HARDWARE_SPI_Mode(mode); + DEV_HARDWARE_SPI_ChipSelect(SPI_CS_Mode_LOW); + DEV_HARDWARE_SPI_setSpeed(speed); + DEV_HARDWARE_SPI_SetDataInterval(0); +} + + +/****************************************************************************** +function: SPI device End +parameter: +Info: +******************************************************************************/ +void DEV_HARDWARE_SPI_end(void) +{ + hardware_SPI.mode = 0; + if (close(hardware_SPI.fd) != 0){ + DEV_HARDWARE_SPI_Debug("Failed to close SPI device\r\n"); + perror("Failed to close SPI device.\n"); + } +} + +/****************************************************************************** +function: Set SPI speed +parameter: +Info: Return 1 success + Return -1 failed +******************************************************************************/ +int DEV_HARDWARE_SPI_setSpeed(uint32_t speed) +{ + uint32_t speed1 = hardware_SPI.speed; + + hardware_SPI.speed = speed; + + //Write speed + if (ioctl(hardware_SPI.fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed) == -1) { + DEV_HARDWARE_SPI_Debug("can't set max speed hz\r\n"); + hardware_SPI.speed = speed1;//Setting failure rate unchanged + return -1; + } + + //Read the speed of just writing + if (ioctl(hardware_SPI.fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) == -1) { + DEV_HARDWARE_SPI_Debug("can't get max speed hz\r\n"); + hardware_SPI.speed = speed1;//Setting failure rate unchanged + return -1; + } + hardware_SPI.speed = speed; + tr.speed_hz = hardware_SPI.speed; + return 1; +} + +/****************************************************************************** +function: Set SPI Mode +parameter: +Info: + SPIMode: + SPI_MODE0 + SPI_MODE1 + SPI_MODE2 + SPI_MODE3 + Return : + Return 1 success + Return -1 failed +******************************************************************************/ +int DEV_HARDWARE_SPI_Mode(SPIMode mode) +{ + hardware_SPI.mode &= 0xfC;//Clear low 2 digits + hardware_SPI.mode |= mode;//Setting mode + + //Write device + if (ioctl(hardware_SPI.fd, SPI_IOC_WR_MODE, &hardware_SPI.mode) == -1) { + DEV_HARDWARE_SPI_Debug("can't set spi mode\r\n"); + return -1; + } + return 1; +} + +/****************************************************************************** +function: Set SPI CS Enable +parameter: +Info: + EN: + DISABLE + ENABLE + Return : + Return 1 success + Return -1 failed +******************************************************************************/ +int DEV_HARDWARE_SPI_CSEN(SPICSEN EN) +{ + if(EN == ENABLE){ + hardware_SPI.mode |= SPI_NO_CS; + }else { + hardware_SPI.mode &= ~SPI_NO_CS; + } + //Write device + if (ioctl(hardware_SPI.fd, SPI_IOC_WR_MODE, &hardware_SPI.mode) == -1) { + DEV_HARDWARE_SPI_Debug("can't set spi CS EN\r\n"); + return -1; + } + return 1; +} + +/****************************************************************************** +function: Chip Select +parameter: +Info: + CS_Mode: + SPI_CS_Mode_LOW + SPI_CS_Mode_HIGH + SPI_CS_Mode_NONE + Return : + Return 1 success + Return -1 failed +******************************************************************************/ +int DEV_HARDWARE_SPI_ChipSelect(SPIChipSelect CS_Mode) +{ + if(CS_Mode == SPI_CS_Mode_HIGH){ + hardware_SPI.mode |= SPI_CS_HIGH; + hardware_SPI.mode &= ~SPI_NO_CS; + DEV_HARDWARE_SPI_Debug("CS HIGH \r\n"); + }else if(CS_Mode == SPI_CS_Mode_LOW){ + hardware_SPI.mode &= ~SPI_CS_HIGH; + hardware_SPI.mode &= ~SPI_NO_CS; + }else if(CS_Mode == SPI_CS_Mode_NONE){ + hardware_SPI.mode |= SPI_NO_CS; + } + + if (ioctl(hardware_SPI.fd, SPI_IOC_WR_MODE, &hardware_SPI.mode) == -1) { + DEV_HARDWARE_SPI_Debug("can't set spi mode\r\n"); + return -1; + } + return 1; +} + +/****************************************************************************** +function: Sets the SPI bit order +parameter: +Info: + Order: + SPI_BIT_ORDER_LSBFIRST + SPI_BIT_ORDER_MSBFIRST + Return : + Return 1 success + Return -1 failed +******************************************************************************/ +int DEV_HARDWARE_SPI_SetBitOrder(SPIBitOrder Order) +{ + if(Order == SPI_BIT_ORDER_LSBFIRST){ + hardware_SPI.mode |= SPI_LSB_FIRST; + DEV_HARDWARE_SPI_Debug("SPI_LSB_FIRST\r\n"); + }else if(Order == SPI_BIT_ORDER_MSBFIRST){ + hardware_SPI.mode &= ~SPI_LSB_FIRST; + DEV_HARDWARE_SPI_Debug("SPI_MSB_FIRST\r\n"); + } + + // DEV_HARDWARE_SPI_Debug("hardware_SPI.mode = 0x%02x\r\n", hardware_SPI.mode); + int fd = ioctl(hardware_SPI.fd, SPI_IOC_WR_MODE, &hardware_SPI.mode); + DEV_HARDWARE_SPI_Debug("fd = %d\r\n",fd); + if (fd == -1) { + DEV_HARDWARE_SPI_Debug("can't set spi SPI_LSB_FIRST\r\n"); + return -1; + } + return 1; +} + +/****************************************************************************** +function: Sets the SPI Bus Mode +parameter: +Info: + Order: + SPI_3WIRE_Mode + SPI_4WIRE_Mode + Return : + Return 1 success + Return -1 failed +******************************************************************************/ +int DEV_HARDWARE_SPI_SetBusMode(BusMode mode) +{ + if(mode == SPI_3WIRE_Mode){ + hardware_SPI.mode |= SPI_3WIRE; + }else if(mode == SPI_4WIRE_Mode){ + hardware_SPI.mode &= ~SPI_3WIRE; + } + if (ioctl(hardware_SPI.fd, SPI_IOC_WR_MODE, &hardware_SPI.mode) == -1) { + DEV_HARDWARE_SPI_Debug("can't set spi mode\r\n"); + return -1; + } + return 1; +} + +/****************************************************************************** +function: + Time interval after transmission of one byte during continuous transmission +parameter: + us : Interval time (us) +Info: +******************************************************************************/ +void DEV_HARDWARE_SPI_SetDataInterval(uint16_t us) +{ + hardware_SPI.delay = us; + tr.delay_usecs = hardware_SPI.delay; +} + +/****************************************************************************** +function: SPI port sends one byte of data +parameter: + buf : Sent data +Info: +******************************************************************************/ +uint8_t DEV_HARDWARE_SPI_TransferByte(uint8_t buf) +{ + uint8_t rbuf[1]; + tr.len = 1; + tr.tx_buf = (unsigned long)&buf; + tr.rx_buf = (unsigned long)rbuf; + + //ioctl Operation, transmission of data + if ( ioctl(hardware_SPI.fd, SPI_IOC_MESSAGE(1), &tr) < 1 ) + DEV_HARDWARE_SPI_Debug("can't send spi message\r\n"); + return rbuf[0]; +} + +/****************************************************************************** +function: The SPI port reads a byte +parameter: +Info: Return read data +******************************************************************************/ +int DEV_HARDWARE_SPI_Transfer(uint8_t *buf, uint32_t len) +{ + uint8_t rbuf[len]; + tr.len = len; + tr.tx_buf = (unsigned long)buf; + tr.rx_buf = (unsigned long)rbuf; + + //ioctl Operation, transmission of data + if (ioctl(hardware_SPI.fd, SPI_IOC_MESSAGE(1), &tr) < 1 ){ + DEV_HARDWARE_SPI_Debug("can't send spi message\r\n"); + return -1; + } + + return 1; +} + diff --git a/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_SPI.h b/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_SPI.h new file mode 100644 index 0000000..c80de24 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_SPI.h @@ -0,0 +1,120 @@ +/***************************************************************************** +* | File : dev_hardware_SPI.h +* | Author : Waveshare team +* | Function : Read and write /dev/SPI, hardware SPI +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2019-06-26 +* | Info : Basic version +* +# +# 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 __DEV_HARDWARE_SPI_ +#define __DEV_HARDWARE_SPI_ + +#include + +#define DEV_HARDWARE_SPI_DEBUG 0 +#if DEV_HARDWARE_SPI_DEBUG +#define DEV_HARDWARE_SPI_Debug(__info,...) printf("Debug: " __info,##__VA_ARGS__) +#else +#define DEV_HARDWARE_SPI_Debug(__info,...) +#endif + +#define SPI_CPHA 0x01 +#define SPI_CPOL 0x02 +#define SPI_MODE_0 (0|0) +#define SPI_MODE_1 (0|SPI_CPHA) +#define SPI_MODE_2 (SPI_CPOL|0) +#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) + +typedef enum{ + SPI_MODE0 = SPI_MODE_0, /*!< CPOL = 0, CPHA = 0 */ + SPI_MODE1 = SPI_MODE_1, /*!< CPOL = 0, CPHA = 1 */ + SPI_MODE2 = SPI_MODE_2, /*!< CPOL = 1, CPHA = 0 */ + SPI_MODE3 = SPI_MODE_3 /*!< CPOL = 1, CPHA = 1 */ +}SPIMode; + +typedef enum{ + DISABLE = 0, + ENABLE = 1 +}SPICSEN; + +typedef enum{ + SPI_CS_Mode_LOW = 0, /*!< Chip Select 0 */ + SPI_CS_Mode_HIGH = 1, /*!< Chip Select 1 */ + SPI_CS_Mode_NONE = 3 /*!< No CS, control it yourself */ +}SPIChipSelect; + +typedef enum +{ + SPI_BIT_ORDER_LSBFIRST = 0, /*!< LSB First */ + SPI_BIT_ORDER_MSBFIRST = 1 /*!< MSB First */ +}SPIBitOrder; + +typedef enum +{ + SPI_3WIRE_Mode = 0, + SPI_4WIRE_Mode = 1 +}BusMode; + + +/** + * Define SPI attribute +**/ +typedef struct SPIStruct { + //GPIO + uint16_t SCLK_PIN; + uint16_t MOSI_PIN; + uint16_t MISO_PIN; + + uint16_t CS0_PIN; + uint16_t CS1_PIN; + + + uint32_t speed; + uint16_t mode; + uint16_t delay; + int fd; // +} HARDWARE_SPI; + + + + +void DEV_HARDWARE_SPI_begin(char *SPI_device); +void DEV_HARDWARE_SPI_beginSet(char *SPI_device, SPIMode mode, uint32_t speed); +void DEV_HARDWARE_SPI_end(void); + +int DEV_HARDWARE_SPI_setSpeed(uint32_t speed); + +uint8_t DEV_HARDWARE_SPI_TransferByte(uint8_t buf); +int DEV_HARDWARE_SPI_Transfer(uint8_t *buf, uint32_t len); + +void DEV_HARDWARE_SPI_SetDataInterval(uint16_t us); +int DEV_HARDWARE_SPI_SetBusMode(BusMode mode); +int DEV_HARDWARE_SPI_SetBitOrder(SPIBitOrder Order); +int DEV_HARDWARE_SPI_ChipSelect(SPIChipSelect CS_Mode); +int DEV_HARDWARE_SPI_CSEN(SPICSEN EN); +int DEV_HARDWARE_SPI_Mode(SPIMode mode); + + +#endif \ No newline at end of file diff --git a/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_i2c.c b/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_i2c.c new file mode 100644 index 0000000..335ab88 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_i2c.c @@ -0,0 +1,112 @@ +/***************************************************************************** +* | File : dev_hardware_i2c.c +* | Author : Waveshare team +* | Function : Read and write /dev/i2C, hardware I2C +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2019-06-26 +* | Info : Basic version +* +# +# 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 "dev_hardware_i2c.h" + +#include +#include //exit() +#include //define O_RDWR +#include +#include +#include +#include + + +HARDWARE_I2C hardware_i2c; + +/****************************************************************************** +function: I2C device initialization +parameter: + i2c_device : Device name +Info: /dev/i2c-* +******************************************************************************/ +void DEV_HARDWARE_I2C_begin(char *i2c_device) +{ + //device + if((hardware_i2c.fd = open(i2c_device, O_RDWR)) < 0) { //open I2C + perror("Failed to open i2c device.\n"); + printf("Failed to open i2c device\r\n"); + exit(1); + } else { + DEV_HARDWARE_I2C_Debug("open : %s\r\n", i2c_device); + } +} + +/****************************************************************************** +function: I2C device End +parameter: +Info: +******************************************************************************/ +void DEV_HARDWARE_I2C_end(void) +{ + if (close(hardware_i2c.fd) != 0){ + perror("Failed to close i2c device.\n"); + } +} + +/****************************************************************************** +function: Set the device address for I2C access +parameter: + addr : Device address accessed by I2C +Info: +******************************************************************************/ +void DEV_HARDWARE_I2C_setSlaveAddress(uint8_t addr) +{ + if(ioctl(hardware_i2c.fd, I2C_SLAVE, addr) < 0) { + printf("Failed to access bus.\n"); + exit(1); + } +} + +/****************************************************************************** +function: I2C Send data +parameter: + buf : Send data buffer address + len : Send data length +Info: +******************************************************************************/ +uint8_t DEV_HARDWARE_I2C_write(const char * buf, uint32_t len) +{ + write(hardware_i2c.fd, buf, len); + return 0; +} + +/****************************************************************************** +function: I2C read data +parameter: + buf : Sead data buffer address + len : Sead data length +Info: +******************************************************************************/ +uint8_t DEV_HARDWARE_I2C_read(char* buf, uint32_t len) +{ + read(hardware_i2c.fd, buf, len); + return 0; +} \ No newline at end of file diff --git a/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_i2c.h b/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_i2c.h new file mode 100644 index 0000000..4c78d06 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Config/dev_hardware_i2c.h @@ -0,0 +1,61 @@ +/***************************************************************************** +* | File : dev_hardware_i2c.h +* | Author : Waveshare team +* | Function : Read and write /dev/i2C, hardware I2C +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2019-06-26 +* | Info : Basic version +* +# +# 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 __DEV_HARDWARE_I2C_ +#define __DEV_HARDWARE_I2C_ + +#include + + +#define DEV_HARDWARE_I2C_DEBUG 0 +#if DEV_HARDWARE_I2C_DEBUG +#define DEV_HARDWARE_I2C_Debug(__info,...) printf("Debug: " __info,##__VA_ARGS__) +#else +#define DEV_HARDWARE_I2C_Debug(__info,...) +#endif + +/** + * Define I2C attribute +**/ +typedef struct I2CStruct { + //GPIO + uint16_t SCL_PIN; + uint16_t SDA_PIN; + + int fd; //I2C device file descriptor + uint16_t addr; //I2C device address +} HARDWARE_I2C; + +void DEV_HARDWARE_I2C_begin(char *i2c_device); +void DEV_HARDWARE_I2C_end(void); +void DEV_HARDWARE_I2C_setSlaveAddress(uint8_t addr); +uint8_t DEV_HARDWARE_I2C_write(const char * buf, uint32_t len); +uint8_t DEV_HARDWARE_I2C_read(char* buf, uint32_t len); +#endif \ No newline at end of file diff --git a/docs/Touch_e-Paper_Code/c/lib/Driver/GT1151.c b/docs/Touch_e-Paper_Code/c/lib/Driver/GT1151.c new file mode 100644 index 0000000..e01bd36 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Driver/GT1151.c @@ -0,0 +1,121 @@ +#include "GT1151.h" + +GT1151_Dev Dev_Now, Dev_Old; +UBYTE GT_Gesture_Mode = 0; + +void GT_Reset(void) +{ + TRST_1; + DEV_Delay_ms(100); + TRST_0; + DEV_Delay_ms(100); + TRST_1; + DEV_Delay_ms(100); +} + +void GT_Write(UWORD Reg, char *Data, UBYTE len) +{ + I2C_Write_Byte(Reg, Data, len); +} + +void GT_Read(UWORD Reg, char *Data, UBYTE len) +{ + I2C_Read_Byte(Reg, Data, len); +} + +void GT_ReadVersion(void) +{ + char buf[4]; + GT_Read(0x8140, buf, 4); + printf("Product ID is %c %c %c %c \r\n", buf[0], buf[1], buf[2] ,buf[3]); +} + +void GT_Init(void) +{ + GT_Reset(); + GT_ReadVersion(); +} + +void GT_Gesture(void) +{ + char buf[3] ={0x08, 0x00, 0xf8}; + GT_Write(0x8040, &buf[0], 1); + GT_Write(0x8041, &buf[1], 1); + GT_Write(0x8042, &buf[2], 1); + GT_Gesture_Mode = 1; + printf("into gesture mode \r\n"); + DEV_Delay_ms(1); +} + +void GT_Gesture_Scan(void) +{ + char buf; + GT_Read(0x814c, &buf, 1); + if(buf == 0xcc) + { + printf("gesture mode exiting \r\n"); + GT_Gesture_Mode = 0; + GT_Reset(); + Dev_Old.X[0] = Dev_Now.X[0]; + Dev_Old.Y[0] = Dev_Now.Y[0]; + Dev_Old.S[0] = Dev_Now.S[0]; + } + else + { + buf = 0x00; + GT_Write(0x814c, &buf, 1); + } + +} + +UBYTE GT_Scan(void) +{ + char buf[100]; + char mask[1] = {0x00}; + + if (Dev_Now.Touch == 1) { + // Dev_Now.Touch = 0; + if(GT_Gesture_Mode == 1) + { + GT_Gesture_Scan(); + return 1; + } + else + { + GT_Read(0x814E, buf, 1); + if ((buf[0]&0x80) == 0x00) { //No new touch + GT_Write(0x814E, mask, 1); + DEV_Delay_ms(1); + // printf("buffers status is 0 \r\n"); + return 1; + } + else { + Dev_Now.TouchpointFlag = buf[0]&0x80; + Dev_Now.TouchCount = buf[0]&0x0f; + if (Dev_Now.TouchCount > 5 || Dev_Now.TouchCount < 1) { + GT_Write(0x814E, mask, 1); + // printf("TouchCount number is wrong \r\n"); + return 1; + } + GT_Read(0x814F, &buf[1], Dev_Now.TouchCount*8); + GT_Write(0x814E, mask, 1); + + Dev_Old.X[0] = Dev_Now.X[0]; + Dev_Old.Y[0] = Dev_Now.Y[0]; + Dev_Old.S[0] = Dev_Now.S[0]; + + for(UBYTE i=0; i 5 || ICNT86_Dev_Now.TouchCount < 1) { + ICNT_Write(0x1001, mask, 1); + ICNT86_Dev_Now.TouchCount = 0; + // printf("TouchCount number is wrong \r\n"); + return 1; + } + ICNT_Read(0x1002, buf, ICNT86_Dev_Now.TouchCount*7); + ICNT_Write(0x1001, mask, 1); + + ICNT86_Dev_Old.X[0] = ICNT86_Dev_Now.X[0]; + ICNT86_Dev_Old.Y[0] = ICNT86_Dev_Now.Y[0]; + ICNT86_Dev_Old.P[0] = ICNT86_Dev_Now.P[0]; + + for(UBYTE i=0; i EPD_2IN13_V2_Reset() +* EPD_SendCommand() => EPD_2IN13_V2_SendCommand() +* EPD_SendData() => EPD_2IN13_V2_SendData() +* EPD_WaitUntilIdle() => EPD_2IN13_V2_ReadBusy() +* EPD_Init() => EPD_2IN13_V2_Init() +* EPD_Clear() => EPD_2IN13_V2_Clear() +* EPD_Display() => EPD_2IN13_V2_Display() +* EPD_Sleep() => EPD_2IN13_V2_Sleep() +* 2.add: +* EPD_2IN13_V2_DisplayPartBaseImage() +* ----------------------------------------------------------------------------- +* V2.0(2018-11-14): +* 1.Remove:ImageBuff[EPD_HEIGHT * EPD_WIDTH / 8] +* 2.Change:EPD_2IN13_V2_Display(UBYTE *Image) +* Need to pass parameters: pointer to cached data +* 3.Change: +* EPD_RST -> EPD_RST_PIN +* EPD_DC -> EPD_DC_PIN +* EPD_CS -> EPD_CS_PIN +* EPD_BUSY -> EPD_BUSY_PIN +# +# 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 "EPD_2in13_V2.h" +#include "Debug.h" + +const unsigned char EPD_2IN13_V2_lut_full_update[]= { + 0x80,0x60,0x40,0x00,0x00,0x00,0x00, //LUT0: BB: VS 0 ~7 + 0x10,0x60,0x20,0x00,0x00,0x00,0x00, //LUT1: BW: VS 0 ~7 + 0x80,0x60,0x40,0x00,0x00,0x00,0x00, //LUT2: WB: VS 0 ~7 + 0x10,0x60,0x20,0x00,0x00,0x00,0x00, //LUT3: WW: VS 0 ~7 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00, //LUT4: VCOM: VS 0 ~7 + + 0x03,0x03,0x00,0x00,0x02, // TP0 A~D RP0 + 0x09,0x09,0x00,0x00,0x02, // TP1 A~D RP1 + 0x03,0x03,0x00,0x00,0x02, // TP2 A~D RP2 + 0x00,0x00,0x00,0x00,0x00, // TP3 A~D RP3 + 0x00,0x00,0x00,0x00,0x00, // TP4 A~D RP4 + 0x00,0x00,0x00,0x00,0x00, // TP5 A~D RP5 + 0x00,0x00,0x00,0x00,0x00, // TP6 A~D RP6 + + 0x15,0x41,0xA8,0x32,0x30,0x0A, +}; + +const unsigned char EPD_2IN13_V2_lut_partial_update[]= { //20 bytes + 0x00,0x00,0x00,0x00,0x00,0x00,0x00, //LUT0: BB: VS 0 ~7 + 0x80,0x00,0x00,0x00,0x00,0x00,0x00, //LUT1: BW: VS 0 ~7 + 0x40,0x00,0x00,0x00,0x00,0x00,0x00, //LUT2: WB: VS 0 ~7 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00, //LUT3: WW: VS 0 ~7 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00, //LUT4: VCOM: VS 0 ~7 + + 0x0A,0x00,0x00,0x00,0x00, // TP0 A~D RP0 + 0x00,0x00,0x00,0x00,0x00, // TP1 A~D RP1 + 0x00,0x00,0x00,0x00,0x00, // TP2 A~D RP2 + 0x00,0x00,0x00,0x00,0x00, // TP3 A~D RP3 + 0x00,0x00,0x00,0x00,0x00, // TP4 A~D RP4 + 0x00,0x00,0x00,0x00,0x00, // TP5 A~D RP5 + 0x00,0x00,0x00,0x00,0x00, // TP6 A~D RP6 + + 0x15,0x41,0xA8,0x32,0x30,0x0A, +}; +/****************************************************************************** +function : Software reset +parameter: +******************************************************************************/ +static void EPD_2IN13_V2_Reset(void) +{ + DEV_Digital_Write(EPD_RST_PIN, 1); + DEV_Delay_ms(200); + DEV_Digital_Write(EPD_RST_PIN, 0); + DEV_Delay_ms(2); + DEV_Digital_Write(EPD_RST_PIN, 1); + DEV_Delay_ms(200); +} + +/****************************************************************************** +function : send command +parameter: + Reg : Command register +******************************************************************************/ +static void EPD_2IN13_V2_SendCommand(UBYTE Reg) +{ + DEV_Digital_Write(EPD_DC_PIN, 0); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_WriteByte(Reg); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +/****************************************************************************** +function : send data +parameter: + Data : Write data +******************************************************************************/ +static void EPD_2IN13_V2_SendData(UBYTE Data) +{ + DEV_Digital_Write(EPD_DC_PIN, 1); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_WriteByte(Data); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +static void EPD_2IN13_V2_SendData2(UBYTE *Data, UDOUBLE len) +{ + DEV_Digital_Write(EPD_DC_PIN, 1); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_Write_nByte(Data, len); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +/****************************************************************************** +function : Wait until the busy_pin goes LOW +parameter: +******************************************************************************/ +void EPD_2IN13_V2_ReadBusy(void) +{ + Debug("e-Paper busy\r\n"); + do { //LOW: idle, HIGH: busy + DEV_Delay_ms(1); + }while(DEV_Digital_Read(EPD_BUSY_PIN) == 1); + Debug("e-Paper busy release\r\n"); +} + +/****************************************************************************** +function : Turn On Display +parameter: +******************************************************************************/ +static void EPD_2IN13_V2_TurnOnDisplay(void) +{ + EPD_2IN13_V2_SendCommand(0x22); + EPD_2IN13_V2_SendData(0xC7); + EPD_2IN13_V2_SendCommand(0x20); + EPD_2IN13_V2_ReadBusy(); +} + +/****************************************************************************** +function : Turn On Display +parameter: +******************************************************************************/ +static void EPD_2IN13_V2_TurnOnDisplayPart(void) +{ + EPD_2IN13_V2_SendCommand(0x22); + EPD_2IN13_V2_SendData(0x0C); + EPD_2IN13_V2_SendCommand(0x20); + // EPD_2IN13_V2_ReadBusy(); +} + +static void EPD_2IN13_V2_TurnOnDisplayPart_Wait(void) +{ + EPD_2IN13_V2_SendCommand(0x22); + EPD_2IN13_V2_SendData(0x0C); + EPD_2IN13_V2_SendCommand(0x20); + EPD_2IN13_V2_ReadBusy(); +} + +/****************************************************************************** +function : Initialize the e-Paper register +parameter: +******************************************************************************/ +void EPD_2IN13_V2_Init(UBYTE Mode) +{ + + UBYTE count; + EPD_2IN13_V2_Reset(); + + if(Mode == EPD_2IN13_V2_FULL) { + EPD_2IN13_V2_ReadBusy(); + EPD_2IN13_V2_SendCommand(0x12); // soft reset + EPD_2IN13_V2_ReadBusy(); + + EPD_2IN13_V2_SendCommand(0x74); //set analog block control + EPD_2IN13_V2_SendData(0x54); + EPD_2IN13_V2_SendCommand(0x7E); //set digital block control + EPD_2IN13_V2_SendData(0x3B); + + EPD_2IN13_V2_SendCommand(0x01); //Driver output control + EPD_2IN13_V2_SendData(0xF9); + EPD_2IN13_V2_SendData(0x00); + EPD_2IN13_V2_SendData(0x00); + + EPD_2IN13_V2_SendCommand(0x11); //data entry mode + EPD_2IN13_V2_SendData(0x01); + + EPD_2IN13_V2_SendCommand(0x44); //set Ram-X address start/end position + EPD_2IN13_V2_SendData(0x00); + EPD_2IN13_V2_SendData(0x0F); //0x0C-->(15+1)*8=128 + + EPD_2IN13_V2_SendCommand(0x45); //set Ram-Y address start/end position + EPD_2IN13_V2_SendData(0xF9); //0xF9-->(249+1)=250 + EPD_2IN13_V2_SendData(0x00); + EPD_2IN13_V2_SendData(0x00); + EPD_2IN13_V2_SendData(0x00); + + EPD_2IN13_V2_SendCommand(0x3C); //BorderWavefrom + EPD_2IN13_V2_SendData(0x03); + + EPD_2IN13_V2_SendCommand(0x2C); //VCOM Voltage + EPD_2IN13_V2_SendData(0x55); // + + EPD_2IN13_V2_SendCommand(0x03); + EPD_2IN13_V2_SendData(EPD_2IN13_V2_lut_full_update[70]); + + EPD_2IN13_V2_SendCommand(0x04); // + EPD_2IN13_V2_SendData(EPD_2IN13_V2_lut_full_update[71]); + EPD_2IN13_V2_SendData(EPD_2IN13_V2_lut_full_update[72]); + EPD_2IN13_V2_SendData(EPD_2IN13_V2_lut_full_update[73]); + + EPD_2IN13_V2_SendCommand(0x3A); //Dummy Line + EPD_2IN13_V2_SendData(EPD_2IN13_V2_lut_full_update[74]); + EPD_2IN13_V2_SendCommand(0x3B); //Gate time + EPD_2IN13_V2_SendData(EPD_2IN13_V2_lut_full_update[75]); + + EPD_2IN13_V2_SendCommand(0x32); + for(count = 0; count < 70; count++) { + EPD_2IN13_V2_SendData(EPD_2IN13_V2_lut_full_update[count]); + } + + EPD_2IN13_V2_SendCommand(0x4E); // set RAM x address count to 0; + EPD_2IN13_V2_SendData(0x00); + EPD_2IN13_V2_SendCommand(0x4F); // set RAM y address count to 0X127; + EPD_2IN13_V2_SendData(0xF9); + EPD_2IN13_V2_SendData(0x00); + EPD_2IN13_V2_ReadBusy(); + } else if(Mode == EPD_2IN13_V2_PART) { + EPD_2IN13_V2_SendCommand(0x2C); //VCOM Voltage + EPD_2IN13_V2_SendData(0x26); + + EPD_2IN13_V2_ReadBusy(); + + EPD_2IN13_V2_SendCommand(0x32); + for(count = 0; count < 70; count++) { + EPD_2IN13_V2_SendData(EPD_2IN13_V2_lut_partial_update[count]); + } + + EPD_2IN13_V2_SendCommand(0x37); + EPD_2IN13_V2_SendData(0x00); + EPD_2IN13_V2_SendData(0x00); + EPD_2IN13_V2_SendData(0x00); + EPD_2IN13_V2_SendData(0x00); + EPD_2IN13_V2_SendData(0x40); + EPD_2IN13_V2_SendData(0x00); + EPD_2IN13_V2_SendData(0x00); + + EPD_2IN13_V2_SendCommand(0x22); + EPD_2IN13_V2_SendData(0xC0); + + EPD_2IN13_V2_SendCommand(0x20); + EPD_2IN13_V2_ReadBusy(); + + EPD_2IN13_V2_SendCommand(0x3C); //BorderWavefrom + EPD_2IN13_V2_SendData(0x01); + } else { + Debug("error, the Mode is EPD_2IN13_FULL or EPD_2IN13_PART"); + } +} + +/****************************************************************************** +function : Clear screen +parameter: +******************************************************************************/ +void EPD_2IN13_V2_Clear(void) +{ + UWORD Width, Height; + Width = (EPD_2IN13_V2_WIDTH % 8 == 0)? (EPD_2IN13_V2_WIDTH / 8 ): (EPD_2IN13_V2_WIDTH / 8 + 1); + Height = EPD_2IN13_V2_HEIGHT; + + EPD_2IN13_V2_SendCommand(0x24); + for (UWORD j = 0; j < Height; j++) { + for (UWORD i = 0; i < Width; i++) { + EPD_2IN13_V2_SendData(0XFF); + } + } + + EPD_2IN13_V2_TurnOnDisplay(); +} + +/****************************************************************************** +function : Sends the image buffer in RAM to e-Paper and displays +parameter: +******************************************************************************/ +void EPD_2IN13_V2_Display(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2IN13_V2_WIDTH % 8 == 0)? (EPD_2IN13_V2_WIDTH / 8 ): (EPD_2IN13_V2_WIDTH / 8 + 1); + Height = EPD_2IN13_V2_HEIGHT; + + EPD_2IN13_V2_SendCommand(0x24); + for (UWORD j = 0; j < Height; j++) { + for (UWORD i = 0; i < Width; i++) { + EPD_2IN13_V2_SendData(Image[i + j * Width]); + } + } + EPD_2IN13_V2_TurnOnDisplay(); +} + +/****************************************************************************** +function : The image of the previous frame must be uploaded, otherwise the + first few seconds will display an exception. +parameter: +******************************************************************************/ +void EPD_2IN13_V2_DisplayPartBaseImage(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2IN13_V2_WIDTH % 8 == 0)? (EPD_2IN13_V2_WIDTH / 8 ): (EPD_2IN13_V2_WIDTH / 8 + 1); + Height = EPD_2IN13_V2_HEIGHT; + + // UDOUBLE Addr = 0; + EPD_2IN13_V2_SendCommand(0x24); + // for (UWORD j = 0; j < Height; j++) { + // for (UWORD i = 0; i < Width; i++) { + // Addr = i + j * Width; + // EPD_2IN13_V2_SendData(Image[Addr]); + // } + // } + EPD_2IN13_V2_SendData2(Image, Height*Width); + EPD_2IN13_V2_SendCommand(0x26); + // for (UWORD j = 0; j < Height; j++) { + // for (UWORD i = 0; i < Width; i++) { + // Addr = i + j * Width; + // EPD_2IN13_V2_SendData(Image[Addr]); + // } + // } + EPD_2IN13_V2_SendData2(Image, Height*Width); + EPD_2IN13_V2_TurnOnDisplay(); +} + +void EPD_2IN13_V2_DisplayPart_Wait(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2IN13_V2_WIDTH % 8 == 0)? (EPD_2IN13_V2_WIDTH / 8 ): (EPD_2IN13_V2_WIDTH / 8 + 1); + Height = EPD_2IN13_V2_HEIGHT; + EPD_2IN13_V2_SendCommand(0x24); + // for (UWORD j = 0; j < Height; j++) { + // for (UWORD i = 0; i < Width; i++) { + // EPD_2IN13_V2_SendData(Image[i + j * Width]); + // } + // } + EPD_2IN13_V2_SendData2(Image, Height*Width); + EPD_2IN13_V2_TurnOnDisplayPart_Wait(); +} + +void EPD_2IN13_V2_DisplayPart(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2IN13_V2_WIDTH % 8 == 0)? (EPD_2IN13_V2_WIDTH / 8 ): (EPD_2IN13_V2_WIDTH / 8 + 1); + Height = EPD_2IN13_V2_HEIGHT; + EPD_2IN13_V2_SendCommand(0x24); + // for (UWORD j = 0; j < Height; j++) { + // for (UWORD i = 0; i < Width; i++) { + // EPD_2IN13_V2_SendData(Image[i + j * Width]); + // } + // } + EPD_2IN13_V2_SendData2(Image, Height*Width); + EPD_2IN13_V2_TurnOnDisplayPart(); +} + +/****************************************************************************** +function : Enter sleep mode +parameter: +******************************************************************************/ +void EPD_2IN13_V2_Sleep(void) +{ + EPD_2IN13_V2_SendCommand(0x22); //POWER OFF + EPD_2IN13_V2_SendData(0xC3); + EPD_2IN13_V2_SendCommand(0x20); + + EPD_2IN13_V2_SendCommand(0x10); //enter deep sleep + EPD_2IN13_V2_SendData(0x01); + DEV_Delay_ms(100); +} diff --git a/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V2.h b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V2.h new file mode 100644 index 0000000..b577122 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V2.h @@ -0,0 +1,74 @@ +/***************************************************************************** +* | File : EPD_2in13_V2.h +* | Author : Waveshare team +* | Function : 2.13inch e-paper V2 +* | Info : +*---------------- +* | This version: V3.0 +* | Date : 2019-06-13 +* | Info : +* ----------------------------------------------------------------------------- +* V3.0(2019-06-13): +* 1.Change name: +* EPD_Reset() => EPD_2IN13_V2_Reset() +* EPD_SendCommand() => EPD_2IN13_V2_SendCommand() +* EPD_SendData() => EPD_2IN13_V2_SendData() +* EPD_WaitUntilIdle() => EPD_2IN13_V2_ReadBusy() +* EPD_Init() => EPD_2IN13_V2_Init() +* EPD_Clear() => EPD_2IN13_V2_Clear() +* EPD_Display() => EPD_2IN13_V2_Display() +* EPD_Sleep() => EPD_2IN13_V2_Sleep() +* 2.add: +* EPD_2IN13_V2_DisplayPartBaseImage() +* ----------------------------------------------------------------------------- +* V2.0(2018-11-14): +* 1.Remove:ImageBuff[EPD_HEIGHT * EPD_WIDTH / 8] +* 2.Change:EPD_2IN13_V2_Display(UBYTE *Image) +* Need to pass parameters: pointer to cached data +* 3.Change: +* EPD_RST -> EPD_RST_PIN +* EPD_DC -> EPD_DC_PIN +* EPD_CS -> EPD_CS_PIN +* EPD_BUSY -> EPD_BUSY_PIN +# +# 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 _EPD_2IN13_V2_H_ +#define _EPD_2IN13_V2_H_ + +#include "DEV_Config.h" + +// Display resolution +#define EPD_2IN13_V2_WIDTH 122 +#define EPD_2IN13_V2_HEIGHT 250 + +#define EPD_2IN13_V2_FULL 0 +#define EPD_2IN13_V2_PART 1 + +void EPD_2IN13_V2_Init(UBYTE Mode); +void EPD_2IN13_V2_Clear(void); +void EPD_2IN13_V2_Display(UBYTE *Image); +void EPD_2IN13_V2_DisplayPart(UBYTE *Image); +void EPD_2IN13_V2_DisplayPartBaseImage(UBYTE *Image); +void EPD_2IN13_V2_Sleep(void); + +void EPD_2IN13_V2_DisplayPart_Wait(UBYTE *Image); + +#endif diff --git a/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V3.c b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V3.c new file mode 100644 index 0000000..5bbf694 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V3.c @@ -0,0 +1,473 @@ +/***************************************************************************** +* | File : EPD_2in13_V3.c +* | Author : Waveshare team +* | Function : 2.13inch e-paper V3 +* | Info : +*---------------- +* | This version: V1.1 +* | Date : 2021-10-30 +* | Info : +* ----------------------------------------------------------------------------- +# +# 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 "EPD_2in13_V3.h" +#include "Debug.h" + +UBYTE WF_PARTIAL_2IN13_V3[159] = +{ + 0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x10,0x0,0x0,0x0,0x0,0x0,0x0, + 0x1,0x0,0x0,0x0,0x0,0x0,0x0, + 0x1,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0, + 0x22,0x17,0x41,0x00,0x32,0x36, +}; + +UBYTE WS_20_30_2IN13_V3[159] = +{ + 0x80, 0x4A, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x40, 0x4A, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x80, 0x4A, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x40, 0x4A, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0xF, 0x0, 0x0, 0xF, 0x0, 0x0, 0x2, + 0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0, + 0x22, 0x17, 0x41, 0x0, 0x32, 0x36 +}; + +/****************************************************************************** +function : Software reset +parameter: +******************************************************************************/ +static void EPD_2in13_V3_Reset(void) +{ + DEV_Digital_Write(EPD_RST_PIN, 1); + DEV_Delay_ms(20); + DEV_Digital_Write(EPD_RST_PIN, 0); + DEV_Delay_ms(2); + DEV_Digital_Write(EPD_RST_PIN, 1); + DEV_Delay_ms(20); +} + +/****************************************************************************** +function : send command +parameter: + Reg : Command register +******************************************************************************/ +static void EPD_2in13_V3_SendCommand(UBYTE Reg) +{ + DEV_Digital_Write(EPD_DC_PIN, 0); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_WriteByte(Reg); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +/****************************************************************************** +function : send data +parameter: + Data : Write data +******************************************************************************/ +static void EPD_2in13_V3_SendData(UBYTE Data) +{ + DEV_Digital_Write(EPD_DC_PIN, 1); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_WriteByte(Data); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +static void EPD_2IN13_V3_SendData2(UBYTE *Data, UDOUBLE len) +{ + DEV_Digital_Write(EPD_DC_PIN, 1); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_Write_nByte(Data, len); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +/****************************************************************************** +function : Wait until the busy_pin goes LOW +parameter: +******************************************************************************/ +void EPD_2in13_V3_ReadBusy(void) +{ + Debug("e-Paper busy\r\n"); + while(1) + { //=1 BUSY + if(DEV_Digital_Read(EPD_BUSY_PIN)==0) + break; + DEV_Delay_ms(10); + } + DEV_Delay_ms(10); + Debug("e-Paper busy release\r\n"); +} + +/****************************************************************************** +function : Turn On Display +parameter: +******************************************************************************/ +static void EPD_2in13_V3_TurnOnDisplay(void) +{ + EPD_2in13_V3_SendCommand(0x22); // Display Update Control + EPD_2in13_V3_SendData(0xc7); + EPD_2in13_V3_SendCommand(0x20); // Activate Display Update Sequence + EPD_2in13_V3_ReadBusy(); +} + +/****************************************************************************** +function : Turn On Display +parameter: +******************************************************************************/ +static void EPD_2in13_V3_TurnOnDisplay_Partial(void) +{ + EPD_2in13_V3_SendCommand(0x22); // Display Update Control + EPD_2in13_V3_SendData(0x0C); // fast:0x0c, quality:0x0f, 0xcf + EPD_2in13_V3_SendCommand(0x20); // Activate Display Update Sequence + // EPD_2in13_V3_ReadBusy(); +} + +static void EPD_2in13_V3_TurnOnDisplay_Partial_Wait(void) +{ + EPD_2in13_V3_SendCommand(0x22); // Display Update Control + EPD_2in13_V3_SendData(0x0C); // fast:0x0c, quality:0x0f, 0xcf + EPD_2in13_V3_SendCommand(0x20); // Activate Display Update Sequence + EPD_2in13_V3_ReadBusy(); +} + +/****************************************************************************** +function : Set lut +parameter: + lut : lut data +******************************************************************************/ +static void EPD_2IN13_V3_LUT(UBYTE *lut) +{ + UBYTE count; + EPD_2in13_V3_SendCommand(0x32); + for(count=0; count<153; count++) + EPD_2in13_V3_SendData(lut[count]); + EPD_2in13_V3_ReadBusy(); +} + +/****************************************************************************** +function : Send lut data and configuration +parameter: + lut : lut data +******************************************************************************/ +static void EPD_2IN13_V2_LUT_by_host(UBYTE *lut) +{ + EPD_2IN13_V3_LUT((UBYTE *)lut); //lut + EPD_2in13_V3_SendCommand(0x3f); + EPD_2in13_V3_SendData(*(lut+153)); + EPD_2in13_V3_SendCommand(0x03); // gate voltage + EPD_2in13_V3_SendData(*(lut+154)); + EPD_2in13_V3_SendCommand(0x04); // source voltage + EPD_2in13_V3_SendData(*(lut+155)); // VSH + EPD_2in13_V3_SendData(*(lut+156)); // VSH2 + EPD_2in13_V3_SendData(*(lut+157)); // VSL + EPD_2in13_V3_SendCommand(0x2c); // VCOM + EPD_2in13_V3_SendData(*(lut+158)); +} + +/****************************************************************************** +function : Setting the display window +parameter: + Xstart : X-axis starting position + Ystart : Y-axis starting position + Xend : End position of X-axis + Yend : End position of Y-axis +******************************************************************************/ +static void EPD_2in13_V3_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend) +{ + EPD_2in13_V3_SendCommand(0x44); // SET_RAM_X_ADDRESS_START_END_POSITION + EPD_2in13_V3_SendData((Xstart>>3) & 0xFF); + EPD_2in13_V3_SendData((Xend>>3) & 0xFF); + + EPD_2in13_V3_SendCommand(0x45); // SET_RAM_Y_ADDRESS_START_END_POSITION + EPD_2in13_V3_SendData(Ystart & 0xFF); + EPD_2in13_V3_SendData((Ystart >> 8) & 0xFF); + EPD_2in13_V3_SendData(Yend & 0xFF); + EPD_2in13_V3_SendData((Yend >> 8) & 0xFF); +} + +/****************************************************************************** +function : Set Cursor +parameter: + Xstart : X-axis starting position + Ystart : Y-axis starting position +******************************************************************************/ +static void EPD_2in13_V3_SetCursor(UWORD Xstart, UWORD Ystart) +{ + EPD_2in13_V3_SendCommand(0x4E); // SET_RAM_X_ADDRESS_COUNTER + EPD_2in13_V3_SendData(Xstart & 0xFF); + + EPD_2in13_V3_SendCommand(0x4F); // SET_RAM_Y_ADDRESS_COUNTER + EPD_2in13_V3_SendData(Ystart & 0xFF); + EPD_2in13_V3_SendData((Ystart >> 8) & 0xFF); +} + +/****************************************************************************** +function : Initialize the e-Paper register +parameter: +******************************************************************************/ +void EPD_2in13_V3_Init(UBYTE Mode) +{ + if(Mode == EPD_2IN13_V3_FULL) + { + EPD_2in13_V3_Reset(); + DEV_Delay_ms(100); + + EPD_2in13_V3_ReadBusy(); + EPD_2in13_V3_SendCommand(0x12); //SWRESET + EPD_2in13_V3_ReadBusy(); + + EPD_2in13_V3_SendCommand(0x01); //Driver output control + EPD_2in13_V3_SendData(0xf9); + EPD_2in13_V3_SendData(0x00); + EPD_2in13_V3_SendData(0x00); + + EPD_2in13_V3_SendCommand(0x11); //data entry mode + EPD_2in13_V3_SendData(0x03); + + EPD_2in13_V3_SetWindows(0, 0, EPD_2in13_V3_WIDTH-1, EPD_2in13_V3_HEIGHT-1); + EPD_2in13_V3_SetCursor(0, 0); + + EPD_2in13_V3_SendCommand(0x3C); //BorderWavefrom + EPD_2in13_V3_SendData(0x05); + + EPD_2in13_V3_SendCommand(0x21); // Display update control + EPD_2in13_V3_SendData(0x00); + EPD_2in13_V3_SendData(0x80); + + EPD_2in13_V3_SendCommand(0x18); //Read built-in temperature sensor + EPD_2in13_V3_SendData(0x80); + + EPD_2in13_V3_ReadBusy(); + EPD_2IN13_V2_LUT_by_host(WS_20_30_2IN13_V3); + } + else if(Mode == EPD_2IN13_V3_PART) + { + //Reset + DEV_Digital_Write(EPD_RST_PIN, 0); + DEV_Delay_ms(1); + DEV_Digital_Write(EPD_RST_PIN, 1); + + EPD_2IN13_V2_LUT_by_host(WF_PARTIAL_2IN13_V3); + + EPD_2in13_V3_SendCommand(0x37); + EPD_2in13_V3_SendData(0x00); + EPD_2in13_V3_SendData(0x00); + EPD_2in13_V3_SendData(0x00); + EPD_2in13_V3_SendData(0x00); + EPD_2in13_V3_SendData(0x00); + EPD_2in13_V3_SendData(0x40); ///RAM Ping-Pong enable + EPD_2in13_V3_SendData(0x00); + EPD_2in13_V3_SendData(0x00); + EPD_2in13_V3_SendData(0x00); + EPD_2in13_V3_SendData(0x00); + + EPD_2in13_V3_SendCommand(0x3C); //BorderWavefrom + EPD_2in13_V3_SendData(0xC0); + + EPD_2in13_V3_SendCommand(0x22); //Display Update Sequence Option + EPD_2in13_V3_SendData(0xC0); // Enable clock and Enable analog + EPD_2in13_V3_SendCommand(0x20); //Activate Display Update Sequence + EPD_2in13_V3_ReadBusy(); + + EPD_2in13_V3_SetWindows(0, 0, EPD_2in13_V3_WIDTH-1, EPD_2in13_V3_HEIGHT-1); + EPD_2in13_V3_SetCursor(0, 0); + } +} + +/****************************************************************************** +function : Clear screen +parameter: +******************************************************************************/ +void EPD_2in13_V3_Clear(void) +{ + UWORD Width, Height; + Width = (EPD_2in13_V3_WIDTH % 8 == 0)? (EPD_2in13_V3_WIDTH / 8 ): (EPD_2in13_V3_WIDTH / 8 + 1); + Height = EPD_2in13_V3_HEIGHT; + + EPD_2in13_V3_SendCommand(0x24); + for (UWORD j = 0; j < Height; j++) { + for (UWORD i = 0; i < Width; i++) { + EPD_2in13_V3_SendData(0XFF); + } + } + + EPD_2in13_V3_TurnOnDisplay(); +} + +/****************************************************************************** +function : Sends the image buffer in RAM to e-Paper and displays +parameter: + Image : Image data +******************************************************************************/ +void EPD_2in13_V3_Display(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2in13_V3_WIDTH % 8 == 0)? (EPD_2in13_V3_WIDTH / 8 ): (EPD_2in13_V3_WIDTH / 8 + 1); + Height = EPD_2in13_V3_HEIGHT; + + EPD_2in13_V3_SendCommand(0x24); + for (UWORD j = 0; j < Height; j++) { + for (UWORD i = 0; i < Width; i++) { + EPD_2in13_V3_SendData(Image[i + j * Width]); + } + } + + EPD_2in13_V3_TurnOnDisplay(); +} + + +/****************************************************************************** +function : Refresh a base image +parameter: + Image : Image data +******************************************************************************/ +void EPD_2in13_V3_Display_Base(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2in13_V3_WIDTH % 8 == 0)? (EPD_2in13_V3_WIDTH / 8 ): (EPD_2in13_V3_WIDTH / 8 + 1); + Height = EPD_2in13_V3_HEIGHT; + + EPD_2in13_V3_SendCommand(0x24); //Write Black and White image to RAM + // for (UWORD j = 0; j < Height; j++) { + // for (UWORD i = 0; i < Width; i++) { + // EPD_2in13_V3_SendData(Image[i + j * Width]); + // } + // } + + EPD_2IN13_V3_SendData2(Image, Height*Width); + EPD_2in13_V3_SendCommand(0x26); //Write Black and White image to RAM + // for (UWORD j = 0; j < Height; j++) { + // for (UWORD i = 0; i < Width; i++) { + // EPD_2in13_V3_SendData(Image[i + j * Width]); + // } + // } + + EPD_2IN13_V3_SendData2(Image, Height*Width); + EPD_2in13_V3_TurnOnDisplay(); +} + +/****************************************************************************** +function : Sends the image buffer in RAM to e-Paper and partial refresh +parameter: + Image : Image data +******************************************************************************/ +void EPD_2in13_V3_Display_Partial(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2in13_V3_WIDTH % 8 == 0)? (EPD_2in13_V3_WIDTH / 8 ): (EPD_2in13_V3_WIDTH / 8 + 1); + Height = EPD_2in13_V3_HEIGHT; + + + + EPD_2in13_V3_SendCommand(0x24); //Write Black and White image to RAM + // for (UWORD j = 0; j < Height; j++) { + // for (UWORD i = 0; i < Width; i++) { + // EPD_2in13_V3_SendData(Image[i + j * Width]); + // } + // } + + EPD_2IN13_V3_SendData2(Image, Height*Width); + EPD_2in13_V3_TurnOnDisplay_Partial(); +} + +void EPD_2in13_V3_Display_Partial_Wait(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2in13_V3_WIDTH % 8 == 0)? (EPD_2in13_V3_WIDTH / 8 ): (EPD_2in13_V3_WIDTH / 8 + 1); + Height = EPD_2in13_V3_HEIGHT; + + // //Reset + // DEV_Digital_Write(EPD_RST_PIN, 0); + // DEV_Delay_ms(1); + // DEV_Digital_Write(EPD_RST_PIN, 1); + + // EPD_2IN13_V2_LUT_by_host(WF_PARTIAL_2IN13_V3); + + // EPD_2in13_V3_SendCommand(0x37); + // EPD_2in13_V3_SendData(0x00); + // EPD_2in13_V3_SendData(0x00); + // EPD_2in13_V3_SendData(0x00); + // EPD_2in13_V3_SendData(0x00); + // EPD_2in13_V3_SendData(0x00); + // EPD_2in13_V3_SendData(0x40); ///RAM Ping-Pong enable + // EPD_2in13_V3_SendData(0x00); + // EPD_2in13_V3_SendData(0x00); + // EPD_2in13_V3_SendData(0x00); + // EPD_2in13_V3_SendData(0x00); + + // EPD_2in13_V3_SendCommand(0x3C); //BorderWavefrom + // EPD_2in13_V3_SendData(0x80); + + // EPD_2in13_V3_SendCommand(0x22); //Display Update Sequence Option + // EPD_2in13_V3_SendData(0xC0); // Enable clock and Enable analog + // EPD_2in13_V3_SendCommand(0x20); //Activate Display Update Sequence + // EPD_2in13_V3_ReadBusy(); + + // EPD_2in13_V3_SetWindows(0, 0, EPD_2in13_V3_WIDTH-1, EPD_2in13_V3_HEIGHT-1); + // EPD_2in13_V3_SetCursor(0, 0); + + EPD_2in13_V3_SendCommand(0x24); //Write Black and White image to RAM + // for (UWORD j = 0; j < Height; j++) { + // for (UWORD i = 0; i < Width; i++) { + // EPD_2in13_V3_SendData(Image[i + j * Width]); + // } + // } + + EPD_2IN13_V3_SendData2(Image, Height*Width); + EPD_2in13_V3_TurnOnDisplay_Partial_Wait(); +} + +/****************************************************************************** +function : Enter sleep mode +parameter: +******************************************************************************/ +void EPD_2in13_V3_Sleep(void) +{ + EPD_2in13_V3_SendCommand(0x10); //enter deep sleep + EPD_2in13_V3_SendData(0x01); + DEV_Delay_ms(100); +} diff --git a/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V3.h b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V3.h new file mode 100644 index 0000000..2013414 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V3.h @@ -0,0 +1,51 @@ +/***************************************************************************** +* | File : EPD_2Iin13_V3.h +* | Author : Waveshare team +* | Function : 2.13inch e-paper V3 +* | Info : +*---------------- +* | This version: V1.1 +* | Date : 2021-10-30 +* | Info : +* ----------------------------------------------------------------------------- +# +# 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 __EPD_2in13_V3_H_ +#define __EPD_2in13_V3_H_ + +#include "DEV_Config.h" + +// Display resolution +#define EPD_2in13_V3_WIDTH 122 +#define EPD_2in13_V3_HEIGHT 250 + +#define EPD_2IN13_V3_FULL 0 +#define EPD_2IN13_V3_PART 1 + +void EPD_2in13_V3_Init(UBYTE Mode); +void EPD_2in13_V3_Clear(void); +void EPD_2in13_V3_Display(UBYTE *Image); +void EPD_2in13_V3_Display_Base(UBYTE *Image); +void EPD_2in13_V3_Display_Partial(UBYTE *Image); +void EPD_2in13_V3_Display_Partial_Wait(UBYTE *Image); +void EPD_2in13_V3_Sleep(void); + +#endif diff --git a/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V4.c b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V4.c new file mode 100644 index 0000000..a0b2b84 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V4.c @@ -0,0 +1,433 @@ +/***************************************************************************** +* | File : EPD_2in13_V4.c +* | Author : Waveshare team +* | Function : 2.13inch e-paper V4 +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2023-08-12 +* | Info : +* ----------------------------------------------------------------------------- +# +# 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 "EPD_2in13_V4.h" +#include "Debug.h" + +/****************************************************************************** +function : Software reset +parameter: +******************************************************************************/ +static void EPD_2in13_V4_Reset(void) +{ + DEV_Digital_Write(EPD_RST_PIN, 1); + DEV_Delay_ms(20); + DEV_Digital_Write(EPD_RST_PIN, 0); + DEV_Delay_ms(2); + DEV_Digital_Write(EPD_RST_PIN, 1); + DEV_Delay_ms(20); +} + +/****************************************************************************** +function : send command +parameter: + Reg : Command register +******************************************************************************/ +static void EPD_2in13_V4_SendCommand(UBYTE Reg) +{ + DEV_Digital_Write(EPD_DC_PIN, 0); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_WriteByte(Reg); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +/****************************************************************************** +function : send data +parameter: + Data : Write data +******************************************************************************/ +static void EPD_2in13_V4_SendData(UBYTE Data) +{ + DEV_Digital_Write(EPD_DC_PIN, 1); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_WriteByte(Data); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +static void EPD_2IN13_V4_SendData2(UBYTE *Data, UDOUBLE len) +{ + DEV_Digital_Write(EPD_DC_PIN, 1); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_Write_nByte(Data, len); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +/****************************************************************************** +function : Wait until the busy_pin goes LOW +parameter: +******************************************************************************/ +void EPD_2in13_V4_ReadBusy(void) +{ + Debug("e-Paper busy\r\n"); + while(1) + { //=1 BUSY + if(DEV_Digital_Read(EPD_BUSY_PIN)==0) + break; + DEV_Delay_ms(10); + } + DEV_Delay_ms(10); + Debug("e-Paper busy release\r\n"); +} + +/****************************************************************************** +function : Setting the display window +parameter: + Xstart : X-axis starting position + Ystart : Y-axis starting position + Xend : End position of X-axis + Yend : End position of Y-axis +******************************************************************************/ +static void EPD_2in13_V4_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend) +{ + EPD_2in13_V4_SendCommand(0x44); // SET_RAM_X_ADDRESS_START_END_POSITION + EPD_2in13_V4_SendData((Xstart>>3) & 0xFF); + EPD_2in13_V4_SendData((Xend>>3) & 0xFF); + + EPD_2in13_V4_SendCommand(0x45); // SET_RAM_Y_ADDRESS_START_END_POSITION + EPD_2in13_V4_SendData(Ystart & 0xFF); + EPD_2in13_V4_SendData((Ystart >> 8) & 0xFF); + EPD_2in13_V4_SendData(Yend & 0xFF); + EPD_2in13_V4_SendData((Yend >> 8) & 0xFF); +} + +/****************************************************************************** +function : Set Cursor +parameter: + Xstart : X-axis starting position + Ystart : Y-axis starting position +******************************************************************************/ +static void EPD_2in13_V4_SetCursor(UWORD Xstart, UWORD Ystart) +{ + EPD_2in13_V4_SendCommand(0x4E); // SET_RAM_X_ADDRESS_COUNTER + EPD_2in13_V4_SendData(Xstart & 0xFF); + + EPD_2in13_V4_SendCommand(0x4F); // SET_RAM_Y_ADDRESS_COUNTER + EPD_2in13_V4_SendData(Ystart & 0xFF); + EPD_2in13_V4_SendData((Ystart >> 8) & 0xFF); +} + +/****************************************************************************** +function : Turn On Display +parameter: +******************************************************************************/ +static void EPD_2in13_V4_TurnOnDisplay(void) +{ + EPD_2in13_V4_SendCommand(0x22); // Display Update Control + EPD_2in13_V4_SendData(0xf7); + EPD_2in13_V4_SendCommand(0x20); // Activate Display Update Sequence + EPD_2in13_V4_ReadBusy(); +} + +static void EPD_2in13_V4_TurnOnDisplay_Fast(void) +{ + EPD_2in13_V4_SendCommand(0x22); // Display Update Control + EPD_2in13_V4_SendData(0xc7); // fast:0x0c, quality:0x0f, 0xcf + EPD_2in13_V4_SendCommand(0x20); // Activate Display Update Sequence + EPD_2in13_V4_ReadBusy(); +} + +static void EPD_2in13_V4_TurnOnDisplay_Partial(void) +{ + EPD_2in13_V4_SendCommand(0x22); // Display Update Control + EPD_2in13_V4_SendData(0xff); // fast:0x0c, quality:0x0f, 0xcf + EPD_2in13_V4_SendCommand(0x20); // Activate Display Update Sequence + // EPD_2in13_V4_ReadBusy(); +} + +static void EPD_2in13_V4_TurnOnDisplay_Partial_Wait(void) +{ + EPD_2in13_V4_SendCommand(0x22); // Display Update Control + EPD_2in13_V4_SendData(0xff); // fast:0x0c, quality:0x0f, 0xcf + EPD_2in13_V4_SendCommand(0x20); // Activate Display Update Sequence + EPD_2in13_V4_ReadBusy(); +} + +/****************************************************************************** +function : Initialize the e-Paper register +parameter: +******************************************************************************/ +void EPD_2in13_V4_Init(UBYTE Mode) +{ + + + if(Mode == EPD_2IN13_V4_FULL) + { + EPD_2in13_V4_Reset(); + EPD_2in13_V4_ReadBusy(); + EPD_2in13_V4_SendCommand(0x12); //SWRESET + EPD_2in13_V4_ReadBusy(); + + EPD_2in13_V4_SendCommand(0x01); //Driver output control + EPD_2in13_V4_SendData(0xF9); + EPD_2in13_V4_SendData(0x00); + EPD_2in13_V4_SendData(0x00); + + EPD_2in13_V4_SendCommand(0x11); //data entry mode + EPD_2in13_V4_SendData(0x03); + + EPD_2in13_V4_SetWindows(0, 0, EPD_2in13_V4_WIDTH-1, EPD_2in13_V4_HEIGHT-1); + EPD_2in13_V4_SetCursor(0, 0); + + EPD_2in13_V4_SendCommand(0x3C); //BorderWavefrom + EPD_2in13_V4_SendData(0x05); + + EPD_2in13_V4_SendCommand(0x21); // Display update control + EPD_2in13_V4_SendData(0x00); + EPD_2in13_V4_SendData(0x80); + + EPD_2in13_V4_SendCommand(0x18); //Read built-in temperature sensor + EPD_2in13_V4_SendData(0x80); + EPD_2in13_V4_ReadBusy(); + } + else if(Mode == EPD_2IN13_V4_PART) + { + //Reset + DEV_Digital_Write(EPD_RST_PIN, 0); + DEV_Delay_ms(1); + DEV_Digital_Write(EPD_RST_PIN, 1); + + EPD_2in13_V4_SendCommand(0x3C); //BorderWavefrom + EPD_2in13_V4_SendData(0x80); + + EPD_2in13_V4_SendCommand(0x01); //Driver output control + EPD_2in13_V4_SendData(0xF9); + EPD_2in13_V4_SendData(0x00); + EPD_2in13_V4_SendData(0x00); + + EPD_2in13_V4_SendCommand(0x11); //data entry mode + EPD_2in13_V4_SendData(0x03); + + EPD_2in13_V4_SetWindows(0, 0, EPD_2in13_V4_WIDTH-1, EPD_2in13_V4_HEIGHT-1); + EPD_2in13_V4_SetCursor(0, 0); + } + else if(Mode == EPD_2IN13_V4_Fast) + { + EPD_2in13_V4_Reset(); + EPD_2in13_V4_ReadBusy(); + EPD_2in13_V4_SendCommand(0x12); //SWRESET + EPD_2in13_V4_ReadBusy(); + + EPD_2in13_V4_SendCommand(0x18); //Read built-in temperature sensor + EPD_2in13_V4_SendData(0x80); + + EPD_2in13_V4_SendCommand(0x11); //data entry mode + EPD_2in13_V4_SendData(0x03); + + EPD_2in13_V4_SetWindows(0, 0, EPD_2in13_V4_WIDTH-1, EPD_2in13_V4_HEIGHT-1); + EPD_2in13_V4_SetCursor(0, 0); + + EPD_2in13_V4_SendCommand(0x22); // Load temperature value + EPD_2in13_V4_SendData(0xB1); + EPD_2in13_V4_SendCommand(0x20); + EPD_2in13_V4_ReadBusy(); + + EPD_2in13_V4_SendCommand(0x1A); // Write to temperature register + EPD_2in13_V4_SendData(0x64); + EPD_2in13_V4_SendData(0x00); + + EPD_2in13_V4_SendCommand(0x22); // Load temperature value + EPD_2in13_V4_SendData(0x91); + EPD_2in13_V4_SendCommand(0x20); + EPD_2in13_V4_ReadBusy(); + } +} + +/****************************************************************************** +function : Clear screen +parameter: +******************************************************************************/ +void EPD_2in13_V4_Clear(void) +{ + UWORD Width, Height; + Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1); + Height = EPD_2in13_V4_HEIGHT; + + EPD_2in13_V4_SendCommand(0x24); + for (UWORD j = 0; j < Height; j++) { + for (UWORD i = 0; i < Width; i++) { + EPD_2in13_V4_SendData(0XFF); + } + } + + EPD_2in13_V4_TurnOnDisplay(); +} + +void EPD_2in13_V4_Clear_Black(void) +{ + UWORD Width, Height; + Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1); + Height = EPD_2in13_V4_HEIGHT; + + EPD_2in13_V4_SendCommand(0x24); + for (UWORD j = 0; j < Height; j++) { + for (UWORD i = 0; i < Width; i++) { + EPD_2in13_V4_SendData(0X00); + } + } + + EPD_2in13_V4_TurnOnDisplay(); +} + +/****************************************************************************** +function : Sends the image buffer in RAM to e-Paper and displays +parameter: + Image : Image data +******************************************************************************/ +void EPD_2in13_V4_Display(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1); + Height = EPD_2in13_V4_HEIGHT; + + EPD_2in13_V4_SendCommand(0x24); + for (UWORD j = 0; j < Height; j++) { + for (UWORD i = 0; i < Width; i++) { + EPD_2in13_V4_SendData(Image[i + j * Width]); + } + } + + EPD_2in13_V4_TurnOnDisplay(); +} + +void EPD_2in13_V4_Display_Fast(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1); + Height = EPD_2in13_V4_HEIGHT; + + EPD_2in13_V4_SendCommand(0x24); + for (UWORD j = 0; j < Height; j++) { + for (UWORD i = 0; i < Width; i++) { + EPD_2in13_V4_SendData(Image[i + j * Width]); + } + } + + EPD_2in13_V4_TurnOnDisplay_Fast(); +} + + +/****************************************************************************** +function : Refresh a base image +parameter: + Image : Image data +******************************************************************************/ +void EPD_2in13_V4_Display_Base(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1); + Height = EPD_2in13_V4_HEIGHT; + + EPD_2in13_V4_SendCommand(0x24); //Write Black and White image to RAM + EPD_2IN13_V4_SendData2(Image, Width*Height); + + EPD_2in13_V4_SendCommand(0x26); //Write Black and White image to RAM + EPD_2IN13_V4_SendData2(Image, Width*Height); + EPD_2in13_V4_TurnOnDisplay(); +} + +/****************************************************************************** +function : Sends the image buffer in RAM to e-Paper and partial refresh +parameter: + Image : Image data +******************************************************************************/ +void EPD_2in13_V4_Display_Partial(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1); + Height = EPD_2in13_V4_HEIGHT; + + printf("1111/r/n"); + + //Reset + DEV_Digital_Write(EPD_RST_PIN, 0); + DEV_Delay_ms(1); + DEV_Digital_Write(EPD_RST_PIN, 1); + + EPD_2in13_V4_SendCommand(0x3C); //BorderWavefrom + EPD_2in13_V4_SendData(0x80); + + EPD_2in13_V4_SendCommand(0x01); //Driver output control + EPD_2in13_V4_SendData(0xF9); + EPD_2in13_V4_SendData(0x00); + EPD_2in13_V4_SendData(0x00); + + EPD_2in13_V4_SendCommand(0x11); //data entry mode + EPD_2in13_V4_SendData(0x03); + + EPD_2in13_V4_SetWindows(0, 0, EPD_2in13_V4_WIDTH-1, EPD_2in13_V4_HEIGHT-1); + EPD_2in13_V4_SetCursor(0, 0); + + EPD_2in13_V4_SendCommand(0x24); //Write Black and White image to RAM + EPD_2IN13_V4_SendData2(Image, Width*Height); + EPD_2in13_V4_TurnOnDisplay_Partial(); +} + +void EPD_2in13_V4_Display_Partial_Wait(UBYTE *Image) +{ + UWORD Width, Height; + Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1); + Height = EPD_2in13_V4_HEIGHT; + + EPD_2in13_V4_ReadBusy(); + + //Reset + DEV_Digital_Write(EPD_RST_PIN, 0); + DEV_Delay_ms(1); + DEV_Digital_Write(EPD_RST_PIN, 1); + + EPD_2in13_V4_SendCommand(0x3C); //BorderWavefrom + EPD_2in13_V4_SendData(0x80); + + EPD_2in13_V4_SendCommand(0x01); //Driver output control + EPD_2in13_V4_SendData(0xF9); + EPD_2in13_V4_SendData(0x00); + EPD_2in13_V4_SendData(0x00); + + EPD_2in13_V4_SendCommand(0x11); //data entry mode + EPD_2in13_V4_SendData(0x03); + + EPD_2in13_V4_SetWindows(0, 0, EPD_2in13_V4_WIDTH-1, EPD_2in13_V4_HEIGHT-1); + EPD_2in13_V4_SetCursor(0, 0); + + EPD_2in13_V4_SendCommand(0x24); //Write Black and White image to RAM + EPD_2IN13_V4_SendData2(Image, Width*Height); + EPD_2in13_V4_TurnOnDisplay_Partial_Wait(); +} + +/****************************************************************************** +function : Enter sleep mode +parameter: +******************************************************************************/ +void EPD_2in13_V4_Sleep(void) +{ + EPD_2in13_V4_SendCommand(0x10); //enter deep sleep + EPD_2in13_V4_SendData(0x01); + DEV_Delay_ms(100); +} diff --git a/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V4.h b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V4.h new file mode 100644 index 0000000..22abdd4 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in13_V4.h @@ -0,0 +1,56 @@ +/***************************************************************************** +* | File : EPD_2Iin13_V4.h +* | Author : Waveshare team +* | Function : 2.13inch e-paper V4 +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2023-08-12 +* | Info : +* ----------------------------------------------------------------------------- +# +# 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 __EPD_2in13_V4_H_ +#define __EPD_2in13_V4_H_ + +#include "DEV_Config.h" + + +// Display resolution +#define EPD_2in13_V4_WIDTH 122 +#define EPD_2in13_V4_HEIGHT 250 + +#define EPD_2IN13_V4_FULL 0 +#define EPD_2IN13_V4_PART 1 +#define EPD_2IN13_V4_Fast 2 + +void EPD_2in13_V4_Init(UBYTE Mode); +void EPD_2in13_V4_Clear(void); +void EPD_2in13_V4_Clear_Black(void); +void EPD_2in13_V4_Display(UBYTE *Image); +void EPD_2in13_V4_Display_Fast(UBYTE *Image); +void EPD_2in13_V4_Display_Base(UBYTE *Image); +void EPD_2in13_V4_Display_Partial(UBYTE *Image); +void EPD_2in13_V4_Display_Partial_Wait(UBYTE *Image); +void EPD_2in13_V4_Sleep(void); + + +#endif diff --git a/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in9_V2.c b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in9_V2.c new file mode 100644 index 0000000..a3c660c --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in9_V2.c @@ -0,0 +1,615 @@ +/***************************************************************************** +* | File : EPD_2in9_V2.c +* | Author : Waveshare team +* | Function : 2.9inch e-paper V2 +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2020-10-20 +* | Info : +* ----------------------------------------------------------------------------- +# +# 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 "EPD_2in9_V2.h" +#include "Debug.h" + +UBYTE _WF_PARTIAL_2IN9[159] = +{ +0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0A,0x0,0x0,0x0,0x0,0x0,0x0, +0x1,0x0,0x0,0x0,0x0,0x0,0x0, +0x1,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0, +0x22,0x17,0x41,0xB0,0x32,0x36, +}; + +UBYTE _WF_PARTIAL_2IN9_Wait[159] = +{ +0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0A,0x0,0x0,0x0,0x0,0x0,0x2, +0x1,0x0,0x0,0x0,0x0,0x0,0x0, +0x1,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0, +0x22,0x17,0x41,0xB0,0x32,0x36, +}; + +unsigned char Gray4[159] = +{ + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L0 //2.28s + 0x20, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L1 + 0x28, 0x60, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L2 + 0x2A, 0x60, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L3 + 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L4 + 0x00, 0x02, 0x00, 0x05, 0x14, 0x00, 0x00, //TP, SR, RP of Group0 + 0x1E, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x01, //TP, SR, RP of Group1 + 0x00, 0x02, 0x00, 0x05, 0x14, 0x00, 0x00, //TP, SR, RP of Group2 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group3 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group4 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group5 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group6 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group7 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group8 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group9 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group10 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group11 + 0x24, 0x22, 0x22, 0x22, 0x23, 0x32, 0x00, 0x00, 0x00, //FR, XON + 0x22, 0x17, 0x41, 0xAE, 0x32, 0x28, //EOPT VGH VSH1 VSH2 VSL VCOM +}; + +unsigned char WF_FULL[159] = +{ +0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L0 1.00S +0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L1 +0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L2 +0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L3 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L4 +0x19, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group0 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group1 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group2 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group3 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group4 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group5 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group6 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group7 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group8 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group9 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group10 +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group11 +0x24, 0x42, 0x22, 0x22, 0x23, 0x32, 0x00, 0x00, 0x00, //FR, XON +0x22, 0x17, 0x41, 0xAE, 0x32, 0x38, //EOPT VGH VSH1 VSH2 VSL VCOM +}; + +/****************************************************************************** +function : Software reset +parameter: +******************************************************************************/ +static void EPD_2IN9_V2_Reset(void) +{ + DEV_Digital_Write(EPD_RST_PIN, 1); + DEV_Delay_ms(20); + DEV_Digital_Write(EPD_RST_PIN, 0); + DEV_Delay_ms(2); + DEV_Digital_Write(EPD_RST_PIN, 1); + DEV_Delay_ms(20); +} + +/****************************************************************************** +function : send command +parameter: + Reg : Command register +******************************************************************************/ +static void EPD_2IN9_V2_SendCommand(UBYTE Reg) +{ + DEV_Digital_Write(EPD_DC_PIN, 0); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_WriteByte(Reg); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +/****************************************************************************** +function : send data +parameter: + Data : Write data +******************************************************************************/ +static void EPD_2IN9_V2_SendData(UBYTE Data) +{ + DEV_Digital_Write(EPD_DC_PIN, 1); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_WriteByte(Data); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +static void EPD_2IN9_V2_SendData2(UBYTE *Data, UDOUBLE len) +{ + DEV_Digital_Write(EPD_DC_PIN, 1); + DEV_Digital_Write(EPD_CS_PIN, 0); + DEV_SPI_Write_nByte(Data, len); + DEV_Digital_Write(EPD_CS_PIN, 1); +} + +/****************************************************************************** +function : Wait until the busy_pin goes LOW +parameter: +******************************************************************************/ +void EPD_2IN9_V2_ReadBusy(void) +{ + // Debug("e-Paper busy\r\n"); + while(1) + { //=1 BUSY + if(DEV_Digital_Read(EPD_BUSY_PIN)==0) + break; + DEV_Delay_ms(0.01); + } + // DEV_Delay_ms(10); + // Debug("e-Paper busy release\r\n"); +} + +static void EPD_2IN9_V2_LUT(UBYTE LUT) +{ + EPD_2IN9_V2_SendCommand(0x32); + if(LUT) + EPD_2IN9_V2_SendData2(_WF_PARTIAL_2IN9, 159); + else + EPD_2IN9_V2_SendData2(_WF_PARTIAL_2IN9_Wait, 159); + EPD_2IN9_V2_ReadBusy(); +} + +static void EPD_2IN9_V2_LUT_by_host(UBYTE *lut) +{ + UBYTE count; + EPD_2IN9_V2_SendCommand(0x32); + for(count=0; count<153; count++) + EPD_2IN9_V2_SendData(*lut++); + EPD_2IN9_V2_ReadBusy(); + + EPD_2IN9_V2_SendCommand(0x3f); + EPD_2IN9_V2_SendData(*lut++); + EPD_2IN9_V2_SendCommand(0x03); // gate voltage + EPD_2IN9_V2_SendData(*lut++); + EPD_2IN9_V2_SendCommand(0x04); // source voltage + EPD_2IN9_V2_SendData(*lut++); // VSH + EPD_2IN9_V2_SendData(*lut++); // VSH2 + EPD_2IN9_V2_SendData(*lut++); // VSL + EPD_2IN9_V2_SendCommand(0x2c); // VCOM + EPD_2IN9_V2_SendData(*lut++); + +} + +/****************************************************************************** +function : Turn On Display +parameter: +******************************************************************************/ +static void EPD_2IN9_V2_TurnOnDisplay(void) +{ + EPD_2IN9_V2_SendCommand(0x22); //Display Update Control + EPD_2IN9_V2_SendData(0xF7); + EPD_2IN9_V2_SendCommand(0x20); //Activate Display Update Sequence + EPD_2IN9_V2_ReadBusy(); +} + +static void EPD_2IN9_V2_TurnOnDisplay_Partial(void) +{ + EPD_2IN9_V2_SendCommand(0x22); //Display Update Control + EPD_2IN9_V2_SendData(0x0F); + EPD_2IN9_V2_SendCommand(0x20); //Activate Display Update Sequence + // EPD_2IN9_V2_ReadBusy(); +} + +static void EPD_2IN9_V2_TurnOnDisplay_Partial_Wait(void) +{ + EPD_2IN9_V2_SendCommand(0x22); //Display Update Control + EPD_2IN9_V2_SendData(0x0F); + EPD_2IN9_V2_SendCommand(0x20); //Activate Display Update Sequence + EPD_2IN9_V2_ReadBusy(); +} + +static void EPD_2IN9_V2_TurnOnDisplay_Gray4(void) +{ + EPD_2IN9_V2_SendCommand(0x22); //Display Update Control + EPD_2IN9_V2_SendData(0xC7); + EPD_2IN9_V2_SendCommand(0x20); //Activate Display Update Sequence + EPD_2IN9_V2_ReadBusy(); +} + +/****************************************************************************** +function : Setting the display window +parameter: +******************************************************************************/ +static void EPD_2IN9_V2_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend) +{ + EPD_2IN9_V2_SendCommand(0x44); // SET_RAM_X_ADDRESS_START_END_POSITION + EPD_2IN9_V2_SendData((Xstart>>3) & 0xFF); + EPD_2IN9_V2_SendData((Xend>>3) & 0xFF); + + EPD_2IN9_V2_SendCommand(0x45); // SET_RAM_Y_ADDRESS_START_END_POSITION + EPD_2IN9_V2_SendData(Ystart & 0xFF); + EPD_2IN9_V2_SendData((Ystart >> 8) & 0xFF); + EPD_2IN9_V2_SendData(Yend & 0xFF); + EPD_2IN9_V2_SendData((Yend >> 8) & 0xFF); +} + +/****************************************************************************** +function : Set Cursor +parameter: +******************************************************************************/ +static void EPD_2IN9_V2_SetCursor(UWORD Xstart, UWORD Ystart) +{ + EPD_2IN9_V2_SendCommand(0x4E); // SET_RAM_X_ADDRESS_COUNTER + EPD_2IN9_V2_SendData(Xstart & 0xFF); + + EPD_2IN9_V2_SendCommand(0x4F); // SET_RAM_Y_ADDRESS_COUNTER + EPD_2IN9_V2_SendData(Ystart & 0xFF); + EPD_2IN9_V2_SendData((Ystart >> 8) & 0xFF); +} + +/****************************************************************************** +function : Initialize the e-Paper register +parameter: +******************************************************************************/ +void EPD_2IN9_V2_Init(void) +{ + EPD_2IN9_V2_Reset(); + DEV_Delay_ms(100); + + EPD_2IN9_V2_ReadBusy(); + EPD_2IN9_V2_SendCommand(0x12); // soft reset + EPD_2IN9_V2_ReadBusy(); + + EPD_2IN9_V2_SendCommand(0x01); //Driver output control + EPD_2IN9_V2_SendData(0x27); + EPD_2IN9_V2_SendData(0x01); + EPD_2IN9_V2_SendData(0x00); + + EPD_2IN9_V2_SendCommand(0x11); //data entry mode + EPD_2IN9_V2_SendData(0x03); + + EPD_2IN9_V2_SetWindows(0, 0, EPD_2IN9_V2_WIDTH-1, EPD_2IN9_V2_HEIGHT-1); + + EPD_2IN9_V2_SendCommand(0x21); // Display update control + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x80); + + EPD_2IN9_V2_SetCursor(0, 0); + EPD_2IN9_V2_ReadBusy(); +} + +void EPD_2IN9_V2_Init_Fast(void) +{ + EPD_2IN9_V2_Reset(); + DEV_Delay_ms(100); + + EPD_2IN9_V2_ReadBusy(); + EPD_2IN9_V2_SendCommand(0x12); // soft reset + EPD_2IN9_V2_ReadBusy(); + + EPD_2IN9_V2_SendCommand(0x01); //Driver output control + EPD_2IN9_V2_SendData(0x27); + EPD_2IN9_V2_SendData(0x01); + EPD_2IN9_V2_SendData(0x00); + + EPD_2IN9_V2_SendCommand(0x11); //data entry mode + EPD_2IN9_V2_SendData(0x03); + + EPD_2IN9_V2_SetWindows(0, 0, EPD_2IN9_V2_WIDTH-1, EPD_2IN9_V2_HEIGHT-1); + + EPD_2IN9_V2_SendCommand(0x3C); + EPD_2IN9_V2_SendData(0x05); + + EPD_2IN9_V2_SendCommand(0x21); // Display update control + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x80); + + EPD_2IN9_V2_SetCursor(0, 0); + EPD_2IN9_V2_ReadBusy(); + + EPD_2IN9_V2_LUT_by_host(WF_FULL); +} + +void EPD_2IN9_V2_Gray4_Init(void) +{ + EPD_2IN9_V2_Reset(); + DEV_Delay_ms(100); + + EPD_2IN9_V2_ReadBusy(); + EPD_2IN9_V2_SendCommand(0x12); // soft reset + EPD_2IN9_V2_ReadBusy(); + + EPD_2IN9_V2_SendCommand(0x74); //set analog block control + EPD_2IN9_V2_SendData(0x54); + EPD_2IN9_V2_SendCommand(0x7E); //set digital block control + EPD_2IN9_V2_SendData(0x3B); + + EPD_2IN9_V2_SendCommand(0x01); //Driver output control + EPD_2IN9_V2_SendData(0x27); + EPD_2IN9_V2_SendData(0x01); + EPD_2IN9_V2_SendData(0x00); + + EPD_2IN9_V2_SendCommand(0x11); //data entry mode + EPD_2IN9_V2_SendData(0x03); + + EPD_2IN9_V2_SetWindows(0, 0, EPD_2IN9_V2_WIDTH-1, EPD_2IN9_V2_HEIGHT-1); + + EPD_2IN9_V2_SendCommand(0x3C); + EPD_2IN9_V2_SendData(0x00); + + EPD_2IN9_V2_SendCommand(0x21); // Display update control + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x80); + + EPD_2IN9_V2_SetCursor(0, 0); + EPD_2IN9_V2_ReadBusy(); + + EPD_2IN9_V2_LUT_by_host(Gray4); +} + +/****************************************************************************** +function : Clear screen +parameter: +******************************************************************************/ +void EPD_2IN9_V2_Clear(void) +{ + UWORD i; + EPD_2IN9_V2_SendCommand(0x24); //write RAM for black(0)/white (1) + for(i=0;i<4736;i++) + { + EPD_2IN9_V2_SendData(0xff); + } + EPD_2IN9_V2_TurnOnDisplay(); +} + +/****************************************************************************** +function : Sends the image buffer in RAM to e-Paper and displays +parameter: +******************************************************************************/ +void EPD_2IN9_V2_Display(UBYTE *Image) +{ + UWORD i; + EPD_2IN9_V2_SendCommand(0x24); //write RAM for black(0)/white (1) + for(i=0;i<4736;i++) + { + EPD_2IN9_V2_SendData(Image[i]); + } + // EPD_2IN9_V2_SendData2(Image, 4736); + EPD_2IN9_V2_TurnOnDisplay(); +} + +void EPD_2IN9_V2_Display_Base(UBYTE *Image) +{ + UWORD i; + + EPD_2IN9_V2_SendCommand(0x24); //Write Black and White image to RAM + for(i=0;i<4736;i++) + { + EPD_2IN9_V2_SendData(Image[i]); + } + // EPD_2IN9_V2_SendData2(Image, 4736); + EPD_2IN9_V2_SendCommand(0x26); //Write Black and White image to RAM + for(i=0;i<4736;i++) + { + EPD_2IN9_V2_SendData(Image[i]); + } + // EPD_2IN9_V2_SendData2(Image, 4736); + EPD_2IN9_V2_TurnOnDisplay(); +} + +void EPD_2IN9_V2_Display_Partial_Wait(UBYTE *Image) +{ + // UWORD i; + +//Reset + DEV_Digital_Write(EPD_RST_PIN, 0); + DEV_Delay_ms(0.2); + DEV_Digital_Write(EPD_RST_PIN, 1); + // DEV_Delay_ms(1); + + EPD_2IN9_V2_LUT(0); + EPD_2IN9_V2_SendCommand(0x37); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x40); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + + EPD_2IN9_V2_SendCommand(0x3C); //BorderWavefrom + EPD_2IN9_V2_SendData(0x80); + + EPD_2IN9_V2_SendCommand(0x22); + EPD_2IN9_V2_SendData(0xC0); + EPD_2IN9_V2_SendCommand(0x20); + EPD_2IN9_V2_ReadBusy(); + + EPD_2IN9_V2_SetWindows(0, 0, EPD_2IN9_V2_WIDTH-1, EPD_2IN9_V2_HEIGHT-1); + EPD_2IN9_V2_SetCursor(0, 0); + + EPD_2IN9_V2_SendCommand(0x24); //Write Black and White image to RAM + // for(i=0;i<4736;i++) + // { + // EPD_2IN9_V2_SendData(Image[i]); + // } + EPD_2IN9_V2_SendData2(Image, 2500); + EPD_2IN9_V2_SendData2(Image+2500, 2236); + EPD_2IN9_V2_TurnOnDisplay_Partial_Wait(); +} + +void EPD_2IN9_V2_Display_Partial(UBYTE *Image) +{ + // UWORD i; + +//Reset + // DEV_Digital_Write(EPD_RST_PIN, 0); + // DEV_Delay_ms(5); + // DEV_Digital_Write(EPD_RST_PIN, 1); + // DEV_Delay_ms(10); + + EPD_2IN9_V2_LUT(1); + EPD_2IN9_V2_SendCommand(0x37); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x40); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + EPD_2IN9_V2_SendData(0x00); + + EPD_2IN9_V2_SendCommand(0x3C); //BorderWavefrom + EPD_2IN9_V2_SendData(0x80); + + EPD_2IN9_V2_SendCommand(0x22); + EPD_2IN9_V2_SendData(0xC0); + EPD_2IN9_V2_SendCommand(0x20); + EPD_2IN9_V2_ReadBusy(); + + EPD_2IN9_V2_SetWindows(0, 0, EPD_2IN9_V2_WIDTH-1, EPD_2IN9_V2_HEIGHT-1); + EPD_2IN9_V2_SetCursor(0, 0); + + EPD_2IN9_V2_SendCommand(0x24); //Write Black and White image to RAM + EPD_2IN9_V2_SendData2(Image, 2500); + EPD_2IN9_V2_SendData2(Image+2500, 2236); + EPD_2IN9_V2_TurnOnDisplay_Partial(); +} + +void EPD_2IN9_V2_4GrayDisplay(UBYTE *Image) +{ + UDOUBLE i,j,k; + UBYTE temp1,temp2,temp3; + + // old data + EPD_2IN9_V2_SendCommand(0x24); + for(i=0; i<4736; i++) { + temp3=0; + for(j=0; j<2; j++) { + temp1 = Image[i*2+j]; + for(k=0; k<2; k++) { + temp2 = temp1&0xC0; + if(temp2 == 0xC0) + temp3 |= 0x00; + else if(temp2 == 0x00) + temp3 |= 0x01; + else if(temp2 == 0x80) + temp3 |= 0x01; + else //0x40 + temp3 |= 0x00; + temp3 <<= 1; + + temp1 <<= 2; + temp2 = temp1&0xC0 ; + if(temp2 == 0xC0) + temp3 |= 0x00; + else if(temp2 == 0x00) + temp3 |= 0x01; + else if(temp2 == 0x80) + temp3 |= 0x01; + else //0x40 + temp3 |= 0x00; + if(j!=1 || k!=1) + temp3 <<= 1; + + temp1 <<= 2; + } + } + EPD_2IN9_V2_SendData(temp3); + // printf("%x ",temp3); + } + + EPD_2IN9_V2_SendCommand(0x26); //write RAM for black(0)/white (1) + for(i=0; i<4736; i++) { + temp3=0; + for(j=0; j<2; j++) { + temp1 = Image[i*2+j]; + for(k=0; k<2; k++) { + temp2 = temp1&0xC0 ; + if(temp2 == 0xC0) + temp3 |= 0x00;//white + else if(temp2 == 0x00) + temp3 |= 0x01; //black + else if(temp2 == 0x80) + temp3 |= 0x00; //gray1 + else //0x40 + temp3 |= 0x01; //gray2 + temp3 <<= 1; + + temp1 <<= 2; + temp2 = temp1&0xC0 ; + if(temp2 == 0xC0) //white + temp3 |= 0x00; + else if(temp2 == 0x00) //black + temp3 |= 0x01; + else if(temp2 == 0x80) + temp3 |= 0x00; //gray1 + else //0x40 + temp3 |= 0x01; //gray2 + if(j!=1 || k!=1) + temp3 <<= 1; + + temp1 <<= 2; + } + } + EPD_2IN9_V2_SendData(temp3); + // printf("%x ",temp3); + } + + EPD_2IN9_V2_TurnOnDisplay_Gray4(); +} + +/****************************************************************************** +function : Enter sleep mode +parameter: +******************************************************************************/ +void EPD_2IN9_V2_Sleep(void) +{ + EPD_2IN9_V2_SendCommand(0x10); //enter deep sleep + EPD_2IN9_V2_SendData(0x01); + DEV_Delay_ms(100); +} diff --git a/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in9_V2.h b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in9_V2.h new file mode 100644 index 0000000..da7b9ce --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/EPD/EPD_2in9_V2.h @@ -0,0 +1,53 @@ +/***************************************************************************** +* | File : EPD_2in9_V2.h +* | Author : Waveshare team +* | Function : 2.9inch e-paper V2 +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2020-10-20 +* | Info : +* ----------------------------------------------------------------------------- +# +# 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 __EPD_2IN9_V2_H_ +#define __EPD_2IN9_V2_H_ + +#include "DEV_Config.h" + +// Display resolution +#define EPD_2IN9_V2_WIDTH 128 +#define EPD_2IN9_V2_HEIGHT 296 + +void EPD_2IN9_V2_Init(void); +void EPD_2IN9_V2_Clear(void); +void EPD_2IN9_V2_Display(UBYTE *Image); +void EPD_2IN9_V2_Display_Base(UBYTE *Image); +void EPD_2IN9_V2_Display_Partial(UBYTE *Image); +void EPD_2IN9_V2_Sleep(void); + +void EPD_2IN9_V2_Display_Partial_Wait(UBYTE *Image); + +void EPD_2IN9_V2_Init_Fast(void); +void EPD_2IN9_V2_Gray4_Init(void); +void EPD_2IN9_V2_4GrayDisplay(UBYTE *Image); + +#endif diff --git a/docs/Touch_e-Paper_Code/c/lib/Fonts/font12.c b/docs/Touch_e-Paper_Code/c/lib/Fonts/font12.c new file mode 100644 index 0000000..485c3f0 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Fonts/font12.c @@ -0,0 +1,1384 @@ +/** + ****************************************************************************** + * @file Font12.c + * @author MCD Application Team + * @version V1.0.0 + * @date 18-February-2014 + * @brief This file provides text Font12 for STM32xx-EVAL's LCD driver. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * 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. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "fonts.h" + +// +// Font data for Courier New 12pt +// + +const uint8_t Font12_Table[] = +{ + // @0 ' ' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @12 '!' (7 pixels wide) + 0x00, // + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + + // @24 '"' (7 pixels wide) + 0x00, // + 0x6C, // ## ## + 0x48, // # # + 0x48, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @36 '#' (7 pixels wide) + 0x00, // + 0x14, // # # + 0x14, // # # + 0x28, // # # + 0x7C, // ##### + 0x28, // # # + 0x7C, // ##### + 0x28, // # # + 0x50, // # # + 0x50, // # # + 0x00, // + 0x00, // + + // @48 '$' (7 pixels wide) + 0x00, // + 0x10, // # + 0x38, // ### + 0x40, // # + 0x40, // # + 0x38, // ### + 0x48, // # # + 0x70, // ### + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + + // @60 '%' (7 pixels wide) + 0x00, // + 0x20, // # + 0x50, // # # + 0x20, // # + 0x0C, // ## + 0x70, // ### + 0x08, // # + 0x14, // # # + 0x08, // # + 0x00, // + 0x00, // + 0x00, // + + // @72 '&' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x18, // ## + 0x20, // # + 0x20, // # + 0x54, // # # # + 0x48, // # # + 0x34, // ## # + 0x00, // + 0x00, // + 0x00, // + + // @84 ''' (7 pixels wide) + 0x00, // + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @96 '(' (7 pixels wide) + 0x00, // + 0x08, // # + 0x08, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x08, // # + 0x08, // # + 0x00, // + + // @108 ')' (7 pixels wide) + 0x00, // + 0x20, // # + 0x20, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x20, // # + 0x20, // # + 0x00, // + + // @120 '*' (7 pixels wide) + 0x00, // + 0x10, // # + 0x7C, // ##### + 0x10, // # + 0x28, // # # + 0x28, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @132 '+' (7 pixels wide) + 0x00, // + 0x00, // + 0x10, // # + 0x10, // # + 0x10, // # + 0xFE, // ####### + 0x10, // # + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + + // @144 ',' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x18, // ## + 0x10, // # + 0x30, // ## + 0x20, // # + 0x00, // + + // @156 '-' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @168 '.' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x30, // ## + 0x30, // ## + 0x00, // + 0x00, // + 0x00, // + + // @180 '/' (7 pixels wide) + 0x00, // + 0x04, // # + 0x04, // # + 0x08, // # + 0x08, // # + 0x10, // # + 0x10, // # + 0x20, // # + 0x20, // # + 0x40, // # + 0x00, // + 0x00, // + + // @192 '0' (7 pixels wide) + 0x00, // + 0x38, // ### + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @204 '1' (7 pixels wide) + 0x00, // + 0x30, // ## + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @216 '2' (7 pixels wide) + 0x00, // + 0x38, // ### + 0x44, // # # + 0x04, // # + 0x08, // # + 0x10, // # + 0x20, // # + 0x44, // # # + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @228 '3' (7 pixels wide) + 0x00, // + 0x38, // ### + 0x44, // # # + 0x04, // # + 0x18, // ## + 0x04, // # + 0x04, // # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @240 '4' (7 pixels wide) + 0x00, // + 0x0C, // ## + 0x14, // # # + 0x14, // # # + 0x24, // # # + 0x44, // # # + 0x7E, // ###### + 0x04, // # + 0x0E, // ### + 0x00, // + 0x00, // + 0x00, // + + // @252 '5' (7 pixels wide) + 0x00, // + 0x3C, // #### + 0x20, // # + 0x20, // # + 0x38, // ### + 0x04, // # + 0x04, // # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @264 '6' (7 pixels wide) + 0x00, // + 0x1C, // ### + 0x20, // # + 0x40, // # + 0x78, // #### + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @276 '7' (7 pixels wide) + 0x00, // + 0x7C, // ##### + 0x44, // # # + 0x04, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + + // @288 '8' (7 pixels wide) + 0x00, // + 0x38, // ### + 0x44, // # # + 0x44, // # # + 0x38, // ### + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @300 '9' (7 pixels wide) + 0x00, // + 0x38, // ### + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x3C, // #### + 0x04, // # + 0x08, // # + 0x70, // ### + 0x00, // + 0x00, // + 0x00, // + + // @312 ':' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x30, // ## + 0x30, // ## + 0x00, // + 0x00, // + 0x30, // ## + 0x30, // ## + 0x00, // + 0x00, // + 0x00, // + + // @324 ';' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x18, // ## + 0x18, // ## + 0x00, // + 0x00, // + 0x18, // ## + 0x30, // ## + 0x20, // # + 0x00, // + 0x00, // + + // @336 '<' (7 pixels wide) + 0x00, // + 0x00, // + 0x0C, // ## + 0x10, // # + 0x60, // ## + 0x80, // # + 0x60, // ## + 0x10, // # + 0x0C, // ## + 0x00, // + 0x00, // + 0x00, // + + // @348 '=' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x7C, // ##### + 0x00, // + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @360 '>' (7 pixels wide) + 0x00, // + 0x00, // + 0xC0, // ## + 0x20, // # + 0x18, // ## + 0x04, // # + 0x18, // ## + 0x20, // # + 0xC0, // ## + 0x00, // + 0x00, // + 0x00, // + + // @372 '?' (7 pixels wide) + 0x00, // + 0x00, // + 0x18, // ## + 0x24, // # # + 0x04, // # + 0x08, // # + 0x10, // # + 0x00, // + 0x30, // ## + 0x00, // + 0x00, // + 0x00, // + + // @384 '@' (7 pixels wide) + 0x38, // ### + 0x44, // # # + 0x44, // # # + 0x4C, // # ## + 0x54, // # # # + 0x54, // # # # + 0x4C, // # ## + 0x40, // # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + + // @396 'A' (7 pixels wide) + 0x00, // + 0x30, // ## + 0x10, // # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x7C, // ##### + 0x44, // # # + 0xEE, // ### ### + 0x00, // + 0x00, // + 0x00, // + + // @408 'B' (7 pixels wide) + 0x00, // + 0xF8, // ##### + 0x44, // # # + 0x44, // # # + 0x78, // #### + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0xF8, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @420 'C' (7 pixels wide) + 0x00, // + 0x3C, // #### + 0x44, // # # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @432 'D' (7 pixels wide) + 0x00, // + 0xF0, // #### + 0x48, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x48, // # # + 0xF0, // #### + 0x00, // + 0x00, // + 0x00, // + + // @444 'E' (7 pixels wide) + 0x00, // + 0xFC, // ###### + 0x44, // # # + 0x50, // # # + 0x70, // ### + 0x50, // # # + 0x40, // # + 0x44, // # # + 0xFC, // ###### + 0x00, // + 0x00, // + 0x00, // + + // @456 'F' (7 pixels wide) + 0x00, // + 0x7E, // ###### + 0x22, // # # + 0x28, // # # + 0x38, // ### + 0x28, // # # + 0x20, // # + 0x20, // # + 0x70, // ### + 0x00, // + 0x00, // + 0x00, // + + // @468 'G' (7 pixels wide) + 0x00, // + 0x3C, // #### + 0x44, // # # + 0x40, // # + 0x40, // # + 0x4E, // # ### + 0x44, // # # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @480 'H' (7 pixels wide) + 0x00, // + 0xEE, // ### ### + 0x44, // # # + 0x44, // # # + 0x7C, // ##### + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0xEE, // ### ### + 0x00, // + 0x00, // + 0x00, // + + // @492 'I' (7 pixels wide) + 0x00, // + 0x7C, // ##### + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @504 'J' (7 pixels wide) + 0x00, // + 0x3C, // #### + 0x08, // # + 0x08, // # + 0x08, // # + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0x30, // ## + 0x00, // + 0x00, // + 0x00, // + + // @516 'K' (7 pixels wide) + 0x00, // + 0xEE, // ### ### + 0x44, // # # + 0x48, // # # + 0x50, // # # + 0x70, // ### + 0x48, // # # + 0x44, // # # + 0xE6, // ### ## + 0x00, // + 0x00, // + 0x00, // + + // @528 'L' (7 pixels wide) + 0x00, // + 0x70, // ### + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x24, // # # + 0x24, // # # + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @540 'M' (7 pixels wide) + 0x00, // + 0xEE, // ### ### + 0x6C, // ## ## + 0x6C, // ## ## + 0x54, // # # # + 0x54, // # # # + 0x44, // # # + 0x44, // # # + 0xEE, // ### ### + 0x00, // + 0x00, // + 0x00, // + + // @552 'N' (7 pixels wide) + 0x00, // + 0xEE, // ### ### + 0x64, // ## # + 0x64, // ## # + 0x54, // # # # + 0x54, // # # # + 0x54, // # # # + 0x4C, // # ## + 0xEC, // ### ## + 0x00, // + 0x00, // + 0x00, // + + // @564 'O' (7 pixels wide) + 0x00, // + 0x38, // ### + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @576 'P' (7 pixels wide) + 0x00, // + 0x78, // #### + 0x24, // # # + 0x24, // # # + 0x24, // # # + 0x38, // ### + 0x20, // # + 0x20, // # + 0x70, // ### + 0x00, // + 0x00, // + 0x00, // + + // @588 'Q' (7 pixels wide) + 0x00, // + 0x38, // ### + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x38, // ### + 0x1C, // ### + 0x00, // + 0x00, // + + // @600 'R' (7 pixels wide) + 0x00, // + 0xF8, // ##### + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x78, // #### + 0x48, // # # + 0x44, // # # + 0xE2, // ### # + 0x00, // + 0x00, // + 0x00, // + + // @612 'S' (7 pixels wide) + 0x00, // + 0x34, // ## # + 0x4C, // # ## + 0x40, // # + 0x38, // ### + 0x04, // # + 0x04, // # + 0x64, // ## # + 0x58, // # ## + 0x00, // + 0x00, // + 0x00, // + + // @624 'T' (7 pixels wide) + 0x00, // + 0xFE, // ####### + 0x92, // # # # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @636 'U' (7 pixels wide) + 0x00, // + 0xEE, // ### ### + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @648 'V' (7 pixels wide) + 0x00, // + 0xEE, // ### ### + 0x44, // # # + 0x44, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + + // @660 'W' (7 pixels wide) + 0x00, // + 0xEE, // ### ### + 0x44, // # # + 0x44, // # # + 0x54, // # # # + 0x54, // # # # + 0x54, // # # # + 0x54, // # # # + 0x28, // # # + 0x00, // + 0x00, // + 0x00, // + + // @672 'X' (7 pixels wide) + 0x00, // + 0xC6, // ## ## + 0x44, // # # + 0x28, // # # + 0x10, // # + 0x10, // # + 0x28, // # # + 0x44, // # # + 0xC6, // ## ## + 0x00, // + 0x00, // + 0x00, // + + // @684 'Y' (7 pixels wide) + 0x00, // + 0xEE, // ### ### + 0x44, // # # + 0x28, // # # + 0x28, // # # + 0x10, // # + 0x10, // # + 0x10, // # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @696 'Z' (7 pixels wide) + 0x00, // + 0x7C, // ##### + 0x44, // # # + 0x08, // # + 0x10, // # + 0x10, // # + 0x20, // # + 0x44, // # # + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @708 '[' (7 pixels wide) + 0x00, // + 0x38, // ### + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x38, // ### + 0x00, // + + // @720 '\' (7 pixels wide) + 0x00, // + 0x40, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x10, // # + 0x10, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x00, // + 0x00, // + + // @732 ']' (7 pixels wide) + 0x00, // + 0x38, // ### + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x38, // ### + 0x00, // + + // @744 '^' (7 pixels wide) + 0x00, // + 0x10, // # + 0x10, // # + 0x28, // # # + 0x44, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @756 '_' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xFE, // ####### + + // @768 '`' (7 pixels wide) + 0x00, // + 0x10, // # + 0x08, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @780 'a' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x38, // ### + 0x44, // # # + 0x3C, // #### + 0x44, // # # + 0x44, // # # + 0x3E, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @792 'b' (7 pixels wide) + 0x00, // + 0xC0, // ## + 0x40, // # + 0x58, // # ## + 0x64, // ## # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0xF8, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @804 'c' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x3C, // #### + 0x44, // # # + 0x40, // # + 0x40, // # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @816 'd' (7 pixels wide) + 0x00, // + 0x0C, // ## + 0x04, // # + 0x34, // ## # + 0x4C, // # ## + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x3E, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @828 'e' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x38, // ### + 0x44, // # # + 0x7C, // ##### + 0x40, // # + 0x40, // # + 0x3C, // #### + 0x00, // + 0x00, // + 0x00, // + + // @840 'f' (7 pixels wide) + 0x00, // + 0x1C, // ### + 0x20, // # + 0x7C, // ##### + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @852 'g' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x36, // ## ## + 0x4C, // # ## + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x3C, // #### + 0x04, // # + 0x38, // ### + 0x00, // + + // @864 'h' (7 pixels wide) + 0x00, // + 0xC0, // ## + 0x40, // # + 0x58, // # ## + 0x64, // ## # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0xEE, // ### ### + 0x00, // + 0x00, // + 0x00, // + + // @876 'i' (7 pixels wide) + 0x00, // + 0x10, // # + 0x00, // + 0x70, // ### + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @888 'j' (7 pixels wide) + 0x00, // + 0x10, // # + 0x00, // + 0x78, // #### + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x70, // ### + 0x00, // + + // @900 'k' (7 pixels wide) + 0x00, // + 0xC0, // ## + 0x40, // # + 0x5C, // # ### + 0x48, // # # + 0x70, // ### + 0x50, // # # + 0x48, // # # + 0xDC, // ## ### + 0x00, // + 0x00, // + 0x00, // + + // @912 'l' (7 pixels wide) + 0x00, // + 0x30, // ## + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @924 'm' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xE8, // ### # + 0x54, // # # # + 0x54, // # # # + 0x54, // # # # + 0x54, // # # # + 0xFE, // ####### + 0x00, // + 0x00, // + 0x00, // + + // @936 'n' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xD8, // ## ## + 0x64, // ## # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0xEE, // ### ### + 0x00, // + 0x00, // + 0x00, // + + // @948 'o' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x38, // ### + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @960 'p' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xD8, // ## ## + 0x64, // ## # + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x78, // #### + 0x40, // # + 0xE0, // ### + 0x00, // + + // @972 'q' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x36, // ## ## + 0x4C, // # ## + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x3C, // #### + 0x04, // # + 0x0E, // ### + 0x00, // + + // @984 'r' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x6C, // ## ## + 0x30, // ## + 0x20, // # + 0x20, // # + 0x20, // # + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @996 's' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x3C, // #### + 0x44, // # # + 0x38, // ### + 0x04, // # + 0x44, // # # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @1008 't' (7 pixels wide) + 0x00, // + 0x00, // + 0x20, // # + 0x7C, // ##### + 0x20, // # + 0x20, // # + 0x20, // # + 0x22, // # # + 0x1C, // ### + 0x00, // + 0x00, // + 0x00, // + + // @1020 'u' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xCC, // ## ## + 0x44, // # # + 0x44, // # # + 0x44, // # # + 0x4C, // # ## + 0x36, // ## ## + 0x00, // + 0x00, // + 0x00, // + + // @1032 'v' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xEE, // ### ### + 0x44, // # # + 0x44, // # # + 0x28, // # # + 0x28, // # # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + + // @1044 'w' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xEE, // ### ### + 0x44, // # # + 0x54, // # # # + 0x54, // # # # + 0x54, // # # # + 0x28, // # # + 0x00, // + 0x00, // + 0x00, // + + // @1056 'x' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xCC, // ## ## + 0x48, // # # + 0x30, // ## + 0x30, // ## + 0x48, // # # + 0xCC, // ## ## + 0x00, // + 0x00, // + 0x00, // + + // @1068 'y' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xEE, // ### ### + 0x44, // # # + 0x24, // # # + 0x28, // # # + 0x18, // ## + 0x10, // # + 0x10, // # + 0x78, // #### + 0x00, // + + // @1080 'z' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x7C, // ##### + 0x48, // # # + 0x10, // # + 0x20, // # + 0x44, // # # + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @1092 '{' (7 pixels wide) + 0x00, // + 0x08, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x20, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x08, // # + 0x00, // + + // @1104 '|' (7 pixels wide) + 0x00, // + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + + // @1116 '}' (7 pixels wide) + 0x00, // + 0x20, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x08, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x20, // # + 0x00, // + + // @1128 '~' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x24, // # # + 0x58, // # ## + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // +}; + +sFONT Font12 = { + Font12_Table, + 7, /* Width */ + 12, /* Height */ +}; + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/docs/Touch_e-Paper_Code/c/lib/Fonts/font12CN.c b/docs/Touch_e-Paper_Code/c/lib/Fonts/font12CN.c new file mode 100644 index 0000000..cf29da2 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Fonts/font12CN.c @@ -0,0 +1,120 @@ +/** + ****************************************************************************** + * @file Font12.c + * @author MCD Application Team + * @version V1.0.0 + * @date 18-February-2014 + * @brief This file provides text Font12 for STM32xx-EVAL's LCD driver. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * 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. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "fonts.h" + + +// +// Font data for Courier New 12pt +// + +const CH_CN Font12CN_Table[] = +{ +/*-- : --*/ +/*-- ΢ź12; ¶ӦĵΪx=16x21 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,0xC0,0x1D,0x80,0x3B,0xFF,0x3B,0x07, +0x3F,0x77,0x7E,0x76,0xF8,0x70,0xFB,0xFE,0xFB,0xFE,0x3F,0x77,0x3F,0x77,0x3E,0x73, +0x38,0x70,0x38,0x70,0x3B,0xE0,0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź12; ¶ӦĵΪx=16x21 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x73,0xFF,0x70,0x0F,0xFE,0x1E, +0x7E,0x3C,0x6E,0x38,0xEE,0x30,0xEF,0xFF,0xFC,0x30,0x7C,0x30,0x38,0x30,0x3E,0x30, +0x7E,0x30,0xE0,0x30,0xC1,0xF0,0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź12; ¶ӦĵΪx=16x21 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x0E,0x30,0x0E,0x3F,0xEE,0x30,0xEE, +0xFC,0xFF,0x76,0xCE,0x77,0xFE,0x7B,0xFE,0xFF,0xFE,0xF3,0xDE,0xF3,0xCE,0x37,0xEE, +0x3E,0x6E,0x3C,0x0E,0x30,0x3E,0x00,0x00,0x00,0x00}}, + +/*-- : ݮ --*/ +/*-- ΢ź12; ¶ӦĵΪx=16x21 --*/ +{{"ݮ"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x70,0xFF,0xFF,0x3E,0x70,0x38,0x00, +0x7F,0xFF,0xE0,0x00,0xFF,0xFC,0x3B,0x8C,0x39,0xCC,0xFF,0xFF,0x73,0x9C,0x71,0xDC, +0x7F,0xFF,0x00,0x1C,0x01,0xF8,0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź12; ¶ӦĵΪx=16x21 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x1F,0xFF,0xF0,0x3E,0x00,0x0E,0x1F, +0xCF,0xFB,0xFF,0xF8,0x3F,0xFF,0x0F,0xFF,0x7F,0xD8,0x7F,0xDC,0x6F,0xCE,0xED,0xFF, +0xFD,0xF7,0xF9,0xC0,0x00,0x00,0x00,0x00,0x00,0x00}}, + +/*-- : a --*/ +/*-- ΢ź12; ¶ӦĵΪx=16x21 --*/ +{{"a"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x3E,0x00,0x67,0x00,0x07,0x80,0x0F,0x80,0x7F,0x80,0xE3,0x80,0xE7,0x80,0xE7,0x80, +0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + +/*-- : b --*/ +/*-- ΢ź12; ¶ӦĵΪx=16x21 --*/ +{{"b"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x70,0x00,0x70,0x00,0x70,0x00, +0x7F,0x00,0x7B,0x80,0x71,0xC0,0x71,0xC0,0x71,0xC0,0x71,0xC0,0x71,0xC0,0x7B,0x80, +0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + +/*-- : c --*/ +/*-- ΢ź12; ¶ӦĵΪx=16x21 --*/ +{{"c"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x3F,0x00,0x73,0x00,0xF0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xF0,0x00,0x73,0x00, +0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + +/*-- : A --*/ +/*-- ΢ź12; ¶ӦĵΪx=16x21 --*/ +{{"A"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x1F,0x00,0x1F,0x00, +0x1F,0x00,0x3B,0x80,0x3B,0x80,0x71,0x80,0x7F,0xC0,0x71,0xC0,0xE0,0xE0,0xE0,0xE0, +0xE0,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, +}; + +cFONT Font12CN = { + Font12CN_Table, + sizeof(Font12CN_Table)/sizeof(CH_CN), /*size of table*/ + 11, /* ASCII Width */ + 16, /* Width */ + 21, /* Height */ +}; + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/docs/Touch_e-Paper_Code/c/lib/Fonts/font16.c b/docs/Touch_e-Paper_Code/c/lib/Fonts/font16.c new file mode 100644 index 0000000..58ce59b --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Fonts/font16.c @@ -0,0 +1,1764 @@ +/** + ****************************************************************************** + * @file font16.c + * @author MCD Application Team + * @version V1.0.0 + * @date 18-February-2014 + * @brief This file provides text font16 for STM32xx-EVAL's LCD driver. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * 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. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "fonts.h" + +// +// Font data for Courier New 12pt +// + +const uint8_t Font16_Table[] = +{ + // @0 ' ' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @32 '!' (11 pixels wide) + 0x00, 0x00, // + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x00, 0x00, // + 0x0C, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @64 '"' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1D, 0xC0, // ### ### + 0x1D, 0xC0, // ### ### + 0x08, 0x80, // # # + 0x08, 0x80, // # # + 0x08, 0x80, // # # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @96 '#' (11 pixels wide) + 0x00, 0x00, // + 0x0D, 0x80, // ## ## + 0x0D, 0x80, // ## ## + 0x0D, 0x80, // ## ## + 0x0D, 0x80, // ## ## + 0x3F, 0xC0, // ######## + 0x1B, 0x00, // ## ## + 0x3F, 0xC0, // ######## + 0x1B, 0x00, // ## ## + 0x1B, 0x00, // ## ## + 0x1B, 0x00, // ## ## + 0x1B, 0x00, // ## ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @128 '$' (11 pixels wide) + 0x04, 0x00, // # + 0x1F, 0x80, // ###### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x38, 0x00, // ### + 0x1E, 0x00, // #### + 0x0F, 0x00, // #### + 0x03, 0x80, // ### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x3F, 0x00, // ###### + 0x04, 0x00, // # + 0x04, 0x00, // # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @160 '%' (11 pixels wide) + 0x00, 0x00, // + 0x18, 0x00, // ## + 0x24, 0x00, // # # + 0x24, 0x00, // # # + 0x18, 0xC0, // ## ## + 0x07, 0x80, // #### + 0x1E, 0x00, // #### + 0x31, 0x80, // ## ## + 0x02, 0x40, // # # + 0x02, 0x40, // # # + 0x01, 0x80, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @192 '&' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x0F, 0x00, // #### + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x0C, 0x00, // ## + 0x1D, 0x80, // ### ## + 0x37, 0x00, // ## ### + 0x33, 0x00, // ## ## + 0x1D, 0x80, // ### ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @224 ''' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x02, 0x00, // # + 0x02, 0x00, // # + 0x02, 0x00, // # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @256 '(' (11 pixels wide) + 0x00, 0x00, // + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x0E, 0x00, // ### + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0E, 0x00, // ### + 0x06, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @288 ')' (11 pixels wide) + 0x00, 0x00, // + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x0C, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x00, // ## + 0x1C, 0x00, // ### + 0x18, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @320 '*' (11 pixels wide) + 0x00, 0x00, // + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x3F, 0xC0, // ######## + 0x3F, 0xC0, // ######## + 0x0F, 0x00, // #### + 0x1F, 0x80, // ###### + 0x19, 0x80, // ## ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @352 '+' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x04, 0x00, // # + 0x04, 0x00, // # + 0x04, 0x00, // # + 0x3F, 0x80, // ####### + 0x04, 0x00, // # + 0x04, 0x00, // # + 0x04, 0x00, // # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @384 ',' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x06, 0x00, // ## + 0x04, 0x00, // # + 0x0C, 0x00, // ## + 0x08, 0x00, // # + 0x08, 0x00, // # + 0x00, 0x00, // + 0x00, 0x00, // + + // @416 '-' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0x80, // ####### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @448 '.' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @480 '/' (11 pixels wide) + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @512 '0' (11 pixels wide) + 0x00, 0x00, // + 0x0E, 0x00, // ### + 0x1B, 0x00, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x1B, 0x00, // ## ## + 0x0E, 0x00, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @544 '1' (11 pixels wide) + 0x00, 0x00, // + 0x06, 0x00, // ## + 0x3E, 0x00, // ##### + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x3F, 0xC0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @576 '2' (11 pixels wide) + 0x00, 0x00, // + 0x0F, 0x00, // #### + 0x19, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x00, // ## + 0x18, 0x00, // ## + 0x30, 0x00, // ## + 0x3F, 0x80, // ####### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @608 '3' (11 pixels wide) + 0x00, 0x00, // + 0x3F, 0x00, // ###### + 0x61, 0x80, // ## ## + 0x01, 0x80, // ## + 0x03, 0x00, // ## + 0x1F, 0x00, // ##### + 0x03, 0x80, // ### + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x61, 0x80, // ## ## + 0x3F, 0x00, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @640 '4' (11 pixels wide) + 0x00, 0x00, // + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x0F, 0x00, // #### + 0x0B, 0x00, // # ## + 0x1B, 0x00, // ## ## + 0x13, 0x00, // # ## + 0x33, 0x00, // ## ## + 0x3F, 0x80, // ####### + 0x03, 0x00, // ## + 0x0F, 0x80, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @672 '5' (11 pixels wide) + 0x00, 0x00, // + 0x1F, 0x80, // ###### + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x1F, 0x00, // ##### + 0x11, 0x80, // # ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x21, 0x80, // # ## + 0x1F, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @704 '6' (11 pixels wide) + 0x00, 0x00, // + 0x07, 0x80, // #### + 0x1C, 0x00, // ### + 0x18, 0x00, // ## + 0x30, 0x00, // ## + 0x37, 0x00, // ## ### + 0x39, 0x80, // ### ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x19, 0x80, // ## ## + 0x0F, 0x00, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @736 '7' (11 pixels wide) + 0x00, 0x00, // + 0x7F, 0x00, // ####### + 0x43, 0x00, // # ## + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @768 '8' (11 pixels wide) + 0x00, 0x00, // + 0x1F, 0x00, // ##### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x1F, 0x00, // ##### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x1F, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @800 '9' (11 pixels wide) + 0x00, 0x00, // + 0x1E, 0x00, // #### + 0x33, 0x00, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x33, 0x80, // ## ### + 0x1D, 0x80, // ### ## + 0x01, 0x80, // ## + 0x03, 0x00, // ## + 0x07, 0x00, // ### + 0x3C, 0x00, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @832 ':' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @864 ';' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x06, 0x00, // ## + 0x04, 0x00, // # + 0x08, 0x00, // # + 0x08, 0x00, // # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @896 '<' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0xC0, // ## + 0x03, 0x00, // ## + 0x04, 0x00, // # + 0x18, 0x00, // ## + 0x60, 0x00, // ## + 0x18, 0x00, // ## + 0x04, 0x00, // # + 0x03, 0x00, // ## + 0x00, 0xC0, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @928 '=' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0xC0, // ######### + 0x00, 0x00, // + 0x7F, 0xC0, // ######### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @960 '>' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x60, 0x00, // ## + 0x18, 0x00, // ## + 0x04, 0x00, // # + 0x03, 0x00, // ## + 0x00, 0xC0, // ## + 0x03, 0x00, // ## + 0x04, 0x00, // # + 0x18, 0x00, // ## + 0x60, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @992 '?' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x00, // ##### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x01, 0x80, // ## + 0x07, 0x00, // ### + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x00, 0x00, // + 0x0C, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1024 '@' (11 pixels wide) + 0x00, 0x00, // + 0x0E, 0x00, // ### + 0x11, 0x00, // # # + 0x21, 0x00, // # # + 0x21, 0x00, // # # + 0x27, 0x00, // # ### + 0x29, 0x00, // # # # + 0x29, 0x00, // # # # + 0x27, 0x00, // # ### + 0x20, 0x00, // # + 0x11, 0x00, // # # + 0x0E, 0x00, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1056 'A' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0x00, // ###### + 0x0F, 0x00, // #### + 0x09, 0x00, // # # + 0x19, 0x80, // ## ## + 0x19, 0x80, // ## ## + 0x1F, 0x80, // ###### + 0x30, 0xC0, // ## ## + 0x30, 0xC0, // ## ## + 0x79, 0xE0, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1088 'B' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0x00, // ####### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x3F, 0x00, // ###### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x7F, 0x00, // ####### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1120 'C' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x40, // ##### # + 0x30, 0xC0, // ## ## + 0x60, 0x40, // ## # + 0x60, 0x00, // ## + 0x60, 0x00, // ## + 0x60, 0x00, // ## + 0x60, 0x40, // ## # + 0x30, 0x80, // ## # + 0x1F, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1152 'D' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0x00, // ####### + 0x31, 0x80, // ## ## + 0x30, 0xC0, // ## ## + 0x30, 0xC0, // ## ## + 0x30, 0xC0, // ## ## + 0x30, 0xC0, // ## ## + 0x30, 0xC0, // ## ## + 0x31, 0x80, // ## ## + 0x7F, 0x00, // ####### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1184 'E' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0x80, // ######## + 0x30, 0x80, // ## # + 0x30, 0x80, // ## # + 0x32, 0x00, // ## # + 0x3E, 0x00, // ##### + 0x32, 0x00, // ## # + 0x30, 0x80, // ## # + 0x30, 0x80, // ## # + 0x7F, 0x80, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1216 'F' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0xC0, // ######### + 0x30, 0x40, // ## # + 0x30, 0x40, // ## # + 0x32, 0x00, // ## # + 0x3E, 0x00, // ##### + 0x32, 0x00, // ## # + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x7C, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1248 'G' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1E, 0x80, // #### # + 0x31, 0x80, // ## ## + 0x60, 0x80, // ## # + 0x60, 0x00, // ## + 0x60, 0x00, // ## + 0x67, 0xC0, // ## ##### + 0x61, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x1F, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1280 'H' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7B, 0xC0, // #### #### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x3F, 0x80, // ####### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x7B, 0xC0, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1312 'I' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0xC0, // ######## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x3F, 0xC0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1344 'J' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0xC0, // ####### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x63, 0x00, // ## ## + 0x63, 0x00, // ## ## + 0x63, 0x00, // ## ## + 0x3E, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1376 'K' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7B, 0xC0, // #### #### + 0x31, 0x80, // ## ## + 0x33, 0x00, // ## ## + 0x36, 0x00, // ## ## + 0x3C, 0x00, // #### + 0x3E, 0x00, // ##### + 0x33, 0x00, // ## ## + 0x31, 0x80, // ## ## + 0x79, 0xC0, // #### ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1408 'L' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7E, 0x00, // ###### + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x40, // ## # + 0x18, 0x40, // ## # + 0x18, 0x40, // ## # + 0x7F, 0xC0, // ######### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1440 'M' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0xE0, 0xE0, // ### ### + 0x60, 0xC0, // ## ## + 0x71, 0xC0, // ### ### + 0x7B, 0xC0, // #### #### + 0x6A, 0xC0, // ## # # ## + 0x6E, 0xC0, // ## ### ## + 0x64, 0xC0, // ## # ## + 0x60, 0xC0, // ## ## + 0xFB, 0xE0, // ##### ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1472 'N' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x73, 0xC0, // ### #### + 0x31, 0x80, // ## ## + 0x39, 0x80, // ### ## + 0x3D, 0x80, // #### ## + 0x35, 0x80, // ## # ## + 0x37, 0x80, // ## #### + 0x33, 0x80, // ## ### + 0x31, 0x80, // ## ## + 0x79, 0x80, // #### ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1504 'O' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x00, // ##### + 0x31, 0x80, // ## ## + 0x60, 0xC0, // ## ## + 0x60, 0xC0, // ## ## + 0x60, 0xC0, // ## ## + 0x60, 0xC0, // ## ## + 0x60, 0xC0, // ## ## + 0x31, 0x80, // ## ## + 0x1F, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1536 'P' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0x00, // ####### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x3F, 0x00, // ###### + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x7E, 0x00, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1568 'Q' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x00, // ##### + 0x31, 0x80, // ## ## + 0x60, 0xC0, // ## ## + 0x60, 0xC0, // ## ## + 0x60, 0xC0, // ## ## + 0x60, 0xC0, // ## ## + 0x60, 0xC0, // ## ## + 0x31, 0x80, // ## ## + 0x1F, 0x00, // ##### + 0x0C, 0xC0, // ## ## + 0x1F, 0x80, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1600 'R' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0x00, // ####### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x3E, 0x00, // ##### + 0x33, 0x00, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x7C, 0xE0, // ##### ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1632 'S' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x80, // ###### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x38, 0x00, // ### + 0x1F, 0x00, // ##### + 0x03, 0x80, // ### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x3F, 0x00, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1664 'T' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0x80, // ######## + 0x4C, 0x80, // # ## # + 0x4C, 0x80, // # ## # + 0x4C, 0x80, // # ## # + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x3F, 0x00, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1696 'U' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7B, 0xC0, // #### #### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x1F, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1728 'V' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7B, 0xC0, // #### #### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x1B, 0x00, // ## ## + 0x1B, 0x00, // ## ## + 0x1B, 0x00, // ## ## + 0x0A, 0x00, // # # + 0x0E, 0x00, // ### + 0x0E, 0x00, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1760 'W' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0xFB, 0xE0, // ##### ##### + 0x60, 0xC0, // ## ## + 0x64, 0xC0, // ## # ## + 0x6E, 0xC0, // ## ### ## + 0x6E, 0xC0, // ## ### ## + 0x2A, 0x80, // # # # # + 0x3B, 0x80, // ### ### + 0x3B, 0x80, // ### ### + 0x31, 0x80, // ## ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1792 'X' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7B, 0xC0, // #### #### + 0x31, 0x80, // ## ## + 0x1B, 0x00, // ## ## + 0x0E, 0x00, // ### + 0x0E, 0x00, // ### + 0x0E, 0x00, // ### + 0x1B, 0x00, // ## ## + 0x31, 0x80, // ## ## + 0x7B, 0xC0, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1824 'Y' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x79, 0xE0, // #### #### + 0x30, 0xC0, // ## ## + 0x19, 0x80, // ## ## + 0x0F, 0x00, // #### + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x1F, 0x80, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1856 'Z' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0x80, // ####### + 0x21, 0x80, // # ## + 0x23, 0x00, // # ## + 0x06, 0x00, // ## + 0x04, 0x00, // # + 0x0C, 0x00, // ## + 0x18, 0x80, // ## # + 0x30, 0x80, // ## # + 0x3F, 0x80, // ####### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1888 '[' (11 pixels wide) + 0x00, 0x00, // + 0x07, 0x80, // #### + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x07, 0x80, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1920 '\' (11 pixels wide) + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x06, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1952 ']' (11 pixels wide) + 0x00, 0x00, // + 0x1E, 0x00, // #### + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x1E, 0x00, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1984 '^' (11 pixels wide) + 0x04, 0x00, // # + 0x0A, 0x00, // # # + 0x0A, 0x00, // # # + 0x11, 0x00, // # # + 0x20, 0x80, // # # + 0x20, 0x80, // # # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2016 '_' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0xFF, 0xE0, // ########### + + // @2048 '`' (11 pixels wide) + 0x08, 0x00, // # + 0x04, 0x00, // # + 0x02, 0x00, // # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2080 'a' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x00, // ##### + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x1F, 0x80, // ###### + 0x31, 0x80, // ## ## + 0x33, 0x80, // ## ### + 0x1D, 0xC0, // ### ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2112 'b' (11 pixels wide) + 0x00, 0x00, // + 0x70, 0x00, // ### + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x37, 0x00, // ## ### + 0x39, 0x80, // ### ## + 0x30, 0xC0, // ## ## + 0x30, 0xC0, // ## ## + 0x30, 0xC0, // ## ## + 0x39, 0x80, // ### ## + 0x77, 0x00, // ### ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2144 'c' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x1E, 0x80, // #### # + 0x31, 0x80, // ## ## + 0x60, 0x80, // ## # + 0x60, 0x00, // ## + 0x60, 0x80, // ## # + 0x31, 0x80, // ## ## + 0x1F, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2176 'd' (11 pixels wide) + 0x00, 0x00, // + 0x03, 0x80, // ### + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x1D, 0x80, // ### ## + 0x33, 0x80, // ## ### + 0x61, 0x80, // ## ## + 0x61, 0x80, // ## ## + 0x61, 0x80, // ## ## + 0x33, 0x80, // ## ### + 0x1D, 0xC0, // ### ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2208 'e' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x00, // ##### + 0x31, 0x80, // ## ## + 0x60, 0xC0, // ## ## + 0x7F, 0xC0, // ######### + 0x60, 0x00, // ## + 0x30, 0xC0, // ## ## + 0x1F, 0x80, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2240 'f' (11 pixels wide) + 0x00, 0x00, // + 0x07, 0xE0, // ###### + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x3F, 0x80, // ####### + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x3F, 0x80, // ####### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2272 'g' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x1D, 0xC0, // ### ### + 0x33, 0x80, // ## ### + 0x61, 0x80, // ## ## + 0x61, 0x80, // ## ## + 0x61, 0x80, // ## ## + 0x33, 0x80, // ## ### + 0x1D, 0x80, // ### ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x1F, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + + // @2304 'h' (11 pixels wide) + 0x00, 0x00, // + 0x70, 0x00, // ### + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x37, 0x00, // ## ### + 0x39, 0x80, // ### ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x7B, 0xC0, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2336 'i' (11 pixels wide) + 0x00, 0x00, // + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x00, 0x00, // + 0x1E, 0x00, // #### + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x3F, 0xC0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2368 'j' (11 pixels wide) + 0x00, 0x00, // + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x00, 0x00, // + 0x3F, 0x00, // ###### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x3E, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + + // @2400 'k' (11 pixels wide) + 0x00, 0x00, // + 0x70, 0x00, // ### + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x37, 0x80, // ## #### + 0x36, 0x00, // ## ## + 0x3C, 0x00, // #### + 0x3C, 0x00, // #### + 0x36, 0x00, // ## ## + 0x33, 0x00, // ## ## + 0x77, 0xC0, // ### ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2432 'l' (11 pixels wide) + 0x00, 0x00, // + 0x1E, 0x00, // #### + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x3F, 0xC0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2464 'm' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0x80, // ######## + 0x36, 0xC0, // ## ## ## + 0x36, 0xC0, // ## ## ## + 0x36, 0xC0, // ## ## ## + 0x36, 0xC0, // ## ## ## + 0x36, 0xC0, // ## ## ## + 0x76, 0xE0, // ### ## ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2496 'n' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x77, 0x00, // ### ### + 0x39, 0x80, // ### ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x7B, 0xC0, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2528 'o' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x00, // ##### + 0x31, 0x80, // ## ## + 0x60, 0xC0, // ## ## + 0x60, 0xC0, // ## ## + 0x60, 0xC0, // ## ## + 0x31, 0x80, // ## ## + 0x1F, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2560 'p' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x77, 0x00, // ### ### + 0x39, 0x80, // ### ## + 0x30, 0xC0, // ## ## + 0x30, 0xC0, // ## ## + 0x30, 0xC0, // ## ## + 0x39, 0x80, // ### ## + 0x37, 0x00, // ## ### + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x7C, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + + // @2592 'q' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x1D, 0xC0, // ### ### + 0x33, 0x80, // ## ### + 0x61, 0x80, // ## ## + 0x61, 0x80, // ## ## + 0x61, 0x80, // ## ## + 0x33, 0x80, // ## ### + 0x1D, 0x80, // ### ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x07, 0xC0, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + + // @2624 'r' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x7B, 0x80, // #### ### + 0x1C, 0xC0, // ### ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x7F, 0x00, // ####### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2656 's' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x80, // ###### + 0x31, 0x80, // ## ## + 0x3C, 0x00, // #### + 0x1F, 0x00, // ##### + 0x03, 0x80, // ### + 0x31, 0x80, // ## ## + 0x3F, 0x00, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2688 't' (11 pixels wide) + 0x00, 0x00, // + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x7F, 0x00, // ####### + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x80, // ## # + 0x0F, 0x00, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2720 'u' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x73, 0x80, // ### ### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x33, 0x80, // ## ### + 0x1D, 0xC0, // ### ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2752 'v' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x7B, 0xC0, // #### #### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x1B, 0x00, // ## ## + 0x1B, 0x00, // ## ## + 0x0E, 0x00, // ### + 0x0E, 0x00, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2784 'w' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0xF1, 0xE0, // #### #### + 0x60, 0xC0, // ## ## + 0x64, 0xC0, // ## # ## + 0x6E, 0xC0, // ## ### ## + 0x3B, 0x80, // ### ### + 0x3B, 0x80, // ### ### + 0x31, 0x80, // ## ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2816 'x' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x7B, 0xC0, // #### #### + 0x1B, 0x00, // ## ## + 0x0E, 0x00, // ### + 0x0E, 0x00, // ### + 0x0E, 0x00, // ### + 0x1B, 0x00, // ## ## + 0x7B, 0xC0, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2848 'y' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x79, 0xE0, // #### #### + 0x30, 0xC0, // ## ## + 0x19, 0x80, // ## ## + 0x19, 0x80, // ## ## + 0x0B, 0x00, // # ## + 0x0F, 0x00, // #### + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x00, // ## + 0x3E, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + + // @2880 'z' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0x80, // ####### + 0x21, 0x80, // # ## + 0x03, 0x00, // ## + 0x0E, 0x00, // ### + 0x18, 0x00, // ## + 0x30, 0x80, // ## # + 0x3F, 0x80, // ####### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2912 '{' (11 pixels wide) + 0x00, 0x00, // + 0x06, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x18, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x06, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2944 '|' (11 pixels wide) + 0x00, 0x00, // + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2976 '}' (11 pixels wide) + 0x00, 0x00, // + 0x0C, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3008 '~' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x18, 0x00, // ## + 0x24, 0x80, // # # # + 0x03, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // +}; + +sFONT Font16 = { + Font16_Table, + 11, /* Width */ + 16, /* Height */ +}; + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/docs/Touch_e-Paper_Code/c/lib/Fonts/font20.c b/docs/Touch_e-Paper_Code/c/lib/Fonts/font20.c new file mode 100644 index 0000000..697e3ed --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Fonts/font20.c @@ -0,0 +1,2142 @@ +/** + ****************************************************************************** + * @file font20.c + * @author MCD Application Team + * @version V1.0.0 + * @date 18-February-2014 + * @brief This file provides text font20 for STM32xx-EVAL's LCD driver. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * 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. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "fonts.h" + +// Character bitmaps for Courier New 15pt +const uint8_t Font20_Table[] = +{ + // @0 ' ' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @40 '!' (14 pixels wide) + 0x00, 0x00, // + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x02, 0x00, // # + 0x02, 0x00, // # + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @80 '"' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1C, 0xE0, // ### ### + 0x1C, 0xE0, // ### ### + 0x1C, 0xE0, // ### ### + 0x08, 0x40, // # # + 0x08, 0x40, // # # + 0x08, 0x40, // # # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @120 '#' (14 pixels wide) + 0x0C, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x3F, 0xF0, // ########## + 0x3F, 0xF0, // ########## + 0x0C, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x3F, 0xF0, // ########## + 0x3F, 0xF0, // ########## + 0x0C, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @160 '$' (14 pixels wide) + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x07, 0xE0, // ###### + 0x0F, 0xE0, // ####### + 0x18, 0x60, // ## ## + 0x18, 0x00, // ## + 0x1F, 0x00, // ##### + 0x0F, 0xC0, // ###### + 0x00, 0xE0, // ### + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x1F, 0xC0, // ####### + 0x1F, 0x80, // ###### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @200 '%' (14 pixels wide) + 0x00, 0x00, // + 0x1C, 0x00, // ### + 0x22, 0x00, // # # + 0x22, 0x00, // # # + 0x22, 0x00, // # # + 0x1C, 0x60, // ### ## + 0x01, 0xE0, // #### + 0x0F, 0x80, // ##### + 0x3C, 0x00, // #### + 0x31, 0xC0, // ## ### + 0x02, 0x20, // # # + 0x02, 0x20, // # # + 0x02, 0x20, // # # + 0x01, 0xC0, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @240 '&' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x03, 0xE0, // ##### + 0x0F, 0xE0, // ####### + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x06, 0x00, // ## + 0x0F, 0x30, // #### ## + 0x1F, 0xF0, // ######### + 0x19, 0xE0, // ## #### + 0x18, 0xC0, // ## ## + 0x1F, 0xF0, // ######### + 0x07, 0xB0, // #### ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @280 ''' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x03, 0x80, // ### + 0x03, 0x80, // ### + 0x03, 0x80, // ### + 0x01, 0x00, // # + 0x01, 0x00, // # + 0x01, 0x00, // # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @320 '(' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @360 ')' (14 pixels wide) + 0x00, 0x00, // + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @400 '*' (14 pixels wide) + 0x00, 0x00, // + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x1B, 0x60, // ## ## ## + 0x1F, 0xE0, // ######## + 0x07, 0x80, // #### + 0x07, 0x80, // #### + 0x0F, 0xC0, // ###### + 0x0C, 0xC0, // ## ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @440 '+' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x3F, 0xF0, // ########## + 0x3F, 0xF0, // ########## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @480 ',' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x03, 0x80, // ### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x04, 0x00, // # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @520 '-' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0xE0, // ######### + 0x3F, 0xE0, // ######### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @560 '.' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x03, 0x80, // ### + 0x03, 0x80, // ### + 0x03, 0x80, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @600 '/' (14 pixels wide) + 0x00, 0x60, // ## + 0x00, 0x60, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @640 '0' (14 pixels wide) + 0x00, 0x00, // + 0x0F, 0x80, // ##### + 0x1F, 0xC0, // ####### + 0x18, 0xC0, // ## ## + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x18, 0xC0, // ## ## + 0x1F, 0xC0, // ####### + 0x0F, 0x80, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @680 '1' (14 pixels wide) + 0x00, 0x00, // + 0x03, 0x00, // ## + 0x1F, 0x00, // ##### + 0x1F, 0x00, // ##### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @720 '2' (14 pixels wide) + 0x00, 0x00, // + 0x0F, 0x80, // ##### + 0x1F, 0xC0, // ####### + 0x38, 0xE0, // ### ### + 0x30, 0x60, // ## ## + 0x00, 0x60, // ## + 0x00, 0xC0, // ## + 0x01, 0x80, // ## + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x00, // ## + 0x18, 0x00, // ## + 0x3F, 0xE0, // ######### + 0x3F, 0xE0, // ######### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @760 '3' (14 pixels wide) + 0x00, 0x00, // + 0x0F, 0x80, // ##### + 0x3F, 0xC0, // ######## + 0x30, 0xE0, // ## ### + 0x00, 0x60, // ## + 0x00, 0xE0, // ### + 0x07, 0xC0, // ##### + 0x07, 0xC0, // ##### + 0x00, 0xE0, // ### + 0x00, 0x60, // ## + 0x00, 0x60, // ## + 0x60, 0xE0, // ## ### + 0x7F, 0xC0, // ######### + 0x3F, 0x80, // ####### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @800 '4' (14 pixels wide) + 0x00, 0x00, // + 0x01, 0xC0, // ### + 0x03, 0xC0, // #### + 0x03, 0xC0, // #### + 0x06, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x18, 0xC0, // ## ## + 0x30, 0xC0, // ## ## + 0x3F, 0xE0, // ######### + 0x3F, 0xE0, // ######### + 0x00, 0xC0, // ## + 0x03, 0xE0, // ##### + 0x03, 0xE0, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @840 '5' (14 pixels wide) + 0x00, 0x00, // + 0x1F, 0xC0, // ####### + 0x1F, 0xC0, // ####### + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x1F, 0x80, // ###### + 0x1F, 0xC0, // ####### + 0x18, 0xE0, // ## ### + 0x00, 0x60, // ## + 0x00, 0x60, // ## + 0x00, 0x60, // ## + 0x30, 0xE0, // ## ### + 0x3F, 0xC0, // ######## + 0x1F, 0x80, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @880 '6' (14 pixels wide) + 0x00, 0x00, // + 0x03, 0xE0, // ##### + 0x0F, 0xE0, // ####### + 0x1E, 0x00, // #### + 0x18, 0x00, // ## + 0x38, 0x00, // ### + 0x37, 0x80, // ## #### + 0x3F, 0xC0, // ######## + 0x38, 0xE0, // ### ### + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x18, 0xE0, // ## ### + 0x1F, 0xC0, // ####### + 0x07, 0x80, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @920 '7' (14 pixels wide) + 0x00, 0x00, // + 0x3F, 0xE0, // ######### + 0x3F, 0xE0, // ######### + 0x30, 0x60, // ## ## + 0x00, 0x60, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @960 '8' (14 pixels wide) + 0x00, 0x00, // + 0x0F, 0x80, // ##### + 0x1F, 0xC0, // ####### + 0x38, 0xE0, // ### ### + 0x30, 0x60, // ## ## + 0x38, 0xE0, // ### ### + 0x1F, 0xC0, // ####### + 0x1F, 0xC0, // ####### + 0x38, 0xE0, // ### ### + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x38, 0xE0, // ### ### + 0x1F, 0xC0, // ####### + 0x0F, 0x80, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1000 '9' (14 pixels wide) + 0x00, 0x00, // + 0x0F, 0x00, // #### + 0x1F, 0xC0, // ####### + 0x38, 0xC0, // ### ## + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x38, 0xE0, // ### ### + 0x1F, 0xE0, // ######## + 0x0F, 0x60, // #### ## + 0x00, 0xE0, // ### + 0x00, 0xC0, // ## + 0x03, 0xC0, // #### + 0x3F, 0x80, // ####### + 0x3E, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1040 ':' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x03, 0x80, // ### + 0x03, 0x80, // ### + 0x03, 0x80, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x03, 0x80, // ### + 0x03, 0x80, // ### + 0x03, 0x80, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1080 ';' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x01, 0xC0, // ### + 0x01, 0xC0, // ### + 0x01, 0xC0, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x03, 0x80, // ### + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x04, 0x00, // # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1120 '<' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x30, // ## + 0x00, 0xF0, // #### + 0x03, 0xC0, // #### + 0x07, 0x00, // ### + 0x1C, 0x00, // ### + 0x78, 0x00, // #### + 0x1C, 0x00, // ### + 0x07, 0x00, // ### + 0x03, 0xC0, // #### + 0x00, 0xF0, // #### + 0x00, 0x30, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1160 '=' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0xF0, // ########### + 0x7F, 0xF0, // ########### + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0xF0, // ########### + 0x7F, 0xF0, // ########### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1200 '>' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x30, 0x00, // ## + 0x3C, 0x00, // #### + 0x0F, 0x00, // #### + 0x03, 0x80, // ### + 0x00, 0xE0, // ### + 0x00, 0x78, // #### + 0x00, 0xE0, // ### + 0x03, 0x80, // ### + 0x0F, 0x00, // #### + 0x3C, 0x00, // #### + 0x30, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1240 '?' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x0F, 0x80, // ##### + 0x1F, 0xC0, // ####### + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x00, 0x60, // ## + 0x01, 0xC0, // ### + 0x03, 0x80, // ### + 0x03, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1280 '@' (14 pixels wide) + 0x00, 0x00, // + 0x03, 0x80, // ### + 0x0C, 0x80, // ## # + 0x08, 0x40, // # # + 0x10, 0x40, // # # + 0x10, 0x40, // # # + 0x11, 0xC0, // # ### + 0x12, 0x40, // # # # + 0x12, 0x40, // # # # + 0x12, 0x40, // # # # + 0x11, 0xC0, // # ### + 0x10, 0x00, // # + 0x08, 0x00, // # + 0x08, 0x40, // # # + 0x07, 0x80, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1320 'A' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x80, // ###### + 0x1F, 0x80, // ###### + 0x03, 0x80, // ### + 0x06, 0xC0, // ## ## + 0x06, 0xC0, // ## ## + 0x0C, 0xC0, // ## ## + 0x0C, 0x60, // ## ## + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x30, 0x30, // ## ## + 0x78, 0x78, // #### #### + 0x78, 0x78, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1360 'B' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0x80, // ####### + 0x3F, 0xC0, // ######## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0xE0, // ## ### + 0x1F, 0xC0, // ####### + 0x1F, 0xE0, // ######## + 0x18, 0x70, // ## ### + 0x18, 0x30, // ## ## + 0x18, 0x30, // ## ## + 0x3F, 0xF0, // ########## + 0x3F, 0xE0, // ######### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1400 'C' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0xB0, // #### ## + 0x0F, 0xF0, // ######## + 0x1C, 0x70, // ### ### + 0x38, 0x30, // ### ## + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x38, 0x30, // ### ## + 0x1C, 0x70, // ### ### + 0x0F, 0xE0, // ####### + 0x07, 0xC0, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1440 'D' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7F, 0x80, // ######## + 0x7F, 0xC0, // ######### + 0x30, 0xE0, // ## ### + 0x30, 0x70, // ## ### + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x70, // ## ### + 0x30, 0xE0, // ## ### + 0x7F, 0xC0, // ######### + 0x7F, 0x80, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1480 'E' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0xF0, // ########## + 0x3F, 0xF0, // ########## + 0x18, 0x30, // ## ## + 0x18, 0x30, // ## ## + 0x19, 0x80, // ## ## + 0x1F, 0x80, // ###### + 0x1F, 0x80, // ###### + 0x19, 0x80, // ## ## + 0x18, 0x30, // ## ## + 0x18, 0x30, // ## ## + 0x3F, 0xF0, // ########## + 0x3F, 0xF0, // ########## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1520 'F' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0xF0, // ########## + 0x3F, 0xF0, // ########## + 0x18, 0x30, // ## ## + 0x18, 0x30, // ## ## + 0x19, 0x80, // ## ## + 0x1F, 0x80, // ###### + 0x1F, 0x80, // ###### + 0x19, 0x80, // ## ## + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x3F, 0x00, // ###### + 0x3F, 0x00, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1560 'G' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0xB0, // #### ## + 0x1F, 0xF0, // ######### + 0x18, 0x70, // ## ### + 0x30, 0x30, // ## ## + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x31, 0xF8, // ## ###### + 0x31, 0xF8, // ## ###### + 0x30, 0x30, // ## ## + 0x18, 0x30, // ## ## + 0x1F, 0xF0, // ######### + 0x07, 0xC0, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1600 'H' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3C, 0xF0, // #### #### + 0x3C, 0xF0, // #### #### + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x3C, 0xF0, // #### #### + 0x3C, 0xF0, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1640 'I' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1680 'J' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x03, 0xF8, // ####### + 0x03, 0xF8, // ####### + 0x00, 0x60, // ## + 0x00, 0x60, // ## + 0x00, 0x60, // ## + 0x00, 0x60, // ## + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x30, 0xE0, // ## ### + 0x3F, 0xC0, // ######## + 0x0F, 0x80, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1720 'K' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3E, 0xF8, // ##### ##### + 0x3E, 0xF8, // ##### ##### + 0x18, 0xE0, // ## ### + 0x19, 0x80, // ## ## + 0x1B, 0x00, // ## ## + 0x1F, 0x00, // ##### + 0x1D, 0x80, // ### ## + 0x18, 0xC0, // ## ## + 0x18, 0xC0, // ## ## + 0x18, 0x60, // ## ## + 0x3E, 0x78, // ##### #### + 0x3E, 0x38, // ##### ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1760 'L' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0x00, // ###### + 0x3F, 0x00, // ###### + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x30, // ## ## + 0x0C, 0x30, // ## ## + 0x0C, 0x30, // ## ## + 0x3F, 0xF0, // ########## + 0x3F, 0xF0, // ########## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1800 'M' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x78, 0x78, // #### #### + 0x78, 0x78, // #### #### + 0x38, 0x70, // ### ### + 0x3C, 0xF0, // #### #### + 0x34, 0xB0, // ## # # ## + 0x37, 0xB0, // ## #### ## + 0x37, 0xB0, // ## #### ## + 0x33, 0x30, // ## ## ## + 0x33, 0x30, // ## ## ## + 0x30, 0x30, // ## ## + 0x7C, 0xF8, // ##### ##### + 0x7C, 0xF8, // ##### ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1840 'N' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x39, 0xF0, // ### ##### + 0x3D, 0xF0, // #### ##### + 0x1C, 0x60, // ### ## + 0x1E, 0x60, // #### ## + 0x1E, 0x60, // #### ## + 0x1B, 0x60, // ## ## ## + 0x1B, 0x60, // ## ## ## + 0x19, 0xE0, // ## #### + 0x19, 0xE0, // ## #### + 0x18, 0xE0, // ## ### + 0x3E, 0xE0, // ##### ### + 0x3E, 0x60, // ##### ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1880 'O' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0x80, // #### + 0x0F, 0xC0, // ###### + 0x1C, 0xE0, // ### ### + 0x38, 0x70, // ### ### + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x38, 0x70, // ### ### + 0x1C, 0xE0, // ### ### + 0x0F, 0xC0, // ###### + 0x07, 0x80, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1920 'P' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0xC0, // ######## + 0x3F, 0xE0, // ######### + 0x18, 0x70, // ## ### + 0x18, 0x30, // ## ## + 0x18, 0x30, // ## ## + 0x18, 0x70, // ## ### + 0x1F, 0xE0, // ######## + 0x1F, 0xC0, // ####### + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x3F, 0x00, // ###### + 0x3F, 0x00, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1960 'Q' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0x80, // #### + 0x0F, 0xC0, // ###### + 0x1C, 0xE0, // ### ### + 0x38, 0x70, // ### ### + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x38, 0x70, // ### ### + 0x1C, 0xE0, // ### ### + 0x0F, 0xC0, // ###### + 0x07, 0x80, // #### + 0x07, 0xB0, // #### ## + 0x0F, 0xF0, // ######## + 0x0C, 0xE0, // ## ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2000 'R' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0xC0, // ######## + 0x3F, 0xE0, // ######### + 0x18, 0x70, // ## ### + 0x18, 0x30, // ## ## + 0x18, 0x70, // ## ### + 0x1F, 0xE0, // ######## + 0x1F, 0xC0, // ####### + 0x18, 0xE0, // ## ### + 0x18, 0x60, // ## ## + 0x18, 0x70, // ## ### + 0x3E, 0x38, // ##### ### + 0x3E, 0x18, // ##### ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2040 'S' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x0F, 0xB0, // ##### ## + 0x1F, 0xF0, // ######### + 0x38, 0x70, // ### ### + 0x30, 0x30, // ## ## + 0x38, 0x00, // ### + 0x1F, 0x80, // ###### + 0x07, 0xE0, // ###### + 0x00, 0x70, // ### + 0x30, 0x30, // ## ## + 0x38, 0x70, // ### ### + 0x3F, 0xE0, // ######### + 0x37, 0xC0, // ## ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2080 'T' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3F, 0xF0, // ########## + 0x3F, 0xF0, // ########## + 0x33, 0x30, // ## ## ## + 0x33, 0x30, // ## ## ## + 0x33, 0x30, // ## ## ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x0F, 0xC0, // ###### + 0x0F, 0xC0, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2120 'U' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3C, 0xF0, // #### #### + 0x3C, 0xF0, // #### #### + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x1C, 0xE0, // ### ### + 0x0F, 0xC0, // ###### + 0x07, 0x80, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2160 'V' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x78, 0xF0, // #### #### + 0x78, 0xF0, // #### #### + 0x30, 0x60, // ## ## + 0x30, 0x60, // ## ## + 0x18, 0xC0, // ## ## + 0x18, 0xC0, // ## ## + 0x0D, 0x80, // ## ## + 0x0D, 0x80, // ## ## + 0x0D, 0x80, // ## ## + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2200 'W' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x7C, 0x7C, // ##### ##### + 0x7C, 0x7C, // ##### ##### + 0x30, 0x18, // ## ## + 0x33, 0x98, // ## ### ## + 0x33, 0x98, // ## ### ## + 0x33, 0x98, // ## ### ## + 0x36, 0xD8, // ## ## ## ## + 0x16, 0xD0, // # ## ## # + 0x1C, 0x70, // ### ### + 0x1C, 0x70, // ### ### + 0x1C, 0x70, // ### ### + 0x18, 0x30, // ## ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2240 'X' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x78, 0xF0, // #### #### + 0x78, 0xF0, // #### #### + 0x30, 0x60, // ## ## + 0x18, 0xC0, // ## ## + 0x0D, 0x80, // ## ## + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x0D, 0x80, // ## ## + 0x18, 0xC0, // ## ## + 0x30, 0x60, // ## ## + 0x78, 0xF0, // #### #### + 0x78, 0xF0, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2280 'Y' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x3C, 0xF0, // #### #### + 0x3C, 0xF0, // #### #### + 0x18, 0x60, // ## ## + 0x0C, 0xC0, // ## ## + 0x07, 0x80, // #### + 0x07, 0x80, // #### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x0F, 0xC0, // ###### + 0x0F, 0xC0, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2320 'Z' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x18, 0x60, // ## ## + 0x18, 0xC0, // ## ## + 0x01, 0x80, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2360 '[' (14 pixels wide) + 0x00, 0x00, // + 0x03, 0xC0, // #### + 0x03, 0xC0, // #### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0xC0, // #### + 0x03, 0xC0, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2400 '\' (14 pixels wide) + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x01, 0x80, // ## + 0x01, 0x80, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0x60, // ## + 0x00, 0x60, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2440 ']' (14 pixels wide) + 0x00, 0x00, // + 0x0F, 0x00, // #### + 0x0F, 0x00, // #### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x0F, 0x00, // #### + 0x0F, 0x00, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2480 '^' (14 pixels wide) + 0x00, 0x00, // + 0x02, 0x00, // # + 0x07, 0x00, // ### + 0x0D, 0x80, // ## ## + 0x18, 0xC0, // ## ## + 0x30, 0x60, // ## ## + 0x20, 0x20, // # # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2520 '_' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0xFF, 0xFC, // ############## + 0xFF, 0xFC, // ############## + + // @2560 '`' (14 pixels wide) + 0x00, 0x00, // + 0x04, 0x00, // # + 0x03, 0x00, // ## + 0x00, 0x80, // # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2600 'a' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x0F, 0xC0, // ###### + 0x1F, 0xE0, // ######## + 0x00, 0x60, // ## + 0x0F, 0xE0, // ####### + 0x1F, 0xE0, // ######## + 0x38, 0x60, // ### ## + 0x30, 0xE0, // ## ### + 0x3F, 0xF0, // ########## + 0x1F, 0x70, // ##### ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2640 'b' (14 pixels wide) + 0x00, 0x00, // + 0x70, 0x00, // ### + 0x70, 0x00, // ### + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x37, 0x80, // ## #### + 0x3F, 0xE0, // ######### + 0x38, 0x60, // ### ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x38, 0x60, // ### ## + 0x7F, 0xE0, // ########## + 0x77, 0x80, // ### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2680 'c' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0xB0, // #### ## + 0x1F, 0xF0, // ######### + 0x18, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x38, 0x30, // ### ## + 0x1F, 0xF0, // ######### + 0x0F, 0xC0, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2720 'd' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x70, // ### + 0x00, 0x70, // ### + 0x00, 0x30, // ## + 0x00, 0x30, // ## + 0x07, 0xB0, // #### ## + 0x1F, 0xF0, // ######### + 0x18, 0x70, // ## ### + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x38, 0x70, // ### ### + 0x1F, 0xF8, // ########## + 0x07, 0xB8, // #### ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2760 'e' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0x80, // #### + 0x1F, 0xE0, // ######## + 0x18, 0x60, // ## ## + 0x3F, 0xF0, // ########## + 0x3F, 0xF0, // ########## + 0x30, 0x00, // ## + 0x18, 0x30, // ## ## + 0x1F, 0xF0, // ######### + 0x07, 0xC0, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2800 'f' (14 pixels wide) + 0x00, 0x00, // + 0x03, 0xF0, // ###### + 0x07, 0xF0, // ####### + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2840 'g' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0xB8, // #### ### + 0x1F, 0xF8, // ########## + 0x18, 0x70, // ## ### + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x18, 0x70, // ## ### + 0x1F, 0xF0, // ######### + 0x07, 0xB0, // #### ## + 0x00, 0x30, // ## + 0x00, 0x70, // ### + 0x0F, 0xE0, // ####### + 0x0F, 0xC0, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + + // @2880 'h' (14 pixels wide) + 0x00, 0x00, // + 0x38, 0x00, // ### + 0x38, 0x00, // ### + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x1B, 0xC0, // ## #### + 0x1F, 0xE0, // ######## + 0x1C, 0x60, // ### ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x3C, 0xF0, // #### #### + 0x3C, 0xF0, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2920 'i' (14 pixels wide) + 0x00, 0x00, // + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x00, // ##### + 0x1F, 0x00, // ##### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @2960 'j' (14 pixels wide) + 0x00, 0x00, // + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0xC0, // ####### + 0x1F, 0xC0, // ####### + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x00, 0xC0, // ## + 0x01, 0xC0, // ### + 0x3F, 0x80, // ####### + 0x3F, 0x00, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + + // @3000 'k' (14 pixels wide) + 0x00, 0x00, // + 0x38, 0x00, // ### + 0x38, 0x00, // ### + 0x18, 0x00, // ## + 0x18, 0x00, // ## + 0x1B, 0xE0, // ## ##### + 0x1B, 0xE0, // ## ##### + 0x1B, 0x00, // ## ## + 0x1E, 0x00, // #### + 0x1E, 0x00, // #### + 0x1B, 0x00, // ## ## + 0x19, 0x80, // ## ## + 0x39, 0xF0, // ### ##### + 0x39, 0xF0, // ### ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3040 'l' (14 pixels wide) + 0x00, 0x00, // + 0x1F, 0x00, // ##### + 0x1F, 0x00, // ##### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3080 'm' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x7E, 0xE0, // ###### ### + 0x7F, 0xF0, // ########### + 0x33, 0x30, // ## ## ## + 0x33, 0x30, // ## ## ## + 0x33, 0x30, // ## ## ## + 0x33, 0x30, // ## ## ## + 0x33, 0x30, // ## ## ## + 0x7B, 0xB8, // #### ### ### + 0x7B, 0xB8, // #### ### ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3120 'n' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x3B, 0xC0, // ### #### + 0x3F, 0xE0, // ######### + 0x1C, 0x60, // ### ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x3C, 0xF0, // #### #### + 0x3C, 0xF0, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3160 'o' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0x80, // #### + 0x1F, 0xE0, // ######## + 0x18, 0x60, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x18, 0x60, // ## ## + 0x1F, 0xE0, // ######## + 0x07, 0x80, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3200 'p' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x77, 0x80, // ### #### + 0x7F, 0xE0, // ########## + 0x38, 0x60, // ### ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x38, 0x60, // ### ## + 0x3F, 0xE0, // ######### + 0x37, 0x80, // ## #### + 0x30, 0x00, // ## + 0x30, 0x00, // ## + 0x7C, 0x00, // ##### + 0x7C, 0x00, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + + // @3240 'q' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0xB8, // #### ### + 0x1F, 0xF8, // ########## + 0x18, 0x70, // ## ### + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x30, 0x30, // ## ## + 0x18, 0x70, // ## ### + 0x1F, 0xF0, // ######### + 0x07, 0xB0, // #### ## + 0x00, 0x30, // ## + 0x00, 0x30, // ## + 0x00, 0xF8, // ##### + 0x00, 0xF8, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + + // @3280 'r' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x3C, 0xE0, // #### ### + 0x3D, 0xF0, // #### ##### + 0x0F, 0x30, // #### ## + 0x0E, 0x00, // ### + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x3F, 0xC0, // ######## + 0x3F, 0xC0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3320 's' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x07, 0xE0, // ###### + 0x1F, 0xE0, // ######## + 0x18, 0x60, // ## ## + 0x1E, 0x00, // #### + 0x0F, 0xC0, // ###### + 0x01, 0xE0, // #### + 0x18, 0x60, // ## ## + 0x1F, 0xE0, // ######## + 0x1F, 0x80, // ###### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3360 't' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x3F, 0xE0, // ######### + 0x3F, 0xE0, // ######### + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x00, // ## + 0x0C, 0x30, // ## ## + 0x0F, 0xF0, // ######## + 0x07, 0xC0, // ##### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3400 'u' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x38, 0xE0, // ### ### + 0x38, 0xE0, // ### ### + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0x60, // ## ## + 0x18, 0xE0, // ## ### + 0x1F, 0xF0, // ######### + 0x0F, 0x70, // #### ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3440 'v' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x78, 0xF0, // #### #### + 0x78, 0xF0, // #### #### + 0x30, 0x60, // ## ## + 0x18, 0xC0, // ## ## + 0x18, 0xC0, // ## ## + 0x0D, 0x80, // ## ## + 0x0D, 0x80, // ## ## + 0x07, 0x00, // ### + 0x07, 0x00, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3480 'w' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x78, 0xF0, // #### #### + 0x78, 0xF0, // #### #### + 0x32, 0x60, // ## # ## + 0x32, 0x60, // ## # ## + 0x37, 0xE0, // ## ###### + 0x1D, 0xC0, // ### ### + 0x1D, 0xC0, // ### ### + 0x18, 0xC0, // ## ## + 0x18, 0xC0, // ## ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3520 'x' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x3C, 0xF0, // #### #### + 0x3C, 0xF0, // #### #### + 0x0C, 0xC0, // ## ## + 0x07, 0x80, // #### + 0x03, 0x00, // ## + 0x07, 0x80, // #### + 0x0C, 0xC0, // ## ## + 0x3C, 0xF0, // #### #### + 0x3C, 0xF0, // #### #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3560 'y' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x78, 0xF0, // #### #### + 0x78, 0xF0, // #### #### + 0x30, 0x60, // ## ## + 0x18, 0xC0, // ## ## + 0x18, 0xC0, // ## ## + 0x0D, 0x80, // ## ## + 0x0F, 0x80, // ##### + 0x07, 0x00, // ### + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x00, // ## + 0x7F, 0x00, // ####### + 0x7F, 0x00, // ####### + 0x00, 0x00, // + 0x00, 0x00, // + + // @3600 'z' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x18, 0xC0, // ## ## + 0x01, 0x80, // ## + 0x03, 0x00, // ## + 0x06, 0x00, // ## + 0x0C, 0x60, // ## ## + 0x1F, 0xE0, // ######## + 0x1F, 0xE0, // ######## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3640 '{' (14 pixels wide) + 0x00, 0x00, // + 0x01, 0xC0, // ### + 0x03, 0xC0, // #### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x07, 0x00, // ### + 0x0E, 0x00, // ### + 0x07, 0x00, // ### + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0xC0, // #### + 0x01, 0xC0, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3680 '|' (14 pixels wide) + 0x00, 0x00, // + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x03, 0x00, // ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3720 '}' (14 pixels wide) + 0x00, 0x00, // + 0x1C, 0x00, // ### + 0x1E, 0x00, // #### + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x07, 0x00, // ### + 0x03, 0x80, // ### + 0x07, 0x00, // ### + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x06, 0x00, // ## + 0x1E, 0x00, // #### + 0x1C, 0x00, // ### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @3760 '~' (14 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x0E, 0x00, // ### + 0x3F, 0x30, // ###### ## + 0x33, 0xF0, // ## ###### + 0x01, 0xE0, // #### + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // +}; + + +sFONT Font20 = { + Font20_Table, + 14, /* Width */ + 20, /* Height */ +}; + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/docs/Touch_e-Paper_Code/c/lib/Fonts/font24.c b/docs/Touch_e-Paper_Code/c/lib/Fonts/font24.c new file mode 100644 index 0000000..fea3321 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Fonts/font24.c @@ -0,0 +1,2520 @@ +/** + ****************************************************************************** + * @file font24.c + * @author MCD Application Team + * @version V1.0.0 + * @date 18-February-2014 + * @brief This file provides text font24 for STM32xx-EVAL's LCD driver. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * 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. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "fonts.h" + +const uint8_t Font24_Table [] = +{ + // @0 ' ' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @72 '!' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x01, 0x00, 0x00, // # + 0x01, 0x00, 0x00, // # + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @144 '"' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x0E, 0x70, 0x00, // ### ### + 0x0E, 0x70, 0x00, // ### ### + 0x0E, 0x70, 0x00, // ### ### + 0x04, 0x20, 0x00, // # # + 0x04, 0x20, 0x00, // # # + 0x04, 0x20, 0x00, // # # + 0x04, 0x20, 0x00, // # # + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @216 '#' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x06, 0x60, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x3F, 0xF8, 0x00, // ########### + 0x3F, 0xF8, 0x00, // ########### + 0x06, 0x60, 0x00, // ## ## + 0x0C, 0xC0, 0x00, // ## ## + 0x3F, 0xF8, 0x00, // ########### + 0x3F, 0xF8, 0x00, // ########### + 0x0C, 0xC0, 0x00, // ## ## + 0x0C, 0xC0, 0x00, // ## ## + 0x0C, 0xC0, 0x00, // ## ## + 0x0C, 0xC0, 0x00, // ## ## + 0x0C, 0xC0, 0x00, // ## ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @288 '$' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x07, 0xB0, 0x00, // #### ## + 0x0F, 0xF0, 0x00, // ######## + 0x18, 0x70, 0x00, // ## ### + 0x18, 0x70, 0x00, // ## ### + 0x1C, 0x00, 0x00, // ### + 0x0F, 0x80, 0x00, // ##### + 0x07, 0xE0, 0x00, // ###### + 0x00, 0xF0, 0x00, // #### + 0x18, 0x30, 0x00, // ## ## + 0x1C, 0x30, 0x00, // ### ## + 0x1C, 0x70, 0x00, // ### ### + 0x1F, 0xE0, 0x00, // ######## + 0x1B, 0xC0, 0x00, // ## #### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @360 '%' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0x80, 0x00, // #### + 0x0F, 0xC0, 0x00, // ###### + 0x1C, 0xE0, 0x00, // ### ### + 0x18, 0x60, 0x00, // ## ## + 0x18, 0x60, 0x00, // ## ## + 0x1C, 0xE0, 0x00, // ### ### + 0x0F, 0xF8, 0x00, // ######### + 0x07, 0xE0, 0x00, // ###### + 0x1F, 0xF0, 0x00, // ######### + 0x07, 0x38, 0x00, // ### ### + 0x06, 0x18, 0x00, // ## ## + 0x06, 0x18, 0x00, // ## ## + 0x07, 0x38, 0x00, // ### ### + 0x03, 0xF0, 0x00, // ###### + 0x01, 0xE0, 0x00, // #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @432 '&' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xF0, 0x00, // ###### + 0x07, 0xF0, 0x00, // ####### + 0x0C, 0x60, 0x00, // ## ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x07, 0x00, 0x00, // ### + 0x0F, 0x9C, 0x00, // ##### ### + 0x1D, 0xFC, 0x00, // ### ####### + 0x18, 0xF0, 0x00, // ## #### + 0x18, 0x70, 0x00, // ## ### + 0x0F, 0xFC, 0x00, // ########## + 0x07, 0xDC, 0x00, // ##### ### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @504 ''' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x01, 0x00, 0x00, // # + 0x01, 0x00, 0x00, // # + 0x01, 0x00, 0x00, // # + 0x01, 0x00, 0x00, // # + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @576 '(' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x18, 0x00, // ## + 0x00, 0x38, 0x00, // ### + 0x00, 0x70, 0x00, // ### + 0x00, 0xF0, 0x00, // #### + 0x00, 0xE0, 0x00, // ### + 0x00, 0xE0, 0x00, // ### + 0x01, 0xC0, 0x00, // ### + 0x01, 0xC0, 0x00, // ### + 0x01, 0xC0, 0x00, // ### + 0x01, 0xC0, 0x00, // ### + 0x01, 0xC0, 0x00, // ### + 0x01, 0xC0, 0x00, // ### + 0x00, 0xE0, 0x00, // ### + 0x00, 0xE0, 0x00, // ### + 0x00, 0x70, 0x00, // ### + 0x00, 0x70, 0x00, // ### + 0x00, 0x38, 0x00, // ### + 0x00, 0x18, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @648 ')' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x18, 0x00, 0x00, // ## + 0x1C, 0x00, 0x00, // ### + 0x0E, 0x00, 0x00, // ### + 0x0E, 0x00, 0x00, // ### + 0x07, 0x00, 0x00, // ### + 0x07, 0x00, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x07, 0x00, 0x00, // ### + 0x07, 0x00, 0x00, // ### + 0x0F, 0x00, 0x00, // #### + 0x0E, 0x00, 0x00, // ### + 0x1C, 0x00, 0x00, // ### + 0x18, 0x00, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @720 '*' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x1D, 0xB8, 0x00, // ### ## ### + 0x1F, 0xF8, 0x00, // ########## + 0x07, 0xE0, 0x00, // ###### + 0x03, 0xC0, 0x00, // #### + 0x03, 0xC0, 0x00, // #### + 0x06, 0x60, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @792 '+' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x3F, 0xFC, 0x00, // ############ + 0x3F, 0xFC, 0x00, // ############ + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @864 ',' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0xE0, 0x00, // ### + 0x00, 0xC0, 0x00, // ## + 0x01, 0xC0, 0x00, // ### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x03, 0x00, 0x00, // ## + 0x03, 0x00, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @936 '-' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x1F, 0xF8, 0x00, // ########## + 0x1F, 0xF8, 0x00, // ########## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1008 '.' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xC0, 0x00, // #### + 0x03, 0xC0, 0x00, // #### + 0x03, 0xC0, 0x00, // #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1080 '/' (17 pixels wide) + 0x00, 0x18, 0x00, // ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x38, 0x00, // ### + 0x00, 0x30, 0x00, // ## + 0x00, 0x70, 0x00, // ### + 0x00, 0x60, 0x00, // ## + 0x00, 0x60, 0x00, // ## + 0x00, 0xC0, 0x00, // ## + 0x00, 0xC0, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x03, 0x00, 0x00, // ## + 0x03, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x0E, 0x00, 0x00, // ### + 0x0C, 0x00, 0x00, // ## + 0x1C, 0x00, 0x00, // ### + 0x18, 0x00, 0x00, // ## + 0x18, 0x00, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1152 '0' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xC0, 0x00, // #### + 0x07, 0xE0, 0x00, // ###### + 0x0C, 0x30, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x07, 0xE0, 0x00, // ###### + 0x03, 0xC0, 0x00, // #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1224 '1' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x80, 0x00, // # + 0x07, 0x80, 0x00, // #### + 0x1F, 0x80, 0x00, // ###### + 0x1D, 0x80, 0x00, // ### ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x1F, 0xF8, 0x00, // ########## + 0x1F, 0xF8, 0x00, // ########## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1296 '2' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0xC0, 0x00, // ##### + 0x1F, 0xF0, 0x00, // ######### + 0x38, 0x30, 0x00, // ### ## + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x60, 0x00, // ## + 0x01, 0xC0, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x06, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x18, 0x00, 0x00, // ## + 0x3F, 0xF8, 0x00, // ########### + 0x3F, 0xF8, 0x00, // ########### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1368 '3' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xC0, 0x00, // #### + 0x0F, 0xE0, 0x00, // ####### + 0x0C, 0x70, 0x00, // ## ### + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x60, 0x00, // ## + 0x03, 0xC0, 0x00, // #### + 0x03, 0xE0, 0x00, // ##### + 0x00, 0x70, 0x00, // ### + 0x00, 0x18, 0x00, // ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x18, 0x00, // ## + 0x18, 0x38, 0x00, // ## ### + 0x1F, 0xF0, 0x00, // ######### + 0x0F, 0xC0, 0x00, // ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1440 '4' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0xE0, 0x00, // ### + 0x01, 0xE0, 0x00, // #### + 0x01, 0xE0, 0x00, // #### + 0x03, 0x60, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x0C, 0x60, 0x00, // ## ## + 0x0C, 0x60, 0x00, // ## ## + 0x18, 0x60, 0x00, // ## ## + 0x30, 0x60, 0x00, // ## ## + 0x3F, 0xF8, 0x00, // ########### + 0x3F, 0xF8, 0x00, // ########### + 0x00, 0x60, 0x00, // ## + 0x03, 0xF8, 0x00, // ####### + 0x03, 0xF8, 0x00, // ####### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1512 '5' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x1F, 0xF0, 0x00, // ######### + 0x1F, 0xF0, 0x00, // ######### + 0x18, 0x00, 0x00, // ## + 0x18, 0x00, 0x00, // ## + 0x18, 0x00, 0x00, // ## + 0x1B, 0xC0, 0x00, // ## #### + 0x1F, 0xF0, 0x00, // ######### + 0x1C, 0x30, 0x00, // ### ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x18, 0x00, // ## + 0x30, 0x30, 0x00, // ## ## + 0x3F, 0xF0, 0x00, // ########## + 0x0F, 0xC0, 0x00, // ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1584 '6' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0xF8, 0x00, // ##### + 0x03, 0xF8, 0x00, // ####### + 0x07, 0x00, 0x00, // ### + 0x0E, 0x00, 0x00, // ### + 0x0C, 0x00, 0x00, // ## + 0x18, 0x00, 0x00, // ## + 0x1B, 0xC0, 0x00, // ## #### + 0x1F, 0xF0, 0x00, // ######### + 0x1C, 0x30, 0x00, // ### ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x0C, 0x38, 0x00, // ## ### + 0x0F, 0xF0, 0x00, // ######## + 0x03, 0xE0, 0x00, // ##### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1656 '7' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x1F, 0xF8, 0x00, // ########## + 0x1F, 0xF8, 0x00, // ########## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x38, 0x00, // ## ### + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x70, 0x00, // ### + 0x00, 0x60, 0x00, // ## + 0x00, 0x60, 0x00, // ## + 0x00, 0xE0, 0x00, // ### + 0x00, 0xC0, 0x00, // ## + 0x00, 0xC0, 0x00, // ## + 0x01, 0xC0, 0x00, // ### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1728 '8' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0xE0, 0x00, // ###### + 0x0F, 0xF0, 0x00, // ######## + 0x1C, 0x38, 0x00, // ### ### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x07, 0xE0, 0x00, // ###### + 0x07, 0xE0, 0x00, // ###### + 0x0C, 0x30, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x1C, 0x38, 0x00, // ### ### + 0x0F, 0xF0, 0x00, // ######## + 0x07, 0xE0, 0x00, // ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1800 '9' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0xC0, 0x00, // ##### + 0x0F, 0xF0, 0x00, // ######## + 0x1C, 0x30, 0x00, // ### ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x0C, 0x38, 0x00, // ## ### + 0x0F, 0xF8, 0x00, // ######### + 0x03, 0xD8, 0x00, // #### ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x70, 0x00, // ### + 0x00, 0xE0, 0x00, // ### + 0x1F, 0xC0, 0x00, // ####### + 0x1F, 0x00, 0x00, // ##### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1872 ':' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xC0, 0x00, // #### + 0x03, 0xC0, 0x00, // #### + 0x03, 0xC0, 0x00, // #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xC0, 0x00, // #### + 0x03, 0xC0, 0x00, // #### + 0x03, 0xC0, 0x00, // #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @1944 ';' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0xF0, 0x00, // #### + 0x00, 0xF0, 0x00, // #### + 0x00, 0xF0, 0x00, // #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0xE0, 0x00, // ### + 0x01, 0xC0, 0x00, // ### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x03, 0x00, 0x00, // ## + 0x02, 0x00, 0x00, // # + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2016 '<' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x1C, 0x00, // ### + 0x00, 0x3C, 0x00, // #### + 0x00, 0xF0, 0x00, // #### + 0x03, 0xC0, 0x00, // #### + 0x0F, 0x00, 0x00, // #### + 0x3C, 0x00, 0x00, // #### + 0xF0, 0x00, 0x00, // #### + 0x3C, 0x00, 0x00, // #### + 0x0F, 0x00, 0x00, // #### + 0x03, 0xC0, 0x00, // #### + 0x00, 0xF0, 0x00, // #### + 0x00, 0x3C, 0x00, // #### + 0x00, 0x1C, 0x00, // ### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2088 '=' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7F, 0xFC, 0x00, // ############# + 0x7F, 0xFC, 0x00, // ############# + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7F, 0xFC, 0x00, // ############# + 0x7F, 0xFC, 0x00, // ############# + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2160 '>' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x70, 0x00, 0x00, // ### + 0x78, 0x00, 0x00, // #### + 0x1E, 0x00, 0x00, // #### + 0x07, 0x80, 0x00, // #### + 0x01, 0xE0, 0x00, // #### + 0x00, 0x78, 0x00, // #### + 0x00, 0x1E, 0x00, // #### + 0x00, 0x78, 0x00, // #### + 0x01, 0xE0, 0x00, // #### + 0x07, 0x80, 0x00, // #### + 0x1E, 0x00, 0x00, // #### + 0x78, 0x00, 0x00, // #### + 0x70, 0x00, 0x00, // ### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2232 '?' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0xC0, 0x00, // ##### + 0x0F, 0xE0, 0x00, // ####### + 0x18, 0x70, 0x00, // ## ### + 0x18, 0x30, 0x00, // ## ## + 0x18, 0x30, 0x00, // ## ## + 0x00, 0x70, 0x00, // ### + 0x00, 0xE0, 0x00, // ### + 0x03, 0xC0, 0x00, // #### + 0x03, 0x80, 0x00, // ### + 0x03, 0x00, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0x00, 0x00, // ### + 0x07, 0x00, 0x00, // ### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2304 '@' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xE0, 0x00, // ##### + 0x07, 0xF0, 0x00, // ####### + 0x0E, 0x38, 0x00, // ### ### + 0x0C, 0x18, 0x00, // ## ## + 0x18, 0x78, 0x00, // ## #### + 0x18, 0xF8, 0x00, // ## ##### + 0x19, 0xD8, 0x00, // ## ### ## + 0x19, 0x98, 0x00, // ## ## ## + 0x19, 0x98, 0x00, // ## ## ## + 0x19, 0x98, 0x00, // ## ## ## + 0x18, 0xF8, 0x00, // ## ##### + 0x18, 0x78, 0x00, // ## #### + 0x18, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0E, 0x18, 0x00, // ### ## + 0x07, 0xF8, 0x00, // ######## + 0x03, 0xE0, 0x00, // ##### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2376 'A' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x1F, 0x80, 0x00, // ###### + 0x1F, 0xC0, 0x00, // ####### + 0x01, 0xC0, 0x00, // ### + 0x03, 0x60, 0x00, // ## ## + 0x03, 0x60, 0x00, // ## ## + 0x06, 0x30, 0x00, // ## ## + 0x06, 0x30, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x0F, 0xF8, 0x00, // ######### + 0x1F, 0xF8, 0x00, // ########## + 0x18, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0xFC, 0x7F, 0x00, // ###### ####### + 0xFC, 0x7F, 0x00, // ###### ####### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2448 'B' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7F, 0xE0, 0x00, // ########## + 0x7F, 0xF0, 0x00, // ########### + 0x18, 0x38, 0x00, // ## ### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x38, 0x00, // ## ### + 0x1F, 0xF0, 0x00, // ######### + 0x1F, 0xF8, 0x00, // ########## + 0x18, 0x1C, 0x00, // ## ### + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x7F, 0xF8, 0x00, // ############ + 0x7F, 0xF0, 0x00, // ########### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2520 'C' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xEC, 0x00, // ##### ## + 0x0F, 0xFC, 0x00, // ########## + 0x1C, 0x1C, 0x00, // ### ### + 0x18, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x00, 0x00, // ## + 0x30, 0x00, 0x00, // ## + 0x30, 0x00, 0x00, // ## + 0x30, 0x00, 0x00, // ## + 0x30, 0x00, 0x00, // ## + 0x18, 0x0C, 0x00, // ## ## + 0x1C, 0x1C, 0x00, // ### ### + 0x0F, 0xF8, 0x00, // ######### + 0x03, 0xF0, 0x00, // ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2592 'D' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7F, 0xC0, 0x00, // ######### + 0x7F, 0xF0, 0x00, // ########### + 0x18, 0x38, 0x00, // ## ### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x38, 0x00, // ## ### + 0x7F, 0xF0, 0x00, // ########### + 0x7F, 0xE0, 0x00, // ########## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2664 'E' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7F, 0xF8, 0x00, // ############ + 0x7F, 0xF8, 0x00, // ############ + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x19, 0x98, 0x00, // ## ## ## + 0x19, 0x80, 0x00, // ## ## + 0x1F, 0x80, 0x00, // ###### + 0x1F, 0x80, 0x00, // ###### + 0x19, 0x80, 0x00, // ## ## + 0x19, 0x98, 0x00, // ## ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x7F, 0xF8, 0x00, // ############ + 0x7F, 0xF8, 0x00, // ############ + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2736 'F' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x3F, 0xFC, 0x00, // ############ + 0x3F, 0xFC, 0x00, // ############ + 0x0C, 0x0C, 0x00, // ## ## + 0x0C, 0x0C, 0x00, // ## ## + 0x0C, 0xCC, 0x00, // ## ## ## + 0x0C, 0xC0, 0x00, // ## ## + 0x0F, 0xC0, 0x00, // ###### + 0x0F, 0xC0, 0x00, // ###### + 0x0C, 0xC0, 0x00, // ## ## + 0x0C, 0xC0, 0x00, // ## ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x3F, 0xC0, 0x00, // ######## + 0x3F, 0xC0, 0x00, // ######## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2808 'G' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xEC, 0x00, // ##### ## + 0x0F, 0xFC, 0x00, // ########## + 0x1C, 0x1C, 0x00, // ### ### + 0x18, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x00, 0x00, // ## + 0x30, 0x00, 0x00, // ## + 0x30, 0xFE, 0x00, // ## ####### + 0x30, 0xFE, 0x00, // ## ####### + 0x30, 0x0C, 0x00, // ## ## + 0x38, 0x0C, 0x00, // ### ## + 0x1C, 0x1C, 0x00, // ### ### + 0x0F, 0xFC, 0x00, // ########## + 0x03, 0xF0, 0x00, // ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2880 'H' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7E, 0x7E, 0x00, // ###### ###### + 0x7E, 0x7E, 0x00, // ###### ###### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x1F, 0xF8, 0x00, // ########## + 0x1F, 0xF8, 0x00, // ########## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x7E, 0x7E, 0x00, // ###### ###### + 0x7E, 0x7E, 0x00, // ###### ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @2952 'I' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x1F, 0xF8, 0x00, // ########## + 0x1F, 0xF8, 0x00, // ########## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x1F, 0xF8, 0x00, // ########## + 0x1F, 0xF8, 0x00, // ########## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3024 'J' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0xFE, 0x00, // ########## + 0x07, 0xFE, 0x00, // ########## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x30, 0x30, 0x00, // ## ## + 0x30, 0x30, 0x00, // ## ## + 0x30, 0x30, 0x00, // ## ## + 0x30, 0x30, 0x00, // ## ## + 0x30, 0x60, 0x00, // ## ## + 0x3F, 0xE0, 0x00, // ######### + 0x0F, 0x80, 0x00, // ##### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3096 'K' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7F, 0x3E, 0x00, // ####### ##### + 0x7F, 0x3E, 0x00, // ####### ##### + 0x18, 0x30, 0x00, // ## ## + 0x18, 0x60, 0x00, // ## ## + 0x18, 0xC0, 0x00, // ## ## + 0x19, 0x80, 0x00, // ## ## + 0x1B, 0x80, 0x00, // ## ### + 0x1F, 0xC0, 0x00, // ####### + 0x1C, 0xE0, 0x00, // ### ### + 0x18, 0x70, 0x00, // ## ### + 0x18, 0x30, 0x00, // ## ## + 0x18, 0x38, 0x00, // ## ### + 0x7F, 0x1F, 0x00, // ####### ##### + 0x7F, 0x1F, 0x00, // ####### ##### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3168 'L' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7F, 0x80, 0x00, // ######## + 0x7F, 0x80, 0x00, // ######## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x0C, 0x00, // ## ## + 0x0C, 0x0C, 0x00, // ## ## + 0x0C, 0x0C, 0x00, // ## ## + 0x0C, 0x0C, 0x00, // ## ## + 0x7F, 0xFC, 0x00, // ############# + 0x7F, 0xFC, 0x00, // ############# + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3240 'M' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0xF0, 0x0F, 0x00, // #### #### + 0xF8, 0x1F, 0x00, // ##### ##### + 0x38, 0x1C, 0x00, // ### ### + 0x3C, 0x3C, 0x00, // #### #### + 0x3C, 0x3C, 0x00, // #### #### + 0x36, 0x6C, 0x00, // ## ## ## ## + 0x36, 0x6C, 0x00, // ## ## ## ## + 0x33, 0xCC, 0x00, // ## #### ## + 0x33, 0xCC, 0x00, // ## #### ## + 0x31, 0x8C, 0x00, // ## ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0xFE, 0x7F, 0x00, // ####### ####### + 0xFE, 0x7F, 0x00, // ####### ####### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3312 'N' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x78, 0xFE, 0x00, // #### ####### + 0x78, 0xFE, 0x00, // #### ####### + 0x1C, 0x18, 0x00, // ### ## + 0x1E, 0x18, 0x00, // #### ## + 0x1F, 0x18, 0x00, // ##### ## + 0x1B, 0x18, 0x00, // ## ## ## + 0x1B, 0x98, 0x00, // ## ### ## + 0x19, 0xD8, 0x00, // ## ### ## + 0x18, 0xD8, 0x00, // ## ## ## + 0x18, 0xF8, 0x00, // ## ##### + 0x18, 0x78, 0x00, // ## #### + 0x18, 0x38, 0x00, // ## ### + 0x7F, 0x18, 0x00, // ####### ## + 0x7F, 0x18, 0x00, // ####### ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3384 'O' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xC0, 0x00, // #### + 0x0F, 0xF0, 0x00, // ######## + 0x1C, 0x38, 0x00, // ### ### + 0x18, 0x18, 0x00, // ## ## + 0x38, 0x1C, 0x00, // ### ### + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x38, 0x1C, 0x00, // ### ### + 0x18, 0x18, 0x00, // ## ## + 0x1C, 0x38, 0x00, // ### ### + 0x0F, 0xF0, 0x00, // ######## + 0x03, 0xC0, 0x00, // #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3456 'P' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x3F, 0xF0, 0x00, // ########## + 0x3F, 0xF8, 0x00, // ########### + 0x0C, 0x1C, 0x00, // ## ### + 0x0C, 0x0C, 0x00, // ## ## + 0x0C, 0x0C, 0x00, // ## ## + 0x0C, 0x0C, 0x00, // ## ## + 0x0C, 0x18, 0x00, // ## ## + 0x0F, 0xF8, 0x00, // ######### + 0x0F, 0xE0, 0x00, // ####### + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x3F, 0xC0, 0x00, // ######## + 0x3F, 0xC0, 0x00, // ######## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3528 'Q' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xC0, 0x00, // #### + 0x0F, 0xF0, 0x00, // ######## + 0x1C, 0x38, 0x00, // ### ### + 0x18, 0x18, 0x00, // ## ## + 0x38, 0x1C, 0x00, // ### ### + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x38, 0x1C, 0x00, // ### ### + 0x18, 0x18, 0x00, // ## ## + 0x1C, 0x38, 0x00, // ### ### + 0x0F, 0xF0, 0x00, // ######## + 0x07, 0xC0, 0x00, // ##### + 0x07, 0xCC, 0x00, // ##### ## + 0x0F, 0xFC, 0x00, // ########## + 0x0C, 0x38, 0x00, // ## ### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3600 'R' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7F, 0xE0, 0x00, // ########## + 0x7F, 0xF0, 0x00, // ########### + 0x18, 0x38, 0x00, // ## ### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x38, 0x00, // ## ### + 0x1F, 0xF0, 0x00, // ######### + 0x1F, 0xC0, 0x00, // ####### + 0x18, 0xE0, 0x00, // ## ### + 0x18, 0x70, 0x00, // ## ### + 0x18, 0x30, 0x00, // ## ## + 0x18, 0x38, 0x00, // ## ### + 0x7F, 0x1E, 0x00, // ####### #### + 0x7F, 0x0E, 0x00, // ####### ### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3672 'S' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0xD8, 0x00, // ##### ## + 0x0F, 0xF8, 0x00, // ######### + 0x1C, 0x38, 0x00, // ### ### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x1E, 0x00, 0x00, // #### + 0x0F, 0xC0, 0x00, // ###### + 0x03, 0xF0, 0x00, // ###### + 0x00, 0x78, 0x00, // #### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x1C, 0x38, 0x00, // ### ### + 0x1F, 0xF0, 0x00, // ######### + 0x1B, 0xE0, 0x00, // ## ##### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3744 'T' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x3F, 0xFC, 0x00, // ############ + 0x3F, 0xFC, 0x00, // ############ + 0x31, 0x8C, 0x00, // ## ## ## + 0x31, 0x8C, 0x00, // ## ## ## + 0x31, 0x8C, 0x00, // ## ## ## + 0x31, 0x8C, 0x00, // ## ## ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x0F, 0xF0, 0x00, // ######## + 0x0F, 0xF0, 0x00, // ######## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3816 'U' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7E, 0x7E, 0x00, // ###### ###### + 0x7E, 0x7E, 0x00, // ###### ###### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x0F, 0xF0, 0x00, // ######## + 0x03, 0xC0, 0x00, // #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3888 'V' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7F, 0x7F, 0x00, // ####### ####### + 0x7F, 0x7F, 0x00, // ####### ####### + 0x18, 0x0C, 0x00, // ## ## + 0x0C, 0x18, 0x00, // ## ## + 0x0C, 0x18, 0x00, // ## ## + 0x0C, 0x18, 0x00, // ## ## + 0x06, 0x30, 0x00, // ## ## + 0x06, 0x30, 0x00, // ## ## + 0x03, 0x60, 0x00, // ## ## + 0x03, 0x60, 0x00, // ## ## + 0x03, 0x60, 0x00, // ## ## + 0x01, 0xC0, 0x00, // ### + 0x01, 0xC0, 0x00, // ### + 0x00, 0x80, 0x00, // # + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @3960 'W' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0xFE, 0x3F, 0x80, // ####### ####### + 0xFE, 0x3F, 0x80, // ####### ####### + 0x30, 0x06, 0x00, // ## ## + 0x30, 0x06, 0x00, // ## ## + 0x30, 0x86, 0x00, // ## # ## + 0x19, 0xCC, 0x00, // ## ### ## + 0x19, 0xCC, 0x00, // ## ### ## + 0x1B, 0x6C, 0x00, // ## ## ## ## + 0x1B, 0x6C, 0x00, // ## ## ## ## + 0x1E, 0x7C, 0x00, // #### ##### + 0x0E, 0x38, 0x00, // ### ### + 0x0E, 0x38, 0x00, // ### ### + 0x0C, 0x18, 0x00, // ## ## + 0x0C, 0x18, 0x00, // ## ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4032 'X' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7E, 0x7E, 0x00, // ###### ###### + 0x7E, 0x7E, 0x00, // ###### ###### + 0x18, 0x18, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x03, 0xC0, 0x00, // #### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x03, 0xC0, 0x00, // #### + 0x06, 0x60, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x7E, 0x7E, 0x00, // ###### ###### + 0x7E, 0x7E, 0x00, // ###### ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4104 'Y' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7C, 0x7E, 0x00, // ##### ###### + 0x7C, 0x7E, 0x00, // ##### ###### + 0x18, 0x18, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x03, 0xC0, 0x00, // #### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x0F, 0xF0, 0x00, // ######## + 0x0F, 0xF0, 0x00, // ######## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4176 'Z' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x1F, 0xF8, 0x00, // ########## + 0x1F, 0xF8, 0x00, // ########## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x30, 0x00, // ## ## + 0x18, 0x60, 0x00, // ## ## + 0x18, 0xC0, 0x00, // ## ## + 0x01, 0x80, 0x00, // ## + 0x03, 0x00, 0x00, // ## + 0x06, 0x18, 0x00, // ## ## + 0x0C, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x3F, 0xF8, 0x00, // ########### + 0x3F, 0xF8, 0x00, // ########### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4248 '[' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x01, 0xF0, 0x00, // ##### + 0x01, 0xF0, 0x00, // ##### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0xF0, 0x00, // ##### + 0x01, 0xF0, 0x00, // ##### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4320 '\' (17 pixels wide) + 0x18, 0x00, 0x00, // ## + 0x18, 0x00, 0x00, // ## + 0x1C, 0x00, 0x00, // ### + 0x0C, 0x00, 0x00, // ## + 0x0E, 0x00, 0x00, // ### + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x03, 0x00, 0x00, // ## + 0x03, 0x00, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x00, 0xC0, 0x00, // ## + 0x00, 0xC0, 0x00, // ## + 0x00, 0x60, 0x00, // ## + 0x00, 0x60, 0x00, // ## + 0x00, 0x70, 0x00, // ### + 0x00, 0x30, 0x00, // ## + 0x00, 0x38, 0x00, // ### + 0x00, 0x18, 0x00, // ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4392 ']' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x0F, 0x80, 0x00, // ##### + 0x0F, 0x80, 0x00, // ##### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x0F, 0x80, 0x00, // ##### + 0x0F, 0x80, 0x00, // ##### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4464 '^' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x80, 0x00, // # + 0x01, 0xC0, 0x00, // ### + 0x03, 0xE0, 0x00, // ##### + 0x07, 0x70, 0x00, // ### ### + 0x06, 0x30, 0x00, // ## ## + 0x0C, 0x18, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x10, 0x04, 0x00, // # # + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4536 '_' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0xFF, 0xFF, 0x00, // ################ + 0xFF, 0xFF, 0x00, // ################ + + // @4608 '`' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x03, 0x00, 0x00, // ## + 0x03, 0x80, 0x00, // ### + 0x00, 0xE0, 0x00, // ### + 0x00, 0x60, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4680 'a' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x0F, 0xC0, 0x00, // ###### + 0x1F, 0xE0, 0x00, // ######## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x07, 0xF0, 0x00, // ####### + 0x1F, 0xF0, 0x00, // ######### + 0x38, 0x30, 0x00, // ### ## + 0x30, 0x30, 0x00, // ## ## + 0x30, 0x70, 0x00, // ## ### + 0x1F, 0xFC, 0x00, // ########### + 0x0F, 0xBC, 0x00, // ##### #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4752 'b' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x78, 0x00, 0x00, // #### + 0x78, 0x00, 0x00, // #### + 0x18, 0x00, 0x00, // ## + 0x18, 0x00, 0x00, // ## + 0x1B, 0xE0, 0x00, // ## ##### + 0x1F, 0xF8, 0x00, // ########## + 0x1C, 0x18, 0x00, // ### ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x1C, 0x18, 0x00, // ### ## + 0x7F, 0xF8, 0x00, // ############ + 0x7B, 0xE0, 0x00, // #### ##### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4824 'c' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xEC, 0x00, // ##### ## + 0x0F, 0xFC, 0x00, // ########## + 0x1C, 0x1C, 0x00, // ### ### + 0x38, 0x0C, 0x00, // ### ## + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x00, 0x00, // ## + 0x30, 0x00, 0x00, // ## + 0x38, 0x0C, 0x00, // ### ## + 0x1C, 0x1C, 0x00, // ### ### + 0x0F, 0xF8, 0x00, // ######### + 0x03, 0xF0, 0x00, // ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4896 'd' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x78, 0x00, // #### + 0x00, 0x78, 0x00, // #### + 0x00, 0x18, 0x00, // ## + 0x00, 0x18, 0x00, // ## + 0x07, 0xD8, 0x00, // ##### ## + 0x1F, 0xF8, 0x00, // ########## + 0x18, 0x38, 0x00, // ## ### + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x18, 0x38, 0x00, // ## ### + 0x1F, 0xFE, 0x00, // ############ + 0x07, 0xDE, 0x00, // ##### #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @4968 'e' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0xE0, 0x00, // ###### + 0x1F, 0xF8, 0x00, // ########## + 0x18, 0x18, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x3F, 0xFC, 0x00, // ############ + 0x3F, 0xFC, 0x00, // ############ + 0x30, 0x00, 0x00, // ## + 0x30, 0x00, 0x00, // ## + 0x18, 0x0C, 0x00, // ## ## + 0x1F, 0xFC, 0x00, // ########### + 0x07, 0xF0, 0x00, // ####### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5040 'f' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x01, 0xFC, 0x00, // ####### + 0x03, 0xFC, 0x00, // ######## + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x3F, 0xF8, 0x00, // ########### + 0x3F, 0xF8, 0x00, // ########### + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x3F, 0xF0, 0x00, // ########## + 0x3F, 0xF0, 0x00, // ########## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5112 'g' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0xDE, 0x00, // ##### #### + 0x1F, 0xFE, 0x00, // ############ + 0x18, 0x38, 0x00, // ## ### + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x18, 0x38, 0x00, // ## ### + 0x1F, 0xF8, 0x00, // ########## + 0x07, 0xD8, 0x00, // ##### ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x38, 0x00, // ### + 0x0F, 0xF0, 0x00, // ######## + 0x0F, 0xC0, 0x00, // ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5184 'h' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x78, 0x00, 0x00, // #### + 0x78, 0x00, 0x00, // #### + 0x18, 0x00, 0x00, // ## + 0x18, 0x00, 0x00, // ## + 0x1B, 0xE0, 0x00, // ## ##### + 0x1F, 0xF0, 0x00, // ######### + 0x1C, 0x38, 0x00, // ### ### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x7E, 0x7E, 0x00, // ###### ###### + 0x7E, 0x7E, 0x00, // ###### ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5256 'i' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x1F, 0x80, 0x00, // ###### + 0x1F, 0x80, 0x00, // ###### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x3F, 0xFC, 0x00, // ############ + 0x3F, 0xFC, 0x00, // ############ + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5328 'j' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0xC0, 0x00, // ## + 0x00, 0xC0, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x1F, 0xF0, 0x00, // ######### + 0x1F, 0xF0, 0x00, // ######### + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x30, 0x00, // ## + 0x00, 0x70, 0x00, // ### + 0x1F, 0xE0, 0x00, // ######## + 0x1F, 0x80, 0x00, // ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5400 'k' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x3C, 0x00, 0x00, // #### + 0x3C, 0x00, 0x00, // #### + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0xF8, 0x00, // ## ##### + 0x0C, 0xF8, 0x00, // ## ##### + 0x0C, 0xC0, 0x00, // ## ## + 0x0D, 0x80, 0x00, // ## ## + 0x0F, 0x80, 0x00, // ##### + 0x0F, 0x00, 0x00, // #### + 0x0F, 0x80, 0x00, // ##### + 0x0D, 0xC0, 0x00, // ## ### + 0x0C, 0xE0, 0x00, // ## ### + 0x3C, 0x7C, 0x00, // #### ##### + 0x3C, 0x7C, 0x00, // #### ##### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5472 'l' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x1F, 0x80, 0x00, // ###### + 0x1F, 0x80, 0x00, // ###### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x3F, 0xFC, 0x00, // ############ + 0x3F, 0xFC, 0x00, // ############ + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5544 'm' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0xF7, 0x78, 0x00, // #### ### #### + 0xFF, 0xFC, 0x00, // ############## + 0x39, 0xCC, 0x00, // ### ### ## + 0x31, 0x8C, 0x00, // ## ## ## + 0x31, 0x8C, 0x00, // ## ## ## + 0x31, 0x8C, 0x00, // ## ## ## + 0x31, 0x8C, 0x00, // ## ## ## + 0x31, 0x8C, 0x00, // ## ## ## + 0x31, 0x8C, 0x00, // ## ## ## + 0xFD, 0xEF, 0x00, // ###### #### #### + 0xFD, 0xEF, 0x00, // ###### #### #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5616 'n' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7B, 0xE0, 0x00, // #### ##### + 0x7F, 0xF0, 0x00, // ########### + 0x1C, 0x38, 0x00, // ### ### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x7E, 0x7E, 0x00, // ###### ###### + 0x7E, 0x7E, 0x00, // ###### ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5688 'o' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x03, 0xC0, 0x00, // #### + 0x0F, 0xF0, 0x00, // ######## + 0x1C, 0x38, 0x00, // ### ### + 0x38, 0x1C, 0x00, // ### ### + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x30, 0x0C, 0x00, // ## ## + 0x38, 0x1C, 0x00, // ### ### + 0x1C, 0x38, 0x00, // ### ### + 0x0F, 0xF0, 0x00, // ######## + 0x03, 0xC0, 0x00, // #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5760 'p' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7B, 0xE0, 0x00, // #### ##### + 0x7F, 0xF8, 0x00, // ############ + 0x1C, 0x18, 0x00, // ### ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x18, 0x0C, 0x00, // ## ## + 0x1C, 0x18, 0x00, // ### ## + 0x1F, 0xF8, 0x00, // ########## + 0x1B, 0xE0, 0x00, // ## ##### + 0x18, 0x00, 0x00, // ## + 0x18, 0x00, 0x00, // ## + 0x18, 0x00, 0x00, // ## + 0x7F, 0x00, 0x00, // ####### + 0x7F, 0x00, 0x00, // ####### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5832 'q' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0xDE, 0x00, // ##### #### + 0x1F, 0xFE, 0x00, // ############ + 0x18, 0x38, 0x00, // ## ### + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x30, 0x18, 0x00, // ## ## + 0x18, 0x38, 0x00, // ## ### + 0x1F, 0xF8, 0x00, // ########## + 0x07, 0xD8, 0x00, // ##### ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x18, 0x00, // ## + 0x00, 0x18, 0x00, // ## + 0x00, 0xFE, 0x00, // ####### + 0x00, 0xFE, 0x00, // ####### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5904 'r' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x3E, 0x78, 0x00, // ##### #### + 0x3E, 0xFC, 0x00, // ##### ###### + 0x07, 0xCC, 0x00, // ##### ## + 0x07, 0x00, 0x00, // ### + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x06, 0x00, 0x00, // ## + 0x3F, 0xF0, 0x00, // ########## + 0x3F, 0xF0, 0x00, // ########## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @5976 's' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0xF8, 0x00, // ######## + 0x0F, 0xF8, 0x00, // ######### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x1F, 0x80, 0x00, // ###### + 0x0F, 0xF0, 0x00, // ######## + 0x00, 0xF8, 0x00, // ##### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x38, 0x00, // ## ### + 0x1F, 0xF0, 0x00, // ######### + 0x1F, 0xE0, 0x00, // ######## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @6048 't' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x3F, 0xF0, 0x00, // ########## + 0x3F, 0xF0, 0x00, // ########## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x00, 0x00, // ## + 0x0C, 0x1C, 0x00, // ## ### + 0x07, 0xFC, 0x00, // ######### + 0x03, 0xF0, 0x00, // ###### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @6120 'u' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x78, 0x78, 0x00, // #### #### + 0x78, 0x78, 0x00, // #### #### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x38, 0x00, // ## ### + 0x0F, 0xFE, 0x00, // ########### + 0x07, 0xDE, 0x00, // ##### #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @6192 'v' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7C, 0x3E, 0x00, // ##### ##### + 0x7C, 0x3E, 0x00, // ##### ##### + 0x18, 0x18, 0x00, // ## ## + 0x18, 0x18, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x07, 0xE0, 0x00, // ###### + 0x03, 0xC0, 0x00, // #### + 0x03, 0xC0, 0x00, // #### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @6264 'w' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x78, 0x3C, 0x00, // #### #### + 0x78, 0x3C, 0x00, // #### #### + 0x31, 0x18, 0x00, // ## # ## + 0x33, 0x98, 0x00, // ## ### ## + 0x33, 0x98, 0x00, // ## ### ## + 0x1A, 0xB0, 0x00, // ## # # ## + 0x1E, 0xF0, 0x00, // #### #### + 0x1E, 0xF0, 0x00, // #### #### + 0x1C, 0x60, 0x00, // ### ## + 0x0C, 0x60, 0x00, // ## ## + 0x0C, 0x60, 0x00, // ## ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @6336 'x' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x3E, 0x7C, 0x00, // ##### ##### + 0x3E, 0x7C, 0x00, // ##### ##### + 0x0C, 0x30, 0x00, // ## ## + 0x06, 0x60, 0x00, // ## ## + 0x03, 0xC0, 0x00, // #### + 0x01, 0x80, 0x00, // ## + 0x03, 0xC0, 0x00, // #### + 0x06, 0x60, 0x00, // ## ## + 0x0C, 0x30, 0x00, // ## ## + 0x3E, 0x7C, 0x00, // ##### ##### + 0x3E, 0x7C, 0x00, // ##### ##### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @6408 'y' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x7E, 0x1F, 0x00, // ###### ##### + 0x7E, 0x1F, 0x00, // ###### ##### + 0x18, 0x0C, 0x00, // ## ## + 0x0C, 0x18, 0x00, // ## ## + 0x0C, 0x18, 0x00, // ## ## + 0x06, 0x30, 0x00, // ## ## + 0x06, 0x30, 0x00, // ## ## + 0x03, 0x60, 0x00, // ## ## + 0x03, 0xE0, 0x00, // ##### + 0x01, 0xC0, 0x00, // ### + 0x00, 0xC0, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x03, 0x00, 0x00, // ## + 0x3F, 0xC0, 0x00, // ######## + 0x3F, 0xC0, 0x00, // ######## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @6480 'z' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x1F, 0xF8, 0x00, // ########## + 0x1F, 0xF8, 0x00, // ########## + 0x18, 0x30, 0x00, // ## ## + 0x18, 0x60, 0x00, // ## ## + 0x00, 0xC0, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x03, 0x00, 0x00, // ## + 0x06, 0x18, 0x00, // ## ## + 0x0C, 0x18, 0x00, // ## ## + 0x1F, 0xF8, 0x00, // ########## + 0x1F, 0xF8, 0x00, // ########## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @6552 '{' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0xE0, 0x00, // ### + 0x01, 0xE0, 0x00, // #### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x03, 0x80, 0x00, // ### + 0x07, 0x00, 0x00, // ### + 0x03, 0x80, 0x00, // ### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0xE0, 0x00, // #### + 0x00, 0xE0, 0x00, // ### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @6624 '|' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @6696 '}' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x07, 0x00, 0x00, // ### + 0x07, 0x80, 0x00, // #### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0xC0, 0x00, // ### + 0x00, 0xE0, 0x00, // ### + 0x01, 0xC0, 0x00, // ### + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x01, 0x80, 0x00, // ## + 0x07, 0x80, 0x00, // #### + 0x07, 0x00, 0x00, // ### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + + // @6768 '~' (17 pixels wide) + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x0E, 0x00, 0x00, // ### + 0x1F, 0x18, 0x00, // ##### ## + 0x3B, 0xB8, 0x00, // ### ### ### + 0x31, 0xF0, 0x00, // ## ##### + 0x00, 0xE0, 0x00, // ### + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, // +}; + +sFONT Font24 = { + Font24_Table, + 17, /* Width */ + 24, /* Height */ +}; + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/docs/Touch_e-Paper_Code/c/lib/Fonts/font24CN.c b/docs/Touch_e-Paper_Code/c/lib/Fonts/font24CN.c new file mode 100644 index 0000000..d3c9584 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Fonts/font24CN.c @@ -0,0 +1,465 @@ +/** + ****************************************************************************** + * @file Font12.c + * @author MCD Application Team + * @version V1.0.0 + * @date 18-February-2014 + * @brief This file provides text Font12 for STM32xx-EVAL's LCD driver. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * 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. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "fonts.h" + + +// +// Font data for Courier New 12pt +// + +const CH_CN Font24CN_Table[] = +{ +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC1,0xC0,0x00, +0x01,0xE3,0xE0,0x00,0x03,0xE3,0xC0,0x00,0x03,0xC7,0x80,0x00,0x03,0xC7,0xFF,0xFF, +0x07,0x8F,0xFF,0xFF,0x07,0x8F,0x00,0x0F,0x0F,0x1E,0x00,0x1E,0x0F,0x3C,0x1E,0x1E, +0x1F,0x3C,0x1E,0x3E,0x1F,0x18,0x1E,0x3C,0x3F,0x00,0x1E,0x1C,0x7F,0x00,0x1E,0x00, +0x7F,0x07,0x9E,0x70,0xFF,0x07,0x9E,0xF0,0xEF,0x0F,0x9E,0x78,0x6F,0x0F,0x1E,0x78, +0x0F,0x0F,0x1E,0x3C,0x0F,0x1E,0x1E,0x3C,0x0F,0x1E,0x1E,0x1E,0x0F,0x3C,0x1E,0x1E, +0x0F,0x3C,0x1E,0x1F,0x0F,0x7C,0x1E,0x0F,0x0F,0x78,0x1E,0x0E,0x0F,0x00,0x1E,0x00, +0x0F,0x00,0x1E,0x00,0x0F,0x00,0x3C,0x00,0x0F,0x07,0xFC,0x00,0x0F,0x07,0xF8,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00, +0x0F,0x07,0xFF,0xFE,0x0F,0x07,0xFF,0xFE,0x0F,0x00,0x00,0x3E,0x1E,0x00,0x00,0xFC, +0xFF,0xF8,0x01,0xF0,0xFF,0xF8,0x03,0xE0,0x1E,0x78,0x07,0xC0,0x1E,0x78,0x0F,0x80, +0x3C,0x78,0x0F,0x00,0x3C,0x78,0x0F,0x00,0x3C,0x78,0x0F,0x00,0x3C,0x78,0x0F,0x00, +0x3C,0x7F,0xFF,0xFF,0x78,0xFF,0xFF,0xFF,0x78,0xF0,0x0F,0x00,0x78,0xF0,0x0F,0x00, +0x3D,0xE0,0x0F,0x00,0x1F,0xE0,0x0F,0x00,0x0F,0xE0,0x0F,0x00,0x07,0xC0,0x0F,0x00, +0x07,0xE0,0x0F,0x00,0x07,0xF0,0x0F,0x00,0x0F,0xF8,0x0F,0x00,0x1E,0x7C,0x0F,0x00, +0x3C,0x38,0x0F,0x00,0x78,0x00,0x0F,0x00,0xF0,0x03,0xFF,0x00,0x60,0x01,0xFE,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : ΢ --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{"΢"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0x01,0xE0,0x07,0x87,0x01,0xE0, +0x07,0x07,0x01,0xC0,0x0F,0xF7,0x79,0xC0,0x1E,0xF7,0x7B,0xC0,0x1E,0xF7,0x7B,0x80, +0x3C,0xF7,0x7B,0xFF,0x78,0xF7,0x7B,0xFF,0xF8,0xF7,0x7F,0x9E,0xF7,0xFF,0xFF,0x9E, +0x67,0xFF,0xFF,0x9E,0x07,0x00,0x7F,0x9C,0x0F,0x00,0x0F,0x9C,0x1E,0x00,0x1F,0x9C, +0x1E,0x7F,0xFF,0xBC,0x3E,0x7F,0xF3,0xFC,0x3E,0x00,0x03,0xFC,0x7E,0x00,0x01,0xF8, +0xFE,0x00,0x01,0xF8,0xFE,0x7F,0xE1,0xF8,0xDE,0x7F,0xE1,0xF8,0x1E,0x78,0xE0,0xF0, +0x1E,0x78,0xEE,0xF0,0x1E,0x78,0xFF,0xF0,0x1E,0x78,0xFD,0xF8,0x1E,0x79,0xFB,0xFC, +0x1E,0xF1,0xF7,0xBC,0x1E,0xF0,0xEF,0x9E,0x1F,0xE0,0x0F,0x0F,0x1E,0xC0,0x1E,0x0F, +0x1E,0x00,0x0C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x03,0xC0,0x78,0x00,0x07,0x80,0x78,0x00,0x07,0x80,0x78,0x00, +0x07,0x80,0xF0,0x00,0x0F,0x00,0xF0,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0x1E,0x03,0xC0,0x1F,0x1E,0x03,0xC0,0x1E,0x1F,0xE7,0x8F,0x3E,0x3D,0xE7,0x8F,0x3C, +0x3D,0xEF,0x0F,0x7C,0x3D,0xE7,0x0F,0x78,0x79,0xE0,0x0F,0x00,0x79,0xE0,0x0E,0x00, +0x7F,0xFE,0x0E,0x00,0x7F,0xFE,0x1F,0x00,0x01,0xE0,0x1F,0x00,0x01,0xE0,0x1F,0x00, +0x01,0xE0,0x1F,0x80,0x01,0xE0,0x1F,0x80,0x01,0xE0,0x3F,0x80,0x01,0xFF,0x3F,0xC0, +0x0F,0xFF,0x7B,0xC0,0xFF,0xF0,0x79,0xE0,0xF9,0xE0,0xF1,0xF0,0x01,0xE1,0xF0,0xF0, +0x01,0xE3,0xE0,0xF8,0x01,0xE7,0xC0,0x7C,0x01,0xFF,0x80,0x3F,0x01,0xFF,0x00,0x1F, +0x01,0xEC,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x00,0x00,0x00,0xFF,0x00, +0x7F,0xFC,0xF7,0x80,0x7F,0xFD,0xE3,0xC0,0x01,0xC1,0xE3,0xC0,0x01,0xC3,0xC1,0x80, +0x3D,0xC7,0xFF,0xFF,0x39,0xC7,0xFF,0xFF,0x39,0xCF,0x83,0x80,0x79,0xDF,0x83,0x80, +0x79,0xFF,0x83,0x80,0x79,0xDF,0x83,0x80,0x71,0xC3,0x83,0x80,0x7F,0xFF,0xFF,0xFE, +0x7F,0xFF,0xFF,0xFE,0x03,0xC3,0x83,0x80,0x07,0xC3,0x83,0x80,0x07,0xC3,0x83,0x80, +0x0F,0xC3,0x83,0x80,0x0F,0xC3,0x83,0x80,0x1F,0xC3,0xFF,0xFE,0x1D,0xC3,0xFF,0xFE, +0x3D,0xC3,0x83,0x80,0x79,0xC3,0x83,0x80,0xF1,0xC3,0x83,0x80,0xF1,0xC3,0x83,0x80, +0x61,0xC3,0x83,0x80,0x01,0xC3,0xFF,0xFF,0x03,0xC3,0xFF,0xFF,0x1F,0xC3,0x80,0x00, +0x1F,0x83,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x1F,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC,0x1E,0x03,0xC0,0x3C,0x1E,0xC3,0xC7,0x3C, +0x1F,0xE3,0xC7,0xBC,0x1E,0xF3,0xCF,0x3C,0x1E,0xFB,0xDF,0x3C,0x1E,0x7B,0xDE,0x3C, +0x1E,0x33,0xDC,0x3C,0x1E,0x03,0xC0,0x3C,0x1F,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC, +0x1E,0x03,0xC0,0x3C,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x3F,0xFF,0xFF,0xFC, +0x3F,0xFF,0xFF,0xFC,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x1C,0x38,0x70,0x70, +0x3E,0x78,0xF8,0xF8,0x3C,0x7C,0x78,0x7C,0x7C,0x3C,0x3C,0x3E,0xF8,0x3E,0x3C,0x1F, +0xF0,0x1C,0x18,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x3C,0x00, +0x00,0x78,0x3C,0x00,0x00,0x78,0x3C,0x00,0x00,0x78,0x3C,0x00,0x00,0x78,0x3C,0x00, +0x00,0x78,0x3C,0x0C,0x3C,0x78,0x3C,0x1E,0x3C,0x78,0x3C,0x3F,0x3C,0x78,0x3C,0xF8, +0x3C,0x7F,0xFD,0xF0,0x3C,0x7F,0xFF,0xE0,0x3C,0x78,0x3F,0x80,0x3C,0x78,0x3E,0x00, +0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00, +0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x0E,0x3C,0x78,0x3C,0x0F, +0x3C,0x78,0x3C,0x0F,0x3C,0x79,0xFC,0x0F,0x3C,0x7F,0xFC,0x0F,0x3F,0xFF,0x3C,0x0F, +0x3F,0xF0,0x3E,0x1E,0xFF,0x00,0x1F,0xFE,0xF0,0x00,0x0F,0xFC,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x03,0xC0,0x00, +0x00,0x03,0xE0,0x00,0x00,0x01,0xE0,0x00,0x7F,0xFF,0xFF,0xFE,0x7F,0xFF,0xFF,0xFE, +0x78,0x00,0x00,0x1E,0x78,0x00,0x00,0x1E,0x78,0x00,0x00,0x1E,0x78,0x00,0x00,0x1E, +0x7B,0xFF,0xFF,0xDE,0x03,0xFF,0xFF,0xC0,0x00,0x00,0x0F,0xC0,0x00,0x00,0x3F,0x00, +0x00,0x00,0x7E,0x00,0x00,0x01,0xF8,0x00,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00, +0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00, +0x00,0x03,0xE0,0x00,0x00,0x03,0xC0,0x00,0x00,0xFF,0xC0,0x00,0x00,0xFF,0x80,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x3C,0x00, +0x03,0xC0,0x3C,0x00,0x03,0xC0,0x3C,0x00,0x07,0x80,0x3C,0x00,0x07,0x80,0x3C,0x00, +0x07,0x80,0x3C,0x00,0x0F,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0x1F,0x01,0xFE,0x00, +0x1F,0x01,0xFF,0x00,0x3F,0x01,0xFF,0x00,0x3F,0x03,0xFF,0x00,0x7F,0x03,0xFF,0x80, +0x7F,0x07,0xBF,0x80,0xFF,0x07,0xBF,0xC0,0xEF,0x0F,0x3D,0xC0,0xCF,0x0F,0x3D,0xE0, +0x0F,0x1E,0x3D,0xE0,0x0F,0x1E,0x3C,0xF0,0x0F,0x3C,0x3C,0x78,0x0F,0x7C,0x3C,0x7C, +0x0F,0xF8,0x3C,0x3E,0x0F,0xF7,0xFF,0xDF,0x0F,0xE7,0xFF,0xCF,0x0F,0xC0,0x3C,0x06, +0x0F,0x00,0x3C,0x00,0x0F,0x00,0x3C,0x00,0x0F,0x00,0x3C,0x00,0x0F,0x00,0x3C,0x00, +0x0F,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00, +0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00, +0x00,0x0F,0xE0,0x00,0x00,0x0F,0xF8,0x00,0x00,0x0F,0xFC,0x00,0x00,0x0F,0xBF,0x00, +0x00,0x0F,0x9F,0x80,0x00,0x0F,0x87,0xE0,0x00,0x0F,0x83,0xF0,0x00,0x0F,0x80,0xF8, +0x00,0x0F,0x80,0x7C,0x00,0x0F,0x80,0x38,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00, +0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00, +0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78, +0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x7F,0xFC,0x00,0x78,0x7F,0xFC,0x00,0x78, +0x00,0x3C,0x00,0x78,0x00,0x3F,0xFF,0xFF,0x30,0x3F,0xFF,0xFF,0x78,0x3C,0x00,0x78, +0x3C,0x38,0x00,0x78,0x3E,0x78,0x00,0x78,0x1E,0x78,0xC0,0x78,0x0F,0x79,0xE0,0x78, +0x0F,0xF0,0xF0,0x78,0x07,0xF0,0xF8,0x78,0x03,0xF0,0x78,0x78,0x01,0xE0,0x3C,0x78, +0x03,0xF0,0x3E,0x78,0x03,0xF0,0x18,0x78,0x07,0xF8,0x00,0x78,0x07,0xFC,0x00,0x78, +0x0F,0x3E,0x00,0x78,0x1F,0x1E,0x00,0x78,0x3E,0x1F,0x00,0x78,0x7C,0x0E,0x00,0xF8, +0xF8,0x00,0x00,0xF0,0xF0,0x00,0x3F,0xF0,0x60,0x00,0x3F,0xE0,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : Ӧ --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{"Ӧ"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x00,0x00,0x03,0xE0,0x00,0x00,0x01,0xE0,0x00, +0x00,0x01,0xF0,0x00,0x00,0x00,0xF0,0x00,0x1F,0xFF,0xFF,0xFF,0x1F,0xFF,0xFF,0xFF, +0x1E,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0x1E,0x01,0xE0,0x78,0x1E,0x01,0xE0,0x78, +0x1E,0xE1,0xE0,0x78,0x1F,0xF1,0xF0,0xF8,0x1E,0xF0,0xF0,0xF0,0x1E,0xF0,0xF0,0xF0, +0x1E,0xF8,0xF0,0xF0,0x1E,0x78,0xF1,0xF0,0x1E,0x78,0xF9,0xE0,0x1E,0x78,0x79,0xE0, +0x1E,0x7C,0x7B,0xE0,0x1E,0x3C,0x7B,0xC0,0x1E,0x3C,0x7B,0xC0,0x1E,0x3C,0x7B,0xC0, +0x3C,0x3E,0x07,0x80,0x3C,0x1C,0x07,0x80,0x3C,0x00,0x07,0x80,0x3C,0x00,0x0F,0x00, +0x78,0x00,0x0F,0x00,0x7B,0xFF,0xFF,0xFF,0xF3,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00, +0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x3C,0x00,0x07,0xC0,0x3E,0x00, +0x07,0x80,0x3C,0x00,0x07,0x80,0x7C,0x00,0x0F,0x00,0x78,0x00,0x7F,0xFE,0x7F,0xFE, +0x7F,0xFE,0xFF,0xFE,0x78,0x1E,0xF0,0x1E,0x78,0x1F,0xE0,0x1E,0x78,0x1F,0xE0,0x1E, +0x78,0x1F,0xC0,0x1E,0x78,0x1F,0xC0,0x1E,0x78,0x1F,0xF0,0x1E,0x78,0x1E,0xF8,0x1E, +0x78,0x1E,0x7C,0x1E,0x7F,0xFE,0x3C,0x1E,0x7F,0xFE,0x1E,0x1E,0x78,0x1E,0x1F,0x1E, +0x78,0x1E,0x0F,0x9E,0x78,0x1E,0x07,0x9E,0x78,0x1E,0x07,0x1E,0x78,0x1E,0x00,0x1E, +0x78,0x1E,0x00,0x1E,0x78,0x1E,0x00,0x3E,0x78,0x1E,0x00,0x3C,0x78,0x1E,0x00,0x3C, +0x7F,0xFE,0x00,0x3C,0x7F,0xFE,0x00,0x7C,0x78,0x1E,0x3F,0xF8,0x78,0x1E,0x3F,0xF0, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00, +0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xFF,0xFF,0x00,0x03,0xFF,0xFF, +0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00, +0x0F,0xFF,0xFF,0xF8,0x0F,0xFF,0xFF,0xF8,0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78, +0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78, +0x0F,0xFF,0xFF,0xF8,0x0F,0xFF,0xFF,0xF8,0x0F,0x00,0x00,0x78,0x00,0x00,0x00,0x00, +0x0C,0x38,0x38,0x30,0x1E,0x7C,0x78,0x78,0x3E,0x3C,0x78,0x78,0x3C,0x3C,0x3C,0x3C, +0x7C,0x3E,0x3C,0x3E,0xF8,0x1E,0x3C,0x1E,0xF0,0x1E,0x1E,0x1F,0x70,0x1E,0x1C,0x0E, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x78,0x00, +0x7F,0xF0,0x78,0x00,0x7F,0xF0,0x78,0x00,0x79,0xFF,0xFF,0xFF,0x79,0xFF,0xFF,0xFF, +0x79,0xE1,0xE0,0x00,0x79,0xE1,0xE0,0x00,0x7B,0xC1,0xEF,0x80,0x7B,0xC3,0xCF,0x80, +0x7B,0xC3,0xCF,0x80,0x7F,0x87,0xCF,0x80,0x7F,0x87,0x8F,0x80,0x7F,0x87,0x8F,0x80, +0x7B,0xCF,0x0F,0x80,0x7B,0xCF,0xFF,0xFE,0x79,0xEF,0xFF,0xFE,0x79,0xE0,0x0F,0x80, +0x78,0xE0,0x0F,0x80,0x78,0xF0,0x0F,0x80,0x78,0xF0,0x0F,0x80,0x78,0xF0,0x0F,0x80, +0x78,0xFF,0xFF,0xFF,0x79,0xFF,0xFF,0xFF,0x7F,0xE0,0x0F,0x80,0x7F,0xC0,0x0F,0x80, +0x78,0x00,0x0F,0x80,0x78,0x00,0x0F,0x80,0x78,0x00,0x0F,0x80,0x78,0x00,0x0F,0x80, +0x78,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : Ϊ --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{"Ϊ"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00, +0x0E,0x07,0x80,0x00,0x1F,0x07,0x80,0x00,0x0F,0x87,0x80,0x00,0x07,0xC7,0x80,0x00, +0x01,0xE7,0x80,0x00,0x00,0xC7,0x80,0x00,0x00,0x07,0x80,0x00,0x7F,0xFF,0xFF,0xFC, +0x7F,0xFF,0xFF,0xFC,0x00,0x07,0x80,0x3C,0x00,0x0F,0x80,0x3C,0x00,0x0F,0x00,0x3C, +0x00,0x0F,0x00,0x3C,0x00,0x0F,0x60,0x3C,0x00,0x1F,0xF0,0x3C,0x00,0x1E,0x78,0x3C, +0x00,0x3E,0x3C,0x3C,0x00,0x3C,0x3E,0x3C,0x00,0x7C,0x1F,0x3C,0x00,0x78,0x0F,0x3C, +0x00,0xF8,0x06,0x3C,0x01,0xF0,0x00,0x3C,0x03,0xE0,0x00,0x7C,0x07,0xC0,0x00,0x7C, +0x0F,0x80,0x00,0x78,0x1F,0x00,0x00,0xF8,0x3E,0x00,0xFF,0xF0,0x7C,0x00,0xFF,0xE0, +0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x38, +0x0F,0x00,0x00,0x38,0x0F,0x00,0x00,0x38,0x0F,0x3F,0xF8,0x38,0x0F,0x3F,0xF8,0x38, +0x0F,0x00,0x78,0x38,0xFF,0xE0,0x7F,0xFF,0xFF,0xE0,0x7F,0xFF,0x0F,0x00,0x70,0x38, +0x0F,0x18,0xF0,0x38,0x1F,0x3C,0xF0,0x38,0x1F,0x1C,0xFE,0x38,0x1F,0xDE,0xFE,0x38, +0x3F,0xEF,0xEF,0x38,0x3F,0xFF,0xEF,0x38,0x3F,0xF7,0xE7,0xB8,0x7F,0x67,0xC7,0xB8, +0x7F,0x03,0xC3,0xB8,0xFF,0x07,0xE0,0x38,0xEF,0x07,0xE0,0x38,0xEF,0x0F,0xF0,0x38, +0xCF,0x1F,0xF0,0x38,0x0F,0x1E,0x78,0x38,0x0F,0x3C,0x7C,0x38,0x0F,0x78,0x3C,0x38, +0x0F,0xF8,0x38,0x38,0x0F,0x60,0x00,0x78,0x0F,0x00,0x0F,0xF8,0x0F,0x00,0x07,0xF0, +0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : ݮ --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{"ݮ"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x1E,0x00,0x00,0x3C,0x1E,0x00, +0x00,0x3C,0x1E,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x3C,0x1E,0x00, +0x07,0xBC,0x1E,0x00,0x07,0x80,0x00,0x00,0x0F,0xFF,0xFF,0xFC,0x0F,0xFF,0xFF,0xFC, +0x1E,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xF0, +0xF7,0xFF,0xFF,0xF0,0x37,0x83,0x80,0xF0,0x07,0x87,0xC0,0xF0,0x07,0x83,0xF0,0xF0, +0x07,0x00,0xE0,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x0F,0x00,0xE0, +0x0F,0x0F,0x81,0xE0,0x0E,0x03,0xE1,0xE0,0x1E,0x01,0xC1,0xE0,0x1F,0xFF,0xFF,0xFE, +0x1F,0xFF,0xFF,0xFE,0x00,0x00,0x01,0xE0,0x00,0x00,0x03,0xC0,0x00,0x00,0xFF,0xC0, +0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x3E, +0x7C,0x00,0x3F,0xFE,0x3F,0x3F,0xFF,0xF0,0x1F,0xBF,0xE0,0x00,0x07,0xBC,0x00,0x00, +0x03,0x3C,0x00,0x00,0x00,0x3C,0x00,0x3C,0x00,0x3C,0x0F,0xFE,0x70,0x3D,0xFF,0xF8, +0xF8,0x3D,0xFF,0x00,0x7C,0x3D,0xE7,0x80,0x3F,0x3D,0xE7,0x80,0x1F,0x3D,0xE7,0x8E, +0x0E,0x3D,0xE7,0x9F,0x00,0x3D,0xE7,0xFE,0x00,0x39,0xE7,0xF8,0x00,0x39,0xE3,0xF0, +0x1C,0x39,0xE3,0xC0,0x1E,0x79,0xE3,0xC0,0x1E,0x79,0xE1,0xE0,0x1E,0x79,0xE1,0xE0, +0x3C,0x79,0xE0,0xF0,0x3C,0x79,0xE0,0xF8,0x3C,0xF1,0xE0,0x7C,0x3C,0xF1,0xE3,0x7C, +0x7D,0xF1,0xEF,0x3F,0x79,0xE1,0xFE,0x1F,0x7B,0xE1,0xF8,0x0E,0x7B,0xC3,0xE0,0x00, +0x79,0x81,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : A --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{ +"A"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x7C,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0xFE,0x00,0x00, +0x01,0xFF,0x00,0x00,0x01,0xFF,0x00,0x00,0x01,0xEF,0x00,0x00,0x03,0xEF,0x80,0x00, +0x03,0xCF,0x80,0x00,0x07,0xC7,0x80,0x00,0x07,0xC7,0xC0,0x00,0x07,0x87,0xC0,0x00, +0x0F,0x83,0xE0,0x00,0x0F,0x83,0xE0,0x00,0x0F,0x01,0xE0,0x00,0x1F,0xFF,0xF0,0x00, +0x1F,0xFF,0xF0,0x00,0x3F,0xFF,0xF8,0x00,0x3E,0x00,0xF8,0x00,0x3C,0x00,0xF8,0x00, +0x7C,0x00,0x7C,0x00,0x7C,0x00,0x7C,0x00,0x78,0x00,0x3C,0x00,0xF8,0x00,0x3E,0x00, +0xF8,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : a --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{"a"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF8,0x00,0x00, +0x1F,0xFE,0x00,0x00,0x3F,0xFE,0x00,0x00,0x3E,0x3F,0x00,0x00,0x38,0x1F,0x00,0x00, +0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x03,0xFF,0x00,0x00,0x1F,0xFF,0x00,0x00, +0x3F,0x8F,0x00,0x00,0x7C,0x0F,0x00,0x00,0x7C,0x0F,0x00,0x00,0x78,0x1F,0x00,0x00, +0x7C,0x1F,0x00,0x00,0x7E,0x7F,0x00,0x00,0x7F,0xFF,0x00,0x00,0x3F,0xFF,0x00,0x00, +0x0F,0xCF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : b --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{"b"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00, +0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00, +0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0xFE,0x00,0x00, +0x3D,0xFF,0x80,0x00,0x3F,0xFF,0xC0,0x00,0x3F,0x8F,0xC0,0x00,0x3F,0x07,0xE0,0x00, +0x3E,0x03,0xE0,0x00,0x3E,0x03,0xE0,0x00,0x3C,0x01,0xE0,0x00,0x3C,0x01,0xE0,0x00, +0x3C,0x01,0xE0,0x00,0x3C,0x03,0xE0,0x00,0x3E,0x03,0xE0,0x00,0x3E,0x03,0xE0,0x00, +0x3F,0x07,0xC0,0x00,0x3F,0x8F,0xC0,0x00,0x3F,0xFF,0x80,0x00,0x3F,0xFF,0x00,0x00, +0x3C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : c --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{"c"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFC,0x00,0x00, +0x07,0xFE,0x00,0x00,0x1F,0xFE,0x00,0x00,0x3F,0x86,0x00,0x00,0x3E,0x00,0x00,0x00, +0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x78,0x00,0x00,0x00, +0x78,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00, +0x3E,0x00,0x00,0x00,0x3F,0x86,0x00,0x00,0x1F,0xFE,0x00,0x00,0x0F,0xFE,0x00,0x00, +0x03,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : ΢ --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{"΢"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0x01,0xE0,0x07,0x87,0x01,0xE0, +0x07,0x07,0x01,0xC0,0x0F,0xF7,0x79,0xC0,0x1E,0xF7,0x7B,0xC0,0x1E,0xF7,0x7B,0x80, +0x3C,0xF7,0x7B,0xFF,0x78,0xF7,0x7B,0xFF,0xF8,0xF7,0x7F,0x9E,0xF7,0xFF,0xFF,0x9E, +0x67,0xFF,0xFF,0x9E,0x07,0x00,0x7F,0x9C,0x0F,0x00,0x0F,0x9C,0x1E,0x00,0x1F,0x9C, +0x1E,0x7F,0xFF,0xBC,0x3E,0x7F,0xF3,0xFC,0x3E,0x00,0x03,0xFC,0x7E,0x00,0x01,0xF8, +0xFE,0x00,0x01,0xF8,0xFE,0x7F,0xE1,0xF8,0xDE,0x7F,0xE1,0xF8,0x1E,0x78,0xE0,0xF0, +0x1E,0x78,0xEE,0xF0,0x1E,0x78,0xFF,0xF0,0x1E,0x78,0xFD,0xF8,0x1E,0x79,0xFB,0xFC, +0x1E,0xF1,0xF7,0xBC,0x1E,0xF0,0xEF,0x9E,0x1F,0xE0,0x0F,0x0F,0x1E,0xC0,0x1E,0x0F, +0x1E,0x00,0x0C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : ѩ --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{"ѩ"},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x1F,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00, +0x7F,0xFF,0xFF,0xFE,0x7F,0xFF,0xFF,0xFE,0x78,0x03,0xC0,0x1E,0x78,0x03,0xC0,0x1E, +0x7F,0xFF,0xFF,0xFE,0x7F,0xFF,0xFF,0xFE,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00, +0x07,0xFF,0xFF,0xE0,0x07,0xFF,0xFF,0xE0,0x00,0x03,0xC0,0x00,0x00,0x00,0x00,0x00, +0x1F,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78, +0x1F,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78, +0x00,0x00,0x00,0x78,0x3F,0xFF,0xFF,0xF8,0x3F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x78, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00, +0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x7F,0xFF,0xFF,0xF8,0x7F,0xFF,0xFF,0xF8, +0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8, +0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x7F,0xFF,0xFF,0xF8,0x7F,0xFF,0xFF,0xF8, +0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8, +0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x7F,0xFF,0xFF,0xF8,0x7F,0xFF,0xFF,0xF8, +0x78,0x07,0x80,0x0E,0x78,0x07,0x80,0x0F,0x00,0x07,0x80,0x0F,0x00,0x07,0x80,0x0F, +0x00,0x07,0x80,0x1F,0x00,0x07,0x80,0x1E,0x00,0x03,0xFF,0xFE,0x00,0x01,0xFF,0xFC, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + +/*-- : --*/ +/*-- ΢ź24; ¶ӦĵΪx=32x41 --*/ +{{""},{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x1F,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xF8,0x00,0x00,0x07,0xE0, +0x00,0x00,0x0F,0xC0,0x00,0x00,0x1F,0x80,0x00,0x00,0x3E,0x00,0x00,0x00,0xFC,0x00, +0x00,0x01,0xF8,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00, +0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00, +0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00, +0x00,0x03,0xE0,0x00,0x00,0x03,0xC0,0x00,0x01,0xFF,0xC0,0x00,0x00,0xFF,0x80,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00}}, + + +}; + +cFONT Font24CN = { + Font24CN_Table, + sizeof(Font24CN_Table)/sizeof(CH_CN), /*size of table*/ + 24, /* ASCII Width */ + 32, /* Width */ + 41, /* Height */ +}; + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/docs/Touch_e-Paper_Code/c/lib/Fonts/font8.c b/docs/Touch_e-Paper_Code/c/lib/Fonts/font8.c new file mode 100644 index 0000000..88450d9 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Fonts/font8.c @@ -0,0 +1,1004 @@ +/** + ****************************************************************************** + * @file Font8.c + * @author MCD Application Team + * @version V1.0.0 + * @date 18-February-2014 + * @brief This file provides text Font8 for STM32xx-EVAL's LCD driver. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * 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. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "fonts.h" + +// +// Font data for Courier New 12pt +// + +const uint8_t Font8_Table[] = +{ + // @0 ' ' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @8 '!' (5 pixels wide) + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x00, // + 0x20, // # + 0x00, // + 0x00, // + + // @16 '"' (5 pixels wide) + 0x50, // # # + 0x50, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @24 '#' (5 pixels wide) + 0x28, // # # + 0x50, // # # + 0xF8, // ##### + 0x50, // # # + 0xF8, // ##### + 0x50, // # # + 0xA0, // # # + 0x00, // + + // @32 '$' (5 pixels wide) + 0x20, // # + 0x30, // ## + 0x60, // ## + 0x30, // ## + 0x10, // # + 0x60, // ## + 0x20, // # + 0x00, // + + // @40 '%' (5 pixels wide) + 0x20, // # + 0x20, // # + 0x18, // ## + 0x60, // ## + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + + // @48 '&' (5 pixels wide) + 0x00, // + 0x38, // ### + 0x20, // # + 0x60, // ## + 0x50, // # # + 0x78, // #### + 0x00, // + 0x00, // + + // @56 ''' (5 pixels wide) + 0x20, // # + 0x20, // # + 0x20, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @64 '(' (5 pixels wide) + 0x10, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x10, // # + 0x00, // + + // @72 ')' (5 pixels wide) + 0x40, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x40, // # + 0x00, // + + // @80 '*' (5 pixels wide) + 0x20, // # + 0x70, // ### + 0x20, // # + 0x50, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @88 '+' (5 pixels wide) + 0x00, // + 0x20, // # + 0x20, // # + 0xF8, // ##### + 0x20, // # + 0x20, // # + 0x00, // + 0x00, // + + // @96 ',' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x10, // # + 0x20, // # + 0x20, // # + 0x00, // + + // @104 '-' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x70, // ### + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @112 '.' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x20, // # + 0x00, // + 0x00, // + + // @120 '/' (5 pixels wide) + 0x10, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x40, // # + 0x40, // # + 0x80, // # + 0x00, // + + // @128 '0' (5 pixels wide) + 0x20, // # + 0x50, // # # + 0x50, // # # + 0x50, // # # + 0x50, // # # + 0x20, // # + 0x00, // + 0x00, // + + // @136 '1' (5 pixels wide) + 0x60, // ## + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0xF8, // ##### + 0x00, // + 0x00, // + + // @144 '2' (5 pixels wide) + 0x20, // # + 0x50, // # # + 0x20, // # + 0x20, // # + 0x40, // # + 0x70, // ### + 0x00, // + 0x00, // + + // @152 '3' (5 pixels wide) + 0x20, // # + 0x50, // # # + 0x10, // # + 0x20, // # + 0x10, // # + 0x60, // ## + 0x00, // + 0x00, // + + // @160 '4' (5 pixels wide) + 0x10, // # + 0x30, // ## + 0x50, // # # + 0x78, // #### + 0x10, // # + 0x38, // ### + 0x00, // + 0x00, // + + // @168 '5' (5 pixels wide) + 0x70, // ### + 0x40, // # + 0x60, // ## + 0x10, // # + 0x50, // # # + 0x20, // # + 0x00, // + 0x00, // + + // @176 '6' (5 pixels wide) + 0x30, // ## + 0x40, // # + 0x60, // ## + 0x50, // # # + 0x50, // # # + 0x60, // ## + 0x00, // + 0x00, // + + // @184 '7' (5 pixels wide) + 0x70, // ### + 0x50, // # # + 0x10, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x00, // + 0x00, // + + // @192 '8' (5 pixels wide) + 0x20, // # + 0x50, // # # + 0x20, // # + 0x50, // # # + 0x50, // # # + 0x20, // # + 0x00, // + 0x00, // + + // @200 '9' (5 pixels wide) + 0x30, // ## + 0x50, // # # + 0x50, // # # + 0x30, // ## + 0x10, // # + 0x60, // ## + 0x00, // + 0x00, // + + // @208 ':' (5 pixels wide) + 0x00, // + 0x00, // + 0x20, // # + 0x00, // + 0x00, // + 0x20, // # + 0x00, // + 0x00, // + + // @216 ';' (5 pixels wide) + 0x00, // + 0x00, // + 0x10, // # + 0x00, // + 0x10, // # + 0x20, // # + 0x00, // + 0x00, // + + // @224 '<' (5 pixels wide) + 0x00, // + 0x10, // # + 0x20, // # + 0xC0, // ## + 0x20, // # + 0x10, // # + 0x00, // + 0x00, // + + // @232 '=' (5 pixels wide) + 0x00, // + 0x70, // ### + 0x00, // + 0x70, // ### + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @240 '>' (5 pixels wide) + 0x00, // + 0x40, // # + 0x20, // # + 0x18, // ## + 0x20, // # + 0x40, // # + 0x00, // + 0x00, // + + // @248 '?' (5 pixels wide) + 0x20, // # + 0x50, // # # + 0x10, // # + 0x20, // # + 0x00, // + 0x20, // # + 0x00, // + 0x00, // + + // @256 '@' (5 pixels wide) + 0x30, // ## + 0x48, // # # + 0x48, // # # + 0x58, // # ## + 0x48, // # # + 0x40, // # + 0x38, // ### + 0x00, // + + // @264 'A' (5 pixels wide) + 0x60, // ## + 0x20, // # + 0x50, // # # + 0x70, // ### + 0x88, // # # + 0xD8, // ## ## + 0x00, // + 0x00, // + + // @272 'B' (5 pixels wide) + 0xF0, // #### + 0x48, // # # + 0x70, // ### + 0x48, // # # + 0x48, // # # + 0xF0, // #### + 0x00, // + 0x00, // + + // @280 'C' (5 pixels wide) + 0x70, // ### + 0x50, // # # + 0x40, // # + 0x40, // # + 0x40, // # + 0x30, // ## + 0x00, // + 0x00, // + + // @288 'D' (5 pixels wide) + 0xF0, // #### + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0xF0, // #### + 0x00, // + 0x00, // + + // @296 'E' (5 pixels wide) + 0xF8, // ##### + 0x48, // # # + 0x60, // ## + 0x40, // # + 0x48, // # # + 0xF8, // ##### + 0x00, // + 0x00, // + + // @304 'F' (5 pixels wide) + 0xF8, // ##### + 0x48, // # # + 0x60, // ## + 0x40, // # + 0x40, // # + 0xE0, // ### + 0x00, // + 0x00, // + + // @312 'G' (5 pixels wide) + 0x70, // ### + 0x40, // # + 0x40, // # + 0x58, // # ## + 0x50, // # # + 0x30, // ## + 0x00, // + 0x00, // + + // @320 'H' (5 pixels wide) + 0xE8, // ### # + 0x48, // # # + 0x78, // #### + 0x48, // # # + 0x48, // # # + 0xE8, // ### # + 0x00, // + 0x00, // + + // @328 'I' (5 pixels wide) + 0x70, // ### + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x70, // ### + 0x00, // + 0x00, // + + // @336 'J' (5 pixels wide) + 0x38, // ### + 0x10, // # + 0x10, // # + 0x50, // # # + 0x50, // # # + 0x20, // # + 0x00, // + 0x00, // + + // @344 'K' (5 pixels wide) + 0xD8, // ## ## + 0x50, // # # + 0x60, // ## + 0x70, // ### + 0x50, // # # + 0xD8, // ## ## + 0x00, // + 0x00, // + + // @352 'L' (5 pixels wide) + 0xE0, // ### + 0x40, // # + 0x40, // # + 0x40, // # + 0x48, // # # + 0xF8, // ##### + 0x00, // + 0x00, // + + // @360 'M' (5 pixels wide) + 0xD8, // ## ## + 0xD8, // ## ## + 0xD8, // ## ## + 0xA8, // # # # + 0x88, // # # + 0xD8, // ## ## + 0x00, // + 0x00, // + + // @368 'N' (5 pixels wide) + 0xD8, // ## ## + 0x68, // ## # + 0x68, // ## # + 0x58, // # ## + 0x58, // # ## + 0xE8, // ### # + 0x00, // + 0x00, // + + // @376 'O' (5 pixels wide) + 0x30, // ## + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0x30, // ## + 0x00, // + 0x00, // + + // @384 'P' (5 pixels wide) + 0xF0, // #### + 0x48, // # # + 0x48, // # # + 0x70, // ### + 0x40, // # + 0xE0, // ### + 0x00, // + 0x00, // + + // @392 'Q' (5 pixels wide) + 0x30, // ## + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0x30, // ## + 0x18, // ## + 0x00, // + + // @400 'R' (5 pixels wide) + 0xF0, // #### + 0x48, // # # + 0x48, // # # + 0x70, // ### + 0x48, // # # + 0xE8, // ### # + 0x00, // + 0x00, // + + // @408 'S' (5 pixels wide) + 0x70, // ### + 0x50, // # # + 0x20, // # + 0x10, // # + 0x50, // # # + 0x70, // ### + 0x00, // + 0x00, // + + // @416 'T' (5 pixels wide) + 0xF8, // ##### + 0xA8, // # # # + 0x20, // # + 0x20, // # + 0x20, // # + 0x70, // ### + 0x00, // + 0x00, // + + // @424 'U' (5 pixels wide) + 0xD8, // ## ## + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0x30, // ## + 0x00, // + 0x00, // + + // @432 'V' (5 pixels wide) + 0xD8, // ## ## + 0x88, // # # + 0x48, // # # + 0x50, // # # + 0x50, // # # + 0x30, // ## + 0x00, // + 0x00, // + + // @440 'W' (5 pixels wide) + 0xD8, // ## ## + 0x88, // # # + 0xA8, // # # # + 0xA8, // # # # + 0xA8, // # # # + 0x50, // # # + 0x00, // + 0x00, // + + // @448 'X' (5 pixels wide) + 0xD8, // ## ## + 0x50, // # # + 0x20, // # + 0x20, // # + 0x50, // # # + 0xD8, // ## ## + 0x00, // + 0x00, // + + // @456 'Y' (5 pixels wide) + 0xD8, // ## ## + 0x88, // # # + 0x50, // # # + 0x20, // # + 0x20, // # + 0x70, // ### + 0x00, // + 0x00, // + + // @464 'Z' (5 pixels wide) + 0x78, // #### + 0x48, // # # + 0x10, // # + 0x20, // # + 0x48, // # # + 0x78, // #### + 0x00, // + 0x00, // + + // @472 '[' (5 pixels wide) + 0x30, // ## + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x30, // ## + 0x00, // + + // @480 '\' (5 pixels wide) + 0x80, // # + 0x40, // # + 0x40, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x10, // # + 0x00, // + + // @488 ']' (5 pixels wide) + 0x60, // ## + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x60, // ## + 0x00, // + + // @496 '^' (5 pixels wide) + 0x20, // # + 0x20, // # + 0x50, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @504 '_' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + + // @512 '`' (5 pixels wide) + 0x20, // # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @520 'a' (5 pixels wide) + 0x00, // + 0x00, // + 0x30, // ## + 0x10, // # + 0x70, // ### + 0x78, // #### + 0x00, // + 0x00, // + + // @528 'b' (5 pixels wide) + 0xC0, // ## + 0x40, // # + 0x70, // ### + 0x48, // # # + 0x48, // # # + 0xF0, // #### + 0x00, // + 0x00, // + + // @536 'c' (5 pixels wide) + 0x00, // + 0x00, // + 0x70, // ### + 0x40, // # + 0x40, // # + 0x70, // ### + 0x00, // + 0x00, // + + // @544 'd' (5 pixels wide) + 0x18, // ## + 0x08, // # + 0x38, // ### + 0x48, // # # + 0x48, // # # + 0x38, // ### + 0x00, // + 0x00, // + + // @552 'e' (5 pixels wide) + 0x00, // + 0x00, // + 0x70, // ### + 0x70, // ### + 0x40, // # + 0x30, // ## + 0x00, // + 0x00, // + + // @560 'f' (5 pixels wide) + 0x10, // # + 0x20, // # + 0x70, // ### + 0x20, // # + 0x20, // # + 0x70, // ### + 0x00, // + 0x00, // + + // @568 'g' (5 pixels wide) + 0x00, // + 0x00, // + 0x38, // ### + 0x48, // # # + 0x48, // # # + 0x38, // ### + 0x08, // # + 0x30, // ## + + // @576 'h' (5 pixels wide) + 0xC0, // ## + 0x40, // # + 0x70, // ### + 0x48, // # # + 0x48, // # # + 0xE8, // ### # + 0x00, // + 0x00, // + + // @584 'i' (5 pixels wide) + 0x20, // # + 0x00, // + 0x60, // ## + 0x20, // # + 0x20, // # + 0x70, // ### + 0x00, // + 0x00, // + + // @592 'j' (5 pixels wide) + 0x20, // # + 0x00, // + 0x70, // ### + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x70, // ### + + // @600 'k' (5 pixels wide) + 0xC0, // ## + 0x40, // # + 0x58, // # ## + 0x70, // ### + 0x50, // # # + 0xD8, // ## ## + 0x00, // + 0x00, // + + // @608 'l' (5 pixels wide) + 0x60, // ## + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x70, // ### + 0x00, // + 0x00, // + + // @616 'm' (5 pixels wide) + 0x00, // + 0x00, // + 0xD0, // ## # + 0xA8, // # # # + 0xA8, // # # # + 0xA8, // # # # + 0x00, // + 0x00, // + + // @624 'n' (5 pixels wide) + 0x00, // + 0x00, // + 0xF0, // #### + 0x48, // # # + 0x48, // # # + 0xC8, // ## # + 0x00, // + 0x00, // + + // @632 'o' (5 pixels wide) + 0x00, // + 0x00, // + 0x30, // ## + 0x48, // # # + 0x48, // # # + 0x30, // ## + 0x00, // + 0x00, // + + // @640 'p' (5 pixels wide) + 0x00, // + 0x00, // + 0xF0, // #### + 0x48, // # # + 0x48, // # # + 0x70, // ### + 0x40, // # + 0xE0, // ### + + // @648 'q' (5 pixels wide) + 0x00, // + 0x00, // + 0x38, // ### + 0x48, // # # + 0x48, // # # + 0x38, // ### + 0x08, // # + 0x18, // ## + + // @656 'r' (5 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0x20, // # + 0x20, // # + 0x70, // ### + 0x00, // + 0x00, // + + // @664 's' (5 pixels wide) + 0x00, // + 0x00, // + 0x30, // ## + 0x20, // # + 0x10, // # + 0x60, // ## + 0x00, // + 0x00, // + + // @672 't' (5 pixels wide) + 0x00, // + 0x40, // # + 0xF0, // #### + 0x40, // # + 0x48, // # # + 0x30, // ## + 0x00, // + 0x00, // + + // @680 'u' (5 pixels wide) + 0x00, // + 0x00, // + 0xD8, // ## ## + 0x48, // # # + 0x48, // # # + 0x38, // ### + 0x00, // + 0x00, // + + // @688 'v' (5 pixels wide) + 0x00, // + 0x00, // + 0xC8, // ## # + 0x48, // # # + 0x30, // ## + 0x30, // ## + 0x00, // + 0x00, // + + // @696 'w' (5 pixels wide) + 0x00, // + 0x00, // + 0xD8, // ## ## + 0xA8, // # # # + 0xA8, // # # # + 0x50, // # # + 0x00, // + 0x00, // + + // @704 'x' (5 pixels wide) + 0x00, // + 0x00, // + 0x48, // # # + 0x30, // ## + 0x30, // ## + 0x48, // # # + 0x00, // + 0x00, // + + // @712 'y' (5 pixels wide) + 0x00, // + 0x00, // + 0xD8, // ## ## + 0x50, // # # + 0x50, // # # + 0x20, // # + 0x20, // # + 0x60, // ## + + // @720 'z' (5 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0x50, // # # + 0x28, // # # + 0x78, // #### + 0x00, // + 0x00, // + + // @728 '{' (5 pixels wide) + 0x10, // # + 0x20, // # + 0x20, // # + 0x60, // ## + 0x20, // # + 0x20, // # + 0x10, // # + 0x00, // + + // @736 '|' (5 pixels wide) + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x00, // + + // @744 '}' (5 pixels wide) + 0x40, // # + 0x20, // # + 0x20, // # + 0x30, // ## + 0x20, // # + 0x20, // # + 0x40, // # + 0x00, // + + // @752 '~' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x28, // # # + 0x50, // # # + 0x00, // + 0x00, // + 0x00, // +}; + +sFONT Font8 = { + Font8_Table, + 5, /* Width */ + 8, /* Height */ +}; + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/docs/Touch_e-Paper_Code/c/lib/Fonts/fonts.h b/docs/Touch_e-Paper_Code/c/lib/Fonts/fonts.h new file mode 100644 index 0000000..c183f04 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/Fonts/fonts.h @@ -0,0 +1,97 @@ +/** + ****************************************************************************** + * @file fonts.h + * @author MCD Application Team + * @version V1.0.0 + * @date 18-February-2014 + * @brief Header for fonts.c file + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * 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 + +/*΢ź24 (32x41) */ +#define MAX_HEIGHT_FONT 41 +#define MAX_WIDTH_FONT 32 +#define OFFSET_BITMAP + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include + +//ASCII +typedef struct _tFont +{ + const uint8_t *table; + uint16_t Width; + uint16_t Height; + +} sFONT; + + +//GB2312 +typedef struct // ģݽṹ +{ + const char index[2]; // + const char matrix[MAX_HEIGHT_FONT*MAX_WIDTH_FONT/8+2]; // +}CH_CN; + + +typedef struct +{ + const CH_CN *table; + uint16_t size; + uint16_t ASCII_Width; + uint16_t Width; + uint16_t Height; + +}cFONT; + +extern sFONT Font24; +extern sFONT Font20; +extern sFONT Font16; +extern sFONT Font12; +extern sFONT Font8; + +extern cFONT Font12CN; +extern cFONT Font24CN; +#ifdef __cplusplus +} +#endif + +#endif /* __FONTS_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_BMPfile.c b/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_BMPfile.c new file mode 100644 index 0000000..bd4c134 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_BMPfile.c @@ -0,0 +1,286 @@ +/***************************************************************************** +* | File : GUI_BMPfile.h +* | Author : Waveshare team +* | Function : Hardware underlying interface +* | Info : +* Used to shield the underlying layers of each master +* and enhance portability +*---------------- +* | This version: V2.2 +* | Date : 2020-07-08 +* | Info : +* ----------------------------------------------------------------------------- +* V2.2(2020-07-08): +* 1.Add GUI_ReadBmp_RGB_7Color() +* V2.1(2019-10-10): +* 1.Add GUI_ReadBmp_4Gray() +* V2.0(2018-11-12): +* 1.Change file name: GUI_BMP.h -> GUI_BMPfile.h +* 2.fix: GUI_ReadBmp() +* Now Xstart and Xstart can control the position of the picture normally, +* and support the display of images of any size. If it is larger than +* the actual display range, it will not be displayed. +# +# 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 "GUI_BMPfile.h" +#include "GUI_Paint.h" +#include "Debug.h" + +#include +#include +#include +#include //exit() +#include //memset() +#include //memset() +#include + +UBYTE GUI_ReadBmp(const char *path, UWORD Xstart, UWORD Ystart) +{ + FILE *fp; //Define a file pointer + BMPFILEHEADER bmpFileHeader; //Define a bmp file header structure + BMPINFOHEADER bmpInfoHeader; //Define a bmp info header structure + + + // Binary file open + if((fp = fopen(path, "rb")) == NULL) { + Debug("Cann't open the file!\n"); + exit(0); + } + + // Set the file pointer from the beginning + fseek(fp, 0, SEEK_SET); + fread(&bmpFileHeader, sizeof(BMPFILEHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 14 + fread(&bmpInfoHeader, sizeof(BMPINFOHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 50 + printf("pixel = %d * %d\r\n", bmpInfoHeader.biWidth, bmpInfoHeader.biHeight); + + UWORD Image_Width_Byte = (bmpInfoHeader.biWidth % 8 == 0)? (bmpInfoHeader.biWidth / 8): (bmpInfoHeader.biWidth / 8 + 1); + UWORD Bmp_Width_Byte = (Image_Width_Byte % 4 == 0) ? Image_Width_Byte: ((Image_Width_Byte / 4 + 1) * 4); + UBYTE Image[Image_Width_Byte * bmpInfoHeader.biHeight]; + memset(Image, 0xFF, Image_Width_Byte * bmpInfoHeader.biHeight); + + // Determine if it is a monochrome bitmap + int readbyte = bmpInfoHeader.biBitCount; + if(readbyte != 1) { + Debug("the bmp Image is not a monochrome bitmap!\n"); + exit(0); + } + + // Determine black and white based on the palette + UWORD i; + UWORD Bcolor, Wcolor; + UWORD bmprgbquadsize = pow(2, bmpInfoHeader.biBitCount);// 2^1 = 2 + BMPRGBQUAD bmprgbquad[bmprgbquadsize]; //palette + // BMPRGBQUAD bmprgbquad[2]; //palette + + for(i = 0; i < bmprgbquadsize; i++){ + // for(i = 0; i < 2; i++) { + fread(&bmprgbquad[i], sizeof(BMPRGBQUAD), 1, fp); + } + if(bmprgbquad[0].rgbBlue == 0xff && bmprgbquad[0].rgbGreen == 0xff && bmprgbquad[0].rgbRed == 0xff) { + Bcolor = BLACK; + Wcolor = WHITE; + } else { + Bcolor = WHITE; + Wcolor = BLACK; + } + + // Read image data into the cache + UWORD x, y; + UBYTE Rdata; + fseek(fp, bmpFileHeader.bOffset, SEEK_SET); + for(y = 0; y < bmpInfoHeader.biHeight; y++) {//Total display column + for(x = 0; x < Bmp_Width_Byte; x++) {//Show a line in the line + if(fread((char *)&Rdata, 1, readbyte, fp) != readbyte) { + perror("get bmpdata:\r\n"); + break; + } + if(x < Image_Width_Byte) { //bmp + Image[x + (bmpInfoHeader.biHeight - y - 1) * Image_Width_Byte] = Rdata; + // printf("rdata = %d\r\n", Rdata); + } + } + } + fclose(fp); + + // Refresh the image to the display buffer based on the displayed orientation + UBYTE color, temp; + for(y = 0; y < bmpInfoHeader.biHeight; y++) { + for(x = 0; x < bmpInfoHeader.biWidth; x++) { + if(x > Paint.Width || y > Paint.Height) { + break; + } + temp = Image[(x / 8) + (y * Image_Width_Byte)]; + color = (((temp << (x%8)) & 0x80) == 0x80) ?Bcolor:Wcolor; + Paint_SetPixel(Xstart + x, Ystart + y, color); + } + } + return 0; +} +/************************************************************************* + +*************************************************************************/ +UBYTE GUI_ReadBmp_4Gray(const char *path, UWORD Xstart, UWORD Ystart) +{ + FILE *fp; //Define a file pointer + BMPFILEHEADER bmpFileHeader; //Define a bmp file header structure + BMPINFOHEADER bmpInfoHeader; //Define a bmp info header structure + + // Binary file open + if((fp = fopen(path, "rb")) == NULL) { + Debug("Cann't open the file!\n"); + exit(0); + } + + // Set the file pointer from the beginning + fseek(fp, 0, SEEK_SET); + fread(&bmpFileHeader, sizeof(BMPFILEHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 14 + fread(&bmpInfoHeader, sizeof(BMPINFOHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 50 + printf("pixel = %d * %d\r\n", bmpInfoHeader.biWidth, bmpInfoHeader.biHeight); + + UWORD Image_Width_Byte = (bmpInfoHeader.biWidth % 4 == 0)? (bmpInfoHeader.biWidth / 4): (bmpInfoHeader.biWidth / 4 + 1); + UWORD Bmp_Width_Byte = (bmpInfoHeader.biWidth % 2 == 0)? (bmpInfoHeader.biWidth / 2): (bmpInfoHeader.biWidth / 2 + 1); + UBYTE Image[Image_Width_Byte * bmpInfoHeader.biHeight * 2]; + memset(Image, 0xFF, Image_Width_Byte * bmpInfoHeader.biHeight * 2); + + // Determine if it is a monochrome bitmap + int readbyte = bmpInfoHeader.biBitCount; + printf("biBitCount = %d\r\n",readbyte); + if(readbyte != 4){ + Debug("Bmp image is not a 4-color bitmap!\n"); + exit(0); + } + // Read image data into the cache + UWORD x, y; + UBYTE Rdata; + fseek(fp, bmpFileHeader.bOffset, SEEK_SET); + + for(y = 0; y < bmpInfoHeader.biHeight; y++) {//Total display column + for(x = 0; x < Bmp_Width_Byte; x++) {//Show a line in the line + if(fread((char *)&Rdata, 1, 1, fp) != 1) { + perror("get bmpdata:\r\n"); + break; + } + if(x < Image_Width_Byte*2) { //bmp + Image[x + (bmpInfoHeader.biHeight - y - 1) * Image_Width_Byte*2] = Rdata; + } + } + } + fclose(fp); + + // Refresh the image to the display buffer based on the displayed orientation + UBYTE color, temp; + printf("bmpInfoHeader.biWidth = %d\r\n",bmpInfoHeader.biWidth); + printf("bmpInfoHeader.biHeight = %d\r\n",bmpInfoHeader.biHeight); + for(y = 0; y < bmpInfoHeader.biHeight; y++) { + for(x = 0; x < bmpInfoHeader.biWidth; x++) { + if(x > Paint.Width || y > Paint.Height) { + break; + } + temp = Image[x/2 + y * bmpInfoHeader.biWidth/2] >> ((x%2)? 0:4);//0xf 0x8 0x7 0x0 + color = temp>>2; //11 10 01 00 + Paint_SetPixel(Xstart + x, Ystart + y, color); + } + } + return 0; +} + + +UBYTE GUI_ReadBmp_RGB_7Color(const char *path, UWORD Xstart, UWORD Ystart) +{ + FILE *fp; //Define a file pointer + BMPFILEHEADER bmpFileHeader; //Define a bmp file header structure + BMPINFOHEADER bmpInfoHeader; //Define a bmp info header structure + + // Binary file open + if((fp = fopen(path, "rb")) == NULL) { + Debug("Cann't open the file!\n"); + exit(0); + } + + // Set the file pointer from the beginning + fseek(fp, 0, SEEK_SET); + fread(&bmpFileHeader, sizeof(BMPFILEHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 14 + fread(&bmpInfoHeader, sizeof(BMPINFOHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 50 + printf("pixel = %d * %d\r\n", bmpInfoHeader.biWidth, bmpInfoHeader.biHeight); + + UDOUBLE Image_Byte = bmpInfoHeader.biWidth * bmpInfoHeader.biHeight * 3; + UBYTE Image[Image_Byte]; + memset(Image, 0xFF, Image_Byte); + + // Determine if it is a monochrome bitmap + int readbyte = bmpInfoHeader.biBitCount; + if(readbyte != 24){ + Debug("Bmp image is not 24 bitmap!\n"); + exit(0); + } + // Read image data into the cache + UWORD x, y; + UBYTE Rdata[3]; + fseek(fp, bmpFileHeader.bOffset, SEEK_SET); + + for(y = 0; y < bmpInfoHeader.biHeight; y++) {//Total display column + for(x = 0; x < bmpInfoHeader.biWidth ; x++) {//Show a line in the line + if(fread((char *)Rdata, 1, 1, fp) != 1) { + perror("get bmpdata:\r\n"); + break; + } + if(fread((char *)Rdata+1, 1, 1, fp) != 1) { + perror("get bmpdata:\r\n"); + break; + } + if(fread((char *)Rdata+2, 1, 1, fp) != 1) { + perror("get bmpdata:\r\n"); + break; + } + + if(Rdata[0] == 0 && Rdata[1] == 0 && Rdata[2] == 0){ + Image[x+(y* bmpInfoHeader.biWidth )] = 0;//Black + }else if(Rdata[0] == 255 && Rdata[1] == 255 && Rdata[2] == 255){ + Image[x+(y* bmpInfoHeader.biWidth )] = 1;//White + }else if(Rdata[0] == 0 && Rdata[1] == 255 && Rdata[2] == 0){ + Image[x+(y* bmpInfoHeader.biWidth )] = 2;//Green + }else if(Rdata[0] == 255 && Rdata[1] == 0 && Rdata[2] == 0){ + Image[x+(y* bmpInfoHeader.biWidth )] = 3;//Blue + }else if(Rdata[0] == 0 && Rdata[1] == 0 && Rdata[2] == 255){ + Image[x+(y* bmpInfoHeader.biWidth )] = 4;//Red + }else if(Rdata[0] == 0 && Rdata[1] == 255 && Rdata[2] == 255){ + Image[x+(y* bmpInfoHeader.biWidth )] = 5;//Yellow + }else if(Rdata[0] == 0 && Rdata[1] == 128 && Rdata[2] == 255){ + Image[x+(y* bmpInfoHeader.biWidth )] = 6;//Orange + } + } + } + fclose(fp); + + // Refresh the image to the display buffer based on the displayed orientation + for(y = 0; y < bmpInfoHeader.biHeight; y++) { + for(x = 0; x < bmpInfoHeader.biWidth; x++) { + if(x > Paint.Width || y > Paint.Height) { + break; + } + Paint_SetPixel(Xstart + x, Ystart + y, Image[bmpInfoHeader.biHeight * bmpInfoHeader.biWidth - 1 -(bmpInfoHeader.biWidth-x-1+(y* bmpInfoHeader.biWidth))]); + } + } + return 0; +} + + diff --git a/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_BMPfile.h b/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_BMPfile.h new file mode 100644 index 0000000..b34efd7 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_BMPfile.h @@ -0,0 +1,89 @@ +/***************************************************************************** +* | File : GUI_BMPfile.h +* | Author : Waveshare team +* | Function : Hardware underlying interface +* | Info : +* Used to shield the underlying layers of each master +* and enhance portability +*---------------- +* | This version: V2.2 +* | Date : 2020-07-08 +* | Info : +* ----------------------------------------------------------------------------- +* V2.2(2020-07-08): +* 1.Add GUI_ReadBmp_RGB_7Color() +* V2.1(2019-10-10): +* 1.Add GUI_ReadBmp_4Gray() +* V2.0(2018-11-12): +* 1.Change file name: GUI_BMP.h -> GUI_BMPfile.h +* 2.fix: GUI_ReadBmp() +* Now Xstart and Xstart can control the position of the picture normally, +* and support the display of images of any size. If it is larger than +* the actual display range, it will not be displayed. +# +# 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 __GUI_BMPFILE_H +#define __GUI_BMPFILE_H + +#include +#include +#include +#include + +#include "DEV_Config.h" + +/*Bitmap file header 14bit*/ +typedef struct BMP_FILE_HEADER { + UWORD bType; //File identifier + UDOUBLE bSize; //The size of the file + UWORD bReserved1; //Reserved value, must be set to 0 + UWORD bReserved2; //Reserved value, must be set to 0 + UDOUBLE bOffset; //The offset from the beginning of the file header to the beginning of the image data bit +} __attribute__ ((packed)) BMPFILEHEADER; // 14bit + +/*Bitmap information header 40bit*/ +typedef struct BMP_INFO { + UDOUBLE biInfoSize; //The size of the header + UDOUBLE biWidth; //The width of the image + UDOUBLE biHeight; //The height of the image + UWORD biPlanes; //The number of planes in the image + UWORD biBitCount; //The number of bits per pixel + UDOUBLE biCompression; //Compression type + UDOUBLE bimpImageSize; //The size of the image, in bytes + UDOUBLE biXPelsPerMeter; //Horizontal resolution + UDOUBLE biYPelsPerMeter; //Vertical resolution + UDOUBLE biClrUsed; //The number of colors used + UDOUBLE biClrImportant; //The number of important colors +} __attribute__ ((packed)) BMPINFOHEADER; + +/*Color table: palette */ +typedef struct RGB_QUAD { + UBYTE rgbBlue; //Blue intensity + UBYTE rgbGreen; //Green strength + UBYTE rgbRed; //Red intensity + UBYTE rgbReversed; //Reserved value +} __attribute__ ((packed)) BMPRGBQUAD; +/**************************************** end ***********************************************/ + +UBYTE GUI_ReadBmp(const char *path, UWORD Xstart, UWORD Ystart); +UBYTE GUI_ReadBmp_4Gray(const char *path, UWORD Xstart, UWORD Ystart); +UBYTE GUI_ReadBmp_RGB_7Color(const char *path, UWORD Xstart, UWORD Ystart); +#endif diff --git a/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_Paint.c b/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_Paint.c new file mode 100644 index 0000000..6449309 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_Paint.c @@ -0,0 +1,798 @@ +/****************************************************************************** +* | File : GUI_Paint.c +* | Author : Waveshare electronics +* | Function : Achieve drawing: draw points, lines, boxes, circles and +* their size, solid dotted line, solid rectangle hollow +* rectangle, solid circle hollow circle. +* | Info : +* Achieve display characters: Display a single character, string, number +* Achieve time display: adaptive size display time minutes and seconds +*---------------- +* | This version: V3.2 +* | Date : 2020-07-10 +* | Info : +* ----------------------------------------------------------------------------- +* V3.2(2020-07-10): +* 1.Change: Paint_SetScale(UBYTE scale) +* Add scale 7 for 5.65f e-Parper +* 2.Change: Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color) +* Add the branch for scale 7 +* 3.Change: Paint_Clear(UWORD Color) +* Add the branch for scale 7 +* ----------------------------------------------------------------------------- +* V3.1(2019-10-10): +* 1. Add gray level +* PAINT Add Scale +* 2. Add void Paint_SetScale(UBYTE scale); +* ----------------------------------------------------------------------------- +* V3.0(2019-04-18): +* 1.Change: +* Paint_DrawPoint(..., DOT_STYLE DOT_STYLE) +* => Paint_DrawPoint(..., DOT_STYLE Dot_Style) +* Paint_DrawLine(..., LINE_STYLE Line_Style, DOT_PIXEL Dot_Pixel) +* => Paint_DrawLine(..., DOT_PIXEL Line_width, LINE_STYLE Line_Style) +* Paint_DrawRectangle(..., DRAW_FILL Filled, DOT_PIXEL Dot_Pixel) +* => Paint_DrawRectangle(..., DOT_PIXEL Line_width, DRAW_FILL Draw_Fill) +* Paint_DrawCircle(..., DRAW_FILL Draw_Fill, DOT_PIXEL Dot_Pixel) +* => Paint_DrawCircle(..., DOT_PIXEL Line_width, DRAW_FILL Draw_Filll) +* +* ----------------------------------------------------------------------------- +* V2.0(2018-11-15): +* 1.add: Paint_NewImage() +* Create an image's properties +* 2.add: Paint_SelectImage() +* Select the picture to be drawn +* 3.add: Paint_SetRotate() +* Set the direction of the cache +* 4.add: Paint_RotateImage() +* Can flip the picture, Support 0-360 degrees, +* but only 90.180.270 rotation is better +* 4.add: Paint_SetMirroring() +* Can Mirroring the picture, horizontal, vertical, origin +* 5.add: Paint_DrawString_CN() +* Can display Chinese(GB1312) +* +* ----------------------------------------------------------------------------- +* V1.0(2018-07-17): +* Create library +* +* 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 "GUI_Paint.h" +#include "DEV_Config.h" +#include "Debug.h" +#include +#include +#include //memset() +#include + +PAINT Paint; + +/****************************************************************************** +function: Create Image +parameter: + image : Pointer to the image cache + width : The width of the picture + Height : The height of the picture + Color : Whether the picture is inverted +******************************************************************************/ +void Paint_NewImage(UBYTE *image, UWORD Width, UWORD Height, UWORD Rotate, UWORD Color) +{ + Paint.Image = NULL; + Paint.Image = image; + + Paint.WidthMemory = Width; + Paint.HeightMemory = Height; + Paint.Color = Color; + Paint.Scale = 2; + Paint.WidthByte = (Width % 8 == 0)? (Width / 8 ): (Width / 8 + 1); + Paint.HeightByte = Height; +// printf("WidthByte = %d, HeightByte = %d\r\n", Paint.WidthByte, Paint.HeightByte); +// printf(" EPD_WIDTH / 8 = %d\r\n", 122 / 8); + + Paint.Rotate = Rotate; + Paint.Mirror = MIRROR_NONE; + + if(Rotate == ROTATE_0 || Rotate == ROTATE_180) { + Paint.Width = Width; + Paint.Height = Height; + } else { + Paint.Width = Height; + Paint.Height = Width; + } +} + +/****************************************************************************** +function: Select Image +parameter: + image : Pointer to the image cache +******************************************************************************/ +void Paint_SelectImage(UBYTE *image) +{ + Paint.Image = image; +} + +/****************************************************************************** +function: Select Image Rotate +parameter: + Rotate : 0,90,180,270 +******************************************************************************/ +void Paint_SetRotate(UWORD Rotate) +{ + if(Rotate == ROTATE_0 || Rotate == ROTATE_90 || Rotate == ROTATE_180 || Rotate == ROTATE_270) { + Debug("Set image Rotate %d\r\n", Rotate); + Paint.Rotate = Rotate; + } else { + Debug("rotate = 0, 90, 180, 270\r\n"); + } +} + +/****************************************************************************** +function: Select Image mirror +parameter: + mirror :Not mirror,Horizontal mirror,Vertical mirror,Origin mirror +******************************************************************************/ +void Paint_SetMirroring(UBYTE mirror) +{ + if(mirror == MIRROR_NONE || mirror == MIRROR_HORIZONTAL || + mirror == MIRROR_VERTICAL || mirror == MIRROR_ORIGIN) { + Debug("mirror image x:%s, y:%s\r\n",(mirror & 0x01)? "mirror":"none", ((mirror >> 1) & 0x01)? "mirror":"none"); + Paint.Mirror = mirror; + } else { + Debug("mirror should be MIRROR_NONE, MIRROR_HORIZONTAL, \ + MIRROR_VERTICAL or MIRROR_ORIGIN\r\n"); + } +} + +void Paint_SetScale(UBYTE scale) +{ + if(scale == 2){ + Paint.Scale = scale; + Paint.WidthByte = (Paint.WidthMemory % 8 == 0)? (Paint.WidthMemory / 8 ): (Paint.WidthMemory / 8 + 1); + }else if(scale == 4){ + Paint.Scale = scale; + Paint.WidthByte = (Paint.WidthMemory % 4 == 0)? (Paint.WidthMemory / 4 ): (Paint.WidthMemory / 4 + 1); + }else if(scale == 7){//Only applicable with 5in65 e-Paper + Paint.Scale = scale; + Paint.WidthByte = (Paint.WidthMemory % 2 == 0)? (Paint.WidthMemory / 2 ): (Paint.WidthMemory / 2 + 1);; + }else{ + Debug("Set Scale Input parameter error\r\n"); + Debug("Scale Only support: 2 4 7\r\n"); + } +} +/****************************************************************************** +function: Draw Pixels +parameter: + Xpoint : At point X + Ypoint : At point Y + Color : Painted colors +******************************************************************************/ +void Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color) +{ + if(Xpoint > Paint.Width || Ypoint > Paint.Height){ + Debug("Exceeding display boundaries\r\n"); + return; + } + UWORD X, Y; + switch(Paint.Rotate) { + case 0: + X = Xpoint; + Y = Ypoint; + break; + case 90: + X = Paint.WidthMemory - Ypoint - 1; + Y = Xpoint; + break; + case 180: + X = Paint.WidthMemory - Xpoint - 1; + Y = Paint.HeightMemory - Ypoint - 1; + break; + case 270: + X = Ypoint; + Y = Paint.HeightMemory - Xpoint - 1; + break; + default: + return; + } + + switch(Paint.Mirror) { + case MIRROR_NONE: + break; + case MIRROR_HORIZONTAL: + X = Paint.WidthMemory - X - 1; + break; + case MIRROR_VERTICAL: + Y = Paint.HeightMemory - Y - 1; + break; + case MIRROR_ORIGIN: + X = Paint.WidthMemory - X - 1; + Y = Paint.HeightMemory - Y - 1; + break; + default: + return; + } + + if(X > Paint.WidthMemory || Y > Paint.HeightMemory){ + Debug("Exceeding display boundaries\r\n"); + return; + } + + if(Paint.Scale == 2){ + UDOUBLE Addr = X / 8 + Y * Paint.WidthByte; + UBYTE Rdata = Paint.Image[Addr]; + if(Color == BLACK) + Paint.Image[Addr] = Rdata & ~(0x80 >> (X % 8)); + else + Paint.Image[Addr] = Rdata | (0x80 >> (X % 8)); + }else if(Paint.Scale == 4){ + UDOUBLE Addr = X / 4 + Y * Paint.WidthByte; + Color = Color % 4;//Guaranteed color scale is 4 --- 0~3 + UBYTE Rdata = Paint.Image[Addr]; + + Rdata = Rdata & (~(0xC0 >> ((X % 4)*2)));//Clear first, then set value + Paint.Image[Addr] = Rdata | ((Color << 6) >> ((X % 4)*2)); + }else if(Paint.Scale == 7){ + UDOUBLE Addr = X / 2 + Y * Paint.WidthByte; + UBYTE Rdata = Paint.Image[Addr]; + Rdata = Rdata & (~(0xF0 >> ((X % 2)*4)));//Clear first, then set value + Paint.Image[Addr] = Rdata | ((Color << 4) >> ((X % 2)*4)); + // printf("Add = %d ,data = %d\r\n",Addr,Rdata); + } +} + +/****************************************************************************** +function: Clear the color of the picture +parameter: + Color : Painted colors +******************************************************************************/ +void Paint_Clear(UWORD Color) +{ + if(Paint.Scale == 2 || Paint.Scale == 4){ + for (UWORD Y = 0; Y < Paint.HeightByte; Y++) { + for (UWORD X = 0; X < Paint.WidthByte; X++ ) {//8 pixel = 1 byte + UDOUBLE Addr = X + Y*Paint.WidthByte; + Paint.Image[Addr] = Color; + } + } + }else if(Paint.Scale == 7){ + for (UWORD Y = 0; Y < Paint.HeightByte; Y++) { + for (UWORD X = 0; X < Paint.WidthByte; X++ ) { + UDOUBLE Addr = X + Y*Paint.WidthByte; + Paint.Image[Addr] = (Color<<4)|Color; + } + } + } + +} + +/****************************************************************************** +function: Clear the color of a window +parameter: + Xstart : x starting point + Ystart : Y starting point + Xend : x end point + Yend : y end point + Color : Painted colors +******************************************************************************/ +void Paint_ClearWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color) +{ + UWORD X, Y; + for (Y = Ystart; Y < Yend; Y++) { + for (X = Xstart; X < Xend; X++) {//8 pixel = 1 byte + Paint_SetPixel(X, Y, Color); + } + } +} + +/****************************************************************************** +function: Draw Point(Xpoint, Ypoint) Fill the color +parameter: + Xpoint : The Xpoint coordinate of the point + Ypoint : The Ypoint coordinate of the point + Color : Painted color + Dot_Pixel : point size + Dot_Style : point Style +******************************************************************************/ +void Paint_DrawPoint(UWORD Xpoint, UWORD Ypoint, UWORD Color, + DOT_PIXEL Dot_Pixel, DOT_STYLE Dot_Style) +{ + if (Xpoint > Paint.Width || Ypoint > Paint.Height) { + Debug("Paint_DrawPoint Input exceeds the normal display range\r\n"); + return; + } + + int16_t XDir_Num , YDir_Num; + if (Dot_Style == DOT_FILL_AROUND) { + for (XDir_Num = 0; XDir_Num < 2 * Dot_Pixel - 1; XDir_Num++) { + for (YDir_Num = 0; YDir_Num < 2 * Dot_Pixel - 1; YDir_Num++) { + if(Xpoint + XDir_Num - Dot_Pixel < 0 || Ypoint + YDir_Num - Dot_Pixel < 0) + break; + // printf("x = %d, y = %d\r\n", Xpoint + XDir_Num - Dot_Pixel, Ypoint + YDir_Num - Dot_Pixel); + Paint_SetPixel(Xpoint + XDir_Num - Dot_Pixel, Ypoint + YDir_Num - Dot_Pixel, Color); + } + } + } else { + for (XDir_Num = 0; XDir_Num < Dot_Pixel; XDir_Num++) { + for (YDir_Num = 0; YDir_Num < Dot_Pixel; YDir_Num++) { + Paint_SetPixel(Xpoint + XDir_Num - 1, Ypoint + YDir_Num - 1, Color); + } + } + } +} + +/****************************************************************************** +function: Draw a line of arbitrary slope +parameter: + Xstart :Starting Xpoint point coordinates + Ystart :Starting Xpoint point coordinates + Xend :End point Xpoint coordinate + Yend :End point Ypoint coordinate + Color :The color of the line segment + Line_width : Line width + Line_Style: Solid and dotted lines +******************************************************************************/ +void Paint_DrawLine(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, + UWORD Color, DOT_PIXEL Line_width, LINE_STYLE Line_Style) +{ + if (Xstart > Paint.Width || Ystart > Paint.Height || + Xend > Paint.Width || Yend > Paint.Height) { + Debug("Paint_DrawLine Input exceeds the normal display range\r\n"); + return; + } + + UWORD Xpoint = Xstart; + UWORD Ypoint = Ystart; + int dx = (int)Xend - (int)Xstart >= 0 ? Xend - Xstart : Xstart - Xend; + int dy = (int)Yend - (int)Ystart <= 0 ? Yend - Ystart : Ystart - Yend; + + // Increment direction, 1 is positive, -1 is counter; + int XAddway = Xstart < Xend ? 1 : -1; + int YAddway = Ystart < Yend ? 1 : -1; + + //Cumulative error + int Esp = dx + dy; + char Dotted_Len = 0; + + for (;;) { + Dotted_Len++; + //Painted dotted line, 2 point is really virtual + if (Line_Style == LINE_STYLE_DOTTED && Dotted_Len % 3 == 0) { + //Debug("LINE_DOTTED\r\n"); + Paint_DrawPoint(Xpoint, Ypoint, IMAGE_BACKGROUND, Line_width, DOT_STYLE_DFT); + Dotted_Len = 0; + } else { + Paint_DrawPoint(Xpoint, Ypoint, Color, Line_width, DOT_STYLE_DFT); + } + if (2 * Esp >= dy) { + if (Xpoint == Xend) + break; + Esp += dy; + Xpoint += XAddway; + } + if (2 * Esp <= dx) { + if (Ypoint == Yend) + break; + Esp += dx; + Ypoint += YAddway; + } + } +} + +/****************************************************************************** +function: Draw a rectangle +parameter: + Xstart :Rectangular Starting Xpoint point coordinates + Ystart :Rectangular Starting Xpoint point coordinates + Xend :Rectangular End point Xpoint coordinate + Yend :Rectangular End point Ypoint coordinate + Color :The color of the Rectangular segment + Line_width: Line width + Draw_Fill : Whether to fill the inside of the rectangle +******************************************************************************/ +void Paint_DrawRectangle(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, + UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill) +{ + if (Xstart > Paint.Width || Ystart > Paint.Height || + Xend > Paint.Width || Yend > Paint.Height) { + Debug("Input exceeds the normal display range\r\n"); + return; + } + + if (Draw_Fill) { + UWORD Ypoint; + for(Ypoint = Ystart; Ypoint < Yend; Ypoint++) { + Paint_DrawLine(Xstart, Ypoint, Xend, Ypoint, Color , Line_width, LINE_STYLE_SOLID); + } + } else { + Paint_DrawLine(Xstart, Ystart, Xend, Ystart, Color, Line_width, LINE_STYLE_SOLID); + Paint_DrawLine(Xstart, Ystart, Xstart, Yend, Color, Line_width, LINE_STYLE_SOLID); + Paint_DrawLine(Xend, Yend, Xend, Ystart, Color, Line_width, LINE_STYLE_SOLID); + Paint_DrawLine(Xend, Yend, Xstart, Yend, Color, Line_width, LINE_STYLE_SOLID); + } +} + +/****************************************************************************** +function: Use the 8-point method to draw a circle of the + specified size at the specified position-> +parameter: + X_Center :Center X coordinate + Y_Center :Center Y coordinate + Radius :circle Radius + Color :The color of the :circle segment + Line_width: Line width + Draw_Fill : Whether to fill the inside of the Circle +******************************************************************************/ +void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius, + UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill) +{ + if (X_Center > Paint.Width || Y_Center >= Paint.Height) { + Debug("Paint_DrawCircle Input exceeds the normal display range\r\n"); + return; + } + + //Draw a circle from(0, R) as a starting point + int16_t XCurrent, YCurrent; + XCurrent = 0; + YCurrent = Radius; + + //Cumulative error,judge the next point of the logo + int16_t Esp = 3 - (Radius << 1 ); + + int16_t sCountY; + if (Draw_Fill == DRAW_FILL_FULL) { + while (XCurrent <= YCurrent ) { //Realistic circles + for (sCountY = XCurrent; sCountY <= YCurrent; sCountY ++ ) { + Paint_DrawPoint(X_Center + XCurrent, Y_Center + sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//1 + Paint_DrawPoint(X_Center - XCurrent, Y_Center + sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//2 + Paint_DrawPoint(X_Center - sCountY, Y_Center + XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//3 + Paint_DrawPoint(X_Center - sCountY, Y_Center - XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//4 + Paint_DrawPoint(X_Center - XCurrent, Y_Center - sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//5 + Paint_DrawPoint(X_Center + XCurrent, Y_Center - sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//6 + Paint_DrawPoint(X_Center + sCountY, Y_Center - XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//7 + Paint_DrawPoint(X_Center + sCountY, Y_Center + XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT); + } + if (Esp < 0 ) + Esp += 4 * XCurrent + 6; + else { + Esp += 10 + 4 * (XCurrent - YCurrent ); + YCurrent --; + } + XCurrent ++; + } + } else { //Draw a hollow circle + while (XCurrent <= YCurrent ) { + Paint_DrawPoint(X_Center + XCurrent, Y_Center + YCurrent, Color, Line_width, DOT_STYLE_DFT);//1 + Paint_DrawPoint(X_Center - XCurrent, Y_Center + YCurrent, Color, Line_width, DOT_STYLE_DFT);//2 + Paint_DrawPoint(X_Center - YCurrent, Y_Center + XCurrent, Color, Line_width, DOT_STYLE_DFT);//3 + Paint_DrawPoint(X_Center - YCurrent, Y_Center - XCurrent, Color, Line_width, DOT_STYLE_DFT);//4 + Paint_DrawPoint(X_Center - XCurrent, Y_Center - YCurrent, Color, Line_width, DOT_STYLE_DFT);//5 + Paint_DrawPoint(X_Center + XCurrent, Y_Center - YCurrent, Color, Line_width, DOT_STYLE_DFT);//6 + Paint_DrawPoint(X_Center + YCurrent, Y_Center - XCurrent, Color, Line_width, DOT_STYLE_DFT);//7 + Paint_DrawPoint(X_Center + YCurrent, Y_Center + XCurrent, Color, Line_width, DOT_STYLE_DFT);//0 + + if (Esp < 0 ) + Esp += 4 * XCurrent + 6; + else { + Esp += 10 + 4 * (XCurrent - YCurrent ); + YCurrent --; + } + XCurrent ++; + } + } +} + +/****************************************************************************** +function: Show English characters +parameter: + Xpoint :X coordinate + Ypoint :Y coordinate + Acsii_Char :To display the English characters + Font :A structure pointer that displays a character size + Color_Foreground : Select the foreground color + Color_Background : Select the background color +******************************************************************************/ +void Paint_DrawChar(UWORD Xpoint, UWORD Ypoint, const char Acsii_Char, + sFONT* Font, UWORD Color_Foreground, UWORD Color_Background) +{ + UWORD Page, Column; + + if (Xpoint > Paint.Width || Ypoint > Paint.Height) { + Debug("Paint_DrawChar Input exceeds the normal display range\r\n"); + return; + } + + uint32_t Char_Offset = (Acsii_Char - ' ') * Font->Height * (Font->Width / 8 + (Font->Width % 8 ? 1 : 0)); + const unsigned char *ptr = &Font->table[Char_Offset]; + + for (Page = 0; Page < Font->Height; Page ++ ) { + for (Column = 0; Column < Font->Width; Column ++ ) { + + //To determine whether the font background color and screen background color is consistent + if (FONT_BACKGROUND == Color_Background) { //this process is to speed up the scan + if (*ptr & (0x80 >> (Column % 8))) + Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Foreground); + // Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT); + } else { + if (*ptr & (0x80 >> (Column % 8))) { + Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Foreground); + // Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT); + } else { + Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Background); + // Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Background, DOT_PIXEL_DFT, DOT_STYLE_DFT); + } + } + //One pixel is 8 bits + if (Column % 8 == 7) + ptr++; + }// Write a line + if (Font->Width % 8 != 0) + ptr++; + }// Write all +} + +/****************************************************************************** +function: Display the string +parameter: + Xstart :X coordinate + Ystart :Y coordinate + pString :The first address of the English string to be displayed + Font :A structure pointer that displays a character size + Color_Foreground : Select the foreground color + Color_Background : Select the background color +******************************************************************************/ +void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString, + sFONT* Font, UWORD Color_Foreground, UWORD Color_Background) +{ + UWORD Xpoint = Xstart; + UWORD Ypoint = Ystart; + + if (Xstart > Paint.Width || Ystart > Paint.Height) { + Debug("Paint_DrawString_EN Input exceeds the normal display range\r\n"); + return; + } + + while (* pString != '\0') { + //if X direction filled , reposition to(Xstart,Ypoint),Ypoint is Y direction plus the Height of the character + if ((Xpoint + Font->Width ) > Paint.Width ) { + Xpoint = Xstart; + Ypoint += Font->Height; + } + + // If the Y direction is full, reposition to(Xstart, Ystart) + if ((Ypoint + Font->Height ) > Paint.Height ) { + Xpoint = Xstart; + Ypoint = Ystart; + } + Paint_DrawChar(Xpoint, Ypoint, * pString, Font, Color_Background, Color_Foreground); + + //The next character of the address + pString ++; + + //The next word of the abscissa increases the font of the broadband + Xpoint += Font->Width; + } +} + + +/****************************************************************************** +function: Display the string +parameter: + Xstart :X coordinate + Ystart :Y coordinate + pString :The first address of the Chinese string and English + string to be displayed + Font :A structure pointer that displays a character size + Color_Foreground : Select the foreground color + Color_Background : Select the background color +******************************************************************************/ +void Paint_DrawString_CN(UWORD Xstart, UWORD Ystart, const char * pString, cFONT* font, + UWORD Color_Foreground, UWORD Color_Background) +{ + const char* p_text = pString; + int x = Xstart, y = Ystart; + int i, j,Num; + + /* Send the string character by character on EPD */ + while (*p_text != 0) { + if(*p_text <= 0x7F) { //ASCII < 126 + for(Num = 0; Num < font->size; Num++) { + if(*p_text== font->table[Num].index[0]) { + const char* ptr = &font->table[Num].matrix[0]; + + for (j = 0; j < font->Height; j++) { + for (i = 0; i < font->Width; i++) { + if (FONT_BACKGROUND == Color_Background) { //this process is to speed up the scan + if (*ptr & (0x80 >> (i % 8))) { + Paint_SetPixel(x + i, y + j, Color_Foreground); + // Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT); + } + } else { + if (*ptr & (0x80 >> (i % 8))) { + Paint_SetPixel(x + i, y + j, Color_Foreground); + // Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT); + } else { + Paint_SetPixel(x + i, y + j, Color_Background); + // Paint_DrawPoint(x + i, y + j, Color_Background, DOT_PIXEL_DFT, DOT_STYLE_DFT); + } + } + if (i % 8 == 7) { + ptr++; + } + } + if (font->Width % 8 != 0) { + ptr++; + } + } + break; + } + } + /* Point on the next character */ + p_text += 1; + /* Decrement the column position by 16 */ + x += font->ASCII_Width; + } else { //Chinese + for(Num = 0; Num < font->size; Num++) { + if((*p_text== font->table[Num].index[0]) && (*(p_text+1) == font->table[Num].index[1])) { + const char* ptr = &font->table[Num].matrix[0]; + + for (j = 0; j < font->Height; j++) { + for (i = 0; i < font->Width; i++) { + if (FONT_BACKGROUND == Color_Background) { //this process is to speed up the scan + if (*ptr & (0x80 >> (i % 8))) { + Paint_SetPixel(x + i, y + j, Color_Foreground); + // Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT); + } + } else { + if (*ptr & (0x80 >> (i % 8))) { + Paint_SetPixel(x + i, y + j, Color_Foreground); + // Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT); + } else { + Paint_SetPixel(x + i, y + j, Color_Background); + // Paint_DrawPoint(x + i, y + j, Color_Background, DOT_PIXEL_DFT, DOT_STYLE_DFT); + } + } + if (i % 8 == 7) { + ptr++; + } + } + if (font->Width % 8 != 0) { + ptr++; + } + } + break; + } + } + /* Point on the next character */ + p_text += 2; + /* Decrement the column position by 16 */ + x += font->Width; + } + } +} + +/****************************************************************************** +function: Display nummber +parameter: + Xstart :X coordinate + Ystart : Y coordinate + Nummber : The number displayed + Font :A structure pointer that displays a character size + Color_Foreground : Select the foreground color + Color_Background : Select the background color +******************************************************************************/ +#define ARRAY_LEN 255 +void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, int32_t Nummber, + sFONT* Font, UWORD Color_Foreground, UWORD Color_Background) +{ + + int16_t Num_Bit = 0, Str_Bit = 0; + uint8_t Str_Array[ARRAY_LEN] = {0}, Num_Array[ARRAY_LEN] = {0}; + uint8_t *pStr = Str_Array; + + if (Xpoint > Paint.Width || Ypoint > Paint.Height) { + Debug("Paint_DisNum Input exceeds the normal display range\r\n"); + return; + } + + //Converts a number to a string + while (Nummber) { + Num_Array[Num_Bit] = Nummber % 10 + '0'; + Num_Bit++; + Nummber /= 10; + } + + //The string is inverted + while (Num_Bit > 0) { + Str_Array[Str_Bit] = Num_Array[Num_Bit - 1]; + Str_Bit ++; + Num_Bit --; + } + + //show + Paint_DrawString_EN(Xpoint, Ypoint, (const char*)pStr, Font, Color_Background, Color_Foreground); +} + +/****************************************************************************** +function: Display time +parameter: + Xstart :X coordinate + Ystart : Y coordinate + pTime : Time-related structures + Font :A structure pointer that displays a character size + Color_Foreground : Select the foreground color + Color_Background : Select the background color +******************************************************************************/ +void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font, + UWORD Color_Foreground, UWORD Color_Background) +{ + uint8_t value[10] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; + + UWORD Dx = Font->Width; + + //Write data into the cache + Paint_DrawChar(Xstart , Ystart, value[pTime->Hour / 10], Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx , Ystart, value[pTime->Hour % 10], Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx + Dx / 4 + Dx / 2 , Ystart, ':' , Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx * 2 + Dx / 2 , Ystart, value[pTime->Min / 10] , Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx * 3 + Dx / 2 , Ystart, value[pTime->Min % 10] , Font, Color_Background, Color_Foreground); + // Paint_DrawChar(Xstart + Dx * 4 + Dx / 2 - Dx / 4, Ystart, ':' , Font, Color_Background, Color_Foreground); + // Paint_DrawChar(Xstart + Dx * 5 , Ystart, value[pTime->Sec / 10] , Font, Color_Background, Color_Foreground); + // Paint_DrawChar(Xstart + Dx * 6 , Ystart, value[pTime->Sec % 10] , Font, Color_Background, Color_Foreground); +} +void Paint_DrawDate(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font, + UWORD Color_Foreground, UWORD Color_Background) +{ + uint8_t value[10] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; + + UWORD Dx = Font->Width; + + //Write data into the cache + Paint_DrawChar(Xstart , Ystart, value[pTime->Year / 1000] , Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx , Ystart, value[pTime->Year / 100 % 10] , Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx * 2 , Ystart, value[pTime->Year / 10 %100] , Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx * 3 , Ystart, value[pTime->Year % 1000 % 100 % 10] , Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx * 4 , Ystart, '-' , Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx * 5 , Ystart, value[pTime->Month / 10] , Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx * 6 , Ystart, value[pTime->Month % 10] , Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx * 7 , Ystart, '-' , Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx * 8 , Ystart, value[pTime->Day / 10] , Font, Color_Background, Color_Foreground); + Paint_DrawChar(Xstart + Dx * 9 , Ystart, value[pTime->Day % 10] , Font, Color_Background, Color_Foreground); +} + +/****************************************************************************** +function: Display monochrome bitmap +parameter: + image_buffer :A picture data converted to a bitmap +info: + Use a computer to convert the image into a corresponding array, + and then embed the array directly into Imagedata.cpp as a .c file. +******************************************************************************/ +void Paint_DrawBitMap(const unsigned char* image_buffer) +{ + UWORD x, y; + UDOUBLE Addr = 0; + + for (y = 0; y < Paint.HeightByte; y++) { + for (x = 0; x < Paint.WidthByte; x++) {//8 pixel = 1 byte + Addr = x + y * Paint.WidthByte; + Paint.Image[Addr] = (unsigned char)image_buffer[Addr]; + } + } +} diff --git a/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_Paint.h b/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_Paint.h new file mode 100644 index 0000000..66c6045 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/lib/GUI/GUI_Paint.h @@ -0,0 +1,215 @@ +/****************************************************************************** +* | File : GUI_Paint.h +* | Author : Waveshare electronics +* | Function : Achieve drawing: draw points, lines, boxes, circles and +* their size, solid dotted line, solid rectangle hollow +* rectangle, solid circle hollow circle. +* | Info : +* Achieve display characters: Display a single character, string, number +* Achieve time display: adaptive size display time minutes and seconds +*---------------- +* | This version: V3.1 +* | Date : 2019-10-10 +* | Info : +* ----------------------------------------------------------------------------- +* V3.1(2019-10-10): +* 1. Add gray level +* PAINT Add Scale +* 2. Add void Paint_SetScale(UBYTE scale); +* +* V3.0(2019-04-18): +* 1.Change: +* Paint_DrawPoint(..., DOT_STYLE DOT_STYLE) +* => Paint_DrawPoint(..., DOT_STYLE Dot_Style) +* Paint_DrawLine(..., LINE_STYLE Line_Style, DOT_PIXEL Dot_Pixel) +* => Paint_DrawLine(..., DOT_PIXEL Line_width, LINE_STYLE Line_Style) +* Paint_DrawRectangle(..., DRAW_FILL Filled, DOT_PIXEL Dot_Pixel) +* => Paint_DrawRectangle(..., DOT_PIXEL Line_width, DRAW_FILL Draw_Fill) +* Paint_DrawCircle(..., DRAW_FILL Draw_Fill, DOT_PIXEL Dot_Pixel) +* => Paint_DrawCircle(..., DOT_PIXEL Line_width, DRAW_FILL Draw_Filll) +* +* ----------------------------------------------------------------------------- +* V2.0(2018-11-15): +* 1.add: Paint_NewImage() +* Create an image's properties +* 2.add: Paint_SelectImage() +* Select the picture to be drawn +* 3.add: Paint_SetRotate() +* Set the direction of the cache +* 4.add: Paint_RotateImage() +* Can flip the picture, Support 0-360 degrees, +* but only 90.180.270 rotation is better +* 4.add: Paint_SetMirroring() +* Can Mirroring the picture, horizontal, vertical, origin +* 5.add: Paint_DrawString_CN() +* Can display Chinese(GB1312) +* +* ----------------------------------------------------------------------------- +* V1.0(2018-07-17): +* Create library +* +* 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 __GUI_PAINT_H +#define __GUI_PAINT_H + +#include "DEV_Config.h" +#include "../Fonts/fonts.h" + +/** + * Image attributes +**/ +typedef struct { + UBYTE *Image; + UWORD Width; + UWORD Height; + UWORD WidthMemory; + UWORD HeightMemory; + UWORD Color; + UWORD Rotate; + UWORD Mirror; + UWORD WidthByte; + UWORD HeightByte; + UWORD Scale; +} PAINT; +extern PAINT Paint; + +/** + * Display rotate +**/ +#define ROTATE_0 0 +#define ROTATE_90 90 +#define ROTATE_180 180 +#define ROTATE_270 270 + +/** + * Display Flip +**/ +typedef enum { + MIRROR_NONE = 0x00, + MIRROR_HORIZONTAL = 0x01, + MIRROR_VERTICAL = 0x02, + MIRROR_ORIGIN = 0x03, +} MIRROR_IMAGE; +#define MIRROR_IMAGE_DFT MIRROR_NONE + +/** + * image color +**/ +#define WHITE 0xFF +#define BLACK 0x00 +#define RED BLACK + +#define IMAGE_BACKGROUND WHITE +#define FONT_FOREGROUND BLACK +#define FONT_BACKGROUND WHITE + +//4 Gray level +#define GRAY1 0x03 //Blackest +#define GRAY2 0x02 +#define GRAY3 0x01 //gray +#define GRAY4 0x00 //white +/** + * The size of the point +**/ +typedef enum { + DOT_PIXEL_1X1 = 1, // 1 x 1 + DOT_PIXEL_2X2 , // 2 X 2 + DOT_PIXEL_3X3 , // 3 X 3 + DOT_PIXEL_4X4 , // 4 X 4 + DOT_PIXEL_5X5 , // 5 X 5 + DOT_PIXEL_6X6 , // 6 X 6 + DOT_PIXEL_7X7 , // 7 X 7 + DOT_PIXEL_8X8 , // 8 X 8 +} DOT_PIXEL; +#define DOT_PIXEL_DFT DOT_PIXEL_1X1 //Default dot pilex + +/** + * Point size fill style +**/ +typedef enum { + DOT_FILL_AROUND = 1, // dot pixel 1 x 1 + DOT_FILL_RIGHTUP , // dot pixel 2 X 2 +} DOT_STYLE; +#define DOT_STYLE_DFT DOT_FILL_AROUND //Default dot pilex + +/** + * Line style, solid or dashed +**/ +typedef enum { + LINE_STYLE_SOLID = 0, + LINE_STYLE_DOTTED, +} LINE_STYLE; + +/** + * Whether the graphic is filled +**/ +typedef enum { + DRAW_FILL_EMPTY = 0, + DRAW_FILL_FULL, +} DRAW_FILL; + +/** + * Custom structure of a time attribute +**/ +typedef struct { + UWORD Year; //0000 + UBYTE Month; //1 - 12 + UBYTE Day; //1 - 30 + UBYTE Hour; //0 - 23 + UBYTE Min; //0 - 59 + UBYTE Sec; //0 - 59 +} PAINT_TIME; +extern PAINT_TIME sPaint_time; + +//init and Clear +void Paint_NewImage(UBYTE *image, UWORD Width, UWORD Height, UWORD Rotate, UWORD Color); +void Paint_SelectImage(UBYTE *image); +void Paint_SetRotate(UWORD Rotate); +void Paint_SetMirroring(UBYTE mirror); +void Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color); +void Paint_SetScale(UBYTE scale); + +void Paint_Clear(UWORD Color); +void Paint_ClearWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color); + +//Drawing +void Paint_DrawPoint(UWORD Xpoint, UWORD Ypoint, UWORD Color, DOT_PIXEL Dot_Pixel, DOT_STYLE Dot_FillWay); +void Paint_DrawLine(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, DOT_PIXEL Line_width, LINE_STYLE Line_Style); +void Paint_DrawRectangle(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill); +void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius, UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill); + +//Display string +void Paint_DrawChar(UWORD Xstart, UWORD Ystart, const char Acsii_Char, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background); +void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background); +void Paint_DrawString_CN(UWORD Xstart, UWORD Ystart, const char * pString, cFONT* font, UWORD Color_Foreground, UWORD Color_Background); +void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, int32_t Nummber, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background); +void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background); +void Paint_DrawDate(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background); +//pic +void Paint_DrawBitMap(const unsigned char* image_buffer); + + +#endif + + + + + diff --git a/docs/Touch_e-Paper_Code/c/main b/docs/Touch_e-Paper_Code/c/main new file mode 100644 index 0000000..d2b525f Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/main differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Menu.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Menu.bmp new file mode 100644 index 0000000..f0de0bb Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Menu.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1.bmp new file mode 100644 index 0000000..343720f Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_0.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_0.bmp new file mode 100644 index 0000000..146e514 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_0.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_1.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_1.bmp new file mode 100644 index 0000000..c5f8c53 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_2.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_2.bmp new file mode 100644 index 0000000..11f2bea Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_3.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_3.bmp new file mode 100644 index 0000000..7d73550 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_3.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_4.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_4.bmp new file mode 100644 index 0000000..6b0e32f Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_4.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_5.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_5.bmp new file mode 100644 index 0000000..8ed57ff Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_5.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_6.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_6.bmp new file mode 100644 index 0000000..0ba4f3a Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_1_6.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2.bmp new file mode 100644 index 0000000..5a4ca53 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_0.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_0.bmp new file mode 100644 index 0000000..ff64e4d Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_0.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_1.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_1.bmp new file mode 100644 index 0000000..b2765ee Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_2.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_2.bmp new file mode 100644 index 0000000..5a7917e Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_3.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_3.bmp new file mode 100644 index 0000000..1b46b3b Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_3.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_4.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_4.bmp new file mode 100644 index 0000000..749976c Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_4.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_5.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_5.bmp new file mode 100644 index 0000000..4ccd98e Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_5.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_6.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_6.bmp new file mode 100644 index 0000000..3481b17 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/Photo_2_6.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in13/White_board.bmp b/docs/Touch_e-Paper_Code/c/pic/2in13/White_board.bmp new file mode 100644 index 0000000..b3f9d70 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in13/White_board.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/2in9_Scale.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/2in9_Scale.bmp new file mode 100644 index 0000000..55a9bd9 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/2in9_Scale.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Menu.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Menu.bmp new file mode 100644 index 0000000..8a30576 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Menu.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1.bmp new file mode 100644 index 0000000..e12fd59 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_0.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_0.bmp new file mode 100644 index 0000000..adb1519 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_0.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_1.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_1.bmp new file mode 100644 index 0000000..b283c56 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_2.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_2.bmp new file mode 100644 index 0000000..7323a21 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_3.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_3.bmp new file mode 100644 index 0000000..3cb9b7a Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_3.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_4.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_4.bmp new file mode 100644 index 0000000..e837d1d Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_4.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_5.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_5.bmp new file mode 100644 index 0000000..4b01428 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_5.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_6.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_6.bmp new file mode 100644 index 0000000..ac3fcec Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_6.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_7.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_7.bmp new file mode 100644 index 0000000..8962758 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_7.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_8.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_8.bmp new file mode 100644 index 0000000..c4062fd Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_8.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_9.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_9.bmp new file mode 100644 index 0000000..9d14405 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_1_9.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2.bmp new file mode 100644 index 0000000..ec3b577 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_0.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_0.bmp new file mode 100644 index 0000000..2bd14a2 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_0.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_1.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_1.bmp new file mode 100644 index 0000000..d625691 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_2.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_2.bmp new file mode 100644 index 0000000..513628f Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_3.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_3.bmp new file mode 100644 index 0000000..4fbe5a4 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_3.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_4.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_4.bmp new file mode 100644 index 0000000..0ca5f74 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_4.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_5.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_5.bmp new file mode 100644 index 0000000..62b1f83 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_5.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_6.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_6.bmp new file mode 100644 index 0000000..162d06e Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_6.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_7.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_7.bmp new file mode 100644 index 0000000..1c6ae04 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_7.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_8.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_8.bmp new file mode 100644 index 0000000..7c55edc Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_8.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_9.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_9.bmp new file mode 100644 index 0000000..7ba9fe4 Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/Photo_2_9.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/pic/2in9/White_board.bmp b/docs/Touch_e-Paper_Code/c/pic/2in9/White_board.bmp new file mode 100644 index 0000000..20e550c Binary files /dev/null and b/docs/Touch_e-Paper_Code/c/pic/2in9/White_board.bmp differ diff --git a/docs/Touch_e-Paper_Code/c/readme_CN.txt b/docs/Touch_e-Paper_Code/c/readme_CN.txt new file mode 100644 index 0000000..a6a3c0e --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/readme_CN.txt @@ -0,0 +1,79 @@ +/***************************************************************************** +* | File : Readme_CN.txt +* | Author : Waveshare team +* | Function : Help with use +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2021-06-05 +* | Info : 在这里提供一个中文版本的使用文档,以便你的快速使用 +******************************************************************************/ +这个文件是帮助您使用本例程。 +在这里简略的描述本工程的使用: + +1.基本信息: +本例程使用 xxxinch e-Paper HAT 模块 在 Raspbe Pi 4B 进行了验证,你可以在工程的Examples\中查看对应的测试例程; + +2.管脚连接: +管脚连接你可以在\lib\Config目录下查看DEV_Config.h中查看,这里也再重述一次: +EPD => Jetson Nano/RPI(BCM) +VCC -> 3.3 +GND -> GND +DIN -> 10(SPI0_MOSI) +CLK -> 11(SPI0_SCK) +CS -> 8(SPI0_CS0) +DC -> 25 +ERST -> 17 +BUSY -> 24 +INT -> 27 +TRST -> 22 +SDA -> SDA1 +SCL -> SCL1 + +3.基本使用: +由于本工程是一个综合工程,对于使用而言,你可能需要阅读以下内容: +你可以在main.c中看到已经进行了注释的函数, +请注意你购买的是哪一款的墨水屏。 +栗子1: + 如果你购买的2.9inch Touch e-Paper HAT,那么你应该把对应的6行代码的注释去掉,即: + // TestCode_2in9(); + 修改成: + TestCode_2in9(); + +然后你需要执行:make,编译程序,会生成可执行文件:main +运行:sudo ./main +如果修改了程序,需要执行:make clear,然后重新make。 + +4.目录结构(选读): +如果你经常使用我们的产品,对我们的程序目录结构会十分熟悉,关于具体的函数的我们有一份 +函数的API手册,你可以在我们的WIKI上下载或像售后客服索取,这里简单介绍一次: +\lib\Config\:此目录为硬件接口层文件,在DEV_Config.c(.h)可以看到很多定义,包括: + 数据类型; + GPIO; + 读写GPIO; + 延时:注意:此延时函数并未使用示波器测量具体数值,因此会不准; + 模块初始化与退出的处理: + void DEV_Module_Init(void); + void DEV_Module_Exit(void); + 注意:1.这里是处理使用墨水屏前与使用完之后一些GPIO的处理。 + 2.对于PCB带有Rev2.1的,DEV_Module_Exit()之后整个模块会进入低功耗,经过测试这个功耗基本为0; + +\lib\GUI\:此目录为一些基本的图像处理函数,在GUI_Paint.c(.h)中: + 常用图像处理:创建图形、翻转图形、镜像图形、设置像素点、清屏等; + 常用画图处理:画点、线、框、圆、中文字符、英文字符、数字等; + 常用时间显示:提供一个常用的显示时间函数; + 常用显示图片:提供一个显示位图的函数; + +\lib\Fonts\:为一些常用的字体: + Ascii: + font8: 5*8 + font12: 7*12 + font16: 11*16 + font20: 14*20 + font24: 17*24 + 中文: + font12CN: 16*21 + font24CN: 32*41 + +\lib\e-paper\:此目录下为墨水屏驱动函数; +Examples\:此目录下为墨水屏的测试程序,你可在其中看到具体的使用方法; \ No newline at end of file diff --git a/docs/Touch_e-Paper_Code/c/readme_EN.txt b/docs/Touch_e-Paper_Code/c/readme_EN.txt new file mode 100644 index 0000000..74aa638 --- /dev/null +++ b/docs/Touch_e-Paper_Code/c/readme_EN.txt @@ -0,0 +1,86 @@ +/***************************************************************************** +* | File : Readme_CN.txt +* | Author : Waveshare team +* | Function : Help with use +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2021-06-05 +* | Info : Here is an English version of the documentation for your quick use. +******************************************************************************/ +This file is to help you use this routine. +A brief description of the use of this project is here: + +1. Basic information: +This routine was verified on Raspbe Pi 4B using the XXXinch e-paper HAT module. +You can view the corresponding test routines in the \lib\Examples\ of the project. + +2. Pin connection: +Pin connection You can view it in DEV_Config.h in the \lib\Config\ directory, and repeat it here: +EPD => Jetson Nano/RPI(BCM) +VCC -> 3.3 +GND -> GND +DIN -> 10(SPI0_MOSI) +CLK -> 11(SPI0_SCK) +CS -> 8(SPI0_CS0) +DC -> 25 +ERST -> 17 +BUSY -> 24 +INT -> 27 +TRST -> 22 +SDA -> SDA1 +SCL -> SCL1 + +3. Basic use: +Since this project is a comprehensive project, you may need to read the following for use: +You can see the functions that have been annotated of main.c. +Please note which ink screen you purchased. +Chestnut 1: +     If you purchased 2.9inch Touch e-Paper HAT, then you should remove the comment for the corresponding 6 lines of code, ie: + // TestCode_2in9(); +     changed to: + TestCode_2in9(); + +Then you need to execute: +make +compile the program, will generate the executable file: main +Run: +sudo ./main +If you modify the program, you need to execute: +make clear +then: +make + +4. Directory structure (selection): +If you use our products frequently, we will be very familiar with our program directory structure. We have a copy of the specific function. +The API manual for the function, you can download it on our WIKI or request it as an after-sales customer service. Here is a brief introduction: +Config\: This directory is a hardware interface layer file. You can see many definitions in DEV_Config.c(.h), including: + type of data; + GPIO; + Read and write GPIO; + Delay: Note: This delay function does not use an oscilloscope to measure specific values. + Module Init and exit processing: + void DEV_Module_Init(void); + void DEV_Module_Exit(void); + Note: 1. Here is the processing of some GPIOs before and after using the ink screen. + 2. For the PCB with Rev2.1, the entire module will enter low power consumption after DEV_Module_Exit(). After testing, the power consumption is basically 0; + +\lib\GUI\: This directory is some basic image processing functions, in GUI_Paint.c(.h): + Common image processing: creating graphics, flipping graphics, mirroring graphics, setting pixels, clearing screens, etc. + Common drawing processing: drawing points, lines, boxes, circles, Chinese characters, English characters, numbers, etc.; + Common time display: Provide a common display time function; + Commonly used display pictures: provide a function to display bitmaps; + +\lib\Fonts\: for some commonly used fonts: + Ascii: + Font8: 5*8 + Font12: 7*12 + Font16: 11*16 + Font20: 14*20 + Font24: 17*24 + Chinese: + font12CN: 16*21 + font24CN: 32*41 + +\lib\E-paper\: This screen is the ink screen driver function; +Examples\: This is the test program for the ink screen. You can see the specific usage method in it. \ No newline at end of file diff --git a/docs/Touch_e-Paper_Code/python/examples/.lgd-nfy0 b/docs/Touch_e-Paper_Code/python/examples/.lgd-nfy0 new file mode 100644 index 0000000..e69de29 diff --git a/docs/Touch_e-Paper_Code/python/examples/TP2in13_V3_test.py b/docs/Touch_e-Paper_Code/python/examples/TP2in13_V3_test.py new file mode 100644 index 0000000..c57b0bc --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/examples/TP2in13_V3_test.py @@ -0,0 +1,236 @@ +#!/usr/bin/python +# -*- coding:utf-8 -*- +import sys +import os +picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic/2in13') +fontdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic') +libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib') +if os.path.exists(libdir): + sys.path.append(libdir) + +from TP_lib import gt1151 +from TP_lib import epd2in13_V3 +import time +import logging +from PIL import Image,ImageDraw,ImageFont +import traceback +import threading + +logging.basicConfig(level=logging.DEBUG) +flag_t = 1 + +def pthread_irq() : + print("pthread running") + while flag_t == 1 : + if(gt.digital_read(gt.INT) == 0) : + GT_Dev.Touch = 1 + else : + GT_Dev.Touch = 0 + print("thread:exit") + +def Show_Photo_Small(image, small): + for t in range(1, 5): + if(small*2+t > 6): + newimage = Image.open(os.path.join(picdir, PhotoPath_S[0])) + image.paste(newimage, ((t-1)//2*45+2, (t%2)*124+2)) + else: + newimage = Image.open(os.path.join(picdir, PhotoPath_S[small*2+t])) + image.paste(newimage, ((t-1)//2*45+2, (t%2)*124+2)) + +def Show_Photo_Large(image, large): + if(large > 6): + newimage = Image.open(os.path.join(picdir, PhotoPath_L[0])) + image.paste(newimage, (2, 2)) + else: + newimage = Image.open(os.path.join(picdir, PhotoPath_L[large])) + image.paste(newimage, (2, 2)) + +def Read_BMP(File, x, y): + newimage = Image.open(os.path.join(picdir, File)) + image.paste(newimage, (x, y)) + +try: + logging.info("epd2in13_V3 Touch Demo") + + epd = epd2in13_V3.EPD() + gt = gt1151.GT1151() + GT_Dev = gt1151.GT_Development() + GT_Old = gt1151.GT_Development() + + logging.info("init and Clear") + + epd.init(epd.FULL_UPDATE) + gt.GT_Init() + epd.Clear(0xFF) + + t = threading.Thread(target = pthread_irq) + t.daemon = True + t.start() + + # Drawing on the image + font15 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 15) + font24 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 24) + + image = Image.open(os.path.join(picdir, 'Menu.bmp')) + epd.displayPartBaseImage(epd.getbuffer(image)) + DrawImage = ImageDraw.Draw(image) + epd.init(epd.PART_UPDATE) + + i = j = k = ReFlag = SelfFlag = Page = Photo_L = Photo_S = 0 + PhotoPath_S = [ "Photo_1_0.bmp", + "Photo_1_1.bmp", "Photo_1_2.bmp", "Photo_1_3.bmp", "Photo_1_4.bmp", + "Photo_1_5.bmp", "Photo_1_6.bmp", + ] + PhotoPath_L = [ "Photo_2_0.bmp", + "Photo_2_1.bmp", "Photo_2_2.bmp", "Photo_2_3.bmp", "Photo_2_4.bmp", + "Photo_2_5.bmp", "Photo_2_6.bmp", + ] + PagePath = ["Menu.bmp", "White_board.bmp", "Photo_1.bmp", "Photo_2.bmp"] + + while(1): + if(i > 12 or ReFlag == 1): + if(Page == 1 and SelfFlag == 0): + epd.displayPartial(epd.getbuffer(image)) + else: + epd.displayPartial_Wait(epd.getbuffer(image)) + i = 0 + k = 0 + j += 1 + ReFlag = 0 + print("*** Draw Refresh ***\r\n") + elif(k>50000 and i>0 and Page == 1): + epd.displayPartial(epd.getbuffer(image)) + i = 0 + k = 0 + j += 1 + print("*** Overtime Refresh ***\r\n") + elif(j > 50 or SelfFlag): + SelfFlag = 0 + j = 0 + epd.init(epd.FULL_UPDATE) + epd.displayPartBaseImage(epd.getbuffer(image)) + epd.init(epd.PART_UPDATE) + print("--- Self Refresh ---\r\n") + else: + k += 1 + # Read the touch input + gt.GT_Scan(GT_Dev, GT_Old) + if(GT_Old.X[0] == GT_Dev.X[0] and GT_Old.Y[0] == GT_Dev.Y[0] and GT_Old.S[0] == GT_Dev.S[0]): + continue + + if(GT_Dev.TouchpointFlag): + i += 1 + GT_Dev.TouchpointFlag = 0 + + if(Page == 0 and ReFlag == 0): #main menu + if(GT_Dev.X[0] > 29 and GT_Dev.X[0] < 92 and GT_Dev.Y[0] > 56 and GT_Dev.Y[0] < 95): + print("Photo ...\r\n") + Page = 2 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) + ReFlag = 1 + elif(GT_Dev.X[0] > 29 and GT_Dev.X[0] < 92 and GT_Dev.Y[0] > 153 and GT_Dev.Y[0] < 193): + print("Draw ...\r\n") + Page = 1 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + + + if(Page == 1 and ReFlag == 0): #white board + DrawImage.rectangle([(GT_Dev.X[0], GT_Dev.Y[0]), (GT_Dev.X[0] + GT_Dev.S[0]/8 + 1, GT_Dev.Y[0] + GT_Dev.S[0]/8 + 1)], fill=0) + if(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 118 and GT_Dev.Y[0] > 6 and GT_Dev.Y[0] < 30): + print("Home ...\r\n") + Page = 1 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 118 and GT_Dev.Y[0] > 113 and GT_Dev.Y[0] < 136): + print("Clear ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 118 and GT_Dev.Y[0] > 220 and GT_Dev.Y[0] < 242): + print("Refresh ...\r\n") + SelfFlag = 1 + ReFlag = 1 + + + if(Page == 2 and ReFlag == 0): #photo menu + if(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 113 and GT_Dev.Y[0] < 136): + print("Home ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 57 and GT_Dev.Y[0] < 78): + print("Next page ...\r\n") + Photo_S += 1 + if(Photo_S > 2): # 6 photos is a maximum of three pages + Photo_S=0 + ReFlag = 2 + elif(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 169 and GT_Dev.Y[0] < 190): + print("Last page ...\r\n") + if(Photo_S == 0): + print("Top page ...\r\n") + else: + Photo_S -= 1 + ReFlag = 2 + elif(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 220 and GT_Dev.Y[0] < 242): + print("Refresh ...\r\n") + SelfFlag = 1 + ReFlag = 1 + elif(GT_Dev.X[0] > 2 and GT_Dev.X[0] < 90 and GT_Dev.Y[0] > 2 and GT_Dev.Y[0] < 248 and ReFlag == 0): + print("Select photo ...\r\n") + Page = 3 + Read_BMP(PagePath[Page], 0, 0) + Photo_L = int(GT_Dev.X[0]/46*2 + 2-GT_Dev.Y[0]/124 + Photo_S*2) + Show_Photo_Large(image, Photo_L) + ReFlag = 1 + if(ReFlag == 2): # Refresh small photo + ReFlag = 1 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) # show small photo + + + if(Page == 3 and ReFlag == 0): #view the photo + if(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 4 and GT_Dev.Y[0] < 25): + print("Photo menu ...\r\n") + Page = 2 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 57 and GT_Dev.Y[0] < 78): + print("Next photo ...\r\n") + Photo_L += 1 + if(Photo_L > 6): + Photo_L = 1 + ReFlag = 2 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 113 and GT_Dev.Y[0] < 136): + print("Home ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 169 and GT_Dev.Y[0] < 190): + print("Last page ...\r\n") + if(Photo_L == 1): + print("Top photo ...\r\n") + else: + Photo_L -= 1 + ReFlag = 2 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 220 and GT_Dev.Y[0] < 242): + print("Refresh photo ...\r\n") + SelfFlag = 1 + ReFlag = 1 + if(ReFlag == 2): # Refresh large photo + ReFlag = 1 + Show_Photo_Large(image, Photo_L) + +except IOError as e: + logging.info(e) + +except KeyboardInterrupt: + logging.info("ctrl + c:") + flag_t = 0 + epd.sleep() + time.sleep(2) + t.join() + epd.Dev_exit() + exit() diff --git a/docs/Touch_e-Paper_Code/python/examples/TP2in13_V4_test.py b/docs/Touch_e-Paper_Code/python/examples/TP2in13_V4_test.py new file mode 100644 index 0000000..f030212 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/examples/TP2in13_V4_test.py @@ -0,0 +1,236 @@ +#!/usr/bin/python +# -*- coding:utf-8 -*- +import sys +import os +picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic/2in13') +fontdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic') +libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib') +if os.path.exists(libdir): + sys.path.append(libdir) + +from TP_lib import gt1151 +from TP_lib import epd2in13_V4 +import time +import logging +from PIL import Image,ImageDraw,ImageFont +import traceback +import threading + +logging.basicConfig(level=logging.DEBUG) +flag_t = 1 + +def pthread_irq() : + print("pthread running") + while flag_t == 1 : + if(gt.digital_read(gt.INT) == 0) : + GT_Dev.Touch = 1 + else : + GT_Dev.Touch = 0 + print("thread:exit") + +def Show_Photo_Small(image, small): + for t in range(1, 5): + if(small*2+t > 6): + newimage = Image.open(os.path.join(picdir, PhotoPath_S[0])) + image.paste(newimage, ((t-1)//2*45+2, (t%2)*124+2)) + else: + newimage = Image.open(os.path.join(picdir, PhotoPath_S[small*2+t])) + image.paste(newimage, ((t-1)//2*45+2, (t%2)*124+2)) + +def Show_Photo_Large(image, large): + if(large > 6): + newimage = Image.open(os.path.join(picdir, PhotoPath_L[0])) + image.paste(newimage, (2, 2)) + else: + newimage = Image.open(os.path.join(picdir, PhotoPath_L[large])) + image.paste(newimage, (2, 2)) + +def Read_BMP(File, x, y): + newimage = Image.open(os.path.join(picdir, File)) + image.paste(newimage, (x, y)) + +try: + logging.info("epd2in13_V4 Touch Demo") + + epd = epd2in13_V4.EPD() + gt = gt1151.GT1151() + GT_Dev = gt1151.GT_Development() + GT_Old = gt1151.GT_Development() + + logging.info("init and Clear") + + epd.init(epd.FULL_UPDATE) + gt.GT_Init() + epd.Clear(0xFF) + + t = threading.Thread(target = pthread_irq) + t.setDaemon(True) + t.start() + + # Drawing on the image + font15 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 15) + font24 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 24) + + image = Image.open(os.path.join(picdir, 'Menu.bmp')) + epd.displayPartBaseImage(epd.getbuffer(image)) + DrawImage = ImageDraw.Draw(image) + epd.init(epd.PART_UPDATE) + + i = j = k = ReFlag = SelfFlag = Page = Photo_L = Photo_S = 0 + PhotoPath_S = [ "Photo_1_0.bmp", + "Photo_1_1.bmp", "Photo_1_2.bmp", "Photo_1_3.bmp", "Photo_1_4.bmp", + "Photo_1_5.bmp", "Photo_1_6.bmp", + ] + PhotoPath_L = [ "Photo_2_0.bmp", + "Photo_2_1.bmp", "Photo_2_2.bmp", "Photo_2_3.bmp", "Photo_2_4.bmp", + "Photo_2_5.bmp", "Photo_2_6.bmp", + ] + PagePath = ["Menu.bmp", "White_board.bmp", "Photo_1.bmp", "Photo_2.bmp"] + + while(1): + if(i > 12 or ReFlag == 1): + if(Page == 1 and SelfFlag == 0): + epd.displayPartial(epd.getbuffer(image)) + else: + epd.displayPartial_Wait(epd.getbuffer(image)) + i = 0 + k = 0 + j += 1 + ReFlag = 0 + print("*** Draw Refresh ***\r\n") + elif(k>50000 and i>0 and Page == 1): + epd.displayPartial(epd.getbuffer(image)) + i = 0 + k = 0 + j += 1 + print("*** Overtime Refresh ***\r\n") + elif(j > 50 or SelfFlag): + SelfFlag = 0 + j = 0 + epd.init(epd.FULL_UPDATE) + epd.displayPartBaseImage(epd.getbuffer(image)) + epd.init(epd.PART_UPDATE) + print("--- Self Refresh ---\r\n") + else: + k += 1 + # Read the touch input + gt.GT_Scan(GT_Dev, GT_Old) + if(GT_Old.X[0] == GT_Dev.X[0] and GT_Old.Y[0] == GT_Dev.Y[0] and GT_Old.S[0] == GT_Dev.S[0]): + continue + + if(GT_Dev.TouchpointFlag): + i += 1 + GT_Dev.TouchpointFlag = 0 + + if(Page == 0 and ReFlag == 0): #main menu + if(GT_Dev.X[0] > 29 and GT_Dev.X[0] < 92 and GT_Dev.Y[0] > 56 and GT_Dev.Y[0] < 95): + print("Photo ...\r\n") + Page = 2 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) + ReFlag = 1 + elif(GT_Dev.X[0] > 29 and GT_Dev.X[0] < 92 and GT_Dev.Y[0] > 153 and GT_Dev.Y[0] < 193): + print("Draw ...\r\n") + Page = 1 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + + + if(Page == 1 and ReFlag == 0): #white board + DrawImage.rectangle([(GT_Dev.X[0], GT_Dev.Y[0]), (GT_Dev.X[0] + GT_Dev.S[0]/8 + 1, GT_Dev.Y[0] + GT_Dev.S[0]/8 + 1)], fill=0) + if(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 118 and GT_Dev.Y[0] > 6 and GT_Dev.Y[0] < 30): + print("Home ...\r\n") + Page = 1 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 118 and GT_Dev.Y[0] > 113 and GT_Dev.Y[0] < 136): + print("Clear ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 118 and GT_Dev.Y[0] > 220 and GT_Dev.Y[0] < 242): + print("Refresh ...\r\n") + SelfFlag = 1 + ReFlag = 1 + + + if(Page == 2 and ReFlag == 0): #photo menu + if(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 113 and GT_Dev.Y[0] < 136): + print("Home ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 57 and GT_Dev.Y[0] < 78): + print("Next page ...\r\n") + Photo_S += 1 + if(Photo_S > 2): # 6 photos is a maximum of three pages + Photo_S=0 + ReFlag = 2 + elif(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 169 and GT_Dev.Y[0] < 190): + print("Last page ...\r\n") + if(Photo_S == 0): + print("Top page ...\r\n") + else: + Photo_S -= 1 + ReFlag = 2 + elif(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 220 and GT_Dev.Y[0] < 242): + print("Refresh ...\r\n") + SelfFlag = 1 + ReFlag = 1 + elif(GT_Dev.X[0] > 2 and GT_Dev.X[0] < 90 and GT_Dev.Y[0] > 2 and GT_Dev.Y[0] < 248 and ReFlag == 0): + print("Select photo ...\r\n") + Page = 3 + Read_BMP(PagePath[Page], 0, 0) + Photo_L = int(GT_Dev.X[0]/46*2 + 2-GT_Dev.Y[0]/124 + Photo_S*2) + Show_Photo_Large(image, Photo_L) + ReFlag = 1 + if(ReFlag == 2): # Refresh small photo + ReFlag = 1 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) # show small photo + + + if(Page == 3 and ReFlag == 0): #view the photo + if(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 4 and GT_Dev.Y[0] < 25): + print("Photo menu ...\r\n") + Page = 2 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 57 and GT_Dev.Y[0] < 78): + print("Next photo ...\r\n") + Photo_L += 1 + if(Photo_L > 6): + Photo_L = 1 + ReFlag = 2 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 113 and GT_Dev.Y[0] < 136): + print("Home ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 169 and GT_Dev.Y[0] < 190): + print("Last page ...\r\n") + if(Photo_L == 1): + print("Top photo ...\r\n") + else: + Photo_L -= 1 + ReFlag = 2 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 220 and GT_Dev.Y[0] < 242): + print("Refresh photo ...\r\n") + SelfFlag = 1 + ReFlag = 1 + if(ReFlag == 2): # Refresh large photo + ReFlag = 1 + Show_Photo_Large(image, Photo_L) + +except IOError as e: + logging.info(e) + +except KeyboardInterrupt: + logging.info("ctrl + c:") + flag_t = 0 + epd.sleep() + time.sleep(2) + t.join() + epd.Dev_exit() + exit() diff --git a/docs/Touch_e-Paper_Code/python/examples/TP2in13_test.py b/docs/Touch_e-Paper_Code/python/examples/TP2in13_test.py new file mode 100644 index 0000000..cfad712 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/examples/TP2in13_test.py @@ -0,0 +1,235 @@ +#!/usr/bin/python +# -*- coding:utf-8 -*- +import sys +import os +picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic/2in13') +fontdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic') +libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib') +if os.path.exists(libdir): + sys.path.append(libdir) + +from TP_lib import gt1151 +from TP_lib import epd2in13_V2 +import time +import logging +from PIL import Image,ImageDraw,ImageFont +import traceback +import threading + +logging.basicConfig(level=logging.DEBUG) +flag_t = 1 + +def pthread_irq() : + print("pthread running") + while flag_t == 1 : + if(gt.digital_read(gt.INT) == 0) : + GT_Dev.Touch = 1 + else : + GT_Dev.Touch = 0 + print("thread:exit") + +def Show_Photo_Small(image, small): + for t in range(1, 5): + if(small*2+t > 6): + newimage = Image.open(os.path.join(picdir, PhotoPath_S[0])) + image.paste(newimage, ((t-1)//2*45+2, (t%2)*124+2)) + else: + newimage = Image.open(os.path.join(picdir, PhotoPath_S[small*2+t])) + image.paste(newimage, ((t-1)//2*45+2, (t%2)*124+2)) + +def Show_Photo_Large(image, large): + if(large > 6): + newimage = Image.open(os.path.join(picdir, PhotoPath_L[0])) + image.paste(newimage, (2, 2)) + else: + newimage = Image.open(os.path.join(picdir, PhotoPath_L[large])) + image.paste(newimage, (2, 2)) + +def Read_BMP(File, x, y): + newimage = Image.open(os.path.join(picdir, File)) + image.paste(newimage, (x, y)) + +try: + logging.info("epd2in13_V2 Touch Demo") + + epd = epd2in13_V2.EPD_2IN13_V2() + gt = gt1151.GT1151() + GT_Dev = gt1151.GT_Development() + GT_Old = gt1151.GT_Development() + + logging.info("init and Clear") + epd.init(epd.FULL_UPDATE) + gt.GT_Init() + epd.Clear(0xFF) + + t = threading.Thread(target = pthread_irq) + t.setDaemon(True) + t.start() + + # Drawing on the image + font15 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 15) + font24 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 24) + + image = Image.open(os.path.join(picdir, 'Menu.bmp')) + epd.displayPartBaseImage(epd.getbuffer(image)) + DrawImage = ImageDraw.Draw(image) + epd.init(epd.PART_UPDATE) + + i = j = k = ReFlag = SelfFlag = Page = Photo_L = Photo_S = 0 + PhotoPath_S = [ "Photo_1_0.bmp", + "Photo_1_1.bmp", "Photo_1_2.bmp", "Photo_1_3.bmp", "Photo_1_4.bmp", + "Photo_1_5.bmp", "Photo_1_6.bmp", + ] + PhotoPath_L = [ "Photo_2_0.bmp", + "Photo_2_1.bmp", "Photo_2_2.bmp", "Photo_2_3.bmp", "Photo_2_4.bmp", + "Photo_2_5.bmp", "Photo_2_6.bmp", + ] + PagePath = ["Menu.bmp", "White_board.bmp", "Photo_1.bmp", "Photo_2.bmp"] + + while(1): + if(i > 12 or ReFlag == 1): + if(Page == 1 and SelfFlag == 0): + epd.displayPartial(epd.getbuffer(image)) + else: + epd.displayPartial_Wait(epd.getbuffer(image)) + i = 0 + k = 0 + j += 1 + ReFlag = 0 + print("*** Draw Refresh ***\r\n") + elif(k>50000 and i>0 and Page == 1): + epd.displayPartial(epd.getbuffer(image)) + i = 0 + k = 0 + j += 1 + print("*** Overtime Refresh ***\r\n") + elif(j > 50 or SelfFlag): + SelfFlag = 0 + j = 0 + epd.init(epd.FULL_UPDATE) + epd.displayPartBaseImage(epd.getbuffer(image)) + epd.init(epd.PART_UPDATE) + print("--- Self Refresh ---\r\n") + else: + k += 1 + # Read the touch input + gt.GT_Scan(GT_Dev, GT_Old) + if(GT_Old.X[0] == GT_Dev.X[0] and GT_Old.Y[0] == GT_Dev.Y[0] and GT_Old.S[0] == GT_Dev.S[0]): + continue + + if(GT_Dev.TouchpointFlag): + i += 1 + GT_Dev.TouchpointFlag = 0 + + if(Page == 0 and ReFlag == 0): #main menu + if(GT_Dev.X[0] > 29 and GT_Dev.X[0] < 92 and GT_Dev.Y[0] > 56 and GT_Dev.Y[0] < 95): + print("Photo ...\r\n") + Page = 2 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) + ReFlag = 1 + elif(GT_Dev.X[0] > 29 and GT_Dev.X[0] < 92 and GT_Dev.Y[0] > 153 and GT_Dev.Y[0] < 193): + print("Draw ...\r\n") + Page = 1 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + + + if(Page == 1 and ReFlag == 0): #white board + DrawImage.rectangle([(GT_Dev.X[0], GT_Dev.Y[0]), (GT_Dev.X[0] + GT_Dev.S[0]/8 + 1, GT_Dev.Y[0] + GT_Dev.S[0]/8 + 1)], fill=0) + if(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 118 and GT_Dev.Y[0] > 6 and GT_Dev.Y[0] < 30): + print("Home ...\r\n") + Page = 1 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 118 and GT_Dev.Y[0] > 113 and GT_Dev.Y[0] < 136): + print("Clear ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 118 and GT_Dev.Y[0] > 220 and GT_Dev.Y[0] < 242): + print("Refresh ...\r\n") + SelfFlag = 1 + ReFlag = 1 + + + if(Page == 2 and ReFlag == 0): #photo menu + if(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 113 and GT_Dev.Y[0] < 136): + print("Home ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 57 and GT_Dev.Y[0] < 78): + print("Next page ...\r\n") + Photo_S += 1 + if(Photo_S > 2): # 6 photos is a maximum of three pages + Photo_S=0 + ReFlag = 2 + elif(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 169 and GT_Dev.Y[0] < 190): + print("Last page ...\r\n") + if(Photo_S == 0): + print("Top page ...\r\n") + else: + Photo_S -= 1 + ReFlag = 2 + elif(GT_Dev.X[0] > 97 and GT_Dev.X[0] < 119 and GT_Dev.Y[0] > 220 and GT_Dev.Y[0] < 242): + print("Refresh ...\r\n") + SelfFlag = 1 + ReFlag = 1 + elif(GT_Dev.X[0] > 2 and GT_Dev.X[0] < 90 and GT_Dev.Y[0] > 2 and GT_Dev.Y[0] < 248 and ReFlag == 0): + print("Select photo ...\r\n") + Page = 3 + Read_BMP(PagePath[Page], 0, 0) + Photo_L = int(GT_Dev.X[0]/46*2 + 2-GT_Dev.Y[0]/124 + Photo_S*2) + Show_Photo_Large(image, Photo_L) + ReFlag = 1 + if(ReFlag == 2): # Refresh small photo + ReFlag = 1 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) # show small photo + + + if(Page == 3 and ReFlag == 0): #view the photo + if(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 4 and GT_Dev.Y[0] < 25): + print("Photo menu ...\r\n") + Page = 2 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 57 and GT_Dev.Y[0] < 78): + print("Next photo ...\r\n") + Photo_L += 1 + if(Photo_L > 6): + Photo_L = 1 + ReFlag = 2 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 113 and GT_Dev.Y[0] < 136): + print("Home ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 169 and GT_Dev.Y[0] < 190): + print("Last page ...\r\n") + if(Photo_L == 1): + print("Top photo ...\r\n") + else: + Photo_L -= 1 + ReFlag = 2 + elif(GT_Dev.X[0] > 96 and GT_Dev.X[0] < 117 and GT_Dev.Y[0] > 220 and GT_Dev.Y[0] < 242): + print("Refresh photo ...\r\n") + SelfFlag = 1 + ReFlag = 1 + if(ReFlag == 2): # Refresh large photo + ReFlag = 1 + Show_Photo_Large(image, Photo_L) + +except IOError as e: + logging.info(e) + +except KeyboardInterrupt: + logging.info("ctrl + c:") + flag_t = 0 + epd.sleep() + time.sleep(2) + t.join() + epd.Dev_exit() + exit() diff --git a/docs/Touch_e-Paper_Code/python/examples/TP2in9_test.py b/docs/Touch_e-Paper_Code/python/examples/TP2in9_test.py new file mode 100644 index 0000000..a893dc5 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/examples/TP2in9_test.py @@ -0,0 +1,268 @@ +#!/usr/bin/python +# -*- coding:utf-8 -*- +import sys +import os +picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic/2in9') +fontdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic') +libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib') +if os.path.exists(libdir): + sys.path.append(libdir) + +from TP_lib import icnt86 +from TP_lib import epd2in9_V2 +from TP_lib import weather_2in9_V2 + +import time +import logging +from PIL import Image, ImageDraw, ImageFont +import traceback +import threading + +logging.basicConfig(level=logging.DEBUG) +flag_t = 1 + +def pthread_irq() : + print("pthread irq running") + while flag_t == 1 : + if(tp.digital_read(tp.INT) == 0) : + ICNT_Dev.Touch = 1 + else : + ICNT_Dev.Touch = 0 + time.sleep(0.01) + print("thread irq: exit") + +def Show_Photo_Small(image, small): + for t in range(1, 7): + if(small*3+t > 9): + newimage = Image.open(os.path.join(picdir, PhotoPath_S[0])) + image.paste(newimage, ((t-1)%3*98+2, (t-1)//3*48+2)) + else: + newimage = Image.open(os.path.join(picdir, PhotoPath_S[small*3+t])) + image.paste(newimage, ((t-1)%3*98+2, (t-1)//3*48+2)) + +def Show_Photo_Large(image, large): + if(large > 9): + newimage = Image.open(os.path.join(picdir, PhotoPath_L[0])) + image.paste(newimage, (2, 2)) + else: + newimage = Image.open(os.path.join(picdir, PhotoPath_L[large])) + image.paste(newimage, (2, 2)) + +def Read_BMP(File, x, y): + newimage = Image.open(os.path.join(picdir, File)) + image.paste(newimage, (x, y)) + +def Draw_Time(image, x, y, font1, font2): + Time = time.strftime("%H : %M", time.localtime()) + Date = time.strftime("%Y - %m - %d", time.localtime()) + imagefill=255 + if image.mode!="1": + imagefill = (255, 255, 255, 255) + image.text((x, y), Time, font = font1, fill = imagefill) + image.text((x-9, y+35), Date, font = font2, fill = imagefill) + + +try: + logging.info("epd2in9_V2 Touch Demo") + + epd = epd2in9_V2.EPD_2IN9_V2() + + + + tp = icnt86.INCT86() + + ICNT_Dev = icnt86.ICNT_Development() + ICNT_Old = icnt86.ICNT_Development() + + ''' + Because the touch display requires a relatively fast refresh speed, the default + needs to use partial refresh, and four gray levels cannot be used in this mode. + Here, only four gray level picture refresh demonstration is used + ''' + # epd.Init_4Gray() + # Himage = Image.open(os.path.join(picdir, '2in9_Scale.bmp')) + # epd.display_4Gray(epd.getbuffer_4Gray(Himage)) + # time.sleep(2) + + logging.info("init and Clear") + epd.init() + tp.ICNT_Init() + epd.Clear(0xFF) + + t1 = threading.Thread(target = pthread_irq) + t1.setDaemon(True) + t1.start() + + # Drawing on the image + font15 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 15) + font24 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 24) + + image = Image.open(os.path.join(picdir, 'Menu.bmp')) + DrawImage = ImageDraw.Draw(image) + + Draw_Time(DrawImage, 209, 40, font24, font15) + + epd.display_Base(epd.getbuffer(image)) + + i = j = k = ReFlag = SelfFlag = Page = Photo_L = Photo_S = 0 + PhotoPath_S = [ "Photo_1_0.bmp", + "Photo_1_1.bmp", "Photo_1_2.bmp", "Photo_1_3.bmp", "Photo_1_4.bmp", + "Photo_1_5.bmp", "Photo_1_6.bmp", "Photo_1_7.bmp", "Photo_1_8.bmp", + "Photo_1_9.bmp", + ] + PhotoPath_L = [ "Photo_2_0.bmp", + "Photo_2_1.bmp", "Photo_2_2.bmp", "Photo_2_3.bmp", "Photo_2_4.bmp", + "Photo_2_5.bmp", "Photo_2_6.bmp", "Photo_2_7.bmp", "Photo_2_8.bmp", + "Photo_2_9.bmp", + ] + PagePath = ["Menu.bmp", "screen_output.png", "Photo_1.bmp", "Photo_2.bmp"] + + while(1): + if(i > 20 or ReFlag == 1): + if(Page == 0): + DrawImage.rectangle((209, 40, 290, 120), fill = 0) + Draw_Time(DrawImage, 209, 40, font24, font15) + # print("*** Time Refresh ***\r\n") + + if(Page == 1): + weather_2in9_V2.get_weather_png() + Read_BMP(PagePath[Page], 0, 0) + + epd.display_Partial_Wait(epd.getbuffer(image)) + print("*** Touch Refresh ***\r\n") + i = 0 + k = 0 + j += 1 + ReFlag = 0 + elif(k>50000 and i>0 and Page == 1): + epd.display_Partial_Wait(epd.getbuffer(image)) + i = 0 + k = 0 + j += 1 + print("*** Overtime Refresh ***\r\n") + elif(j > 50 or SelfFlag): + SelfFlag = 0 + j = 0 + epd.init() + epd.display_Base(epd.getbuffer(image)) + print("--- Self Refresh ---\r\n") + else: + k += 1 + + if(Page==0 and k>5000000): + ReFlag = 1 + + tp.ICNT_Scan(ICNT_Dev, ICNT_Old) + if(ICNT_Old.X[0] == ICNT_Dev.X[0] and ICNT_Old.Y[0] == ICNT_Dev.Y[0]): + continue + + if(ICNT_Dev.TouchCount): + ICNT_Dev.TouchCount = 0 + i += 1 + if(Page == 0 and ReFlag == 0): #main menu + if(ICNT_Dev.X[0] > 119 and ICNT_Dev.X[0] < 152 and ICNT_Dev.Y[0] > 31 and ICNT_Dev.Y[0] < 96): + print("Photo ...\r\n") + Page = 2 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) + ReFlag = 1 + elif(ICNT_Dev.X[0] > 39 and ICNT_Dev.X[0] < 80 and ICNT_Dev.Y[0] > 31 and ICNT_Dev.Y[0] < 96): + print("Weather ...\r\n") + Page = 1 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + + + if(Page == 1 and ReFlag == 0): #weather + if(ICNT_Dev.X[0] > 136 and ICNT_Dev.X[0] < 159 and ICNT_Dev.Y[0] > 101 and ICNT_Dev.Y[0] < 124): + print("Home ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(ICNT_Dev.X[0] > 5 and ICNT_Dev.X[0] < 27 and ICNT_Dev.Y[0] > 101 and ICNT_Dev.Y[0] < 124): + print("Refresh ...\r\n") + SelfFlag = 1 + ReFlag = 1 + + + if(Page == 2 and ReFlag == 0): #photo menu + if(ICNT_Dev.X[0] > 135 and ICNT_Dev.X[0] < 160 and ICNT_Dev.Y[0] > 101 and ICNT_Dev.Y[0] < 124): + print("Home ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(ICNT_Dev.X[0] > 203 and ICNT_Dev.X[0] < 224 and ICNT_Dev.Y[0] > 101 and ICNT_Dev.Y[0] < 124): + print("Next page ...\r\n") + Photo_S += 1 + if(Photo_S > 2): # 9 photos is a maximum of three pages + Photo_S=0 + ReFlag = 2 + elif(ICNT_Dev.X[0] > 71 and ICNT_Dev.X[0] < 92 and ICNT_Dev.Y[0] > 101 and ICNT_Dev.Y[0] < 124): + print("Last page ...\r\n") + if(Photo_S == 0): + print("Top page ...\r\n") + else: + Photo_S -= 1 + ReFlag = 2 + elif(ICNT_Dev.X[0] > 5 and ICNT_Dev.X[0] < 27 and ICNT_Dev.Y[0] > 101 and ICNT_Dev.Y[0] < 124): + print("Refresh ...\r\n") + SelfFlag = 1 + ReFlag = 1 + elif(ICNT_Dev.X[0] > 2 and ICNT_Dev.X[0] < 293 and ICNT_Dev.Y[0] > 2 and ICNT_Dev.Y[0] < 96 and ReFlag == 0): + print("Select photo ...\r\n") + Page = 3 + Read_BMP(PagePath[Page], 0, 0) + Photo_L = ICNT_Dev.X[0]//96 + ICNT_Dev.Y[0]//48*3 + Photo_S*3 + 1 + Show_Photo_Large(image, Photo_L) + ReFlag = 1 + if(ReFlag == 2): # Refresh small photo + ReFlag = 1 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) # show small photo + + + if(Page == 3 and ReFlag == 0): #view the photo + if(ICNT_Dev.X[0] > 268 and ICNT_Dev.X[0] < 289 and ICNT_Dev.Y[0] > 101 and ICNT_Dev.Y[0] < 124): + print("Photo menu ...\r\n") + Page = 2 + Read_BMP(PagePath[Page], 0, 0) + Show_Photo_Small(image, Photo_S) + ReFlag = 1 + elif(ICNT_Dev.X[0] > 203 and ICNT_Dev.X[0] < 224 and ICNT_Dev.Y[0] > 101 and ICNT_Dev.Y[0] < 124): + print("Next photo ...\r\n") + Photo_L += 1 + if(Photo_L > 9): + Photo_L = 1 + ReFlag = 2 + elif(ICNT_Dev.X[0] > 135 and ICNT_Dev.X[0] < 160 and ICNT_Dev.Y[0] > 101 and ICNT_Dev.Y[0] < 124): + print("Home ...\r\n") + Page = 0 + Read_BMP(PagePath[Page], 0, 0) + ReFlag = 1 + elif(ICNT_Dev.X[0] > 71 and ICNT_Dev.X[0] < 92 and ICNT_Dev.Y[0] > 101 and ICNT_Dev.Y[0] < 124): + print("Last page ...\r\n") + if(Photo_L == 1): + print("Top photo ...\r\n") + else: + Photo_L -= 1 + ReFlag = 2 + elif(ICNT_Dev.X[0] > 5 and ICNT_Dev.X[0] < 27 and ICNT_Dev.Y[0] > 101 and ICNT_Dev.Y[0] < 124): + print("Refresh photo ...\r\n") + SelfFlag = 1 + ReFlag = 1 + if(ReFlag == 2): # Refresh large photo + ReFlag = 1 + Show_Photo_Large(image, Photo_L) + + +except IOError as e: + logging.info(e) + +except KeyboardInterrupt: + logging.info("ctrl + c:") + flag_t = 0 + epd.sleep() + time.sleep(2) + t1.join() + epd.Dev_exit() + exit() diff --git a/docs/Touch_e-Paper_Code/python/lib/TP_lib/__init__.py b/docs/Touch_e-Paper_Code/python/lib/TP_lib/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in13_V2.py b/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in13_V2.py new file mode 100644 index 0000000..1a9c828 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in13_V2.py @@ -0,0 +1,339 @@ +# ***************************************************************************** +# * | File : epd2in13_V2.py +# * | Author : Waveshare team +# * | Function : Electronic paper driver +# * | Info : +# *---------------- +# * | This version: V4.0 +# * | Date : 2019-06-20 +# # | Info : python demo +# ----------------------------------------------------------------------------- +# 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. +# + + +import logging +from . import epdconfig +import numpy as np + +# Display resolution +EPD_WIDTH = 122 +EPD_HEIGHT = 250 + +class EPD_2IN13_V2: + def __init__(self): + self.reset_pin = epdconfig.EPD_RST_PIN + self.dc_pin = epdconfig.EPD_DC_PIN + self.busy_pin = epdconfig.EPD_BUSY_PIN + self.cs_pin = epdconfig.EPD_CS_PIN + self.width = EPD_WIDTH + self.height = EPD_HEIGHT + epdconfig.address = 0x14 + + FULL_UPDATE = 0 + PART_UPDATE = 1 + lut_full_update= [ + 0x80,0x60,0x40,0x00,0x00,0x00,0x00, #LUT0: BB: VS 0 ~7 + 0x10,0x60,0x20,0x00,0x00,0x00,0x00, #LUT1: BW: VS 0 ~7 + 0x80,0x60,0x40,0x00,0x00,0x00,0x00, #LUT2: WB: VS 0 ~7 + 0x10,0x60,0x20,0x00,0x00,0x00,0x00, #LUT3: WW: VS 0 ~7 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00, #LUT4: VCOM: VS 0 ~7 + + 0x03,0x03,0x00,0x00,0x02, # TP0 A~D RP0 + 0x09,0x09,0x00,0x00,0x02, # TP1 A~D RP1 + 0x03,0x03,0x00,0x00,0x02, # TP2 A~D RP2 + 0x00,0x00,0x00,0x00,0x00, # TP3 A~D RP3 + 0x00,0x00,0x00,0x00,0x00, # TP4 A~D RP4 + 0x00,0x00,0x00,0x00,0x00, # TP5 A~D RP5 + 0x00,0x00,0x00,0x00,0x00, # TP6 A~D RP6 + + 0x15,0x41,0xA8,0x32,0x30,0x0A, + ] + + lut_partial_update = [ #20 bytes + 0x00,0x00,0x00,0x00,0x00,0x00,0x00, #LUT0: BB: VS 0 ~7 + 0x80,0x00,0x00,0x00,0x00,0x00,0x00, #LUT1: BW: VS 0 ~7 + 0x40,0x00,0x00,0x00,0x00,0x00,0x00, #LUT2: WB: VS 0 ~7 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00, #LUT3: WW: VS 0 ~7 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00, #LUT4: VCOM: VS 0 ~7 + + 0x0A,0x00,0x00,0x00,0x00, # TP0 A~D RP0 + 0x00,0x00,0x00,0x00,0x00, # TP1 A~D RP1 + 0x00,0x00,0x00,0x00,0x00, # TP2 A~D RP2 + 0x00,0x00,0x00,0x00,0x00, # TP3 A~D RP3 + 0x00,0x00,0x00,0x00,0x00, # TP4 A~D RP4 + 0x00,0x00,0x00,0x00,0x00, # TP5 A~D RP5 + 0x00,0x00,0x00,0x00,0x00, # TP6 A~D RP6 + + 0x15,0x41,0xA8,0x32,0x30,0x0A, + ] + + # Hardware reset + def reset(self): + epdconfig.digital_write(self.reset_pin, 1) + epdconfig.delay_ms(200) + epdconfig.digital_write(self.reset_pin, 0) + epdconfig.delay_ms(5) + epdconfig.digital_write(self.reset_pin, 1) + epdconfig.delay_ms(200) + + def send_command(self, command): + epdconfig.digital_write(self.dc_pin, 0) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte([command]) + epdconfig.digital_write(self.cs_pin, 1) + + def send_data(self, data): + epdconfig.digital_write(self.dc_pin, 1) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte([data]) + epdconfig.digital_write(self.cs_pin, 1) + + def send_data2(self, data): + epdconfig.digital_write(self.dc_pin, 1) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte(data) + epdconfig.digital_write(self.cs_pin, 1) + + def ReadBusy(self): + while(epdconfig.digital_read(self.busy_pin) == 1): # 0: idle, 1: busy + epdconfig.delay_ms(10) + + def TurnOnDisplay(self): + self.send_command(0x22) + self.send_data(0xC7) + self.send_command(0x20) + self.ReadBusy() + + def TurnOnDisplayPart(self): + self.send_command(0x22) + self.send_data(0x0c) + self.send_command(0x20) + # self.ReadBusy() + + def TurnOnDisplayPart_Wait(self): + self.send_command(0x22) + self.send_data(0x0c) + self.send_command(0x20) + self.ReadBusy() + + def init(self, update): + if (epdconfig.module_init() != 0): + return -1 + # EPD hardware init start + self.reset() + if(update == self.FULL_UPDATE): + self.ReadBusy() + self.send_command(0x12) # soft reset + self.ReadBusy() + + self.send_command(0x74) #set analog block control + self.send_data(0x54) + self.send_command(0x7E) #set digital block control + self.send_data(0x3B) + + self.send_command(0x01) #Driver output control + self.send_data(0xF9) + self.send_data(0x00) + self.send_data(0x00) + + self.send_command(0x11) #data entry mode + self.send_data(0x01) + + self.send_command(0x44) #set Ram-X address start/end position + self.send_data(0x00) + self.send_data(0x0F) #0x0C-->(15+1)*8=128 + + self.send_command(0x45) #set Ram-Y address start/end position + self.send_data(0xF9) #0xF9-->(249+1)=250 + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + + self.send_command(0x3C) #BorderWavefrom + self.send_data(0x03) + + self.send_command(0x2C) #VCOM Voltage + self.send_data(0x55) # + + self.send_command(0x03) + self.send_data(self.lut_full_update[70]) + + self.send_command(0x04) # + self.send_data(self.lut_full_update[71]) + self.send_data(self.lut_full_update[72]) + self.send_data(self.lut_full_update[73]) + + self.send_command(0x3A) #Dummy Line + self.send_data(self.lut_full_update[74]) + self.send_command(0x3B) #Gate time + self.send_data(self.lut_full_update[75]) + + self.send_command(0x32) + for count in range(70): + self.send_data(self.lut_full_update[count]) + + self.send_command(0x4E) # set RAM x address count to 0 + self.send_data(0x00) + self.send_command(0x4F) # set RAM y address count to 0X127 + self.send_data(0xF9) + self.send_data(0x00) + self.ReadBusy() + else: + self.send_command(0x2C) #VCOM Voltage + self.send_data(0x26) + + self.ReadBusy() + + self.send_command(0x32) + for count in range(70): + self.send_data(self.lut_partial_update[count]) + + self.send_command(0x37) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x40) + self.send_data(0x00) + self.send_data(0x00) + + self.send_command(0x22) + self.send_data(0xC0) + self.send_command(0x20) + self.ReadBusy() + + self.send_command(0x3C) #BorderWavefrom + self.send_data(0x01) + return 0 + + def getbuffer(self, image): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + buf = [0xFF] * (linewidth * self.height) + image_monocolor = image.convert('1') + imwidth, imheight = image_monocolor.size + pixels = image_monocolor.load() + + if(imwidth == self.width and imheight == self.height): + # logging.debug("Vertical") + for y in range(imheight): + for x in range(imwidth): + if pixels[x, y] == 0: + x = imwidth - x + buf[int(x / 8) + y * linewidth] &= ~(0x80 >> (x % 8)) + elif(imwidth == self.height and imheight == self.width): + # logging.debug("Horizontal") + for y in range(imheight): + for x in range(imwidth): + newx = y + newy = self.height - x - 1 + if pixels[x, y] == 0: + newy = imwidth - newy - 1 + buf[int(newx / 8) + newy*linewidth] &= ~(0x80 >> (y % 8)) + return buf + + + def display(self, image): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + self.send_command(0x24) + # for j in range(0, self.height): + # for i in range(0, linewidth): + # self.send_data(image[i + j * linewidth]) + self.send_data2(image) + self.TurnOnDisplay() + + def displayPartial(self, image): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + self.send_command(0x24) + # for j in range(0, self.height): + # for i in range(0, linewidth): + # self.send_data(image[i + j * linewidth]) + self.send_data2(image) + self.TurnOnDisplayPart() + + def displayPartial_Wait(self, image): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + self.send_command(0x24) + for j in range(0, self.height): + for i in range(0, linewidth): + self.send_data(image[i + j * linewidth]) + + self.TurnOnDisplayPart_Wait() + + def displayPartBaseImage(self, image): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + self.send_command(0x24) + for j in range(0, self.height): + for i in range(0, linewidth): + self.send_data(image[i + j * linewidth]) + + + self.send_command(0x26) + for j in range(0, self.height): + for i in range(0, linewidth): + self.send_data(image[i + j * linewidth]) + self.TurnOnDisplay() + + def Clear(self, color): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + self.send_command(0x24) + for j in range(0, self.height): + for i in range(0, linewidth): + self.send_data(color) + + self.TurnOnDisplay() + + def sleep(self): + # self.send_command(0x22) #POWER OFF + # self.send_data(0xC3) + # self.send_command(0x20) + + self.send_command(0x10) #enter deep sleep + self.send_data(0x03) + epdconfig.delay_ms(100) + + def Dev_exit(self): + epdconfig.module_exit() + +### END OF FILE ### + diff --git a/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in13_V3.py b/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in13_V3.py new file mode 100644 index 0000000..d4fc0f3 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in13_V3.py @@ -0,0 +1,436 @@ +# ***************************************************************************** +# * | File : epd2in13_V3.py +# * | Author : Waveshare team +# * | Function : Electronic paper driver +# * | Info : +# *---------------- +# * | This version: V1.1 +# * | Date : 2021-10-30 +# # | Info : python demo +# ----------------------------------------------------------------------------- +# 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. +# + + +import logging +from . import epdconfig +import numpy as np + +# Display resolution +EPD_WIDTH = 122 +EPD_HEIGHT = 250 + +logger = logging.getLogger(__name__) + +class EPD: + def __init__(self): + self.reset_pin = epdconfig.EPD_RST_PIN + self.dc_pin = epdconfig.EPD_DC_PIN + self.busy_pin = epdconfig.EPD_BUSY_PIN + self.cs_pin = epdconfig.EPD_CS_PIN + self.width = EPD_WIDTH + self.height = EPD_HEIGHT + epdconfig.address = 0x14 + + FULL_UPDATE = 0 + PART_UPDATE = 1 + + lut_partial_update= [ + 0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x10,0x0,0x0,0x0,0x0,0x0,0x0, + 0x1,0x0,0x0,0x0,0x0,0x0,0x0, + 0x1,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0, + 0x22,0x17,0x41,0x00,0x32,0x36, + ] + + lut_full_update = [ + 0x80,0x4A,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x40,0x4A,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x80,0x4A,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x40,0x4A,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0xF,0x0,0x0,0x0,0x0,0x0,0x0, + 0xF,0x0,0x0,0xF,0x0,0x0,0x2, + 0xF,0x0,0x0,0x0,0x0,0x0,0x0, + 0x1,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0, + 0x22,0x17,0x41,0x0,0x32,0x36, + ] + + ''' + function :Hardware reset + parameter: + ''' + def reset(self): + epdconfig.digital_write(self.reset_pin, 1) + epdconfig.delay_ms(20) + epdconfig.digital_write(self.reset_pin, 0) + epdconfig.delay_ms(2) + epdconfig.digital_write(self.reset_pin, 1) + epdconfig.delay_ms(20) + + ''' + function :send command + parameter: + command : Command register + ''' + def send_command(self, command): + epdconfig.digital_write(self.dc_pin, 0) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte([command]) + epdconfig.digital_write(self.cs_pin, 1) + + ''' + function :send data + parameter: + data : Write data + ''' + def send_data(self, data): + epdconfig.digital_write(self.dc_pin, 1) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte([data]) + epdconfig.digital_write(self.cs_pin, 1) + + def send_data2(self, data): + epdconfig.digital_write(self.dc_pin, 1) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte(data) + epdconfig.digital_write(self.cs_pin, 1) + + ''' + function :Wait until the busy_pin goes LOW + parameter: + ''' + def ReadBusy(self): + logger.debug("e-Paper busy") + while(epdconfig.digital_read(self.busy_pin) == 1): # 0: idle, 1: busy + epdconfig.delay_ms(10) + logger.debug("e-Paper busy release") + + ''' + function : Turn On Display + parameter: + ''' + def TurnOnDisplay(self): + self.send_command(0x22) # Display Update Control + self.send_data(0xC7) + self.send_command(0x20) # Activate Display Update Sequence + self.ReadBusy() + + ''' + function : Turn On Display Part + parameter: + ''' + def TurnOnDisplayPart(self): + self.send_command(0x22) # Display Update Control + self.send_data(0x0c) # fast:0x0c, quality:0x0f, 0xcf + self.send_command(0x20) # Activate Display Update Sequence + # self.ReadBusy() + + def TurnOnDisplayPart_Wait(self): + self.send_command(0x22) # Display Update Control + self.send_data(0x0c) # fast:0x0c, quality:0x0f, 0xcf + self.send_command(0x20) # Activate Display Update Sequence + self.ReadBusy() + + ''' + function : Set lut + parameter: + lut : lut data + ''' + def Lut(self, lut): + self.send_command(0x32) + for i in range(0, 153): + self.send_data(lut[i]) + self.ReadBusy() + + ''' + function : Send lut data and configuration + parameter: + lut : lut data + ''' + def SetLut(self, lut): + self.Lut(lut) + self.send_command(0x3f) + self.send_data(lut[153]) + self.send_command(0x03) # gate voltage + self.send_data(lut[154]) + self.send_command(0x04) # source voltage + self.send_data(lut[155]) # VSH + self.send_data(lut[156]) # VSH2 + self.send_data(lut[157]) # VSL + self.send_command(0x2c) # VCOM + self.send_data(lut[158]) + + ''' + function : Setting the display window + parameter: + xstart : X-axis starting position + ystart : Y-axis starting position + xend : End position of X-axis + yend : End position of Y-axis + ''' + def SetWindow(self, x_start, y_start, x_end, y_end): + self.send_command(0x44) # SET_RAM_X_ADDRESS_START_END_POSITION + # x point must be the multiple of 8 or the last 3 bits will be ignored + self.send_data((x_start>>3) & 0xFF) + self.send_data((x_end>>3) & 0xFF) + + self.send_command(0x45) # SET_RAM_Y_ADDRESS_START_END_POSITION + self.send_data(y_start & 0xFF) + self.send_data((y_start >> 8) & 0xFF) + self.send_data(y_end & 0xFF) + self.send_data((y_end >> 8) & 0xFF) + + ''' + function : Set Cursor + parameter: + x : X-axis starting position + y : Y-axis starting position + ''' + def SetCursor(self, x, y): + self.send_command(0x4E) # SET_RAM_X_ADDRESS_COUNTER + # x point must be the multiple of 8 or the last 3 bits will be ignored + self.send_data(x & 0xFF) + + self.send_command(0x4F) # SET_RAM_Y_ADDRESS_COUNTER + self.send_data(y & 0xFF) + self.send_data((y >> 8) & 0xFF) + + ''' + function : Initialize the e-Paper register + parameter: + ''' + def init(self, update): + if (epdconfig.module_init() != 0): + return -1 + + if update == self.FULL_UPDATE: + # EPD hardware init start + self.reset() + + self.ReadBusy() + self.send_command(0x12) #SWRESET + self.ReadBusy() + + self.send_command(0x01) #Driver output control + self.send_data(0xf9) + self.send_data(0x00) + self.send_data(0x00) + + self.send_command(0x11) #data entry mode + self.send_data(0x03) + + self.SetWindow(0, 0, self.width-1, self.height-1) + self.SetCursor(0, 0) + + self.send_command(0x3c) + self.send_data(0x05) + + self.send_command(0x21) # Display update control + self.send_data(0x00) + self.send_data(0x80) + + self.send_command(0x18) + self.send_data(0x80) + + self.ReadBusy() + + self.SetLut(self.lut_full_update) + + else: + epdconfig.digital_write(self.reset_pin, 0) + epdconfig.delay_ms(1) + epdconfig.digital_write(self.reset_pin, 1) + + self.SetLut(self.lut_partial_update) + self.send_command(0x37) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x40) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + + self.send_command(0x3C) #BorderWavefrom + self.send_data(0x80) + + self.send_command(0x22) + self.send_data(0xC0) + self.send_command(0x20) + self.ReadBusy() + + self.SetWindow(0, 0, self.width - 1, self.height - 1) + self.SetCursor(0, 0) + + return 0 + + ''' + function : Display images + parameter: + image : Image data + ''' + def getbuffer(self, image): + img = image + imwidth, imheight = img.size + if(imwidth == self.width and imheight == self.height): + img = img.rotate(180, expand=True).convert('1') + elif(imwidth == self.height and imheight == self.width): + # image has correct dimensions, but needs to be rotated + img = img.rotate(270, expand=True).convert('1') + else: + logger.warning("Wrong image dimensions: must be " + str(self.width) + "x" + str(self.height)) + # return a blank buffer + return [0x00] * (int(self.width/8) * self.height) + + buf = bytearray(img.tobytes('raw')) + return buf + + ''' + function : Sends the image buffer in RAM to e-Paper and displays + parameter: + image : Image data + ''' + def display(self, image): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + self.send_command(0x24) + # for j in range(0, self.height): + # for i in range(0, linewidth): + # self.send_data(image[i + j * linewidth]) + + self.send_data2(image) + self.TurnOnDisplay() + + ''' + function : Sends the image buffer in RAM to e-Paper and partial refresh + parameter: + image : Image data + ''' + def displayPartial(self, image): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + self.send_command(0x24) # WRITE_RAM + # for j in range(0, self.height): + # for i in range(0, linewidth): + # self.send_data(image[i + j * linewidth]) + self.send_data2(image) + self.TurnOnDisplayPart() + + def displayPartial_Wait(self, image): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + self.send_command(0x24) # WRITE_RAM + # for j in range(0, self.height): + # for i in range(0, linewidth): + # self.send_data(image[i + j * linewidth]) + + self.send_data2(image) + self.TurnOnDisplayPart_Wait() + + ''' + function : Refresh a base image + parameter: + image : Image data + ''' + def displayPartBaseImage(self, image): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + self.send_command(0x24) + for j in range(0, self.height): + for i in range(0, linewidth): + self.send_data(image[i + j * linewidth]) + + self.send_command(0x26) + for j in range(0, self.height): + for i in range(0, linewidth): + self.send_data(image[i + j * linewidth]) + self.TurnOnDisplay() + + ''' + function : Clear screen + parameter: + ''' + def Clear(self, color): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + # logger.debug(linewidth) + + self.send_command(0x24) + for j in range(0, self.height): + for i in range(0, linewidth): + self.send_data(color) + + self.TurnOnDisplay() + + ''' + function : Enter sleep mode + parameter: + ''' + def sleep(self): + self.send_command(0x10) #enter deep sleep + self.send_data(0x01) + + epdconfig.delay_ms(2000) + + def Dev_exit(self): + epdconfig.module_exit() + +### END OF FILE ### + diff --git a/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in13_V4.py b/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in13_V4.py new file mode 100644 index 0000000..f8401f1 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in13_V4.py @@ -0,0 +1,370 @@ +# ***************************************************************************** +# * | File : epd2in13_V4.py +# * | Author : Waveshare team +# * | Function : Electronic paper driver +# * | Info : +# *---------------- +# * | This version: V1.0 +# * | Date : 2023-08-14 +# # | Info : python demo +# ----------------------------------------------------------------------------- +# 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. +# + + +import logging +from . import epdconfig +import numpy as np + +# Display resolution +EPD_WIDTH = 122 +EPD_HEIGHT = 250 + +logger = logging.getLogger(__name__) + +class EPD: + def __init__(self): + self.reset_pin = epdconfig.EPD_RST_PIN + self.dc_pin = epdconfig.EPD_DC_PIN + self.busy_pin = epdconfig.EPD_BUSY_PIN + self.cs_pin = epdconfig.EPD_CS_PIN + self.width = EPD_WIDTH + self.height = EPD_HEIGHT + epdconfig.address = 0x14 + + FULL_UPDATE = 0 + PART_UPDATE = 1 + + ''' + function :Hardware reset + parameter: + ''' + def reset(self): + epdconfig.digital_write(self.reset_pin, 1) + epdconfig.delay_ms(20) + epdconfig.digital_write(self.reset_pin, 0) + epdconfig.delay_ms(2) + epdconfig.digital_write(self.reset_pin, 1) + epdconfig.delay_ms(20) + + ''' + function :send command + parameter: + command : Command register + ''' + def send_command(self, command): + epdconfig.digital_write(self.dc_pin, 0) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte([command]) + epdconfig.digital_write(self.cs_pin, 1) + + ''' + function :send data + parameter: + data : Write data + ''' + def send_data(self, data): + epdconfig.digital_write(self.dc_pin, 1) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte([data]) + epdconfig.digital_write(self.cs_pin, 1) + + def send_data2(self, data): + epdconfig.digital_write(self.dc_pin, 1) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte(data) + epdconfig.digital_write(self.cs_pin, 1) + + ''' + function :Wait until the busy_pin goes LOW + parameter: + ''' + def ReadBusy(self): + logger.debug("e-Paper busy") + while(epdconfig.digital_read(self.busy_pin) == 1): # 0: idle, 1: busy + epdconfig.delay_ms(10) + logger.debug("e-Paper busy release") + + ''' + function : Turn On Display + parameter: + ''' + def TurnOnDisplay(self): + self.send_command(0x22) # Display Update Control + self.send_data(0xF7) + self.send_command(0x20) # Activate Display Update Sequence + self.ReadBusy() + + ''' + function : Turn On Display Part + parameter: + ''' + def TurnOnDisplayPart(self): + self.send_command(0x22) # Display Update Control + self.send_data(0xFF) # fast:0x0c, quality:0x0f, 0xcf + self.send_command(0x20) # Activate Display Update Sequence + # self.ReadBusy() + + def TurnOnDisplayPart_Wait(self): + self.send_command(0x22) # Display Update Control + self.send_data(0xFF) # fast:0x0c, quality:0x0f, 0xcf + self.send_command(0x20) # Activate Display Update Sequence + self.ReadBusy() + + ''' + function : Setting the display window + parameter: + xstart : X-axis starting position + ystart : Y-axis starting position + xend : End position of X-axis + yend : End position of Y-axis + ''' + def SetWindow(self, x_start, y_start, x_end, y_end): + self.send_command(0x44) # SET_RAM_X_ADDRESS_START_END_POSITION + # x point must be the multiple of 8 or the last 3 bits will be ignored + self.send_data((x_start>>3) & 0xFF) + self.send_data((x_end>>3) & 0xFF) + + self.send_command(0x45) # SET_RAM_Y_ADDRESS_START_END_POSITION + self.send_data(y_start & 0xFF) + self.send_data((y_start >> 8) & 0xFF) + self.send_data(y_end & 0xFF) + self.send_data((y_end >> 8) & 0xFF) + + ''' + function : Set Cursor + parameter: + x : X-axis starting position + y : Y-axis starting position + ''' + def SetCursor(self, x, y): + self.send_command(0x4E) # SET_RAM_X_ADDRESS_COUNTER + # x point must be the multiple of 8 or the last 3 bits will be ignored + self.send_data(x & 0xFF) + + self.send_command(0x4F) # SET_RAM_Y_ADDRESS_COUNTER + self.send_data(y & 0xFF) + self.send_data((y >> 8) & 0xFF) + + ''' + function : Initialize the e-Paper register + parameter: + ''' + def init(self, update): + if (epdconfig.module_init() != 0): + return -1 + + if update == self.FULL_UPDATE: + # EPD hardware init start + self.reset() + + self.ReadBusy() + self.send_command(0x12) #SWRESET + self.ReadBusy() + + self.send_command(0x01) #Driver output control + self.send_data(0xf9) + self.send_data(0x00) + self.send_data(0x00) + + self.send_command(0x11) #data entry mode + self.send_data(0x03) + + self.SetWindow(0, 0, self.width-1, self.height-1) + self.SetCursor(0, 0) + + self.send_command(0x3c) + self.send_data(0x05) + + self.send_command(0x21) # Display update control + self.send_data(0x00) + self.send_data(0x80) + + self.send_command(0x18) + self.send_data(0x80) + + self.ReadBusy() + + else: + epdconfig.digital_write(self.reset_pin, 0) + epdconfig.delay_ms(1) + epdconfig.digital_write(self.reset_pin, 1) + + self.send_command(0x01) #Driver output control + self.send_data(0xf9) + self.send_data(0x00) + self.send_data(0x00) + + self.send_command(0x3C) #BorderWavefrom + self.send_data(0x80) + + self.send_command(0x11) #data entry mode + self.send_data(0x03) + + self.SetWindow(0, 0, self.width - 1, self.height - 1) + self.SetCursor(0, 0) + + return 0 + + ''' + function : Display images + parameter: + image : Image data + ''' + def getbuffer(self, image): + img = image + imwidth, imheight = img.size + if(imwidth == self.width and imheight == self.height): + img = img.rotate(180, expand=True).convert('1') + elif(imwidth == self.height and imheight == self.width): + # image has correct dimensions, but needs to be rotated + img = img.rotate(270, expand=True).convert('1') + else: + logger.warning("Wrong image dimensions: must be " + str(self.width) + "x" + str(self.height)) + # return a blank buffer + return [0x00] * (int(self.width/8) * self.height) + + buf = bytearray(img.tobytes('raw')) + return buf + + ''' + function : Sends the image buffer in RAM to e-Paper and displays + parameter: + image : Image data + ''' + def display(self, image): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + self.send_command(0x24) + # for j in range(0, self.height): + # for i in range(0, linewidth): + # self.send_data(image[i + j * linewidth]) + + self.send_data2(image) + self.TurnOnDisplay() + + ''' + function : Sends the image buffer in RAM to e-Paper and partial refresh + parameter: + image : Image data + ''' + def displayPartial(self, image): + epdconfig.digital_write(self.reset_pin, 0) + epdconfig.delay_ms(1) + epdconfig.digital_write(self.reset_pin, 1) + + self.send_command(0x01) #Driver output control + self.send_data(0xf9) + self.send_data(0x00) + self.send_data(0x00) + + self.send_command(0x3C) #BorderWavefrom + self.send_data(0x80) + + self.send_command(0x11) #data entry mode + self.send_data(0x03) + + self.SetWindow(0, 0, self.width - 1, self.height - 1) + self.SetCursor(0, 0) + + self.send_command(0x24) # WRITE_RAM + self.send_data2(image) + self.TurnOnDisplayPart() + + def displayPartial_Wait(self, image): + epdconfig.digital_write(self.reset_pin, 0) + epdconfig.delay_ms(1) + epdconfig.digital_write(self.reset_pin, 1) + + self.send_command(0x01) #Driver output control + self.send_data(0xf9) + self.send_data(0x00) + self.send_data(0x00) + + self.send_command(0x3C) #BorderWavefrom + self.send_data(0x80) + + self.send_command(0x11) #data entry mode + self.send_data(0x03) + + self.SetWindow(0, 0, self.width - 1, self.height - 1) + self.SetCursor(0, 0) + + self.send_command(0x24) # WRITE_RAM + self.send_data2(image) + self.TurnOnDisplayPart_Wait() + + ''' + function : Refresh a base image + parameter: + image : Image data + ''' + def displayPartBaseImage(self, image): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + + self.send_command(0x24) + for j in range(0, self.height): + for i in range(0, linewidth): + self.send_data(image[i + j * linewidth]) + + self.send_command(0x26) + for j in range(0, self.height): + for i in range(0, linewidth): + self.send_data(image[i + j * linewidth]) + self.TurnOnDisplay() + + ''' + function : Clear screen + parameter: + ''' + def Clear(self, color): + if self.width%8 == 0: + linewidth = int(self.width/8) + else: + linewidth = int(self.width/8) + 1 + # logger.debug(linewidth) + + self.send_command(0x24) + for j in range(0, self.height): + for i in range(0, linewidth): + self.send_data(color) + + self.TurnOnDisplay() + + ''' + function : Enter sleep mode + parameter: + ''' + def sleep(self): + self.send_command(0x10) #enter deep sleep + self.send_data(0x01) + + epdconfig.delay_ms(2000) + + def Dev_exit(self): + epdconfig.module_exit() + +### END OF FILE ### + diff --git a/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in9_V2.py b/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in9_V2.py new file mode 100644 index 0000000..f634c05 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/lib/TP_lib/epd2in9_V2.py @@ -0,0 +1,586 @@ +# ***************************************************************************** +# * | File : epd2in9_V2.py +# * | Author : Waveshare team +# * | Function : Electronic paper driver +# * | Info : +# *---------------- +# * | This version: V1.0 +# * | Date : 2020-10-20 +# # | Info : python demo +# ----------------------------------------------------------------------------- +# 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. +# + +import logging +from . import epdconfig +import numpy as np + +# Display resolution +EPD_WIDTH = 128 +EPD_HEIGHT = 296 + +class EPD_2IN9_V2: + def __init__(self): + self.reset_pin = epdconfig.EPD_RST_PIN + self.dc_pin = epdconfig.EPD_DC_PIN + self.busy_pin = epdconfig.EPD_BUSY_PIN + self.cs_pin = epdconfig.EPD_CS_PIN + self.width = EPD_WIDTH + self.height = EPD_HEIGHT + epdconfig.address = 0x48 + + WF_PARTIAL_2IN9 = [ + 0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0A,0x0,0x0,0x0,0x0,0x0,0x0, + 0x1,0x0,0x0,0x0,0x0,0x0,0x0, + 0x1,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0, + 0x22,0x17,0x41,0xB0,0x32,0x36, + ] + + WF_PARTIAL_2IN9_Wait = [ + 0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0A,0x0,0x0,0x0,0x0,0x0,0x2, + 0x1,0x0,0x0,0x0,0x0,0x0,0x0, + 0x1,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0, + 0x22,0x17,0x41,0xB0,0x32,0x36, + ] + + Gray4 = [ + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x28, 0x60, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2A, 0x60, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x05, 0x14, 0x00, 0x00, + 0x1E, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x02, 0x00, 0x05, 0x14, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x24, 0x22, 0x22, 0x22, 0x23, 0x32, 0x00, 0x00, 0x00, + 0x22, 0x17, 0x41, 0xAE, 0x32, 0x28, + ] + + WF_FULL = [ + 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x19, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x24, 0x42, 0x22, 0x22, 0x23, 0x32, 0x00, 0x00, 0x00, + 0x22, 0x17, 0x41, 0xAE, 0x32, 0x38] + + # Hardware reset + def reset(self): + epdconfig.digital_write(self.reset_pin, 1) + epdconfig.delay_ms(20) + epdconfig.digital_write(self.reset_pin, 0) + epdconfig.delay_ms(2) + epdconfig.digital_write(self.reset_pin, 1) + epdconfig.delay_ms(20) + + def send_command(self, command): + epdconfig.digital_write(self.dc_pin, 0) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte([command]) + epdconfig.digital_write(self.cs_pin, 1) + + def send_data(self, data): + epdconfig.digital_write(self.dc_pin, 1) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte([data]) + epdconfig.digital_write(self.cs_pin, 1) + + def send_data2(self, data): + epdconfig.digital_write(self.dc_pin, 1) + epdconfig.digital_write(self.cs_pin, 0) + epdconfig.spi_writebyte2(data) + epdconfig.digital_write(self.cs_pin, 1) + + def ReadBusy(self): + # logging.debug("e-Paper busy") + while(epdconfig.digital_read(self.busy_pin) == 1): # 0: idle, 1: busy + epdconfig.delay_ms(0.1) + # logging.debug("e-Paper busy release") + + def TurnOnDisplay(self): + self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2 + self.send_data(0xF7) + self.send_command(0x20) # MASTER_ACTIVATION + self.ReadBusy() + + def TurnOnDisplay_Partial(self): + self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2 + self.send_data(0x0F) + self.send_command(0x20) # MASTER_ACTIVATION + # self.ReadBusy() + + def TurnOnDisplay_Partial_Wait(self): + self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2 + self.send_data(0x0F) + self.send_command(0x20) # MASTER_ACTIVATION + self.ReadBusy() + + def TurnOnDisplay_4Gray(self): + self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2 + self.send_data(0xC7) + self.send_command(0x20) # MASTER_ACTIVATION + self.ReadBusy() + + def SendLut(self, lut): + self.send_command(0x32) + # for i in range(0, 153): + # self.send_data(self.WF_PARTIAL_2IN9[i]) + if(lut): + self.send_data2(self.WF_PARTIAL_2IN9) + else: + self.send_data2(self.WF_PARTIAL_2IN9_Wait) + self.ReadBusy() + + def lut(self, lut): + self.send_command(0x32) + for i in range(0, 153): + self.send_data(lut[i]) + self.ReadBusy() + + def SetLut(self, lut): + self.lut(lut) + self.send_command(0x3f) + self.send_data(lut[153]) + self.send_command(0x03); # gate voltage + self.send_data(lut[154]) + self.send_command(0x04); # source voltage + self.send_data(lut[155]) # VSH + self.send_data(lut[156]) # VSH2 + self.send_data(lut[157]) # VSL + self.send_command(0x2c); # VCOM + self.send_data(lut[158]) + + def SetWindow(self, x_start, y_start, x_end, y_end): + self.send_command(0x44) # SET_RAM_X_ADDRESS_START_END_POSITION + # x point must be the multiple of 8 or the last 3 bits will be ignored + self.send_data((x_start>>3) & 0xFF) + self.send_data((x_end>>3) & 0xFF) + self.send_command(0x45) # SET_RAM_Y_ADDRESS_START_END_POSITION + self.send_data(y_start & 0xFF) + self.send_data((y_start >> 8) & 0xFF) + self.send_data(y_end & 0xFF) + self.send_data((y_end >> 8) & 0xFF) + + def SetCursor(self, x, y): + self.send_command(0x4E) # SET_RAM_X_ADDRESS_COUNTER + # x point must be the multiple of 8 or the last 3 bits will be ignored + self.send_data(x & 0xFF) + + self.send_command(0x4F) # SET_RAM_Y_ADDRESS_COUNTER + self.send_data(y & 0xFF) + self.send_data((y >> 8) & 0xFF) + self.ReadBusy() + + def init(self): + if (epdconfig.module_init() != 0): + return -1 + # EPD hardware init start + self.reset() + + self.ReadBusy() + self.send_command(0x12) #SWRESET + self.ReadBusy() + + self.send_command(0x01) #Driver output control + self.send_data(0x27) + self.send_data(0x01) + self.send_data(0x00) + + self.send_command(0x11) #data entry mode + self.send_data(0x03) + + self.SetWindow(0, 0, self.width-1, self.height-1) + + self.send_command(0x21) # Display update control + self.send_data(0x00) + self.send_data(0x80) + + self.SetCursor(0, 0) + self.ReadBusy() + # EPD hardware init end + return 0 + + def init_Fast(self): + if (epdconfig.module_init() != 0): + return -1 + # EPD hardware init start + self.reset() + + self.ReadBusy() + self.send_command(0x12) #SWRESET + self.ReadBusy() + + self.send_command(0x01) #Driver output control + self.send_data(0x27) + self.send_data(0x01) + self.send_data(0x00) + + self.send_command(0x11) #data entry mode + self.send_data(0x03) + + self.SetWindow(0, 0, self.width-1, self.height-1) + + self.send_command(0x3C) + self.send_data(0x05) + + self.send_command(0x21) # Display update control + self.send_data(0x00) + self.send_data(0x80) + + self.SetCursor(0, 0) + self.ReadBusy() + + self.SetLut(self.WF_FULL) + # EPD hardware init end + return 0 + + def Init_4Gray(self): + if (epdconfig.module_init() != 0): + return -1 + self.reset() + epdconfig.delay_ms(100) + + self.ReadBusy() + self.send_command(0x12) #SWRESET + self.ReadBusy() + + self.send_command(0x01) #Driver output control + self.send_data(0x27) + self.send_data(0x01) + self.send_data(0x00) + + self.send_command(0x11) #data entry mode + self.send_data(0x03) + + self.SetWindow(8, 0, self.width, self.height-1) + + self.send_command(0x3C) + self.send_data(0x04) + + self.SetCursor(1, 0) + self.ReadBusy() + + self.SetLut(self.Gray4) + # EPD hardware init end + return 0 + + def getbuffer(self, image): + # logging.debug("bufsiz = ",int(self.width/8) * self.height) + buf = [0xFF] * (int(self.width/8) * self.height) + image_monocolor = image.convert('1') + imwidth, imheight = image_monocolor.size + pixels = image_monocolor.load() + # logging.debug("imwidth = %d, imheight = %d",imwidth,imheight) + if(imwidth == self.width and imheight == self.height): + # logging.debug("Vertical") + for y in range(imheight): + for x in range(imwidth): + # Set the bits for the column of pixels at the current position. + if pixels[x, y] == 0: + buf[int((x + y * self.width) / 8)] &= ~(0x80 >> (x % 8)) + elif(imwidth == self.height and imheight == self.width): + # logging.debug("Horizontal") + for y in range(imheight): + for x in range(imwidth): + newx = y + newy = self.height - x - 1 + if pixels[x, y] == 0: + buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8)) + return buf + + def getbuffer_4Gray(self, image): + # logger.debug("bufsiz = ",int(self.width/8) * self.height) + buf = [0xFF] * (int(self.width / 4) * self.height) + image_monocolor = image.convert('L') + imwidth, imheight = image_monocolor.size + pixels = image_monocolor.load() + i=0 + # logger.debug("imwidth = %d, imheight = %d",imwidth,imheight) + if(imwidth == self.width and imheight == self.height): + # logger.debug("Vertical") + for y in range(imheight): + for x in range(imwidth): + # Set the bits for the column of pixels at the current position. + if(pixels[x, y] == 0xC0): + pixels[x, y] = 0x80 + elif (pixels[x, y] == 0x80): + pixels[x, y] = 0x40 + i= i+1 + if(i%4 == 0): + buf[int((x + (y * self.width))/4)] = ((pixels[x-3, y]&0xc0) | (pixels[x-2, y]&0xc0)>>2 | (pixels[x-1, y]&0xc0)>>4 | (pixels[x, y]&0xc0)>>6) + + elif(imwidth == self.height and imheight == self.width): + # logger.debug("Horizontal") + for x in range(imwidth): + for y in range(imheight): + newx = y + newy = self.height - x - 1 + if(pixels[x, y] == 0xC0): + pixels[x, y] = 0x80 + elif (pixels[x, y] == 0x80): + pixels[x, y] = 0x40 + i= i+1 + if(i%4 == 0): + buf[int((newx + (newy * self.width))/4)] = ((pixels[x, y-3]&0xc0) | (pixels[x, y-2]&0xc0)>>2 | (pixels[x, y-1]&0xc0)>>4 | (pixels[x, y]&0xc0)>>6) + return buf + + def display(self, image): + if (image == None): + return + self.send_command(0x24) # WRITE_RAM + # for j in range(0, self.height): + # for i in range(0, int(self.width / 8)): + # self.send_data(image[i + j * int(self.width / 8)]) + self.send_data2(image) + self.TurnOnDisplay() + + def display_Base(self, image): + if (image == None): + return + + self.send_command(0x24) # WRITE_RAM + # for j in range(0, self.height): + # for i in range(0, int(self.width / 8)): + # self.send_data(image[i + j * int(self.width / 8)]) + self.send_data2(image) + + self.send_command(0x26) # WRITE_RAM + # for j in range(0, self.height): + # for i in range(0, int(self.width / 8)): + # self.send_data(image[i + j * int(self.width / 8)]) + self.send_data2(image) + + self.TurnOnDisplay() + + def display_Partial(self, image): + if (image == None): + return + + # epdconfig.digital_write(self.reset_pin, 0) + # epdconfig.delay_ms(2) + # epdconfig.digital_write(self.reset_pin, 1) + # epdconfig.delay_ms(2) + + self.SendLut(1) + self.send_command(0x37) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x40) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + + self.send_command(0x3C) #BorderWavefrom + self.send_data(0x80) + + self.send_command(0x22) + self.send_data(0xC0) + self.send_command(0x20) + self.ReadBusy() + + self.SetWindow(0, 0, self.width - 1, self.height - 1) + self.SetCursor(0, 0) + + self.send_command(0x24) # WRITE_RAM + # for j in range(0, self.height): + # for i in range(0, int(self.width / 8)): + # self.send_data(image[i + j * int(self.width / 8)]) + self.send_data2(image) + + self.TurnOnDisplay_Partial() + + def display_Partial_Wait(self, image): + if (image == None): + return + + epdconfig.digital_write(self.reset_pin, 0) + epdconfig.delay_ms(1) + epdconfig.digital_write(self.reset_pin, 1) + # epdconfig.delay_ms(2) + + self.SendLut(0) + self.send_command(0x37) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x40) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + self.send_data(0x00) + + self.send_command(0x3C) #BorderWavefrom + self.send_data(0x80) + + self.send_command(0x22) + self.send_data(0xC0) + self.send_command(0x20) + self.ReadBusy() + + self.SetWindow(0, 0, self.width - 1, self.height - 1) + self.SetCursor(0, 0) + + self.send_command(0x24) # WRITE_RAM + # for j in range(0, self.height): + # for i in range(0, int(self.width / 8)): + # self.send_data(image[i + j * int(self.width / 8)]) + self.send_data2(image) + + self.TurnOnDisplay_Partial_Wait() + + def Clear(self, color): + self.send_command(0x24) # WRITE_RAM + for j in range(0, self.height): + for i in range(0, int(self.width / 8)): + self.send_data(color) + self.TurnOnDisplay() + + def display_4Gray(self, image): + self.send_command(0x24) + for i in range(0, 4736): + temp3=0 + for j in range(0, 2): + temp1 = image[i*2+j] + for k in range(0, 2): + temp2 = temp1&0xC0 + if(temp2 == 0xC0): + temp3 |= 0x00 + elif(temp2 == 0x00): + temp3 |= 0x01 + elif(temp2 == 0x80): + temp3 |= 0x01 + else: #0x40 + temp3 |= 0x00 + temp3 <<= 1 + + temp1 <<= 2 + temp2 = temp1&0xC0 + if(temp2 == 0xC0): + temp3 |= 0x00 + elif(temp2 == 0x00): + temp3 |= 0x01 + elif(temp2 == 0x80): + temp3 |= 0x01 + else : #0x40 + temp3 |= 0x00 + if(j!=1 or k!=1): + temp3 <<= 1 + temp1 <<= 2 + self.send_data(temp3) + + self.send_command(0x26) + for i in range(0, 4736): + temp3=0 + for j in range(0, 2): + temp1 = image[i*2+j] + for k in range(0, 2): + temp2 = temp1&0xC0 + if(temp2 == 0xC0): + temp3 |= 0x00 + elif(temp2 == 0x00): + temp3 |= 0x01 + elif(temp2 == 0x80): + temp3 |= 0x00 + else: #0x40 + temp3 |= 0x01 + temp3 <<= 1 + + temp1 <<= 2 + temp2 = temp1&0xC0 + if(temp2 == 0xC0): + temp3 |= 0x00 + elif(temp2 == 0x00): + temp3 |= 0x01 + elif(temp2 == 0x80): + temp3 |= 0x00 + else: #0x40 + temp3 |= 0x01 + if(j!=1 or k!=1): + temp3 <<= 1 + temp1 <<= 2 + self.send_data(temp3) + + self.TurnOnDisplay_4Gray() + + def sleep(self): + self.send_command(0x10) # DEEP_SLEEP_MODE + self.send_data(0x01) + + def Dev_exit(self): + epdconfig.module_exit() +### END OF FILE ### + diff --git a/docs/Touch_e-Paper_Code/python/lib/TP_lib/epdconfig.py b/docs/Touch_e-Paper_Code/python/lib/TP_lib/epdconfig.py new file mode 100644 index 0000000..caaeb83 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/lib/TP_lib/epdconfig.py @@ -0,0 +1,140 @@ +# /***************************************************************************** +# * | File : epdconfig.py +# * | Author : Waveshare team +# * | Function : Hardware underlying interface +# * | Info : +# *---------------- +# * | This version: V1.0 +# * | Date : 2020-12-21 +# * | Info : +# ****************************************************************************** +# 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. +# + +import gpiozero +import time +from smbus import SMBus +import spidev +import ctypes +import logging + +# e-Paper +EPD_RST_PIN = 17 +EPD_DC_PIN = 25 +EPD_CS_PIN = 8 +EPD_BUSY_PIN = 24 + +# TP +TRST = 22 +INT = 27 + +spi = spidev.SpiDev(0, 0) +address = 0x0 +# address = 0x14 +# address = 0x48 +bus = SMBus(1) + + +GPIO_RST_PIN = gpiozero.LED(EPD_RST_PIN) +GPIO_DC_PIN = gpiozero.LED(EPD_DC_PIN) +# GPIO_CS_PIN = gpiozero.LED(EPD_CS_PIN) +GPIO_TRST = gpiozero.LED(TRST) + +GPIO_BUSY_PIN = gpiozero.Button(EPD_BUSY_PIN, pull_up = False) +GPIO_INT = gpiozero.Button(INT, pull_up = False) + + +def digital_write(pin, value): + if pin == EPD_RST_PIN: + if value: + GPIO_RST_PIN.on() + else: + GPIO_RST_PIN.off() + elif pin == EPD_DC_PIN: + if value: + GPIO_DC_PIN.on() + else: + GPIO_DC_PIN.off() + # elif pin == EPD_CS_PIN: + # if value: + # GPIO_CS_PIN.on() + # else: + # GPIO_CS_PIN.off() + elif pin == TRST: + if value: + GPIO_TRST.on() + else: + GPIO_TRST.off() + +def digital_read(pin): + if pin == EPD_BUSY_PIN: + return GPIO_BUSY_PIN.value + elif pin == INT: + return GPIO_INT.value + +def delay_ms(delaytime): + time.sleep(delaytime / 1000.0) + +def spi_writebyte(data): + spi.writebytes(data) + +def spi_writebyte2(data): + spi.writebytes2(data) + +def i2c_writebyte(reg, value): + bus.write_word_data(address, (reg>>8) & 0xff, (reg & 0xff) | ((value & 0xff) << 8)) + +def i2c_write(reg): + bus.write_byte_data(address, (reg>>8) & 0xff, reg & 0xff) + +def i2c_readbyte(reg, len): + i2c_write(reg) + rbuf = [] + for i in range(len): + rbuf.append(int(bus.read_byte(address))) + return rbuf + +def module_init(): + + spi.max_speed_hz = 10000000 + spi.mode = 0b00 + + return 0 + +def module_exit(): + logging.debug("spi end") + spi.close() + bus.close() + + logging.debug("close 5V, Module enters 0 power consumption ...") + GPIO_RST_PIN.off() + GPIO_DC_PIN.off() + # GPIO_CS_PIN.off() + GPIO_TRST.off() + + GPIO_RST_PIN.close() + GPIO_DC_PIN.close() + # GPIO_CS_PIN.close() + GPIO_TRST.close() + + GPIO_BUSY_PIN.close() + GPIO_INT.close() + + +### END OF FILE ### diff --git a/docs/Touch_e-Paper_Code/python/lib/TP_lib/gt1151.py b/docs/Touch_e-Paper_Code/python/lib/TP_lib/gt1151.py new file mode 100644 index 0000000..cd86606 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/lib/TP_lib/gt1151.py @@ -0,0 +1,84 @@ +import logging +from . import epdconfig as config + +class GT_Development: + def __init__(self): + self.Touch = 0 + self.TouchpointFlag = 0 + self.TouchCount = 0 + self.Touchkeytrackid = [0, 1, 2, 3, 4] + self.X = [0, 1, 2, 3, 4] + self.Y = [0, 1, 2, 3, 4] + self.S = [0, 1, 2, 3, 4] + +class GT1151: + def __init__(self): + # e-Paper + self.ERST = config.EPD_RST_PIN + self.DC = config.EPD_DC_PIN + self.CS = config.EPD_CS_PIN + self.BUSY = config.EPD_BUSY_PIN + # TP + self.TRST = config.TRST + self.INT = config.INT + + def digital_read(self, pin): + return config.digital_read(pin) + + def GT_Reset(self): + config.digital_write(self.TRST, 1) + config.delay_ms(100) + config.digital_write(self.TRST, 0) + config.delay_ms(100) + config.digital_write(self.TRST, 1) + config.delay_ms(100) + + def GT_Write(self, Reg, Data): + config.i2c_writebyte(Reg, Data) + + def GT_Read(self, Reg, len): + return config.i2c_readbyte(Reg, len) + + def GT_ReadVersion(self): + buf = self.GT_Read(0x8140, 4) + print(buf) + + def GT_Init(self): + self.GT_Reset() + self.GT_ReadVersion() + + def GT_Scan(self, GT_Dev, GT_Old): + buf = [] + mask = 0x00 + + if(GT_Dev.Touch == 1): + GT_Dev.Touch = 0 + buf = self.GT_Read(0x814E, 1) + + if(buf[0]&0x80 == 0x00): + self.GT_Write(0x814E, mask) + config.delay_ms(10) + + else: + GT_Dev.TouchpointFlag = buf[0]&0x80 + GT_Dev.TouchCount = buf[0]&0x0f + + if(GT_Dev.TouchCount > 5 or GT_Dev.TouchCount < 1): + self.GT_Write(0x814E, mask) + return + + buf = self.GT_Read(0x814F, GT_Dev.TouchCount*8) + self.GT_Write(0x814E, mask) + + GT_Old.X[0] = GT_Dev.X[0]; + GT_Old.Y[0] = GT_Dev.Y[0]; + GT_Old.S[0] = GT_Dev.S[0]; + + for i in range(0, GT_Dev.TouchCount, 1): + GT_Dev.Touchkeytrackid[i] = buf[0 + 8*i] + GT_Dev.X[i] = (buf[2 + 8*i] << 8) + buf[1 + 8*i] + GT_Dev.Y[i] = (buf[4 + 8*i] << 8) + buf[3 + 8*i] + GT_Dev.S[i] = (buf[6 + 8*i] << 8) + buf[5 + 8*i] + + print(GT_Dev.X[0], GT_Dev.Y[0], GT_Dev.S[0]) + \ No newline at end of file diff --git a/docs/Touch_e-Paper_Code/python/lib/TP_lib/icnt86.py b/docs/Touch_e-Paper_Code/python/lib/TP_lib/icnt86.py new file mode 100644 index 0000000..349eb05 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/lib/TP_lib/icnt86.py @@ -0,0 +1,89 @@ +import logging +from . import epdconfig as config + +class ICNT_Development: + def __init__(self): + self.Touch = 0 + self.TouchGestureid = 0 + self.TouchCount = 0 + + self.TouchEvenid = [0, 1, 2, 3, 4] + self.X = [0, 1, 2, 3, 4] + self.Y = [0, 1, 2, 3, 4] + self.P = [0, 1, 2, 3, 4] + +class INCT86: + def __init__(self): + # e-Paper + self.ERST = config.EPD_RST_PIN + self.DC = config.EPD_DC_PIN + self.CS = config.EPD_CS_PIN + self.BUSY = config.EPD_BUSY_PIN + # TP + self.TRST = config.TRST + self.INT = config.INT + + def digital_read(self, pin): + return config.digital_read(pin) + + def ICNT_Reset(self): + config.digital_write(self.TRST, 1) + config.delay_ms(100) + config.digital_write(self.TRST, 0) + config.delay_ms(100) + config.digital_write(self.TRST, 1) + config.delay_ms(100) + + def ICNT_Write(self, Reg, Data): + config.i2c_writebyte(Reg, Data) + + def ICNT_Read(self, Reg, len): + return config.i2c_readbyte(Reg, len) + + def ICNT_ReadVersion(self): + buf = self.ICNT_Read(0x000a, 4) + print(buf) + + def ICNT_Init(self): + self.ICNT_Reset() + self.ICNT_ReadVersion() + + def ICNT_Scan(self, ICNT_Dev, ICNT_Old): + buf = [] + mask = 0x00 + + if(ICNT_Dev.Touch == 1): + # ICNT_Dev.Touch = 0 + buf = self.ICNT_Read(0x1001, 1) + + if(buf[0] == 0x00): + self.ICNT_Write(0x1001, mask) + config.delay_ms(1) + # print("buffers status is 0") + return + else: + ICNT_Dev.TouchCount = buf[0] + + if(ICNT_Dev.TouchCount > 5 or ICNT_Dev.TouchCount < 1): + self.ICNT_Write(0x1001, mask) + ICNT_Dev.TouchCount = 0 + # print("TouchCount number is wrong") + return + + buf = self.ICNT_Read(0x1002, ICNT_Dev.TouchCount*7) + self.ICNT_Write(0x1001, mask) + + ICNT_Old.X[0] = ICNT_Dev.X[0]; + ICNT_Old.Y[0] = ICNT_Dev.Y[0]; + ICNT_Old.P[0] = ICNT_Dev.P[0]; + + for i in range(0, ICNT_Dev.TouchCount, 1): + ICNT_Dev.TouchEvenid[i] = buf[6 + 7*i] + ICNT_Dev.X[i] = 295 - ((buf[2 + 7*i] << 8) + buf[1 + 7*i]) + ICNT_Dev.Y[i] = 127 - ((buf[4 + 7*i] << 8) + buf[3 + 7*i]) + ICNT_Dev.P[i] = buf[5 + 7*i] + + print(ICNT_Dev.X[0], ICNT_Dev.Y[0], ICNT_Dev.P[0]) + return + return + \ No newline at end of file diff --git a/docs/Touch_e-Paper_Code/python/lib/TP_lib/weather_2in9_V2.py b/docs/Touch_e-Paper_Code/python/lib/TP_lib/weather_2in9_V2.py new file mode 100644 index 0000000..56ce90b --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/lib/TP_lib/weather_2in9_V2.py @@ -0,0 +1,261 @@ +# This little program is for the Waveshare 2.9 +# inch Version 2 black and white only epaper display +# It uses OpenWeatherMap API to display weather info +import sys +import os +picdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../pic/2in9') +icondir = os.path.join(picdir, 'icon') +fontdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../pic') + +# Search lib folder for display driver modules +sys.path.append('lib') +from . import epd2in9_V2 +epd = epd2in9_V2.EPD_2IN9_V2() + +from datetime import datetime +import time +from PIL import Image,ImageDraw,ImageFont +import traceback + +import requests, json +from io import BytesIO +import csv + +# define funciton for writing image and sleeping for 5 min. +def write_to_screen(image, sleep_seconds): + print('Writing to screen.') + # Write to screen + h_image = Image.new('1', (epd.height, epd.width), 255) + # Open the template + screen_output_file = Image.open(os.path.join(picdir, image)) + # Initialize the drawing context with template as background + h_image.paste(screen_output_file, (0, 0)) + epd.display(epd.getbuffer(h_image)) + # Sleep + print('Sleeping for ' + str(sleep_seconds) +'.') + time.sleep(sleep_seconds) + +# define function for displaying error +def display_error(error_source): + # Display an error + print('Error in the', error_source, 'request.') + # Initialize drawing + error_image = Image.new('1', (epd.height, epd.width), 255) + # Initialize the drawing + draw = ImageDraw.Draw(error_image) + draw.text((5, 5), error_source +' ERROR', font=font20, fill=black) + draw.text((5, 30), 'Retrying in 30 seconds', font=font20, fill=black) + current_time = datetime.now().strftime('%H:%M') + draw.text((5, 55), 'Last Refresh: ' + str(current_time), font = font20, fill=black) + # Save the error image + error_image_file = 'error.png' + error_image.save(os.path.join(picdir, error_image_file)) + # Close error image + error_image.close() + # Write error to screen + write_to_screen(error_image_file, 30) + +# Set the fonts +font12 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 12) +font16 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 16) +font20 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 20) +font24 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 24) +font30 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 30) +font35 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 35) +font50 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 50) +font60 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 60) +font100 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 100) +font160 = ImageFont.truetype(os.path.join(fontdir, 'Font.ttc'), 160) + +# Set the special fonts +font18_Roboto_Bold = ImageFont.truetype(os.path.join(fontdir, 'Roboto-Bold.ttf'), 18) +font20_Roboto_Bold = ImageFont.truetype(os.path.join(fontdir, 'Roboto-Bold.ttf'), 20) +font20_Roboto_Regular = ImageFont.truetype(os.path.join(fontdir, 'Roboto-Regular.ttf'), 20) +font34_Roboto_Black = ImageFont.truetype(os.path.join(fontdir, 'Roboto-Black.ttf'), 34) + +# Set the colors +black = 'rgb(0,0,0)' +white = 'rgb(255,255,255)' +grey = 'rgb(235,235,235)' + +# Initialize and clear screen +# print('Initializing and clearing screen.') +# epd.init() +# epd.Clear() + +# I provide my API_KEY for you to test: 82ec63bb0530e31e0ef9042786d195cc, Please try to use your own API_KEY +API_KEY = '******API KEY*******' +LOCATION = 'Shenzhen' +LATITUDE = '22.543097' +LONGITUDE = '114.057861' +UNITS = 'imperial' +CSV_OPTION = False # if csv_option == True, a weather data will be appended to 'record.csv' + +BASE_URL = 'http://api.openweathermap.org/data/2.5/onecall?' +URL = BASE_URL + 'lat=' + LATITUDE + '&lon=' + LONGITUDE + '&units=' + UNITS +'&appid=' + API_KEY + +def get_weather_png(): + # Ensure there are no errors with connection + error_connect = True + while error_connect == True: + try: + # HTTP request + print('Attempting to connect to OWM.') + response = requests.get(URL) + print('Connection to OWM successful.') + error_connect = None + except: + # Call function to display connection error + print('Connection error.') + display_error('CONNECTION') + + error = None + while error == None: + # Check status of code request + if response.status_code == 200: + print('Connection to Open Weather successful.') + # get data in jason format + data = response.json() + + # get current dict block + current = data['current'] + # get current + temp_current = current['temp'] + # get feels like + feels_like = current['feels_like'] + # get humidity + humidity = current['humidity'] + # get pressure + wind = current['wind_speed'] + # get description + weather = current['weather'] + report = weather[0]['description'] + # get icon url + icon_code = weather[0]['icon'] + #icon_URL = 'http://openweathermap.org/img/wn/'+ icon_code +'@4x.png' + + # get daily dict block + daily = data['daily'] + # get daily precip + daily_precip_float = daily[0]['pop'] + #format daily precip + daily_precip_percent = daily_precip_float * 100 + # get min and max temp + daily_temp = daily[0]['temp'] + temp_max = daily_temp['max'] + temp_min = daily_temp['min'] + + # Append weather data to CSV if csv_option == True + if CSV_OPTION == True: + # Get current year, month, date, and time + current_year = datetime.now().strftime('%Y') + current_month = datetime.now().strftime('%m') + current_date = datetime.now().strftime('%d') + current_time = datetime.now().strftime('%H:%M') + #open the CSV and append weather data + with open('records.csv', 'a', newline='') as csv_file: + writer = csv.writer(csv_file, delimiter=',') + writer.writerow([current_year, current_month, current_date, current_time, + LOCATION,temp_current, feels_like, temp_max, temp_min, + humidity, daily_precip_float, wind]) + print('Weather data appended to CSV.') + + # Set strings to be printed to screen + string_location = 'City: ' + LOCATION + string_temp_current = format(temp_current, '.0f') + u'\N{DEGREE SIGN}F' + string_temp_current_C = format((temp_current-32)/1.8, '.0f') + u'\N{DEGREE SIGN}C' + string_temp = string_temp_current + ' / ' + string_temp_current_C + string_feels_like = 'Feels like: ' + format(feels_like, '.0f') + u'\N{DEGREE SIGN}F' + string_humidity = 'Humidity: ' + str(humidity) + '%' + string_wind = 'Wind: ' + format(wind, '.1f') + ' MPH' + # string_report = 'Now: ' + report.title() + string_report = report.title() + string_temp_max = 'High: ' + format(temp_max, '>.0f') + u'\N{DEGREE SIGN}F' + string_temp_min = 'Low: ' + format(temp_min, '>.0f') + u'\N{DEGREE SIGN}F' + string_precip_percent = 'Precip: ' + str(format(daily_precip_percent, '.0f')) + '%' + + # Set error code to false + error = False + + ''' + print('Location:', LOCATION) + print('Temperature:', format(temp_current, '.0f'), u'\N{DEGREE SIGN}F') + print('Feels Like:', format(feels_like, '.0f'), 'F') + print('Humidity:', humidity) + print('Wind Speed:', format(wind_speed, '.1f'), 'MPH') + print('Report:', report.title()) + + print('High:', format(temp_max, '.0f'), 'F') + print('Low:', format(temp_min, '.0f'), 'F') + print('Probabilty of Precipitation: ' + str(format(daily_precip_percent, '.0f')) + '%') + ''' + else: + # Call function to display HTTP error + display_error('HTTP') + + # Open template file + template = Image.open(os.path.join(picdir, 'template.bmp')) + # Initialize the drawing context with template as background + draw = ImageDraw.Draw(template) + + draw.rectangle((0, 0, 295, 67), fill=white) + + # Draw top left box + ## Open icon file + icon_file = icon_code + '.png' + icon_image = Image.open(os.path.join(icondir, icon_file)) + icon_image_resize = icon_image.resize((68, 68)) + + ### Paste the image + template.paste(icon_image_resize, (0, 0)) + ## Place a black rectangle outline + # draw.rectangle((15, 5, 80, 60), outline=black) + ## Draw text + font_report = font20_Roboto_Bold + font_report_size = 20 + while(font_report.getsize(string_report)[0] > 120): + font_report_size -= 2 + font_report = ImageFont.truetype(os.path.join(fontdir, 'Roboto-Bold.ttf'), font_report_size) + draw.text((70, 12), string_report, font=font_report, fill=black) + draw.text((70, 34), string_precip_percent, font=font20_Roboto_Bold, fill=black) + + # Draw top right box + draw.text((12, 72), string_temp, font=font18_Roboto_Bold, fill=white) + # draw.text((60, 30), string_feels_like, font=font20, fill=white) + + # Draw bottom left box + # draw.text((15, 85), string_temp_max, font=font20, fill=black) + # draw.rectangle((15, 108, 265, 110), fill=black) + # draw.text((15, 105), string_temp_min, font=font20, fill=black) + + # Draw bottom middle box + # draw.text((120, 85), string_humidity, font=font20, fill=black) + # draw.text((120, 105), string_wind, font=font20, fill=black) + + # Draw bottom right box + draw.text((295-11-font20_Roboto_Regular.getsize('UPDATED')[0], 7), 'UPDATED', font=font20_Roboto_Regular, fill=black, align='right') + current_time = datetime.now().strftime('%H:%M') + draw.text((295-11-font34_Roboto_Black.getsize(current_time)[0], 25), current_time, font = font34_Roboto_Black, fill=black, align='right') + # draw.rectangle((193, 35, 288, 85), outline=black) + + draw.text((295-11-font18_Roboto_Bold.getsize(string_location)[0], 72), string_location, font = font18_Roboto_Bold, fill=white, align='right') + + ## Add a reminder to take out trash on Mon and Thurs + # weekday = datetime.today().weekday() + # if weekday == 0 or weekday == 3: + # draw.rectangle((345, 13, 705, 55), fill =black) + # draw.text((355, 15), 'TAKE OUT TRASH TODAY!', font=font18, fill=white) + + # Save the image for display as PNG + screen_output_file = os.path.join(picdir, 'screen_output.png') + template.save(screen_output_file) + # Close the template file + template.close() + + # Refresh clear screen to avoid burn-in at 3:00 AM + # if datetime.now().strftime('%H') == '03': + # print('Clearning screen to avoid burn-in.') + # epd.Clear() + + # Write to screen + # write_to_screen(screen_output_file, 600) diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Menu.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Menu.bmp new file mode 100644 index 0000000..f0de0bb Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Menu.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1.bmp new file mode 100644 index 0000000..343720f Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_0.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_0.bmp new file mode 100644 index 0000000..146e514 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_0.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_1.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_1.bmp new file mode 100644 index 0000000..c5f8c53 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_2.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_2.bmp new file mode 100644 index 0000000..11f2bea Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_3.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_3.bmp new file mode 100644 index 0000000..7d73550 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_3.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_4.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_4.bmp new file mode 100644 index 0000000..6b0e32f Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_4.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_5.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_5.bmp new file mode 100644 index 0000000..8ed57ff Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_5.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_6.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_6.bmp new file mode 100644 index 0000000..0ba4f3a Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_1_6.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2.bmp new file mode 100644 index 0000000..5a4ca53 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_0.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_0.bmp new file mode 100644 index 0000000..ff64e4d Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_0.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_1.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_1.bmp new file mode 100644 index 0000000..b2765ee Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_2.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_2.bmp new file mode 100644 index 0000000..5a7917e Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_3.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_3.bmp new file mode 100644 index 0000000..1b46b3b Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_3.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_4.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_4.bmp new file mode 100644 index 0000000..749976c Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_4.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_5.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_5.bmp new file mode 100644 index 0000000..4ccd98e Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_5.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_6.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_6.bmp new file mode 100644 index 0000000..3481b17 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/Photo_2_6.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in13/White_board.bmp b/docs/Touch_e-Paper_Code/python/pic/2in13/White_board.bmp new file mode 100644 index 0000000..b3f9d70 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in13/White_board.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/2in9_Scale.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/2in9_Scale.bmp new file mode 100644 index 0000000..55a9bd9 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/2in9_Scale.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Menu.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Menu.bmp new file mode 100644 index 0000000..7f9b70a Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Menu.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1.bmp new file mode 100644 index 0000000..e12fd59 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_0.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_0.bmp new file mode 100644 index 0000000..adb1519 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_0.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_1.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_1.bmp new file mode 100644 index 0000000..b283c56 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_2.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_2.bmp new file mode 100644 index 0000000..7323a21 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_3.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_3.bmp new file mode 100644 index 0000000..3cb9b7a Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_3.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_4.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_4.bmp new file mode 100644 index 0000000..e837d1d Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_4.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_5.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_5.bmp new file mode 100644 index 0000000..4b01428 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_5.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_6.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_6.bmp new file mode 100644 index 0000000..ac3fcec Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_6.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_7.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_7.bmp new file mode 100644 index 0000000..8962758 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_7.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_8.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_8.bmp new file mode 100644 index 0000000..c4062fd Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_8.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_9.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_9.bmp new file mode 100644 index 0000000..9d14405 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_1_9.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2.bmp new file mode 100644 index 0000000..ec3b577 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_0.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_0.bmp new file mode 100644 index 0000000..2bd14a2 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_0.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_1.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_1.bmp new file mode 100644 index 0000000..d625691 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_1.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_2.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_2.bmp new file mode 100644 index 0000000..513628f Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_2.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_3.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_3.bmp new file mode 100644 index 0000000..4fbe5a4 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_3.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_4.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_4.bmp new file mode 100644 index 0000000..0ca5f74 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_4.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_5.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_5.bmp new file mode 100644 index 0000000..62b1f83 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_5.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_6.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_6.bmp new file mode 100644 index 0000000..162d06e Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_6.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_7.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_7.bmp new file mode 100644 index 0000000..1c6ae04 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_7.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_8.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_8.bmp new file mode 100644 index 0000000..7c55edc Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_8.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_9.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_9.bmp new file mode 100644 index 0000000..7ba9fe4 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/Photo_2_9.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/White_board.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/White_board.bmp new file mode 100644 index 0000000..20e550c Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/White_board.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/error.png b/docs/Touch_e-Paper_Code/python/pic/2in9/error.png new file mode 100644 index 0000000..1b8d746 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/error.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/01d.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/01d.png new file mode 100644 index 0000000..df542d3 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/01d.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/01n.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/01n.png new file mode 100644 index 0000000..6151d3b Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/01n.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/02d.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/02d.png new file mode 100644 index 0000000..f00acc6 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/02d.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/02n.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/02n.png new file mode 100644 index 0000000..fd1bcb4 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/02n.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/03d.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/03d.png new file mode 100644 index 0000000..a47f89a Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/03d.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/03n.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/03n.png new file mode 100644 index 0000000..91776b4 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/03n.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/04d.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/04d.png new file mode 100644 index 0000000..6f18e29 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/04d.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/04n.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/04n.png new file mode 100644 index 0000000..6f18e29 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/04n.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/09d.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/09d.png new file mode 100644 index 0000000..5c89d1f Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/09d.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/09n.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/09n.png new file mode 100644 index 0000000..142e8e5 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/09n.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/10d.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/10d.png new file mode 100644 index 0000000..3f6963a Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/10d.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/10n.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/10n.png new file mode 100644 index 0000000..512ede4 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/10n.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/11d.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/11d.png new file mode 100644 index 0000000..92bd108 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/11d.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/11n.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/11n.png new file mode 100644 index 0000000..f721b6e Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/11n.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/13d.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/13d.png new file mode 100644 index 0000000..4a63099 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/13d.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/13n.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/13n.png new file mode 100644 index 0000000..51ad3ea Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/13n.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/50d.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/50d.png new file mode 100644 index 0000000..9b1b772 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/50d.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/icon/50n.png b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/50n.png new file mode 100644 index 0000000..0e389bc Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/icon/50n.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/screen_output.png b/docs/Touch_e-Paper_Code/python/pic/2in9/screen_output.png new file mode 100644 index 0000000..b89d865 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/screen_output.png differ diff --git a/docs/Touch_e-Paper_Code/python/pic/2in9/template.bmp b/docs/Touch_e-Paper_Code/python/pic/2in9/template.bmp new file mode 100644 index 0000000..417192f Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/2in9/template.bmp differ diff --git a/docs/Touch_e-Paper_Code/python/pic/Font.ttc b/docs/Touch_e-Paper_Code/python/pic/Font.ttc new file mode 100644 index 0000000..4cbb7c5 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/Font.ttc differ diff --git a/docs/Touch_e-Paper_Code/python/pic/Roboto-Black.ttf b/docs/Touch_e-Paper_Code/python/pic/Roboto-Black.ttf new file mode 100644 index 0000000..2d45238 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/Roboto-Black.ttf differ diff --git a/docs/Touch_e-Paper_Code/python/pic/Roboto-Bold.ttf b/docs/Touch_e-Paper_Code/python/pic/Roboto-Bold.ttf new file mode 100644 index 0000000..d998cf5 Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/Roboto-Bold.ttf differ diff --git a/docs/Touch_e-Paper_Code/python/pic/Roboto-Regular.ttf b/docs/Touch_e-Paper_Code/python/pic/Roboto-Regular.ttf new file mode 100644 index 0000000..2b6392f Binary files /dev/null and b/docs/Touch_e-Paper_Code/python/pic/Roboto-Regular.ttf differ diff --git a/docs/Touch_e-Paper_Code/python/readme_CN.txt b/docs/Touch_e-Paper_Code/python/readme_CN.txt new file mode 100644 index 0000000..60c8237 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/readme_CN.txt @@ -0,0 +1,59 @@ +/***************************************************************************** +* | File : Readme_CN.txt +* | Author : Waveshare team +* | Function : Help with use +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2021-06-05 +* | Info : 在这里提供一个中文版本的使用文档,以便你的快速使用 +******************************************************************************/ +这个文件是帮助您使用本例程。 +在这里简略的描述本工程的使用: + +1.基本信息: +本例程使用 xxxinch e-Paper HAT 模块 在 Raspbe Pi 4B 进行了验证,你可以在工程的examples\中查看对应的测试例程; + +2.管脚连接: +管脚连接你可以在\lib\epdconfig.py中查看,这里也再重述一次: +EPD => Jetson Nano/RPI(BCM) +VCC -> 3.3 +GND -> GND +DIN -> 10(SPI0_MOSI) +CLK -> 11(SPI0_SCK) +CS -> 8(SPI0_CS0) +DC -> 25 +ERST -> 17 +BUSY -> 24 +INT -> 27 +TRST -> 22 +SDA -> SDA1 +SCL -> SCL1 + +3.安装库: +python2 + sudo apt-get update + sudo apt-get install python-pip + sudo apt-get install python-pil + sudo apt-get install python-numpy + sudo pip install RPi.GPIO + sudo pip install spidev + +python3 + sudo apt-get update + sudo apt-get install python3-pip + sudo apt-get install python3-pil + sudo apt-get install python3-numpy + sudo pip3 install RPi.GPIO + sudo pip3 install spidev + +4.基本使用: +由于本工程是一个综合工程,对于使用而言,你可能需要阅读以下内容: +你可以在main.c中看到已经进行了注释的函数, +请注意你购买的是哪一款的墨水屏。 +栗子1: + 如果你购买的 2.9inch Touch e-Paper HAT,那么你应该执行命令: + sudo python TP2in9_test.py + 或 + sudo python3 TP2in9_test.py + diff --git a/docs/Touch_e-Paper_Code/python/readme_EN.txt b/docs/Touch_e-Paper_Code/python/readme_EN.txt new file mode 100644 index 0000000..598a5a6 --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/readme_EN.txt @@ -0,0 +1,60 @@ +/***************************************************************************** +* | File : Readme_CN.txt +* | Author : Waveshare team +* | Function : Help with use +* | Info : +*---------------- +* | This version: V1.0 +* | Date : 2021-06-05 +* | Info : Here is an English version of the documentation for your quick use. +******************************************************************************/ +This file is to help you use this Demo. +A brief description of the use of this project is here: + +1. Basic information: +This routine was verified on Raspbe Pi 4B using the XXXinch e-paper HAT module. +You can view the corresponding test routines in the \lib\Examples\ of the project. + +2. Pin connection: +Pin connections can be viewed in \lib\epdconfig.py and will be repeated here: +EPD => Jetson Nano/RPI(BCM) +VCC -> 3.3 +GND -> GND +DIN -> 10(SPI0_MOSI) +CLK -> 11(SPI0_SCK) +CS -> 8(SPI0_CS0) +DC -> 25 +ERST -> 17 +BUSY -> 24 +INT -> 27 +TRST -> 22 +SDA -> SDA1 +SCL -> SCL1 + +3.Installation library +python2 + sudo apt-get update + sudo apt-get install python-pip + sudo apt-get install python-pil + sudo apt-get install python-numpy + sudo pip install RPi.GPIO + sudo pip install spidev + +python3 + sudo apt-get update + sudo apt-get install python3-pip + sudo apt-get install python3-pil + sudo apt-get install python3-numpy + sudo pip3 install RPi.GPIO + sudo pip3 install spidev + +4. Basic use: +Since this project is a comprehensive project, you may need to read the following for use: +You can view the test program in the examples\ directory. +Please note which ink screen you purchased. +Chestnut 1: +    If you purchased 2.9inch Touch e-Paper HAT, then you should execute the command: + sudo python TP2in9_test.py + or + sudo python3 TP2in9_test.py + diff --git a/docs/Touch_e-Paper_Code/python/setup.py b/docs/Touch_e-Paper_Code/python/setup.py new file mode 100644 index 0000000..02fdd4b --- /dev/null +++ b/docs/Touch_e-Paper_Code/python/setup.py @@ -0,0 +1,10 @@ +import sys +from setuptools import setup +setup( + name='waveshare-ETP', + description='Waveshare e-Paper Touch Display', + author='Waveshare', + package_dir={'': 'lib'}, + packages=['TP_lib'], +) + diff --git a/touch_i2c_cap.csv b/touch_i2c_cap.csv new file mode 100644 index 0000000..e890ac4 --- /dev/null +++ b/touch_i2c_cap.csv @@ -0,0 +1,4 @@ +name,type,start_time,duration,"ack","address","read" +"I2C","start",0,0.0000001,,, +"I2C","address",0.0619353,0.0001884,false,0x14,false +"I2C","stop",0.0621445,0.0000001,,, diff --git a/waveshare-test.yaml b/waveshare-test.yaml index 15407dc..3fa8af0 100644 --- a/waveshare-test.yaml +++ b/waveshare-test.yaml @@ -17,6 +17,8 @@ # |Display RST |GPIO5 |Pin11/GPIO17/SPI1_CE1 |Orange | # |Touch SDA |GPIO21 |Pin3/GPIO2/I2C1_SDA |Gray | # |Touch SCL |GPIO22 |Pin5/GPIO3/I2C1_SCL |Purple | +# |Touch RST |GPIO15 |Pin13/GPIO27 |Blue | +# |Touch INT |GPIO16 |Pin15/GPIO22 |White | # # Exposed Entities # --- @@ -64,10 +66,26 @@ spi: # For the touchscreen i2c: + id: i2c_bus sda: GPIO21 scl: GPIO22 scan: false - + +touchscreen: + platform: icnt86x + id: touchscreen0 + address: 0x48 + reset_pin: GPIO15 + update_interval: 50ms + calibration: + x_min: 0 + x_max: 295 + y_min: 0 + y_max: 127 + transform: + mirror_x: true + mirror_y: true + ### Okay, now the Good Stuff ### # Load some fonts for the display renderer (we don't neeed these with LVGL) @@ -106,7 +124,7 @@ binary_sensor: inverted: true id: boot_button internal: true - on_press: + on_click: then: - component.update: lvgl0 - delay: 1s @@ -132,6 +150,8 @@ lvgl: - id: lvgl0 displays: - display0 + touchscreens: + - touchscreen0 # on_draw_end: # - component.update: display0 bg_color: 0xFFFFFF @@ -154,12 +174,14 @@ lvgl: bg_color: 0xFFFFFF widgets: - label: - text: 'Test 2bpp 1532' + text: 'Test 2bpp 1636' align: TOP_LEFT text_font: font1 - button: id: button0 align: TOP_RIGHT + on_click: + - logger.log: "button0 clicked (unlock)" widgets: - image: src: home_lock_open @@ -167,6 +189,8 @@ lvgl: - button: id: button1 align: BOTTOM_RIGHT + on_click: + - logger.log: "button1 clicked (lock)" widgets: - image: src: home_lock