Spelling and other language fixes to documentation (#2293)
This commit is contained in:
committed by
Gabor Kiss-Vamosi
parent
ad9de31a05
commit
1deff8ed03
@@ -14,7 +14,7 @@ For example ESP32 is a good candidate to create your UI with LVGL.
|
||||
|
||||
## Get the LVGL Ardunio library
|
||||
|
||||
LVGL can be installed via Arduino IDE Library Manager or as an .ZIP library.
|
||||
LVGL can be installed via the Arduino IDE Library Manager or as a .ZIP library.
|
||||
It will also install [lv_exmaples](https://github.com/lvgl/lv_examples) which contains a lot of examples and demos to try LVGL.
|
||||
|
||||
## Set up drivers
|
||||
@@ -46,7 +46,7 @@ LVGL has its own configuration file called `lv_conf.h`. When LVGL is installed t
|
||||
## Initialize LVGL and run an example
|
||||
|
||||
Take a look at [LVGL_Arduino.ino](https://github.com/lvgl/lvgl/blob/master/examples/LVGL_Arduino.ino) to see how to initialize LVGL.
|
||||
It also uses TFT_eSPI as driver.
|
||||
TFT_eSPI is used as the display driver.
|
||||
|
||||
In the INO file you can see how to register a display and a touch pad for LVGL and call an example.
|
||||
|
||||
@@ -55,9 +55,9 @@ For the full list of examples see the [README of lv_examples](https://github.com
|
||||
|
||||
## Debugging and logging
|
||||
|
||||
In case of trouble there are debug information inside LVGL.
|
||||
In case of trouble LVGL can display debug information.
|
||||
In the `LVGL_Arduino.ino` example there is `my_print` method, which allow to send this debug information to the serial interface.
|
||||
To enable this feature you have to edit `lv_conf.h` file and enable logging in section `log settings`:
|
||||
To enable this feature you have to edit `lv_conf.h` file and enable logging in the section `log settings`:
|
||||
|
||||
```c
|
||||
/*Log settings*/
|
||||
@@ -73,5 +73,5 @@ To enable this feature you have to edit `lv_conf.h` file and enable logging in s
|
||||
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
|
||||
```
|
||||
|
||||
After enabling log module and setting LV_LOG_LEVEL accordingly the output log is sent to the `Serial` port @ 115200 Baud rate.
|
||||
After enabling the log module and setting LV_LOG_LEVEL accordingly the output log is sent to the `Serial` port @ 115200 bps.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
```
|
||||
# Get started
|
||||
|
||||
There are several ways to get your feet wet with LVGL. This list shows the recommended way of learning the library:
|
||||
There are several ways to get your feet wet with LVGL. Here is one recommended order of documents to read and things to play with when you are learning to use LVGL:
|
||||
1. Check the [Online demos](https://lvgl.io/demos) to see LVGL in action (3 minutes)
|
||||
2. Read the [Introduction](https://docs.lvgl.io/latest/en/html/intro/index.html) page of the documentation (5 minutes)
|
||||
3. Read the [Quick overview](https://docs.lvgl.io/latest/en/html/get-started/quick-overview.html) page of the documentation (15 minutes)
|
||||
|
||||
@@ -33,8 +33,8 @@ In Micropython it's just **`Change code` > `Run`** ! You can even run commands i
|
||||
### Micropython + LVGL 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.
|
||||
- Shortening the cycle of changing and fine-tuning the GUI.
|
||||
- Modelling 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 LVGL 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 LVGL at a higher level (e.g. drag-and-drop designer).
|
||||
@@ -82,15 +82,15 @@ Micropython is ported to many platforms. One notable port is "unix", which allow
|
||||
|
||||
### Embedded platform
|
||||
|
||||
At the end, the goal is to run it all on an embedded platform.
|
||||
In the end, the goal is to run it all on an embedded platform.
|
||||
Both Micropython and LVGL 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!
|
||||
You would also need display and input drivers. We have some sample drivers (ESP32+ILI9341, as well as some other examples), but chances are you would want to create your own input/display drivers for your specific hardware.
|
||||
Drivers can be implemented either in C as a Micropython module, or in pure Micropython!
|
||||
|
||||
## Where can I find more information?
|
||||
|
||||
- On the [Blog Post](https://blog.lvgl.io/2019-02-20/micropython-bindings)
|
||||
- On `lv_micropython` [README](https://github.com/lvgl/lv_micropython)
|
||||
- On `lv_binding_micropython` [README](https://github.com/lvgl/lv_binding_micropython)
|
||||
- On LVGL forum (Feel free to ask anything!)
|
||||
- On Micropython [docs](http://docs.micropython.org/en/latest/) and [forum](https://forum.micropython.org/)
|
||||
- In this [Blog Post](https://blog.lvgl.io/2019-02-20/micropython-bindings)
|
||||
- `lv_micropython` [README](https://github.com/lvgl/lv_micropython)
|
||||
- `lv_binding_micropython` [README](https://github.com/lvgl/lv_binding_micropython)
|
||||
- The [LVGL micropython forum](https://forum.lvgl.io/c/micropython) (Feel free to ask anything!)
|
||||
- At Micropython: [docs](http://docs.micropython.org/en/latest/) and [forum](https://forum.micropython.org/)
|
||||
|
||||
@@ -7,50 +7,50 @@
|
||||
## What is NuttX?
|
||||
|
||||
[NuttX](https://nuttx.apache.org/) is a mature and secure real-time operating system (RTOS) with an emphasis on technical standards compliance and small size.
|
||||
It is scalable from 8-bit to 64-bit microcontroller and microprocessors. Complaint with the Portable Operating System Interface (POSIX) and the American National Standards Institute (ANSI) standards and with many Linux-like subsystems.
|
||||
The best way to think about NuttX is thinking about a small Unix/Linux for microcontrollers.
|
||||
It is scalable from 8-bit to 64-bit microcontrollers and microprocessors and compliant with the Portable Operating System Interface (POSIX) and the American National Standards Institute (ANSI) standards and with many Linux-like subsystems.
|
||||
The best way to think about NuttX is to think of it as a small Unix/Linux for microcontrollers.
|
||||
|
||||
### Highlights of NuttX
|
||||
|
||||
- **Small** - Fits and runs within small microcontroller as small was 32KB Flash and 8KB of RAM.
|
||||
- **Small** - Fits and runs in microcontrollers as small as 32KB Flash and 8KB of RAM.
|
||||
- **Compliant** - Strives to be as compatible as possible with POSIX and Linux.
|
||||
- **Versatile** - Supports many architectures (ARM, ARM Thumb, AVR, MIPS, OpenRISC, RISC-V 32-bit and 64-bit, RX65N, x86-64, Xtensa, Z80/Z180, etc).
|
||||
- **Modular** - Its modular design allow developers to select only what really matters and use modules to include new features.
|
||||
- **Modular** - Its modular design allows developers to select only what really matters and use modules to include new features.
|
||||
- **Popular** - NuttX is used by many companies around the world. Probably you already used a product with NuttX without knowing it was running NuttX.
|
||||
- **Predictable** - NuttX is a preemptible Realtime kernel, then you can use it to create predictable applications for realtime control.
|
||||
- **Predictable** - NuttX is a preemptible Realtime kernel, so you can use it to create predictable applications for realtime control.
|
||||
|
||||
---
|
||||
|
||||
## Why NuttX + LVGL?
|
||||
|
||||
Although NuttX has its own graphic library called [NX](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629474), LVGL is a good alternative because users could find more eyes-candy demos and reuse it from previous projects.
|
||||
Although NuttX has its own graphic library called [NX](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629474), LVGL is a good alternative because users could find more eye-candy demos and they can reuse code from previous projects.
|
||||
LVGL is an [Object Oriented Component Based](https://blog.lvgl.io/2018-12-13/extend-lvgl-objects) high-level GUI library, that could fit very well for a RTOS with advanced features like NuttX.
|
||||
LVGL is implemented in C and its APIs are in C.
|
||||
|
||||
### Here are some advantages of using LVGL in NuttX
|
||||
|
||||
- Develop GUI in Linux first and when it is done just compile it for NuttX, nothing more, no wasting of time.
|
||||
- Usually, GUI development for low level RTOS requires multiple iterations to get things right. Where each iteration consists of **`Change code` > `Build` > `Flash` > `Run`**.
|
||||
- Develop GUI in Linux first and when it is done just compile it for NuttX. Nothing more, no wasting of time.
|
||||
- Usually, GUI development for low level RTOS requires multiple iterations to get things right, where each iteration consists of **`Change code` > `Build` > `Flash` > `Run`**.
|
||||
Using LVGL, Linux and NuttX you can reduce this process and just test everything on your computer and when it is done, compile it on NuttX and that is it.
|
||||
|
||||
### NuttX + LVGL could be used for
|
||||
|
||||
- GUI demos to demonstrate your board graphics capacities.
|
||||
- Fast prototyping GUI for MVP (Minimum Viable Product) presentation.
|
||||
- Easy way to visualize sensors data directly on the board without using a computer.
|
||||
- Final products GUI without touchscreen (i.e. 3D Printer Interface using Rotary Encoder to Input data).
|
||||
- Final products interface with touchscren (and bells and whistles).
|
||||
- visualize sensor data directly and easily on the board without using a computer.
|
||||
- Final products with a GUI without a touchscreen (i.e. 3D Printer Interface using Rotary Encoder to Input data).
|
||||
- Final products with a touchscreen (and all sorts of bells and whistles).
|
||||
|
||||
---
|
||||
|
||||
## How to get started with NuttX and LVGL?
|
||||
|
||||
There are many boards in the NuttX mainline (https://github.com/apache/incubator-nuttx) with support for LVGL.
|
||||
Let's to use the [STM32F429IDISCOVERY](https://www.st.com/en/evaluation-tools/32f429idiscovery.html) as example because it is a very popular board.
|
||||
Let's use the [STM32F429IDISCOVERY](https://www.st.com/en/evaluation-tools/32f429idiscovery.html) as example because it is a very popular board.
|
||||
|
||||
### First you need to install the pre-requisite on your system
|
||||
|
||||
Let's to use Linux and example, for [Windows](https://acassis.wordpress.com/2018/01/10/how-to-build-nuttx-on-windows-10/)
|
||||
Let's use the [Windows Subsystem for Linux](https://acassis.wordpress.com/2018/01/10/how-to-build-nuttx-on-windows-10/)
|
||||
|
||||
```shell
|
||||
$ sudo apt-get install automake bison build-essential flex gcc-arm-none-eabi gperf git libncurses5-dev libtool libusb-dev libusb-1.0.0-dev pkg-config kconfig-frontends openocd
|
||||
@@ -96,6 +96,6 @@ nsh> lvgldemo
|
||||
|
||||
## Where can I find more information?
|
||||
|
||||
- On the [LVGL on LPCXpresso54628](https://acassis.wordpress.com/2018/07/19/running-nuttx-on-lpcxpresso54628-om13098/)
|
||||
- NuttX mailing list [Apache NuttX Mailing List](http://nuttx.incubator.apache.org/community/)
|
||||
- This blog post: [LVGL on LPCXpresso54628](https://acassis.wordpress.com/2018/07/19/running-nuttx-on-lpcxpresso54628-om13098/)
|
||||
- NuttX mailing list: [Apache NuttX Mailing List](http://nuttx.incubator.apache.org/community/)
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
# Simulator on PC
|
||||
|
||||
|
||||
You can try out the LVGL **using only your PC** (i.e. without any development boards). The LVGL will run on a simulator environment on the PC where anyone can write and experiment the real LVGL applications.
|
||||
You can try out LVGL **using only your PC** (i.e. without any development boards). LVGL will run on a simulator environment on the PC where anyone can write and experiment the real LVGL 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.
|
||||
Using the simulator on the PC has the following advantages:
|
||||
- Hardware independent - Write code, run it on the PC and see the result on the PC monitor.
|
||||
- Cross-platform - Any Windows, Linux or MacOS system 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.lvgl.io).
|
||||
- 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 the simulator and use the code snippet in the [Forum](https://forum.lvgl.io).
|
||||
|
||||
## Select an IDE
|
||||
|
||||
@@ -23,7 +23,7 @@ The simulator is ported to various IDEs (Integrated Development Environments). C
|
||||
- [VSCode with SDL driver](https://github.com/lvgl/lv_sim_vscode_sdl): Recommended on Linux and Mac
|
||||
- [PlatformIO with SDL driver](https://github.com/lvgl/lv_platformio): Recommended on Linux and Mac
|
||||
|
||||
You can use any IDEs for the development but, for simplicity, the configuration for Eclipse CDT is focused in this tutorial.
|
||||
You can use any IDE for the development but, for simplicity, the configuration for Eclipse CDT is what we'll focus on 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.**
|
||||
@@ -91,8 +91,8 @@ On **Windows** you have to do two additional things:
|
||||
|
||||
### Compile and Run
|
||||
|
||||
Now you are ready to run the LVGL 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.
|
||||
Now you are ready to run LVGL 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 LVGL in the practice or begin the development on your PC.
|
||||
Now you are ready to use LVGL and begin development on your PC.
|
||||
|
||||
@@ -6,20 +6,20 @@
|
||||
# Quick overview
|
||||
|
||||
Here you can learn the most important things about LVGL.
|
||||
You should read it first to get a general impression and read the detailed [Porting](/porting/index) and [Overview](/overview/index) sections after that.
|
||||
You should read this first to get a general impression and read the detailed [Porting](/porting/index) and [Overview](/overview/index) sections after that.
|
||||
|
||||
## Get started in a simulator
|
||||
|
||||
Instead of porting LVGL to an embedded hardware, it's highly recommended to get started in a simulator first.
|
||||
Instead of porting LVGL to embedded hardware straight away, it's highly recommended to get started in a simulator first.
|
||||
|
||||
LVGL is ported to many IDEs to be sure you will find your favorite one.
|
||||
Go to the [Simulators](/get-started/pc-simulator) section to get ready-to-use projects that can be run on your PC.
|
||||
This way you can save the time of porting for now and make some experience with LVGL immediately.
|
||||
This way you can save the time of porting for now and get some experience with LVGL immediately.
|
||||
|
||||
## Add LVGL into your project
|
||||
If you rather want to try LVGL on your own project follow these steps:
|
||||
If you would rather try LVGL on your own project follow these steps:
|
||||
|
||||
- [Download](https://github.com/lvgl/lvgl/archive/master.zip) or Clone the library from GitHub with `git clone https://github.com/lvgl/lvgl.git`.
|
||||
- [Download](https://github.com/lvgl/lvgl/archive/master.zip) or clone the library from GitHub with `git clone https://github.com/lvgl/lvgl.git`.
|
||||
- Copy the `lvgl` folder into your project.
|
||||
- Copy `lvgl/lv_conf_template.h` as `lv_conf.h` next to the `lvgl` folder, change the first `#if 0` to `1` to enable the file's content and set the `LV_COLOR_DEPTH` defines.
|
||||
- Include `lvgl/lvgl.h` in files where you need to use LVGL related functions.
|
||||
@@ -94,7 +94,7 @@ Every object has a parent object where it is created. For example if a label is
|
||||
|
||||
The child object moves with the parent and if the parent is deleted the children will be deleted too.
|
||||
|
||||
Children can be visible only on their parent. It other words, the parts of the children out of the parent are clipped.
|
||||
Children can be visible only on their parent. It other words, the parts of the children outside of the parent are clipped.
|
||||
|
||||
A Screen is the "root" parent. You can have any number of screens.
|
||||
|
||||
@@ -124,10 +124,10 @@ To see the full API visit the documentation of the widgets or the related header
|
||||
|
||||
|
||||
### Events
|
||||
Events are used to inform the user if something has happened with an object.
|
||||
Events are used to inform the user that something has happened with an object.
|
||||
You can assign one or more callbacks to an object which will be called if the object is clicked, released, dragged, being deleted etc.
|
||||
|
||||
It should look like this:
|
||||
A callback is assigned like this:
|
||||
|
||||
```c
|
||||
lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_CLICKED, NULL); /*Assign a callback to the button*/
|
||||
@@ -174,11 +174,11 @@ The objects can be in a combination of the following states:
|
||||
- `LV_STATE_SCROLLED` Being scrolled
|
||||
- `LV_STATE_DISABLED` Disabled
|
||||
|
||||
For example, if you press an object it will automatically goes to `LV_STATE_FOCUSED` and `LV_STATE_PRESSED` state and when you release it, the `LV_STATE_PRESSED` state will be removed.
|
||||
For example, if you press an object it will automatically go to `LV_STATE_FOCUSED` and `LV_STATE_PRESSED` state and when you release it, the `LV_STATE_PRESSED` state will be removed.
|
||||
|
||||
To check if an object is in a given state use `lv_obj_has_state(obj, LV_STATE_...)`. It will return `true` if the object "has" the given state at that moment.
|
||||
To check if an object is in a given state use `lv_obj_has_state(obj, LV_STATE_...)`. It will return `true` if the object is in that state at that time.
|
||||
|
||||
To manually add remove the states use
|
||||
To manually add or remove states use
|
||||
```c
|
||||
lv_obj_add_state(obj, LV_STATE_...);
|
||||
lv_obj_clear_state(obj, LV_STATE_...);
|
||||
@@ -195,7 +195,7 @@ lv_style_init(&style1);
|
||||
lv_style_set_bg_color(&style1, lv_color_hex(0xa03080))
|
||||
lv_style_set_border_width(&style1, 2))
|
||||
```
|
||||
See the full list of properties go [here](/overview/style.html#properties).
|
||||
See the full list of properties [here](/overview/style.html#properties).
|
||||
|
||||
|
||||
The styles are assigned to an object's part and state. For example to *"Use this style on the slider's indicator when the slider is pressed"*:
|
||||
@@ -230,15 +230,15 @@ lv_obj_add_style(btn1, &style1_btn_red, 0);
|
||||
If a property is not set on for the current state the style with `LV_STATE_DEFAULT` will be used. If the property is not defined even in the default state a default value is used.
|
||||
|
||||
Some properties (typically the text-related ones) can be inherited. It means if a property is not set in an object it will be searched in its parents too.
|
||||
For example, you can set the font once in the screen's style and every text will inherit it by default.
|
||||
For example, you can set the font once in the screen's style and all text on that screen will inherit it by default.
|
||||
|
||||
|
||||
Local style properties also can be added to the objects. It creates a style is inside the object that is used only by the object:
|
||||
Local style properties also can be added to the objects. It creates a style which resides inside the object and which is used only by the object:
|
||||
```c
|
||||
lv_obj_set_style_bg_color(slider1, lv_color_hex(0x2080bb), LV_PART_INDICATOR | LV_STATE_PRESSED);
|
||||
```
|
||||
|
||||
To learn all the features of styles see the [Style overview](/overview/style) section
|
||||
To learn all the features of styles see the [Style overview](/overview/style) section.
|
||||
|
||||
|
||||
### Themes
|
||||
|
||||
Reference in New Issue
Block a user