Skip to content

Commit f82b029

Browse files
port LVGL 7.11
1 parent 7a7420e commit f82b029

File tree

358 files changed

+220402
-278930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

358 files changed

+220402
-278930
lines changed

.gitignore

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,12 @@
88

99
# PROS
1010
bin/
11-
template/
12-
*.ini
13-
14-
# this project
15-
liblvgl*.zip
16-
17-
# IDEs
1811
.vscode/
19-
.idea/
20-
21-
# static analysis and build tools
22-
.d/
23-
.clangd/
24-
.ccls-cache/
25-
.ccls
26-
cquery_log.txt
12+
template/
2713
compile_commands.json
28-
29-
# misc
3014
temp.log
3115
temp.errors
32-
.*.sw*
16+
*.ini
17+
.d/
18+
.clangd/
19+
.cache/

common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ LIBRARIES+=$(wildcard $(FWDIR)/*.a)
2121
EXCLUDE_COLD_LIBRARIES+=$(FWDIR)/libc.a $(FWDIR)/libm.a
2222
COLD_LIBRARIES=$(filter-out $(EXCLUDE_COLD_LIBRARIES), $(LIBRARIES))
2323
wlprefix=-Wl,$(subst $(SPACE),$(COMMA),$1)
24-
LNK_FLAGS=--gc-sections --start-group $(strip $(LIBRARIES)) -lc -lm -lgcc -lstdc++ -lsupc++ --end-group -T$(FWDIR)/v5-common.ld
24+
LNK_FLAGS=--gc-sections --start-group $(strip $(LIBRARIES)) -lgcc -lstdc++ --end-group -T$(FWDIR)/v5-common.ld
2525

2626
ASMFLAGS=$(MFLAGS) $(WARNFLAGS)
2727
CFLAGS=$(MFLAGS) $(CPPFLAGS) $(WARNFLAGS) $(GCCFLAGS) --std=gnu11

firmware/libpros.a

-595 KB
Binary file not shown.

include/api.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* This file should not be modified by users, since it gets replaced whenever
99
* a kernel upgrade occurs.
1010
*
11-
* Copyright (c) 2017-2020, Purdue University ACM SIGBots.
11+
* Copyright (c) 2017-2021, Purdue University ACM SIGBots.
1212
* All rights reserved.
1313
*
1414
* This Source Code Form is subject to the terms of the Mozilla Public
@@ -40,26 +40,33 @@
4040
#endif /* __cplusplus */
4141

4242
#define PROS_VERSION_MAJOR 3
43-
#define PROS_VERSION_MINOR 2
44-
#define PROS_VERSION_PATCH 1
45-
#define PROS_VERSION_STRING "3.2.1-dirty.78.5aa0072"
43+
#define PROS_VERSION_MINOR 3
44+
#define PROS_VERSION_PATCH 2
45+
#define PROS_VERSION_STRING "3.3.2-dirty.16.9b263da"
4646

4747
#define PROS_ERR (INT32_MAX)
4848
#define PROS_ERR_F (INFINITY)
4949

5050
#include "pros/adi.h"
5151
#include "pros/colors.h"
52+
#include "pros/distance.h"
53+
#include "pros/ext_adi.h"
5254
#include "pros/imu.h"
5355
#include "pros/misc.h"
5456
#include "pros/motors.h"
57+
#include "pros/optical.h"
5558
#include "pros/rtos.h"
59+
#include "pros/rotation.h"
5660
#include "pros/vision.h"
5761

5862
#ifdef __cplusplus
5963
#include "pros/adi.hpp"
64+
#include "pros/distance.hpp"
6065
#include "pros/imu.hpp"
6166
#include "pros/misc.hpp"
6267
#include "pros/motors.hpp"
68+
#include "pros/optical.hpp"
69+
#include "pros/rotation.hpp"
6370
#include "pros/rtos.hpp"
6471
#include "pros/vision.hpp"
6572
#endif

include/display/licence.txt renamed to include/display/LICENCE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
MIT licence
2-
Copyright (c) 2016 Gábor Kiss-Vámosi
2+
Copyright (c) 2020 LVGL LLC
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation 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 furnished to do so, subject to the following conditions:
55

include/display/README.md

Lines changed: 152 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,161 @@
1-
# Littlev Graphics Libraray
1+
<h1 align="center"> LVGL - Light and Versatile Graphics Library</h1>
22

3-
![LittlevGL cover](http://www.gl.littlev.hu/home/main_cover_small.png)
3+
<p align="center">
4+
<img src="https://lvgl.io/assets/images/img_1.png">
5+
</p>
46

5-
LittlevGL provides everything you need to create a Graphical User Interface (GUI) on embedded systems with easy-to-use graphical elements, beautiful visual effects and low memory footprint.
7+
<p align="center">
8+
LVGL provides everything you need to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint.
9+
</p>
610

7-
Homepage: https://littlevgl.com
11+
<h4 align="center">
12+
<a href="https://lvgl.io">Website </a> &middot;
13+
<a href="https://lvgl.io/demos">Online demo</a> &middot;
14+
<a href="https://lvgl.github.io/lv_examples/">Nightly demos</a> &middot;
15+
<a href="https://docs.lvgl.io/">Docs</a> &middot;
16+
<a href="https://forum.lvgl.io">Forum</a>
17+
</h4>
818

9-
### Table Of Content
10-
* [Key features](#key-features)
11-
* [Porting](#porting)
12-
* [Project set-up](#project-set-up)
13-
* [PC simulator](#pc-simulator)
14-
* [Screenshots](#screenshots)
15-
* [Contributing](#contributing)
16-
* [Donate](#donate)
19+
---
1720

18-
## Key features
19-
* Powerful building blocks buttons, charts, lists, sliders, images etc
20-
* Advanced graphics with animations, anti-aliasing, opacity, smooth scrolling
21-
* Various input devices touch pad, mouse, keyboard, encoder, buttons etc
22-
* Multi language support with UTF-8 decoding
23-
* Fully customizable graphical elements
21+
## Features
22+
* Powerful [building blocks](https://docs.lvgl.io/latest/en/html/widgets/index.html): buttons, charts, lists, sliders, images, etc.
23+
* Advanced graphics: animations, anti-aliasing, opacity, smooth scrolling
24+
* Use [various input devices](https://docs.lvgl.io/latest/en/html/overview/indev.html): touchscreen, mouse, keyboard, encoder, buttons, etc.
25+
* Use [multiple displays](https://docs.lvgl.io/latest/en/html/overview/display.html): e.g. monochrome and color display
2426
* Hardware independent to use with any microcontroller or display
25-
* Scalable to operate with few memory (50 kB Flash, 10 kB RAM)
26-
* OS, External memory and GPU supported but not required
27-
* Single frame buffer operation even with advances graphical effects
28-
* Written in C for maximal compatibility
29-
* Simulator to develop on PC without embedded hardware
30-
* Tutorials, examples, themes for rapid development
31-
* Documentation and API references online
32-
33-
## Porting
34-
In the most sime case you need 4 things:
35-
1. Call `lv_tick_inc(1)` in every millisecods in a Timer or Task
36-
2. Register a function which can **copy a pixel array** to an area of the screen
37-
3. Register a function which can **read an input device**. (E.g. touch pad)
38-
4. Call `lv_task_handler()` periodically in every few milliseconds
39-
For more information visit https://littlevgl.com/porting
40-
41-
## Project set-up
42-
1. **Clone** or [Download](https://littlevgl.com/download) the lvgl repository: `git clone https://github.com/littlevgl/lvgl.git`
43-
2. **Create project** with your preferred IDE and add the *lvgl* folder
44-
3. Copy **lvgl/lv_conf_templ.h** as **lv_conf.h** next to the *lvgl* folder
45-
4. In the lv_conf.h delete the first `#if 0` and its `#endif`. Let the default configurations at first.
46-
5. In your *main.c*: #include "lvgl/lvgl.h"
47-
6. In your *main function*:
48-
* lvgl_init();
49-
* tick, display and input device initialization (see above)
50-
7. To **test** create a label: `lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);`
51-
8. In the main *while(1)* call `lv_task_handler();` and make a few milliseconds delay (e.g. `my_delay_ms(5);`)
52-
9. Compile the code and load it to your embedded hardware
53-
54-
## PC Simulator
55-
If you don't have got an embedded hardware you can test the graphics library in a PC simulator. The simulator uses [SDL2](https://www.libsdl.org/) to emulate a display on your monitor and a touch pad with your mouse.
56-
57-
There is a pre-configured PC project for **Eclipse CDT** in this repository: https://github.com/littlevgl/pc_simulator
58-
59-
## Screenshots
60-
![TFT material](http://www.gl.littlev.hu/github_res/tft_material.png)
61-
![TFT zen](http://www.gl.littlev.hu/github_res/tft_zen.png)
62-
![TFT alien](http://www.gl.littlev.hu/github_res/tft_alien.png)
63-
![TFT night](http://www.gl.littlev.hu/github_res/tft_night.png)
27+
* Scalable to operate with little memory (64 kB Flash, 10 kB RAM)
28+
* Multi-language support with UTF-8 handling, Bidirectional and Arabic script support
29+
* Fully customizable graphical elements via [CSS-like styles](https://docs.lvgl.io/latest/en/html/overview/style.html)
30+
* OS, External memory and GPU are supported but not required
31+
* Smooth rendering even with a [single frame buffer](https://docs.lvgl.io/latest/en/html/porting/display.html)
32+
* Written in C for maximal compatibility (C++ compatible)
33+
* Micropython Binding exposes [LVGL API in Micropython](https://blog.lvgl.io/2019-02-20/micropython-bindings)
34+
* [Simulator](https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html) to develop on PC without embedded hardware
35+
* [Examples](lv_examples) and tutorials for rapid development
36+
* [Documentation](http://docs.lvgl.io/) and API references
6437

65-
## Contributing
66-
See [CONTRIBUTING.md](https://github.com/littlevgl/lvgl/blob/master/docs/CONTRIBUTING.md)
38+
## Requirements
39+
Basically, every modern controller (which is able to drive a display) is suitable to run LVGL. The minimal requirements are:
40+
41+
<table>
42+
<tr>
43+
<td> <strong>Name</strong> </td>
44+
<td><strong>Minimal</strong></td>
45+
<td><strong>Recommended</strong></td>
46+
</tr>
47+
<tr>
48+
<td><strong>Architecture</strong></td>
49+
<td colspan="2">16, 32 or 64 bit microcontroller or processor</td>
50+
</tr>
51+
<tr>
52+
<td> <strong>Clock</strong></td>
53+
<td> &gt; 16 MHz </td>
54+
<td> &gt; 48 MHz</td>
55+
</tr>
56+
57+
<tr>
58+
<td> <strong>Flash/ROM</strong></td>
59+
<td> &gt; 64 kB </td>
60+
<td> &gt; 180 kB</td>
61+
</tr>
62+
63+
<tr>
64+
<td> <strong>Static RAM</strong></td>
65+
<td> &gt; 2 kB </td>
66+
<td> &gt; 4 kB</td>
67+
</tr>
68+
69+
<tr>
70+
<td> <strong>Stack</strong></td>
71+
<td> &gt; 2 kB </td>
72+
<td> &gt; 8 kB</td>
73+
</tr>
74+
75+
<tr>
76+
<td> <strong>Heap</strong></td>
77+
<td> &gt; 2 kB </td>
78+
<td> &gt; 8 kB</td>
79+
</tr>
80+
81+
<tr>
82+
<td> <strong>Display buffer</strong></td>
83+
<td> &gt; 1 &times; <em>hor. res.</em> pixels </td>
84+
<td> &gt; 10 &times; <em>hor. res.</em> pixels </td>
85+
</tr>
86+
87+
<tr>
88+
<td> <strong>Compiler</strong></td>
89+
<td colspan="2"> C99 or newer </td>
90+
</tr>
91+
</table>
92+
93+
*Note that the memory usage might vary depending on the architecture, compiler and build options.*
94+
95+
Just to mention some platforms:
96+
- STM32F1, STM32F3, STM32F4, STM32F7, STM32L4, STM32L5, STM32H7
97+
- Microchip dsPIC33, PIC24, PIC32MX, PIC32MZ
98+
- NXP: Kinetis, LPC, iMX, iMX RT
99+
- [Linux frame buffer](https://blog.lvgl.io/2018-01-03/linux_fb) (/dev/fb)
100+
- [Raspberry Pi](http://www.vk3erw.com/index.php/16-software/63-raspberry-pi-official-7-touchscreen-and-littlevgl)
101+
- [Espressif ESP32](https://github.com/lvgl/lv_port_esp32)
102+
- [Infineon Aurix](https://github.com/lvgl/lv_port_aurix)
103+
- Nordic NRF52 Bluetooth modules
104+
- Quectel modems
67105

68-
## Donate
69-
If you are pleased with the graphics library, found it useful or be happy with the support you got, please help its further development:
106+
## Get started
107+
This list shows the recommended way of learning the library:
108+
1. Check the [Online demos](https://lvgl.io/demos) to see LVGL in action (3 minutes)
109+
2. Read the [Introduction](https://docs.lvgl.io/latest/en/html/intro/index.html) page of the documentation (5 minutes)
110+
3. Get familiar with the basics on the [Quick overview](https://docs.lvgl.io/latest/en/html/get-started/quick-overview.html) page (15 minutes)
111+
4. Set up a [Simulator](https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html) (10 minutes)
112+
5. Try out some [Examples](https://github.com/lvgl/lv_examples/)
113+
6. Port LVGL to a board. See the [Porting](https://docs.lvgl.io/latest/en/html/porting/index.html) guide or check the ready to use [Projects](https://github.com/lvgl?q=lv_port_&type=&language=)
114+
7. Read the [Overview](https://docs.lvgl.io/latest/en/html/overview/index.html) page to get a better understanding of the library (2-3 hours)
115+
8. Check the documentation of the [Widgets](https://docs.lvgl.io/latest/en/html/widgets/index.html) to see their features and usage
116+
9. If you have questions go to the [Forum](http://forum.lvgl.io/)
117+
10. Read the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) guide to see how you can help to improve LVGL (15 minutes)
118+
119+
## Examples
120+
121+
For more examples see the [lv_examples](https://github.com/lvgl/lv_examples) repository.
122+
123+
### Button with label
124+
```c
125+
lv_obj_t * btn = lv_btn_create(lv_scr_act(), NULL); /*Add a button to the current screen*/
126+
lv_obj_set_pos(btn, 10, 10); /*Set its position*/
127+
lv_obj_set_size(btn, 100, 50); /*Set its size*/
128+
lv_obj_set_event_cb(btn, btn_event_cb); /*Assign a callback to the button*/
129+
130+
lv_obj_t * label = lv_label_create(btn, NULL); /*Add a label to the button*/
131+
lv_label_set_text(label, "Button"); /*Set the labels text*/
132+
133+
...
134+
135+
void btn_event_cb(lv_obj_t * btn, lv_event_t event)
136+
{
137+
if(event == LV_EVENT_CLICKED) {
138+
printf("Clicked\n");
139+
}
140+
}
141+
```
142+
![LVGL button with label example](https://raw.githubusercontent.com/lvgl/docs/latest/misc/simple_button_example.gif)
143+
144+
### LVGL from Micropython
145+
Learn more about [Micropython](https://docs.lvgl.io/latest/en/html/get-started/micropython.html).
146+
```python
147+
# Create a Button and a Label
148+
scr = lv.obj()
149+
btn = lv.btn(scr)
150+
btn.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0)
151+
label = lv.label(btn)
152+
label.set_text("Button")
153+
154+
# Load the screen
155+
lv.scr_load(scr)
156+
```
157+
158+
## Contributing
159+
LVGL is an open project and contribution is very welcome. There are many ways to contribute from simply speaking about your project, through writing examples, improving the documentation, fixing bugs to hosing your own project under in LVGL.
70160

71-
[![Donate](https://littlevgl.com/donate_dir/donate_btn.png)](https://littlevgl.com/donate)
161+
For a detailed description of contribution opportunities visit the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) section of the documentation.

0 commit comments

Comments
 (0)