-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ lvgl/lvgl@f3bc984 🚀
- Loading branch information
0 parents
commit dc56cc1
Showing
7,654 changed files
with
7,202,269 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 49d3a66846b076dc435f4270a086764a | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
```eval_rst | ||
:github_url: https://github.com/littlevgl/docs/blob/master/en/get-started/index.md | ||
``` | ||
# Get started | ||
|
||
```eval_rst | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
live-demo | ||
pc-simulator | ||
quick-overview | ||
micropython | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
```eval_rst | ||
:github_url: https://github.com/littlevgl/docs/blob/master/en/get-started/live-demo.md | ||
``` | ||
# Live demos | ||
|
||
You can see how LittlevGL looks like without installing and downloading anything either on target platform or on the host machine. There are some ready made user interfaces which you can easily try in your browser. | ||
|
||
Go to the [Live demo](https://littlevgl.com/live-demo) page and choose a demo you are interested in. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
```eval_rst | ||
:github_url: https://github.com/littlevgl/docs/blob/master/en/get-started/micropython.md | ||
``` | ||
# Micropython | ||
|
||
## What is Micropython? | ||
|
||
[Micropython](http://micropython.org/) is Python for microcontrollers. | ||
Using Micropython, you can write Python3 code and run it even on a bare metal architecture with limited resources. | ||
|
||
### Highlights of Micropython | ||
|
||
- **Compact** - Fits and runs within just 256k of code space and 16k of RAM. No OS is needed, although you can also run it with an OS, if you want. | ||
- **Compatible** - Strives to be as compatible as possible with normal Python (known as CPython). | ||
- **Versatile** - Supports many architectures (x86, x86-64, ARM, ARM Thumb, Xtensa). | ||
- **Interactive** - No need for the compile-flash-boot cycle. With the REPL (interactive prompt) you can type commands and execute them immediately, run scripts etc. | ||
- **Popular** - Many platforms are supported. The user base is growing bigger. Notable forks: [MicroPython](https://github.com/micropython/micropython), [CircuitPython](https://github.com/adafruit/circuitpython), [MicroPython_ESP32_psRAM_LoBo](https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo) | ||
- **Embedded Oriented** - Comes with modules specifically for embedded systems, such as the [machine module](https://docs.micropython.org/en/latest/library/machine.html#classes) for accessing low-level hardware (I/O pins, ADC, UART, SPI, I2C, RTC, Timers etc.) | ||
|
||
--- | ||
|
||
## Why Micropython + LittlevGL? | ||
|
||
Currently, Micropython [does not have a good high-level GUI library](https://forum.micropython.org/viewtopic.php?f=18&t=5543) by default. LittlevGL is an [Object Oriented Component Based](https://blog.littlevgl.com/2018-12-13/extend-lvgl-objects) high-level GUI library, which seems to be a natural candidate to map into a higher level language, such as Python. LittlevGL is implemented in C and its APIs are in C. | ||
|
||
### Here are some advantages of using LittlevGL in Micropython: | ||
|
||
- Develop GUI in Python, a very popular high level language. Use paradigms such as Object Oriented Programming. | ||
- Usually, GUI development requires multiple iterations to get things right. With C, each iteration consists of **`Change code` > `Build` > `Flash` > `Run`**. | ||
In Micropython it's just **`Change code` > `Run`** ! You can even run commands interactively using the [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) (the interactive prompt) | ||
|
||
### Micropython + LittlevGL could be used for: | ||
|
||
- Fast prototyping GUI. | ||
- Shorten the cycle of changing and fine-tuning the GUI. | ||
- Model the GUI in a more abstract way by defining reusable composite objects, taking advantage of Python's language features such as Inheritance, Closures, List Comprehension, Generators, Exception Handling, Arbitrary Precision Integers and others. | ||
- Make LittlevGL accessible to a larger audience. No need to know C in order to create a nice GUI on an embedded system. | ||
This goes well with [CircuitPython vision](https://learn.adafruit.com/welcome-to-circuitpython/what-is-circuitpython). CircuitPython was designed with education in mind, to make it easier for new or unexperienced users to get started with embedded development. | ||
- Creating tools to work with LittlevGL at a higher level (e.g. drag-and-drop designer). | ||
|
||
--- | ||
|
||
## So what does it look like? | ||
|
||
> TL;DR: | ||
> It's very much like the C API, but Object Oriented for LittlevGL components. | ||
|
||
Let's dive right into an example! | ||
|
||
### A simple example | ||
|
||
```python | ||
import lvgl as lv | ||
lv.init() | ||
scr = lv.obj() | ||
btn = lv.btn(scr) | ||
btn.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0) | ||
label = lv.label(btn) | ||
label.set_text("Button") | ||
lv.scr_load(scr) | ||
``` | ||
|
||
## How can I use it? | ||
|
||
### Online Simulator | ||
|
||
If you want to experiment with LittlevGL + Micropython without downloading anything - you can use our online simulator! | ||
It's a fully functional LittlevGL + Micropython that runs entirely in the browser and allows you to edit a python script and run it. | ||
|
||
[Click here to experiment on the online simulator](https://sim.littlevgl.com/v6/micropython/ports/javascript/lvgl_editor.html) | ||
|
||
[Hello World](https://sim.littlevgl.com/v6/micropython/ports/javascript/lvgl_editor.html?script=https://gist.githubusercontent.com/amirgon/51299ce9b6448328a855826149482ae6/raw/0f235c6d40462fd2f0e55364b874f14fe3fd613c/lvgl_hello_world.py&script_startup=https://gist.githubusercontent.com/amirgon/7bf15a66ba6d959bbf90d10f3da571be/raw/8684b5fa55318c184b1310663b187aaab5c65be6/init_lv_mp_js.py) | ||
|
||
### PC Simulator | ||
|
||
Micropython is ported to many platforms. One notable port is "unix", which allows you to build and run Micropython (+LittlevGL) on a Linux machine. (On a Windows machine you might need Virtual Box or WSL or MinGW or Cygwin etc.) | ||
|
||
[Click here to know more information about building and running the unix port](https://github.com/littlevgl/lv_micropython) | ||
|
||
### Embedded platform | ||
|
||
At the end, the goal is to run it all on an embedded platform. | ||
Both Micropython and LittlevGL can be used on many embedded architectures, such as stm32, ESP32 etc. | ||
You would also need display and input drivers. We have some sample drivers (ESP32+ILI9341, as well as some other examples), but most chances are you would want to create your own input/display drivers for your specific purposes. | ||
Drivers can be implemented either in C as Micropython module, or in pure Micropython! | ||
|
||
## Where can I find more information? | ||
|
||
- On the [Blog Post](https://blog.littlevgl.com/2019-02-20/micropython-bindings) | ||
- On `lv_micropython` [README](https://github.com/littlevgl/lv_micropython) | ||
- On `lv_binding_micropython` [README](https://github.com/littlevgl/lv_binding_micropython) | ||
- On LittlevGL forum (Feel free to ask anything!) | ||
- On Micropython [docs](http://docs.micropython.org/en/latest/) and [forum](https://forum.micropython.org/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
```eval_rst | ||
:github_url: https://github.com/littlevgl/docs/blob/master/en/get-started/pc-simulator.md | ||
``` | ||
# Simulator on PC | ||
|
||
|
||
You can try out the LittlevGL **using only your PC** (i.e. without any development boards). The LittlevGL will run on a simulator environment on the PC where anyone can write and experiment the real LittlevGL applications. | ||
|
||
Simulator on the PC have the following advantages: | ||
- Hardware independent - Write a code, run it on the PC and see the result on the PC monitor. | ||
- Cross-platform - Any Windows, Linux or OSX PC can run the PC simulator. | ||
- Portability - the written code is portable, which means you can simply copy it when using an embedded hardware. | ||
- Easy Validation - The simulator is also very useful to report bugs because it means common platform for every user. So it's a good idea to reproduce a bug in simulator and use the code snippet in the [Forum](https://forum.littlevgl.com). | ||
|
||
## Select an IDE | ||
|
||
The simulator is ported to various IDEs (Integrated Development Environments). Choose your favorite IDE, read its README on GitHub, download the project, and load it to the IDE. | ||
|
||
```eval_rst | ||
.. raw:: html | ||
|
||
<table style="width:100%"> | ||
<thead> | ||
<tr> | ||
<th>Eclipse</th> | ||
<th>CodeBlocks</th> | ||
<th>Visual Studio</th> | ||
<th>PlatformIO</th> | ||
<th>Qt Creator</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td><a href="https://github.com/littlevgl/pc_simulator_sdl_eclipse"><img src="https://littlevgl.com/logo/ide/eclipse.jpg"></a> </td> | ||
<td><a href="https://github.com/littlevgl/pc_simulator_win_codeblocks"><img src="https://littlevgl.com/logo/ide/codeblocks.jpg"></a></td> | ||
<td><a href="https://github.com/littlevgl/visual_studio_2017_sdl_x64"><img src="https://littlevgl.com/logo/ide/visualstudio.jpg"></a></td> | ||
<td><a href="https://github.com/littlevgl/pc_simulator_sdl_platformio"><img src="https://littlevgl.com/logo/ide/platformio.jpg"></a></td> | ||
<td><a href="https://blog.littlevgl.com/2019-01-03/qt-creator"><img src="https://littlevgl.com/logo/ide/qtcreator.jpg"> </a></td> | ||
</tr> | ||
|
||
<tr> | ||
<td>Cross-platform<br>with SDL | ||
</td><td>Native Windows </td> | ||
<td>Cross-platform<br>with SDL </td> | ||
<td>Cross-platform<br>with SDL </td> | ||
<td>Cross-platform<br>with SDL </td> | ||
</tr> | ||
</tbody></table> | ||
``` | ||
|
||
|
||
You can use any IDEs for the development but, for simplicity, the configuration for Eclipse CDT is focused in this tutorial. | ||
The following section describes the set-up guide of Eclipse CDT in more details. | ||
|
||
**Note: If you are on Windows, it's usually better to use the Visual Studio or CodeBlocks projects instead. They work out of the box without requiring extra steps.** | ||
|
||
## Set-up Eclipse CDT | ||
|
||
### Install Eclipse CDT | ||
|
||
[Eclipse CDT](https://eclipse.org/cdt/) is a C/C++ IDE. | ||
|
||
Eclipse is a Java based software therefore be sure **Java Runtime Environment** is installed on your system. | ||
|
||
On Debian-based distros (e.g. Ubuntu): `sudo apt-get install default-jre` | ||
|
||
Note: If you are using other distros, then please refer and install 'Java Runtime Environment' suitable to your distro. | ||
Note: If you are using macOS and get a "Failed to create the Java Virtual Machine" error, uninstall any other Java JDK installs and install Java JDK 8u. This should fix the problem. | ||
|
||
You can download Eclipse's CDT from: [https://www.eclipse.org/cdt/downloads.php](https://www.eclipse.org/cdt/downloads.php). Start the installer and choose *Eclipse CDT* from the list. | ||
|
||
### Install SDL 2 | ||
|
||
The PC simulator uses the [SDL 2](https://www.libsdl.org/download-2.0.php) cross platform library to simulate a TFT display and a touch pad. | ||
|
||
#### Linux | ||
On **Linux** you can easily install SDL2 using a terminal: | ||
|
||
1. Find the current version of SDL2: `apt-cache search libsdl2 (e.g. libsdl2-2.0-0)` | ||
2. Install SDL2: `sudo apt-get install libsdl2-2.0-0` (replace with the found version) | ||
3. Install SDL2 development package: `sudo apt-get install libsdl2-dev` | ||
4. If build essentials are not installed yet: `sudo apt-get install build-essential` | ||
|
||
#### Windows | ||
If you are using **Windows** firstly you need to install MinGW ([64 bit version](http://mingw-w64.org/doku.php/download)). After installing MinGW, do the following steps to add SDL2: | ||
|
||
1. Download the development libraries of SDL. | ||
Go to [https://www.libsdl.org/download-2.0.php](https://www.libsdl.org/download-2.0.php) and download _Development Libraries: SDL2-devel-2.0.5-mingw.tar.gz_ | ||
2. Decompress the file and go to _x86_64-w64-mingw32_ directory (for 64 bit MinGW) or to _i686-w64-mingw32_ (for 32 bit MinGW) | ||
3. Copy _..._mingw32/include/SDL2_ folder to _C:/MinGW/.../x86_64-w64-mingw32/include_ | ||
4. Copy _..._mingw32/lib/_ content to _C:/MinGW/.../x86_64-w64-mingw32/lib_ | ||
5. Copy _..._mingw32/bin/SDL2.dll_ to _{eclipse_worksapce}/pc_simulator/Debug/_. Do it later when Eclipse is installed. | ||
|
||
Note: If you are using **Microsoft Visual Studio** instead of Eclipse then you don't have to install MinGW. | ||
|
||
#### OSX | ||
On **OSX** you can easily install SDL2 with brew: `brew install sdl2` | ||
|
||
If something is not working, then please refer [this tutorial](http://lazyfoo.net/tutorials/SDL/01_hello_SDL/index.php) to get started with SDL. | ||
|
||
### Pre-configured project | ||
|
||
A pre-configured graphics library project (based on the latest release) is always available to get started easily. | ||
You can find the latest one on [GitHub](https://github.com/littlevgl/proj_pc) or on the [Download](https://littlevgl.com/download) page. | ||
(Please note that, the project is configured for Eclipse CDT). | ||
|
||
### Add the pre-configured project to Eclipse CDT | ||
|
||
Run Eclipse CDT. It will show a dialogue about the **workspace path**. Before accepting the path, check that path and copy (and unzip) the downloaded pre-configured project there. After that, you can accept the workspace path. Of course you can modify this path but, in that case copy the project to the corresponding location. | ||
|
||
Close the start up window and go to **File->Import** and choose **General->Existing project into Workspace**. **Browse the root directory** of the project and click **Finish** | ||
|
||
On **Windows** you have to do two additional things: | ||
|
||
- Copy the **SDL2.dll** into the project's Debug folder | ||
- Right click on the project -> Project properties -> C/C++ Build -> Settings -> Libraries -> Add ... and add _mingw32_ above SDLmain and SDL. (The order is important: mingw32, SDLmain, SDL) | ||
|
||
### Compile and Run | ||
|
||
Now you are ready to run the LittlevGL Graphics Library on your PC. Click on the Hammer Icon on the top menu bar to Build the project. If you have done everything right, then you will not get any errors. Note that on some systems additional steps might be required to "see" SDL 2 from Eclipse but, in most of cases the configurations in the downloaded project is enough. | ||
|
||
After a success build, click on the Play button on the top menu bar to run the project. Now a window should appear in the middle of your screen. | ||
|
||
Now everything is ready to use the LittlevGL Graphics Library in the practice or begin the development on your PC. |
Oops, something went wrong.