Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
BasedOnStyle: Microsoft
AlignConsecutiveMacros: 'true'
MaxEmptyLinesToKeep: '2'
TabWidth: '4'
UseTab: Never
IncludeBlocks: Preserve
SortIncludes: false

...
58 changes: 58 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Compile Examples
on: [push]
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
include:
- board:
fqbn: soldered-inkplate-boards:esp32:Inkplate5V2
additional-sketch-paths: |
- examples/Inkplate5V2
- board:
fqbn: soldered-inkplate-boards:esp32:Inkplate6V2
additional-sketch-paths: |
- examples/Inkplate6
- board:
fqbn: soldered-inkplate-boards:esp32:Inkplate10V2
additional-sketch-paths: |
- examples/Inkplate10
- board:
fqbn: soldered-inkplate-boards:esp32:Inkplate6Flick
additional-sketch-paths: |
- examples/Inkplate6FLICK
- board:
fqbn: soldered-inkplate-boards:esp32:Inkplate6COLOR
additional-sketch-paths: |
- examples/Inkplate6COLOR
- board:
fqbn: soldered-inkplate-boards:esp32:Inkplate2
additional-sketch-paths: |
- examples/Inkplate2
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install ESP32 platform dependencies
run: pip3 install pyserial
- name: Compile examples
uses: arduino/compile-sketches@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
platforms: |
- source-url: https://github.com/SolderedElectronics/Inkplate-Board-Definitions-for-Arduino-IDE/raw/refs/heads/main/package_Inkplate_Boards_index.json
name: soldered-inkplate-boards:esp32

fqbn: ${{ matrix.board.fqbn }}
libraries: |
- source-path: ./
- name: ArduinoJson
- name: Time
- source-url: https://github.com/SolderedElectronics/Soldered-MFRC522-RFID-Reader-Arduino-Library.git
- source-url: https://github.com/SolderedElectronics/Soldered-WS2812-Smart-Leds-Arduino-Library.git
- source-url: https://github.com/SolderedElectronics/Soldered-BME280-BME680-Gas-Sensor-Arduino-Library.git
sketch-paths: |
${{ matrix.additional-sketch-paths }}
cli-compile-flags: |
- --warnings="default"
22 changes: 22 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run clang-format Linter

on: [push]

jobs:
format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: DoozyX/[email protected]
with:
source: "./src"
exclude: "./src/lvgl"
extensions: "h,cpp,ino"
clangFormatVersion: 20
inplace: True
- uses: EndBug/add-and-commit@v9
with:
author_name: Clang Robot
author_email: [email protected]
message: "Committing clang-format changes"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.DS_Store
100 changes: 98 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,98 @@
# Inkplate-LVGL-Library
An Arduino Library implementing the LVGL library for the Inkplate family of products
# Soldered Inkplate LVGL library

[![Compile Sketches](https://github.com/e-radionicacom/Inkplate-Arduino-library/actions/workflows/compile.yml/badge.svg?branch=master)](https://github.com/e-radionicacom/Inkplate-Arduino-library/actions/workflows/compile.yml)

<p align="center">
<img src="https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/master/extras/InkplateImage.jpg">
</p>

The Soldered Inkplate LVGL Library brings full LVGL support to the Soldered Inkplate family of e-paper displays.
It provides ready-to-use integrations for display control, touch input (where available), and file system (FS) access, so you can focus entirely on designing and implementing your user interface.
All necessary LVGL initialization is handled internally through the library’s begin() function — meaning you can start building your UI right away without worrying about setup details.
Below are the color formats used by each Inkplate model:

| Board | Color Format |
| --------------- | ------------ |
| Inkplate 2 | RGB565 |
| Inkplate 5V2 | L8 |
| Inkplate 6 | L8 |
| Inkplate 6Flick | L8 |
| Inkplate 6Color | RGB565 |
| Inkplate 10 | L8 |


### Setting up Inkplate in Arduino IDE

In order to get a head start with Inkplate (any), follow these steps:

1. [Install Inkplate board definition](https://github.com/SolderedElectronics/Inkplate-Board-Definitions-for-Arduino-IDE) - add Inkplate 2/5V2/6/6FLICK/6COLOR/10 as a board into your Arduino IDE.
2. If you aren't using macOS install CH340 drivers (in case you don't have them yet) - instructions [here](https://soldered.com/learn/ch340-driver-installation-croduino-basic3-nova2/)
3. Install Inkplate Arduino library - Install the library from the Arduino Library Manager (just type "Inkplate" and click "Install") or install it with this repo. If you don't know how, check our [tutorial](https://soldered.com/learn/arduino-library/#Kako%20instaliraty%20library?).
4. You are ready to get started! Select Tools -> Board -> Inkplate Boards and then pick correct one, as well as correct COM port and upload!

### Code examples

As this is currently a work in progress, only a small amount of examples are present, but more are coming very soon!

### Documentation

Find Inkplate documentation [here](https://soldered.com/documentation/inkplate/).

### Soldered Image Converter

In order to display an Image on Inkplate, you can use the Soldered Image Converter to convert from .png, .jpg, .bmp to .h files which can be easily added to your project. Download the latest release [here](https://github.com/SolderedElectronics/Soldered-Image-Converter/releases).


### Battery power

Inkplate boards has two options for powering it. First one is obvious - USB port at side of the board. Just plug any micro USB cable and you are good to go. Second option is battery. Supported batteries are standard Li-Ion/Li-Poly batteries with 3.7V nominal voltage. Connector for the battery is standard 2.00mm pitch JST connector (except on Inkplate 2, it uses SMD solder pads for battery terminals). The onboard charger will charge the battery with 500mA when USB is plugged at the same time. You can use battery of any size or capacity if you don't have a enclosure. If you are using our enclosure, battery size shouldn't exceed 90mm x 40mm (3.5 x 1.57 inch) and 5mm (0.19 inch) in height (excluding Inkplate 2, it uses [this battery](https://soldered.com/product/li-ion-baterija-600mah-3-7v/). [This battery](https://soldered.com/product/li-ion-battery-1200mah-3-7v/) is good fit for the Inkplate. Also, Inkplate's hardware is specially optimized for low power consumption in deep sleep mode, making it extremely suitable for battery applications.

#### ⚠️ WARNING
Please check the polarity on the battery JST connector! Some batteries that can be purchased from the web have reversed polarity that can damage Inkplate board! You are safe if you are using the pouch battery from [soldered.com](https://soldered.com/categories/power-sources-batteries/batteries/lithium-batteries/) or Inkplate with the built-in battery .

#### ℹ NOTE
CR2032 battery is only for RTC backup. Inkplate cannot be powered with it.

### Linux?

Running Linux? You'll need to run few other lines from your Terminal:

```
apt install python3-pip
pip3 install pyserial
apt install python-is-python3
```

In case you're getting an [error](https://github.com/SolderedElectronics/Inkplate-Arduino-library/issues/212) while trying to install pyserial, run the following command:

```
apt install python3-serial
```

### Open-source

All of Inkplate-related development is open-sourced:

- [Arduino library](https://github.com/SolderedElectronics/Inkplate-Arduino-library)
- Hardware design:
- [Soldered Inkplate 2](https://github.com/SolderedElectronics/Soldered-Inkplate-2-hardware-design)
- Soldered Inkplate 6 (comming soon!)
- Soldered Inkplate 6PLUS (comming soon!)
- [Soldered Inkplate 10](https://github.com/SolderedElectronics/Soldered-Inkplate-10-hardware-design)
- Soldered Inkplate 6COLOR (comming soon!)
- [e-radionica.com Inkplate 6](https://github.com/SolderedElectronics/Inkplate-6-hardware)
- [e-radionica.com Inkplate 10](https://github.com/SolderedElectronics/Inkplate-10-hardware)
- [e-radionica.com Inkplate 6PLUS](https://github.com/SolderedElectronics/Inkplate-6PLUS-Hardware)
- e-radionica.com Inkplate 6COLOR (comming soon!)
- [micropython Inkplate](https://github.com/SolderedElectronics/Inkplate-micropython)
- [OSHWA cerfiticates](https://certification.oshwa.org/list.html?q=inkplate)

### Where to buy & other

Inkplate boards are available for purchase via:

- [soldered.com](https://soldered.com/categories/inkplate/)
- [Crowd Supply](https://www.crowdsupply.com/soldered)
- [Mouser](https://hr.mouser.com/Search/Refine?Keyword=inkplate)

For all questions and issues please reach us via [e-mail](mailto:[email protected]) or our [contact form](https://soldered.com/contact/).
36 changes: 36 additions & 0 deletions examples/Inkplate10/Basic/HelloWorld/HelloWorld.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Include the Inkplate LVGL Library
#include <Inkplate-LVGL.h>

// Create an instance of Inkplate display in 1-bit mode (change to INKPLATE_3BIT if you want grayscale)
Inkplate inkplate(INKPLATE_1BIT);

void setup() {
/* Initialize the display as well as LVGL itself in FULL render mode,
other possibilities are PARTIAL (fastest) and DIRECT (not currently supported)
NOTE: Dithering is only supported in FULL render mode */
inkplate.begin(LV_DISP_RENDER_MODE_FULL);
// Change the active screen's background color to white
lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0xFFFFFF), LV_PART_MAIN);

/*Create a black label, set its text and font and align it to the center*/
lv_obj_t * label = lv_label_create(lv_screen_active());
lv_label_set_text(label, "Hello world!");
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0x000000), LV_PART_MAIN);
lv_obj_set_style_text_font(label, &lv_font_montserrat_48, 0);
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);

// Tick the LVGL timer by 50
lv_tick_inc(50);

// Handle the new label and write it into the framebuffer
lv_timer_handler();

// Display the created label onto the screen
inkplate.display();

}

void loop() {
// Stays empty, label is only rendered once to the screen

}
36 changes: 36 additions & 0 deletions examples/Inkplate2/Basic/HelloWorld/HelloWorld.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Include the Inkplate LVGL Library
#include <Inkplate-LVGL.h>

// Create an instance of Inkplate display
Inkplate inkplate;

void setup() {
/* Initialize the display as well as LVGL itself in FULL render mode,
other possibilities are PARTIAL (fastest) and DIRECT (not currently supported)
NOTE: Dithering is only supported in FULL render mode */
inkplate.begin(LV_DISP_RENDER_MODE_FULL);
// Change the active screen's background color to white
lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0xFFFFFF), LV_PART_MAIN);

/*Create a black label, set its text and font and align it to the center*/
lv_obj_t * label = lv_label_create(lv_screen_active());
lv_label_set_text(label, "Hello world!");
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0x000000), LV_PART_MAIN);
lv_obj_set_style_text_font(label, &lv_font_montserrat_14, 0);
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);

// Tick the LVGL timer by 50
lv_tick_inc(50);

// Handle the new label and write it into the framebuffer
lv_timer_handler();

// Display the created label onto the screen
inkplate.display();

}

void loop() {
// Stays empty, label is only rendered once to the screen

}
36 changes: 36 additions & 0 deletions examples/Inkplate5V2/Basic/HelloWorld/HelloWorld.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Include the Inkplate LVGL Library
#include <Inkplate-LVGL.h>

// Create an instance of Inkplate display in 1-bit mode (change to INKPLATE_3BIT if you want grayscale)
Inkplate inkplate(INKPLATE_1BIT);

void setup() {
/* Initialize the display as well as LVGL itself in FULL render mode,
other possibilities are PARTIAL (fastest) and DIRECT (not currently supported)
NOTE: Dithering is only supported in FULL render mode */
inkplate.begin(LV_DISP_RENDER_MODE_FULL);
// Change the active screen's background color to white
lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0xFFFFFF), LV_PART_MAIN);

/*Create a black label, set its text and font and align it to the center*/
lv_obj_t * label = lv_label_create(lv_screen_active());
lv_label_set_text(label, "Hello world!");
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0x000000), LV_PART_MAIN);
lv_obj_set_style_text_font(label, &lv_font_montserrat_48, 0);
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);

// Tick the LVGL timer by 50
lv_tick_inc(50);

// Handle the new label and write it into the framebuffer
lv_timer_handler();

// Display the created label onto the screen
inkplate.display();

}

void loop() {
// Stays empty, label is only rendered once to the screen

}
36 changes: 36 additions & 0 deletions examples/Inkplate6/Basic/HelloWorld/HelloWorld.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Include the Inkplate LVGL Library
#include <Inkplate-LVGL.h>

// Create an instance of Inkplate display in 1-bit mode (change to INKPLATE_3BIT if you want grayscale)
Inkplate inkplate(INKPLATE_1BIT);

void setup() {
/* Initialize the display as well as LVGL itself in FULL render mode,
other possibilities are PARTIAL (fastest) and DIRECT (not currently supported)
NOTE: Dithering is only supported in FULL render mode */
inkplate.begin(LV_DISP_RENDER_MODE_FULL);
// Change the active screen's background color to white
lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0xFFFFFF), LV_PART_MAIN);

/*Create a black label, set its text and font and align it to the center*/
lv_obj_t * label = lv_label_create(lv_screen_active());
lv_label_set_text(label, "Hello world!");
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0x000000), LV_PART_MAIN);
lv_obj_set_style_text_font(label, &lv_font_montserrat_48, 0);
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);

// Tick the LVGL timer by 50
lv_tick_inc(50);

// Handle the new label and write it into the framebuffer
lv_timer_handler();

// Display the created label onto the screen
inkplate.display();

}

void loop() {
// Stays empty, label is only rendered once to the screen

}
36 changes: 36 additions & 0 deletions examples/Inkplate6COLOR/Basic/HelloWorld/HelloWorld.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Include the Inkplate LVGL Library
#include <Inkplate-LVGL.h>

// Create an instance of Inkplate display
Inkplate inkplate;

void setup() {
/* Initialize the display as well as LVGL itself in FULL render mode,
other possibilities are PARTIAL (fastest) and DIRECT (not currently supported)
NOTE: Dithering is only supported in FULL render mode */
inkplate.begin(LV_DISP_RENDER_MODE_FULL);
// Change the active screen's background color to white
lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0xFFFFFF), LV_PART_MAIN);

/*Create a black label, set its text and font and align it to the center*/
lv_obj_t * label = lv_label_create(lv_screen_active());
lv_label_set_text(label, "Hello world!");
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0x000000), LV_PART_MAIN);
lv_obj_set_style_text_font(label, &lv_font_montserrat_48, 0);
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);

// Tick the LVGL timer by 50
lv_tick_inc(50);

// Handle the new label and write it into the framebuffer
lv_timer_handler();

// Display the created label onto the screen
inkplate.display();

}

void loop() {
// Stays empty, label is only rendered once to the screen

}
Loading