mirror of https://github.com/arendst/Tasmota.git
Merge pull request #11789 from s-hadinger/lvgl_v7.11_2
Add LVGL 7.11 support with Berry binding (ESP32 only)
This commit is contained in:
commit
19314a7fc4
|
@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
|
|||
### Added
|
||||
- Optional GUI file editor enabled with define ``GUI_EDIT_FILE`` by barbudor (#11668)
|
||||
- Initial support for universal display driver UDisplay by Gerhard Mutz. Enable by selecting any GPIO as ``Option A3`` (#11665)
|
||||
- Add LVGL 7.11 support with Berry binding (ESP32 only)
|
||||
|
||||
### Breaking Changed
|
||||
- ESP32 partition layout changed to accomodate more file space on most and more code space on core2 and odroid-go (#11746)
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
CFLAGS = -Wall -Wextra -std=c99 -pedantic-errors -O2
|
||||
LIBS = -lm
|
||||
TARGET = berry
|
||||
CC ?= gcc
|
||||
MKDIR = mkdir
|
||||
LFLAGS =
|
||||
|
||||
INCPATH = src default
|
||||
SRCPATH = src default
|
||||
GENERATE = generate
|
||||
CONFIG = default/berry_conf.h
|
||||
COC = tools/coc/coc
|
||||
CONST_TAB = $(GENERATE)/be_const_strtab.h
|
||||
MAKE_COC = $(MAKE) -C tools/coc
|
||||
|
||||
ifeq ($(OS), Windows_NT) # Windows
|
||||
CFLAGS += -Wno-format # for "%I64d" warning
|
||||
LFLAGS += -Wl,--out-implib,berry.lib # export symbols lib for dll linked
|
||||
TARGET := $(TARGET).exe
|
||||
COC := $(COC).exe
|
||||
else
|
||||
CFLAGS += -DUSE_READLINE_LIB
|
||||
LIBS += -lreadline -ldl
|
||||
OS := $(shell uname)
|
||||
ifeq ($(OS), Linux)
|
||||
LFLAGS += -Wl,--export-dynamic
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(V), 1)
|
||||
Q=@
|
||||
MSG=@echo
|
||||
MAKE_COC += -s Q=$(Q)
|
||||
else
|
||||
MSG=@true
|
||||
endif
|
||||
|
||||
ifeq ($(TEST), 1)
|
||||
CFLAGS += -fprofile-arcs -ftest-coverage
|
||||
LFLAGS += -fprofile-arcs -ftest-coverage
|
||||
endif
|
||||
|
||||
SRCS = $(foreach dir, $(SRCPATH), $(wildcard $(dir)/*.c))
|
||||
OBJS = $(patsubst %.c, %.o, $(SRCS))
|
||||
DEPS = $(patsubst %.c, %.d, $(SRCS))
|
||||
INCFLAGS = $(foreach dir, $(INCPATH), -I"$(dir)")
|
||||
|
||||
.PHONY : clean
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
debug: CFLAGS += -O0 -g -DBE_DEBUG
|
||||
debug: all
|
||||
|
||||
test: CFLAGS += --coverage
|
||||
test: LFLAGS += --coverage
|
||||
test: all
|
||||
$(MSG) [Run Testcases...]
|
||||
$(Q) ./testall.be
|
||||
$(Q) $(RM) */*.gcno */*.gcda
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(MSG) [Linking...]
|
||||
$(Q) $(CC) $(OBJS) $(LFLAGS) $(LIBS) -o $@
|
||||
$(MSG) done
|
||||
|
||||
$(OBJS): %.o: %.c
|
||||
$(MSG) [Compile] $<
|
||||
$(Q) $(CC) -MM $(CFLAGS) $(INCFLAGS) -MT"$*.d" -MT"$(<:.c=.o)" $< > $*.d
|
||||
$(Q) $(CC) $(CFLAGS) $(INCFLAGS) -c $< -o $@
|
||||
|
||||
sinclude $(DEPS)
|
||||
|
||||
$(OBJS): $(CONST_TAB)
|
||||
|
||||
$(CONST_TAB): $(COC) $(GENERATE) $(SRCS) $(CONFIG)
|
||||
$(MSG) [Prebuild] generate resources
|
||||
$(Q) $(COC) -i $(SRCPATH) -c $(CONFIG) -o $(GENERATE)
|
||||
|
||||
$(GENERATE):
|
||||
$(Q) $(MKDIR) $(GENERATE)
|
||||
|
||||
$(COC):
|
||||
$(MSG) [Make] coc
|
||||
$(Q) $(MAKE_COC)
|
||||
|
||||
install:
|
||||
cp $(TARGET) /usr/local/bin
|
||||
|
||||
uninstall:
|
||||
$(RM) /usr/local/bin/$(TARGET)
|
||||
|
||||
prebuild: $(COC) $(GENERATE)
|
||||
$(MSG) [Prebuild] generate resources
|
||||
$(Q) $(COC) -o $(GENERATE) $(SRCPATH) -c $(CONFIG)
|
||||
$(MSG) done
|
||||
|
||||
clean:
|
||||
$(MSG) [Clean...]
|
||||
$(Q) $(RM) $(OBJS) $(DEPS) $(GENERATE)/* berry.lib
|
||||
$(Q) $(MAKE_COC) clean
|
||||
$(MSG) done
|
|
@ -0,0 +1,163 @@
|
|||
<p align="center">
|
||||
<h1 align="center">
|
||||
<img src="https://gitee.com/mirrors/Berry/raw/master/berry-logo.png" alt="Berry" width=272 height=128>
|
||||
</h1>
|
||||
<p align="center">The Berry Script Language.</p>
|
||||
</p>
|
||||
|
||||
## Introduction
|
||||
|
||||
Berry is a ultra-lightweight dynamically typed embedded scripting language. It is designed for lower-performance embedded devices. The Berry interpreter-core's code size is less than 40KiB and can run on less than 4KiB heap (on ARM Cortex M4 CPU, Thumb ISA and ARMCC compiler).
|
||||
|
||||
The interpreter of Berry include a one-pass compiler and register-based VM, all the code is written in ANSI C99. In Berry not every type is a class object. Some simple value types, such as int, real, boolean and string are not class object, but list, map and range are class object. This is a consideration about performance.
|
||||
Register-based VM is the same meaning as above.
|
||||
|
||||
Berry has the following advantages:
|
||||
|
||||
* Lightweight: A well-optimized interpreter with very little resources. Ideal for use in microprocessors.
|
||||
* Fast: optimized one-pass bytecode compiler and register-based virtual machine.
|
||||
* Powerful: supports imperative programming, object-oriented programming, functional programming.
|
||||
* Flexible: Berry is a dynamic type script, and it's intended for embedding in applications. It can provide good dynamic scalability for the host system.
|
||||
* Simple: simple and natural syntax, support garbage collection, and easy to use FFI (foreign function interface).
|
||||
* RAM saving: With compile-time object construction, most of the constant objects are stored in read-only code data segments, so the RAM usage of the interpreter is very low when it starts.
|
||||
|
||||
## Documents
|
||||
|
||||
LaTeX documents repository: [https://github.com/Skiars/berry_doc](https://github.com/Skiars/berry_doc)
|
||||
|
||||
Short Manual: [berry_short_manual.pdf](https://github.com/Skiars/berry_doc/releases/download/latest/berry_short_manual.pdf).
|
||||
|
||||
Reference Manual: [berry_rm_en_us.pdf](https://github.com/Skiars/berry_doc/releases/download/latest/berry_rm_en_us.pdf), [berry_rm_zh_cn.pdf](https://github.com/Skiars/berry_doc/releases/download/latest/berry_rm_zh_cn.pdf).
|
||||
|
||||
Berry's EBNF grammar definition: [tools/grammar/berry.ebnf](./tools/grammar/berry.ebnf)
|
||||
|
||||
## Features
|
||||
|
||||
* Base Type
|
||||
* Nil: `nil`
|
||||
* Boolean: `true` and `false`
|
||||
* Numerical: Integer (`int`) and Real (`real`)
|
||||
* String: Single quotation-mark string and double quotation-mark string
|
||||
* Class: Instance template, read only
|
||||
* Instance: Object constructed by class
|
||||
* Module: Read-write key-value pair table
|
||||
* List: Ordered container, like `[1, 2, 3]`
|
||||
* Map: Hash Map container, like `{ 'a': 1, 2: 3, 'map': {} }`
|
||||
* Range: include a lower and a upper integer value, like `0..5`
|
||||
* Operator and Expression
|
||||
* Assign operator: `=`, `+=`, `-=`, `*=`, `/=`, `%=`, `&=`, `|=`, `^=`, `<<=`, `>>=`
|
||||
* Relational operator: `<`, `<=`, `==`, `!=`, `>`, `>=`
|
||||
* Logic operator: `&&`, `||`, `!`
|
||||
* Arithmetic operator: `+`, `-`, `*`, `/`, `%`
|
||||
* Bitwise operator: `&`, `|`, `~`, `^`, `<<`, `>>`
|
||||
* Field operator: `.`
|
||||
* Subscript operator: `[]`
|
||||
* Connect string operator: `+`
|
||||
* Conditional operator: `? :`
|
||||
* Brackets: `()`
|
||||
* Control Structure
|
||||
* Conditional statement: `if-else`
|
||||
* Iteration statement: `while` and `for`
|
||||
* Jump statement: `break` and `continue`
|
||||
* Function
|
||||
* Local variable and block scope
|
||||
* Return statement
|
||||
* Nested functions definition
|
||||
* Closure based on Upvalue
|
||||
* Anonymous function
|
||||
* Lambda expression
|
||||
* Class
|
||||
* Inheritance (only public single inheritance)
|
||||
* Method and Operator Overload
|
||||
* Constructor method
|
||||
* Destructive method
|
||||
* Module Management
|
||||
* Built-in module that takes almost no RAM
|
||||
* Extension module support: script module, bytecode file module and shared library (like *.so, *.dll) module
|
||||
* GC (Garbage collection)
|
||||
* Mark-Sweep GC
|
||||
* Exceptional Handling
|
||||
* Throw any exception value using the `raise` statement
|
||||
* Multiple catch mode
|
||||
* Bytecode file support
|
||||
* Export function to bytecode file
|
||||
* Load the bytecode file and execute
|
||||
|
||||
## Build and Run
|
||||
|
||||
1. Install the readline library (Windows does not need):
|
||||
|
||||
``` bash
|
||||
sudo apt install libreadline-dev # Ubuntu
|
||||
brew install readline # MacOS
|
||||
```
|
||||
|
||||
2. Build (The default compiler is GCC):
|
||||
|
||||
```
|
||||
make
|
||||
```
|
||||
|
||||
3. Run:
|
||||
|
||||
``` bash
|
||||
./berry # Bash or PowerShell
|
||||
berry # Windows CMD
|
||||
```
|
||||
|
||||
4. Install (Only Unix-like):
|
||||
|
||||
``` bash
|
||||
make install
|
||||
```
|
||||
|
||||
## Editor pulgins
|
||||
|
||||
[Visual Studio Code](https://code.visualstudio.com/) pulgin are in this directory: [./tools/pulgins/vscode](./tools/pulgins/vscode).
|
||||
|
||||
## Examples
|
||||
|
||||
After compiling successfully, use the `berry` command with no parameters to enter the REPL environment:
|
||||
```
|
||||
Berry 0.0.1 (build in Dec 24 2018, 18:12:49)
|
||||
[GCC 8.2.0] on Linux (default)
|
||||
>
|
||||
```
|
||||
|
||||
Now enter this code:
|
||||
|
||||
``` lua
|
||||
print("Hello world!")
|
||||
```
|
||||
|
||||
You will see this output:
|
||||
|
||||
```
|
||||
Hello world!
|
||||
```
|
||||
|
||||
You can copy this code to the REPL:
|
||||
|
||||
``` ruby
|
||||
def fib(x)
|
||||
if x <= 1
|
||||
return x
|
||||
end
|
||||
return fib(x - 1) + fib(x - 2)
|
||||
end
|
||||
fib(10)
|
||||
```
|
||||
|
||||
This example code will output the result `55` and you can save the above code to a plain text file (eg test.be) and run this command:
|
||||
|
||||
``` bash
|
||||
./berry test.be
|
||||
```
|
||||
|
||||
This will also get the correct output.
|
||||
|
||||
## License
|
||||
|
||||
Berry is free software distributed under the [MIT license](./LICENSE).
|
||||
|
||||
The Berry interpreter partly referred to [Lua](http://www.lua.org/)'s design. View Lua's license here: http://www.lua.org/license.html.
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,46 @@
|
|||
/********************************************************************
|
||||
* Tasmota LVGL Font class
|
||||
*******************************************************************/
|
||||
#include "be_object.h"
|
||||
#include "be_string.h"
|
||||
|
||||
#ifdef USE_LVGL
|
||||
|
||||
#include "lvgl.h"
|
||||
|
||||
extern int lco_init(bvm *vm); // generic function
|
||||
extern int lco_tostring(bvm *vm); // generic function
|
||||
|
||||
|
||||
#if BE_USE_PRECOMPILED_OBJECT
|
||||
#include "../generate/be_fixed_be_class_lv_color.h"
|
||||
#endif
|
||||
|
||||
void be_load_lvgl_color_lib(bvm *vm) {
|
||||
#if !BE_USE_PRECOMPILED_OBJECT
|
||||
static const bnfuncinfo members[] = {
|
||||
{ ".p", NULL }, // keeping track of styles to avoid GC
|
||||
{ "init", lco_init },
|
||||
{ "tostring", lco_tostring },
|
||||
|
||||
// { NULL, (bntvfunc) BE_CLOSURE }, /* mark section for berry closures */
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
be_regclass(vm, "lv_color", members);
|
||||
#else
|
||||
be_pushntvclass(vm, &be_class_lv_color);
|
||||
be_setglobal(vm, "lv_color");
|
||||
be_pop(vm, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* @const_object_info_begin
|
||||
class be_class_lv_color (scope: global, name: lv_color) {
|
||||
.p, var
|
||||
init, func(lco_init)
|
||||
tostring, func(lco_tostring)
|
||||
}
|
||||
@const_object_info_end */
|
||||
|
||||
#endif // USE_LVGL
|
|
@ -0,0 +1,45 @@
|
|||
/********************************************************************
|
||||
* Tasmota LVGL Font class
|
||||
*******************************************************************/
|
||||
#include "be_object.h"
|
||||
#include "be_string.h"
|
||||
|
||||
#ifdef USE_LVGL
|
||||
|
||||
#include "lvgl.h"
|
||||
|
||||
extern int lvx_init(bvm *vm); // generic function
|
||||
extern int lvx_tostring(bvm *vm); // generic function
|
||||
|
||||
#if BE_USE_PRECOMPILED_OBJECT
|
||||
#include "../generate/be_fixed_be_class_lv_font.h"
|
||||
#endif
|
||||
|
||||
void be_load_lvgl_font_lib(bvm *vm) {
|
||||
#if !BE_USE_PRECOMPILED_OBJECT
|
||||
static const bnfuncinfo members[] = {
|
||||
{ ".p", NULL }, // keeping track of styles to avoid GC
|
||||
{ "init", lvx_init },
|
||||
{ "tostring", lvx_tostring },
|
||||
|
||||
// { NULL, (bntvfunc) BE_CLOSURE }, /* mark section for berry closures */
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
be_regclass(vm, "lv_font", members);
|
||||
#else
|
||||
be_pushntvclass(vm, &be_class_lv_font);
|
||||
be_setglobal(vm, "lv_font");
|
||||
be_pop(vm, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* @const_object_info_begin
|
||||
class be_class_lv_font (scope: global, name: lv_font) {
|
||||
.p, var
|
||||
init, func(lvx_init)
|
||||
tostring, func(lvx_tostring)
|
||||
}
|
||||
@const_object_info_end */
|
||||
|
||||
#endif // USE_LVGL
|
File diff suppressed because it is too large
Load Diff
|
@ -24,6 +24,9 @@ be_extern_native_module(solidify);
|
|||
be_extern_native_module(light);
|
||||
be_extern_native_module(gpio);
|
||||
be_extern_native_module(energy);
|
||||
#ifdef USE_LVGL
|
||||
be_extern_native_module(lvgl);
|
||||
#endif // USE_LVGL
|
||||
|
||||
/* user-defined modules declare start */
|
||||
|
||||
|
@ -60,13 +63,15 @@ BERRY_LOCAL const bntvmodule* const be_module_table[] = {
|
|||
&be_native_module(solidify),
|
||||
#endif
|
||||
/* user-defined modules register start */
|
||||
// #ifdef ESP32
|
||||
#if BE_USE_TASMOTA
|
||||
&be_native_module(gpio),
|
||||
&be_native_module(light),
|
||||
#endif
|
||||
|
||||
#ifdef USE_LVGL
|
||||
&be_native_module(lvgl),
|
||||
#endif // USE_LVGL
|
||||
&be_native_module(energy),
|
||||
// #endif // ESP32
|
||||
#endif
|
||||
|
||||
/* user-defined modules register end */
|
||||
NULL /* do not remove */
|
||||
|
@ -77,6 +82,12 @@ extern void be_load_tasmota_ntvlib(bvm *vm);
|
|||
extern void be_load_wirelib(bvm *vm);
|
||||
extern void be_load_driverlib(bvm *vm);
|
||||
|
||||
#ifdef USE_LVGL
|
||||
extern void be_load_lvgl_color_lib(bvm *vm);
|
||||
extern void be_load_lvgl_font_lib(bvm *vm);
|
||||
extern void be_load_lv_all_lib(bvm *vm);
|
||||
#endif// USE_LVGL
|
||||
|
||||
/* this code loads the native class definitions */
|
||||
BERRY_API void be_load_custom_libs(bvm *vm)
|
||||
{
|
||||
|
@ -89,5 +100,12 @@ BERRY_API void be_load_custom_libs(bvm *vm)
|
|||
be_load_tasmota_ntvlib(vm);
|
||||
be_load_wirelib(vm);
|
||||
be_load_driverlib(vm);
|
||||
#ifdef USE_LVGL
|
||||
// LVGL
|
||||
be_load_lvgl_color_lib(vm);
|
||||
be_load_lvgl_font_lib(vm);
|
||||
|
||||
be_load_lv_all_lib(vm);
|
||||
#endif // USE_LVGL
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -10,6 +10,11 @@
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef COMPILE_BERRY_LIB
|
||||
#include "my_user_config.h"
|
||||
#include "tasmota_configurations.h"
|
||||
#endif
|
||||
|
||||
/* Macro: BE_DEBUG
|
||||
* Berry interpreter debug switch.
|
||||
* Default: 0
|
||||
|
@ -41,11 +46,7 @@
|
|||
* runtime. Enable this macro can greatly optimize RAM usage.
|
||||
* Default: 1
|
||||
// **/
|
||||
// #ifdef ESP8266
|
||||
// #define BE_USE_PRECOMPILED_OBJECT 0
|
||||
// #else
|
||||
#define BE_USE_PRECOMPILED_OBJECT 1 // will enable later when stabilized
|
||||
// #endif
|
||||
#define BE_USE_PRECOMPILED_OBJECT 1
|
||||
|
||||
/* Macro: BE_DEBUG_RUNTIME_INFO
|
||||
* Set runtime error debugging information.
|
||||
|
@ -178,8 +179,8 @@ extern "C" {
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#define BE_EXPLICIT_MALLOC special_malloc
|
||||
#define BE_EXPLICIT_REALLOC special_realloc
|
||||
#define BE_EXPLICIT_MALLOC berry_malloc
|
||||
#define BE_EXPLICIT_REALLOC berry_realloc
|
||||
#else
|
||||
#define BE_EXPLICIT_MALLOC malloc
|
||||
#define BE_EXPLICIT_REALLOC realloc
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,42 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_arc_map) {
|
||||
{ be_const_key(set_type, -1), be_const_func(lvbe_arc_set_type) },
|
||||
{ be_const_key(set_adjustable, -1), be_const_func(lvbe_arc_set_adjustable) },
|
||||
{ be_const_key(set_bg_start_angle, -1), be_const_func(lvbe_arc_set_bg_start_angle) },
|
||||
{ be_const_key(set_chg_rate, -1), be_const_func(lvbe_arc_set_chg_rate) },
|
||||
{ be_const_key(set_start_angle, 18), be_const_func(lvbe_arc_set_start_angle) },
|
||||
{ be_const_key(get_min_value, -1), be_const_func(lvbe_arc_get_min_value) },
|
||||
{ be_const_key(create, 7), be_const_func(lvbe_arc_create) },
|
||||
{ be_const_key(dot_p, 16), be_const_int(0) },
|
||||
{ be_const_key(get_bg_angle_start, 5), be_const_func(lvbe_arc_get_bg_angle_start) },
|
||||
{ be_const_key(is_dragged, -1), be_const_func(lvbe_arc_is_dragged) },
|
||||
{ be_const_key(set_range, 21), be_const_func(lvbe_arc_set_range) },
|
||||
{ be_const_key(get_angle_end, 6), be_const_func(lvbe_arc_get_angle_end) },
|
||||
{ be_const_key(get_max_value, 9), be_const_func(lvbe_arc_get_max_value) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_bg_angles, -1), be_const_func(lvbe_arc_set_bg_angles) },
|
||||
{ be_const_key(set_end_angle, -1), be_const_func(lvbe_arc_set_end_angle) },
|
||||
{ be_const_key(set_bg_end_angle, 23), be_const_func(lvbe_arc_set_bg_end_angle) },
|
||||
{ be_const_key(get_adjustable, -1), be_const_func(lvbe_arc_get_adjustable) },
|
||||
{ be_const_key(set_rotation, -1), be_const_func(lvbe_arc_set_rotation) },
|
||||
{ be_const_key(set_value, 10), be_const_func(lvbe_arc_set_value) },
|
||||
{ be_const_key(set_angles, -1), be_const_func(lvbe_arc_set_angles) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_arc_create) },
|
||||
{ be_const_key(get_angle_start, -1), be_const_func(lvbe_arc_get_angle_start) },
|
||||
{ be_const_key(get_bg_angle_end, -1), be_const_func(lvbe_arc_get_bg_angle_end) },
|
||||
{ be_const_key(get_type, 4), be_const_func(lvbe_arc_get_type) },
|
||||
{ be_const_key(get_value, 15), be_const_func(lvbe_arc_get_value) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_arc_map,
|
||||
26
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_arc,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_arc
|
||||
);
|
|
@ -0,0 +1,31 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_bar_map) {
|
||||
{ be_const_key(set_value, 8), be_const_func(lvbe_bar_set_value) },
|
||||
{ be_const_key(get_anim_time, -1), be_const_func(lvbe_bar_get_anim_time) },
|
||||
{ be_const_key(set_anim_time, 7), be_const_func(lvbe_bar_set_anim_time) },
|
||||
{ be_const_key(set_range, -1), be_const_func(lvbe_bar_set_range) },
|
||||
{ be_const_key(get_type, 11), be_const_func(lvbe_bar_get_type) },
|
||||
{ be_const_key(get_start_value, -1), be_const_func(lvbe_bar_get_start_value) },
|
||||
{ be_const_key(set_type, -1), be_const_func(lvbe_bar_set_type) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_bar_create) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_bar_create) },
|
||||
{ be_const_key(get_min_value, -1), be_const_func(lvbe_bar_get_min_value) },
|
||||
{ be_const_key(tostring, 1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_start_value, 13), be_const_func(lvbe_bar_set_start_value) },
|
||||
{ be_const_key(get_value, -1), be_const_func(lvbe_bar_get_value) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(get_max_value, -1), be_const_func(lvbe_bar_get_max_value) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_bar_map,
|
||||
15
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_bar,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_bar
|
||||
);
|
|
@ -0,0 +1,34 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_btn_map) {
|
||||
{ be_const_key(get_state, -1), be_const_func(lvbe_btn_get_state) },
|
||||
{ be_const_key(get_fit_top, 10), be_const_func(lvbe_btn_get_fit_top) },
|
||||
{ be_const_key(get_fit_bottom, 0), be_const_func(lvbe_btn_get_fit_bottom) },
|
||||
{ be_const_key(set_fit4, -1), be_const_func(lvbe_btn_set_fit4) },
|
||||
{ be_const_key(get_fit_right, -1), be_const_func(lvbe_btn_get_fit_right) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_btn_create) },
|
||||
{ be_const_key(set_fit, -1), be_const_func(lvbe_btn_set_fit) },
|
||||
{ be_const_key(tostring, 3), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_layout, -1), be_const_func(lvbe_btn_set_layout) },
|
||||
{ be_const_key(get_fit_left, -1), be_const_func(lvbe_btn_get_fit_left) },
|
||||
{ be_const_key(dot_p, 13), be_const_int(0) },
|
||||
{ be_const_key(set_state, 6), be_const_func(lvbe_btn_set_state) },
|
||||
{ be_const_key(set_checkable, 14), be_const_func(lvbe_btn_set_checkable) },
|
||||
{ be_const_key(toggle, -1), be_const_func(lvbe_btn_toggle) },
|
||||
{ be_const_key(get_layout, 16), be_const_func(lvbe_btn_get_layout) },
|
||||
{ be_const_key(init, 9), be_const_func(lvbe_btn_create) },
|
||||
{ be_const_key(get_checkable, -1), be_const_func(lvbe_btn_get_checkable) },
|
||||
{ be_const_key(set_fit2, 2), be_const_func(lvbe_btn_set_fit2) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_btn_map,
|
||||
18
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_btn,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_btn
|
||||
);
|
|
@ -0,0 +1,39 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_btnmatrix_map) {
|
||||
{ be_const_key(clear_btn_ctrl, 13), be_const_func(lvbe_btnmatrix_clear_btn_ctrl) },
|
||||
{ be_const_key(set_align, -1), be_const_func(lvbe_btnmatrix_set_align) },
|
||||
{ be_const_key(get_btn_text, 7), be_const_func(lvbe_btnmatrix_get_btn_text) },
|
||||
{ be_const_key(get_active_btn_text, -1), be_const_func(lvbe_btnmatrix_get_active_btn_text) },
|
||||
{ be_const_key(create, 3), be_const_func(lvbe_btnmatrix_create) },
|
||||
{ be_const_key(set_btn_ctrl_all, -1), be_const_func(lvbe_btnmatrix_set_btn_ctrl_all) },
|
||||
{ be_const_key(clear_btn_ctrl_all, 12), be_const_func(lvbe_btnmatrix_clear_btn_ctrl_all) },
|
||||
{ be_const_key(get_one_check, -1), be_const_func(lvbe_btnmatrix_get_one_check) },
|
||||
{ be_const_key(get_active_btn, -1), be_const_func(lvbe_btnmatrix_get_active_btn) },
|
||||
{ be_const_key(get_align, 22), be_const_func(lvbe_btnmatrix_get_align) },
|
||||
{ be_const_key(set_focused_btn, 4), be_const_func(lvbe_btnmatrix_set_focused_btn) },
|
||||
{ be_const_key(set_map, -1), be_const_func(lvbe_btnmatrix_set_map) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(set_one_check, 20), be_const_func(lvbe_btnmatrix_set_one_check) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_btnmatrix_create) },
|
||||
{ be_const_key(get_recolor, -1), be_const_func(lvbe_btnmatrix_get_recolor) },
|
||||
{ be_const_key(set_recolor, 8), be_const_func(lvbe_btnmatrix_set_recolor) },
|
||||
{ be_const_key(set_btn_ctrl, -1), be_const_func(lvbe_btnmatrix_set_btn_ctrl) },
|
||||
{ be_const_key(get_focused_btn, -1), be_const_func(lvbe_btnmatrix_get_focused_btn) },
|
||||
{ be_const_key(set_btn_width, 0), be_const_func(lvbe_btnmatrix_set_btn_width) },
|
||||
{ be_const_key(get_btn_ctrl, -1), be_const_func(lvbe_btnmatrix_get_btn_ctrl) },
|
||||
{ be_const_key(set_ctrl_map, 5), be_const_func(lvbe_btnmatrix_set_ctrl_map) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_btnmatrix_map,
|
||||
23
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_btnmatrix,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_btnmatrix
|
||||
);
|
|
@ -0,0 +1,27 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_calendar_map) {
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_calendar_create) },
|
||||
{ be_const_key(get_day_of_week, -1), be_const_func(lvbe_calendar_get_day_of_week) },
|
||||
{ be_const_key(get_highlighted_dates_num, 5), be_const_func(lvbe_calendar_get_highlighted_dates_num) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_highlighted_dates, -1), be_const_func(lvbe_calendar_set_highlighted_dates) },
|
||||
{ be_const_key(set_showed_date, -1), be_const_func(lvbe_calendar_set_showed_date) },
|
||||
{ be_const_key(set_day_names, -1), be_const_func(lvbe_calendar_set_day_names) },
|
||||
{ be_const_key(set_today_date, -1), be_const_func(lvbe_calendar_set_today_date) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(init, 4), be_const_func(lvbe_calendar_create) },
|
||||
{ be_const_key(set_month_names, -1), be_const_func(lvbe_calendar_set_month_names) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_calendar_map,
|
||||
11
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_calendar,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_calendar
|
||||
);
|
|
@ -0,0 +1,35 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_canvas_map) {
|
||||
{ be_const_key(init, 16), be_const_func(lvbe_canvas_create) },
|
||||
{ be_const_key(set_palette, -1), be_const_func(lvbe_canvas_set_palette) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(draw_img, -1), be_const_func(lvbe_canvas_draw_img) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(copy_buf, 6), be_const_func(lvbe_canvas_copy_buf) },
|
||||
{ be_const_key(create, 17), be_const_func(lvbe_canvas_create) },
|
||||
{ be_const_key(draw_arc, 10), be_const_func(lvbe_canvas_draw_arc) },
|
||||
{ be_const_key(get_px, 7), be_const_func(lvbe_canvas_get_px) },
|
||||
{ be_const_key(transform, -1), be_const_func(lvbe_canvas_transform) },
|
||||
{ be_const_key(draw_text, 3), be_const_func(lvbe_canvas_draw_text) },
|
||||
{ be_const_key(fill_bg, -1), be_const_func(lvbe_canvas_fill_bg) },
|
||||
{ be_const_key(draw_polygon, -1), be_const_func(lvbe_canvas_draw_polygon) },
|
||||
{ be_const_key(blur_ver, 0), be_const_func(lvbe_canvas_blur_ver) },
|
||||
{ be_const_key(blur_hor, -1), be_const_func(lvbe_canvas_blur_hor) },
|
||||
{ be_const_key(draw_line, -1), be_const_func(lvbe_canvas_draw_line) },
|
||||
{ be_const_key(draw_rect, -1), be_const_func(lvbe_canvas_draw_rect) },
|
||||
{ be_const_key(set_buffer, -1), be_const_func(lvbe_canvas_set_buffer) },
|
||||
{ be_const_key(set_px, -1), be_const_func(lvbe_canvas_set_px) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_canvas_map,
|
||||
19
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_canvas,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_canvas
|
||||
);
|
|
@ -0,0 +1,53 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_chart_map) {
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_chart_create) },
|
||||
{ be_const_key(set_secondary_y_tick_length, -1), be_const_func(lvbe_chart_set_secondary_y_tick_length) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_chart_create) },
|
||||
{ be_const_key(set_x_tick_length, -1), be_const_func(lvbe_chart_set_x_tick_length) },
|
||||
{ be_const_key(set_next, -1), be_const_func(lvbe_chart_set_next) },
|
||||
{ be_const_key(set_x_start_point, 14), be_const_func(lvbe_chart_set_x_start_point) },
|
||||
{ be_const_key(set_point_id, 23), be_const_func(lvbe_chart_set_point_id) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(set_ext_array, 12), be_const_func(lvbe_chart_set_ext_array) },
|
||||
{ be_const_key(get_cursor_point, 4), be_const_func(lvbe_chart_get_cursor_point) },
|
||||
{ be_const_key(hide_series, -1), be_const_func(lvbe_chart_hide_series) },
|
||||
{ be_const_key(refresh, -1), be_const_func(lvbe_chart_refresh) },
|
||||
{ be_const_key(set_point_count, -1), be_const_func(lvbe_chart_set_point_count) },
|
||||
{ be_const_key(set_secondary_y_tick_texts, -1), be_const_func(lvbe_chart_set_secondary_y_tick_texts) },
|
||||
{ be_const_key(set_points, 27), be_const_func(lvbe_chart_set_points) },
|
||||
{ be_const_key(set_update_mode, -1), be_const_func(lvbe_chart_set_update_mode) },
|
||||
{ be_const_key(set_y_tick_texts, 1), be_const_func(lvbe_chart_set_y_tick_texts) },
|
||||
{ be_const_key(set_cursor_point, -1), be_const_func(lvbe_chart_set_cursor_point) },
|
||||
{ be_const_key(get_point_count, -1), be_const_func(lvbe_chart_get_point_count) },
|
||||
{ be_const_key(init_points, 20), be_const_func(lvbe_chart_init_points) },
|
||||
{ be_const_key(remove_series, -1), be_const_func(lvbe_chart_remove_series) },
|
||||
{ be_const_key(set_series_axis, 8), be_const_func(lvbe_chart_set_series_axis) },
|
||||
{ be_const_key(set_type, -1), be_const_func(lvbe_chart_set_type) },
|
||||
{ be_const_key(clear_series, -1), be_const_func(lvbe_chart_clear_series) },
|
||||
{ be_const_key(set_div_line_count, -1), be_const_func(lvbe_chart_set_div_line_count) },
|
||||
{ be_const_key(get_point_id, 31), be_const_func(lvbe_chart_get_point_id) },
|
||||
{ be_const_key(tostring, 17), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_y_range, -1), be_const_func(lvbe_chart_set_y_range) },
|
||||
{ be_const_key(get_type, -1), be_const_func(lvbe_chart_get_type) },
|
||||
{ be_const_key(get_series_axis, 30), be_const_func(lvbe_chart_get_series_axis) },
|
||||
{ be_const_key(set_y_tick_length, -1), be_const_func(lvbe_chart_set_y_tick_length) },
|
||||
{ be_const_key(get_nearest_index_from_coord, -1), be_const_func(lvbe_chart_get_nearest_index_from_coord) },
|
||||
{ be_const_key(set_x_tick_texts, -1), be_const_func(lvbe_chart_set_x_tick_texts) },
|
||||
{ be_const_key(get_x_from_index, -1), be_const_func(lvbe_chart_get_x_from_index) },
|
||||
{ be_const_key(get_x_start_point, -1), be_const_func(lvbe_chart_get_x_start_point) },
|
||||
{ be_const_key(get_series_area, 33), be_const_func(lvbe_chart_get_series_area) },
|
||||
{ be_const_key(get_y_from_index, -1), be_const_func(lvbe_chart_get_y_from_index) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_chart_map,
|
||||
37
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_chart,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_chart
|
||||
);
|
|
@ -0,0 +1,29 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_checkbox_map) {
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(get_state, -1), be_const_func(lvbe_checkbox_get_state) },
|
||||
{ be_const_key(is_checked, 7), be_const_func(lvbe_checkbox_is_checked) },
|
||||
{ be_const_key(dot_p, 4), be_const_int(0) },
|
||||
{ be_const_key(create, 9), be_const_func(lvbe_checkbox_create) },
|
||||
{ be_const_key(set_state, -1), be_const_func(lvbe_checkbox_set_state) },
|
||||
{ be_const_key(is_inactive, 10), be_const_func(lvbe_checkbox_is_inactive) },
|
||||
{ be_const_key(set_disabled, -1), be_const_func(lvbe_checkbox_set_disabled) },
|
||||
{ be_const_key(set_checked, -1), be_const_func(lvbe_checkbox_set_checked) },
|
||||
{ be_const_key(get_text, -1), be_const_func(lvbe_checkbox_get_text) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_checkbox_create) },
|
||||
{ be_const_key(set_text, 3), be_const_func(lvbe_checkbox_set_text) },
|
||||
{ be_const_key(set_text_static, 2), be_const_func(lvbe_checkbox_set_text_static) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_checkbox_map,
|
||||
13
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_checkbox,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_checkbox
|
||||
);
|
|
@ -0,0 +1,19 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_color_map) {
|
||||
{ be_const_key(init, -1), be_const_func(lco_init) },
|
||||
{ be_const_key(tostring, 2), be_const_func(lco_tostring) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_color_map,
|
||||
3
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_color,
|
||||
1,
|
||||
NULL,
|
||||
lv_color
|
||||
);
|
|
@ -0,0 +1,29 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_cont_map) {
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(get_layout, -1), be_const_func(lvbe_cont_get_layout) },
|
||||
{ be_const_key(set_fit2, -1), be_const_func(lvbe_cont_set_fit2) },
|
||||
{ be_const_key(set_fit, -1), be_const_func(lvbe_cont_set_fit) },
|
||||
{ be_const_key(get_fit_top, -1), be_const_func(lvbe_cont_get_fit_top) },
|
||||
{ be_const_key(get_fit_bottom, -1), be_const_func(lvbe_cont_get_fit_bottom) },
|
||||
{ be_const_key(init, 9), be_const_func(lvbe_cont_create) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_cont_create) },
|
||||
{ be_const_key(get_fit_right, 1), be_const_func(lvbe_cont_get_fit_right) },
|
||||
{ be_const_key(get_fit_left, -1), be_const_func(lvbe_cont_get_fit_left) },
|
||||
{ be_const_key(set_layout, -1), be_const_func(lvbe_cont_set_layout) },
|
||||
{ be_const_key(dot_p, 7), be_const_int(0) },
|
||||
{ be_const_key(set_fit4, -1), be_const_func(lvbe_cont_set_fit4) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_cont_map,
|
||||
13
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_cont,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_cont
|
||||
);
|
|
@ -0,0 +1,37 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_cpicker_map) {
|
||||
{ be_const_key(init, 2), be_const_func(lvbe_cpicker_create) },
|
||||
{ be_const_key(get_hue, -1), be_const_func(lvbe_cpicker_get_hue) },
|
||||
{ be_const_key(get_value, -1), be_const_func(lvbe_cpicker_get_value) },
|
||||
{ be_const_key(set_color, 13), be_const_func(lvbe_cpicker_set_color) },
|
||||
{ be_const_key(set_color_mode, -1), be_const_func(lvbe_cpicker_set_color_mode) },
|
||||
{ be_const_key(get_knob_colored, 15), be_const_func(lvbe_cpicker_get_knob_colored) },
|
||||
{ be_const_key(get_color_mode, -1), be_const_func(lvbe_cpicker_get_color_mode) },
|
||||
{ be_const_key(set_hsv, 18), be_const_func(lvbe_cpicker_set_hsv) },
|
||||
{ be_const_key(set_saturation, -1), be_const_func(lvbe_cpicker_set_saturation) },
|
||||
{ be_const_key(set_knob_colored, -1), be_const_func(lvbe_cpicker_set_knob_colored) },
|
||||
{ be_const_key(set_hue, 17), be_const_func(lvbe_cpicker_set_hue) },
|
||||
{ be_const_key(set_color_mode_fixed, -1), be_const_func(lvbe_cpicker_set_color_mode_fixed) },
|
||||
{ be_const_key(set_value, 0), be_const_func(lvbe_cpicker_set_value) },
|
||||
{ be_const_key(set_type, -1), be_const_func(lvbe_cpicker_set_type) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_cpicker_create) },
|
||||
{ be_const_key(get_color, 16), be_const_func(lvbe_cpicker_get_color) },
|
||||
{ be_const_key(get_color_mode_fixed, -1), be_const_func(lvbe_cpicker_get_color_mode_fixed) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(get_saturation, -1), be_const_func(lvbe_cpicker_get_saturation) },
|
||||
{ be_const_key(get_hsv, -1), be_const_func(lvbe_cpicker_get_hsv) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_cpicker_map,
|
||||
21
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_cpicker,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_cpicker
|
||||
);
|
|
@ -0,0 +1,41 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_dropdown_map) {
|
||||
{ be_const_key(get_selected, -1), be_const_func(lvbe_dropdown_get_selected) },
|
||||
{ be_const_key(get_show_selected, -1), be_const_func(lvbe_dropdown_get_show_selected) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_dropdown_create) },
|
||||
{ be_const_key(set_symbol, 18), be_const_func(lvbe_dropdown_set_symbol) },
|
||||
{ be_const_key(get_text, -1), be_const_func(lvbe_dropdown_get_text) },
|
||||
{ be_const_key(set_text, 2), be_const_func(lvbe_dropdown_set_text) },
|
||||
{ be_const_key(set_dir, 8), be_const_func(lvbe_dropdown_set_dir) },
|
||||
{ be_const_key(get_dir, -1), be_const_func(lvbe_dropdown_get_dir) },
|
||||
{ be_const_key(get_option_cnt, -1), be_const_func(lvbe_dropdown_get_option_cnt) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_dropdown_create) },
|
||||
{ be_const_key(set_selected, -1), be_const_func(lvbe_dropdown_set_selected) },
|
||||
{ be_const_key(dot_p, 24), be_const_int(0) },
|
||||
{ be_const_key(open, 7), be_const_func(lvbe_dropdown_open) },
|
||||
{ be_const_key(set_max_height, -1), be_const_func(lvbe_dropdown_set_max_height) },
|
||||
{ be_const_key(add_option, -1), be_const_func(lvbe_dropdown_add_option) },
|
||||
{ be_const_key(set_show_selected, 16), be_const_func(lvbe_dropdown_set_show_selected) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_options_static, 9), be_const_func(lvbe_dropdown_set_options_static) },
|
||||
{ be_const_key(clear_options, -1), be_const_func(lvbe_dropdown_clear_options) },
|
||||
{ be_const_key(get_max_height, 11), be_const_func(lvbe_dropdown_get_max_height) },
|
||||
{ be_const_key(set_options, 15), be_const_func(lvbe_dropdown_set_options) },
|
||||
{ be_const_key(close, -1), be_const_func(lvbe_dropdown_close) },
|
||||
{ be_const_key(get_selected_str, -1), be_const_func(lvbe_dropdown_get_selected_str) },
|
||||
{ be_const_key(get_symbol, 13), be_const_func(lvbe_dropdown_get_symbol) },
|
||||
{ be_const_key(get_options, -1), be_const_func(lvbe_dropdown_get_options) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_dropdown_map,
|
||||
25
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_dropdown,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_dropdown
|
||||
);
|
|
@ -0,0 +1,19 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_font_map) {
|
||||
{ be_const_key(init, -1), be_const_func(lvx_init) },
|
||||
{ be_const_key(tostring, 2), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_font_map,
|
||||
3
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_font,
|
||||
1,
|
||||
NULL,
|
||||
lv_font
|
||||
);
|
|
@ -0,0 +1,40 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_gauge_map) {
|
||||
{ be_const_key(get_needle_img_pivot_y, -1), be_const_func(lvbe_gauge_get_needle_img_pivot_y) },
|
||||
{ be_const_key(get_needle_img_pivot_x, -1), be_const_func(lvbe_gauge_get_needle_img_pivot_x) },
|
||||
{ be_const_key(get_line_count, -1), be_const_func(lvbe_gauge_get_line_count) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_gauge_create) },
|
||||
{ be_const_key(dot_p, 20), be_const_int(0) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_gauge_create) },
|
||||
{ be_const_key(get_min_value, 2), be_const_func(lvbe_gauge_get_min_value) },
|
||||
{ be_const_key(set_range, -1), be_const_func(lvbe_gauge_set_range) },
|
||||
{ be_const_key(get_max_value, -1), be_const_func(lvbe_gauge_get_max_value) },
|
||||
{ be_const_key(get_value, 7), be_const_func(lvbe_gauge_get_value) },
|
||||
{ be_const_key(get_label_count, -1), be_const_func(lvbe_gauge_get_label_count) },
|
||||
{ be_const_key(set_needle_img, 1), be_const_func(lvbe_gauge_set_needle_img) },
|
||||
{ be_const_key(get_needle_count, -1), be_const_func(lvbe_gauge_get_needle_count) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_scale, -1), be_const_func(lvbe_gauge_set_scale) },
|
||||
{ be_const_key(set_critical_value, 16), be_const_func(lvbe_gauge_set_critical_value) },
|
||||
{ be_const_key(get_angle_offset, -1), be_const_func(lvbe_gauge_get_angle_offset) },
|
||||
{ be_const_key(get_critical_value, -1), be_const_func(lvbe_gauge_get_critical_value) },
|
||||
{ be_const_key(set_formatter_cb, -1), be_const_func(lvbe_gauge_set_formatter_cb) },
|
||||
{ be_const_key(set_needle_count, 4), be_const_func(lvbe_gauge_set_needle_count) },
|
||||
{ be_const_key(set_angle_offset, 17), be_const_func(lvbe_gauge_set_angle_offset) },
|
||||
{ be_const_key(set_value, -1), be_const_func(lvbe_gauge_set_value) },
|
||||
{ be_const_key(get_scale_angle, -1), be_const_func(lvbe_gauge_get_scale_angle) },
|
||||
{ be_const_key(get_needle_img, 12), be_const_func(lvbe_gauge_get_needle_img) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_gauge_map,
|
||||
24
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_gauge,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_gauge
|
||||
);
|
|
@ -0,0 +1,39 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_group_map) {
|
||||
{ be_const_key(get_focus_cb, 17), be_const_func(lvbe_group_get_focus_cb) },
|
||||
{ be_const_key(init, 7), be_const_func(lvbe_group_create) },
|
||||
{ be_const_key(focus_next, -1), be_const_func(lvbe_group_focus_next) },
|
||||
{ be_const_key(focus_freeze, -1), be_const_func(lvbe_group_focus_freeze) },
|
||||
{ be_const_key(set_click_focus, -1), be_const_func(lvbe_group_set_click_focus) },
|
||||
{ be_const_key(get_wrap, 8), be_const_func(lvbe_group_get_wrap) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(get_editing, 11), be_const_func(lvbe_group_get_editing) },
|
||||
{ be_const_key(get_focused, -1), be_const_func(lvbe_group_get_focused) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(create, 2), be_const_func(lvbe_group_create) },
|
||||
{ be_const_key(set_refocus_policy, -1), be_const_func(lvbe_group_set_refocus_policy) },
|
||||
{ be_const_key(send_data, 21), be_const_func(lvbe_group_send_data) },
|
||||
{ be_const_key(add_obj, 22), be_const_func(lvbe_group_add_obj) },
|
||||
{ be_const_key(set_focus_cb, 1), be_const_func(lvbe_group_set_focus_cb) },
|
||||
{ be_const_key(set_editing, -1), be_const_func(lvbe_group_set_editing) },
|
||||
{ be_const_key(set_wrap, 0), be_const_func(lvbe_group_set_wrap) },
|
||||
{ be_const_key(remove_obj, -1), be_const_func(lvbe_group_remove_obj) },
|
||||
{ be_const_key(focus_obj, -1), be_const_func(lvbe_group_focus_obj) },
|
||||
{ be_const_key(remove_all_objs, 12), be_const_func(lvbe_group_remove_all_objs) },
|
||||
{ be_const_key(focus_prev, -1), be_const_func(lvbe_group_focus_prev) },
|
||||
{ be_const_key(get_click_focus, -1), be_const_func(lvbe_group_get_click_focus) },
|
||||
{ be_const_key(del, -1), be_const_func(lvbe_group_del) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_group_map,
|
||||
23
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_group,
|
||||
1,
|
||||
NULL,
|
||||
lv_group
|
||||
);
|
|
@ -0,0 +1,38 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_img_map) {
|
||||
{ be_const_key(get_offset_y, -1), be_const_func(lvbe_img_get_offset_y) },
|
||||
{ be_const_key(get_zoom, 2), be_const_func(lvbe_img_get_zoom) },
|
||||
{ be_const_key(set_tasmota_logo, -1), be_const_func(lvbe_img_set_tasmota_logo) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(get_pivot, 15), be_const_func(lvbe_img_get_pivot) },
|
||||
{ be_const_key(get_auto_size, 1), be_const_func(lvbe_img_get_auto_size) },
|
||||
{ be_const_key(get_offset_x, 4), be_const_func(lvbe_img_get_offset_x) },
|
||||
{ be_const_key(set_angle, 0), be_const_func(lvbe_img_set_angle) },
|
||||
{ be_const_key(get_src, -1), be_const_func(lvbe_img_get_src) },
|
||||
{ be_const_key(set_zoom, 12), be_const_func(lvbe_img_set_zoom) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_img_create) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_img_create) },
|
||||
{ be_const_key(get_angle, -1), be_const_func(lvbe_img_get_angle) },
|
||||
{ be_const_key(set_src, -1), be_const_func(lvbe_img_set_src) },
|
||||
{ be_const_key(set_pivot, 17), be_const_func(lvbe_img_set_pivot) },
|
||||
{ be_const_key(set_antialias, -1), be_const_func(lvbe_img_set_antialias) },
|
||||
{ be_const_key(get_antialias, -1), be_const_func(lvbe_img_get_antialias) },
|
||||
{ be_const_key(set_offset_x, -1), be_const_func(lvbe_img_set_offset_x) },
|
||||
{ be_const_key(set_offset_y, 10), be_const_func(lvbe_img_set_offset_y) },
|
||||
{ be_const_key(get_file_name, -1), be_const_func(lvbe_img_get_file_name) },
|
||||
{ be_const_key(set_auto_size, -1), be_const_func(lvbe_img_set_auto_size) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_img_map,
|
||||
22
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_img,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_img
|
||||
);
|
|
@ -0,0 +1,26 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_imgbtn_map) {
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(set_state, -1), be_const_func(lvbe_imgbtn_set_state) },
|
||||
{ be_const_key(set_checkable, -1), be_const_func(lvbe_imgbtn_set_checkable) },
|
||||
{ be_const_key(toggle, 1), be_const_func(lvbe_imgbtn_toggle) },
|
||||
{ be_const_key(get_src, -1), be_const_func(lvbe_imgbtn_get_src) },
|
||||
{ be_const_key(init, 6), be_const_func(lvbe_imgbtn_create) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_imgbtn_create) },
|
||||
{ be_const_key(set_src, -1), be_const_func(lvbe_imgbtn_set_src) },
|
||||
{ be_const_key(get_state, 0), be_const_func(lvbe_imgbtn_get_state) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_imgbtn_map,
|
||||
10
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_imgbtn,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_imgbtn
|
||||
);
|
|
@ -0,0 +1,28 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_keyboard_map) {
|
||||
{ be_const_key(set_ctrl_map, -1), be_const_func(lvbe_keyboard_set_ctrl_map) },
|
||||
{ be_const_key(def_event_cb, 10), be_const_func(lvbe_keyboard_def_event_cb) },
|
||||
{ be_const_key(get_textarea, 6), be_const_func(lvbe_keyboard_get_textarea) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_keyboard_create) },
|
||||
{ be_const_key(get_cursor_manage, -1), be_const_func(lvbe_keyboard_get_cursor_manage) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_keyboard_create) },
|
||||
{ be_const_key(set_textarea, 9), be_const_func(lvbe_keyboard_set_textarea) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(set_cursor_manage, -1), be_const_func(lvbe_keyboard_set_cursor_manage) },
|
||||
{ be_const_key(set_map, -1), be_const_func(lvbe_keyboard_set_map) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_mode, -1), be_const_func(lvbe_keyboard_set_mode) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_keyboard_map,
|
||||
12
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_keyboard,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_keyboard
|
||||
);
|
|
@ -0,0 +1,42 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_label_map) {
|
||||
{ be_const_key(get_letter_on, -1), be_const_func(lvbe_label_get_letter_on) },
|
||||
{ be_const_key(create, 14), be_const_func(lvbe_label_create) },
|
||||
{ be_const_key(is_char_under_pos, -1), be_const_func(lvbe_label_is_char_under_pos) },
|
||||
{ be_const_key(ins_text, -1), be_const_func(lvbe_label_ins_text) },
|
||||
{ be_const_key(set_text_static, -1), be_const_func(lvbe_label_set_text_static) },
|
||||
{ be_const_key(set_anim_speed, -1), be_const_func(lvbe_label_set_anim_speed) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_label_create) },
|
||||
{ be_const_key(get_text_sel_start, -1), be_const_func(lvbe_label_get_text_sel_start) },
|
||||
{ be_const_key(set_recolor, 15), be_const_func(lvbe_label_set_recolor) },
|
||||
{ be_const_key(get_letter_pos, 23), be_const_func(lvbe_label_get_letter_pos) },
|
||||
{ be_const_key(get_text_sel_end, -1), be_const_func(lvbe_label_get_text_sel_end) },
|
||||
{ be_const_key(set_text_sel_start, 1), be_const_func(lvbe_label_set_text_sel_start) },
|
||||
{ be_const_key(refr_text, 4), be_const_func(lvbe_label_refr_text) },
|
||||
{ be_const_key(cut_text, 9), be_const_func(lvbe_label_cut_text) },
|
||||
{ be_const_key(get_text, 16), be_const_func(lvbe_label_get_text) },
|
||||
{ be_const_key(set_long_mode, -1), be_const_func(lvbe_label_set_long_mode) },
|
||||
{ be_const_key(set_text, 17), be_const_func(lvbe_label_set_text) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(get_long_mode, -1), be_const_func(lvbe_label_get_long_mode) },
|
||||
{ be_const_key(get_align, 6), be_const_func(lvbe_label_get_align) },
|
||||
{ be_const_key(set_text_sel_end, 2), be_const_func(lvbe_label_set_text_sel_end) },
|
||||
{ be_const_key(set_text_fmt, -1), be_const_func(lvbe_label_set_text_fmt) },
|
||||
{ be_const_key(get_recolor, -1), be_const_func(lvbe_label_get_recolor) },
|
||||
{ be_const_key(tostring, 24), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(get_anim_speed, -1), be_const_func(lvbe_label_get_anim_speed) },
|
||||
{ be_const_key(set_align, -1), be_const_func(lvbe_label_set_align) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_label_map,
|
||||
26
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_label,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_label
|
||||
);
|
|
@ -0,0 +1,25 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_led_map) {
|
||||
{ be_const_key(get_bright, -1), be_const_func(lvbe_led_get_bright) },
|
||||
{ be_const_key(toggle, 4), be_const_func(lvbe_led_toggle) },
|
||||
{ be_const_key(on, -1), be_const_func(lvbe_led_on) },
|
||||
{ be_const_key(set_bright, -1), be_const_func(lvbe_led_set_bright) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(off, 8), be_const_func(lvbe_led_off) },
|
||||
{ be_const_key(init, 3), be_const_func(lvbe_led_create) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_led_create) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_led_map,
|
||||
9
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_led,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_led
|
||||
);
|
|
@ -0,0 +1,25 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_line_map) {
|
||||
{ be_const_key(get_y_invert, -1), be_const_func(lvbe_line_get_y_invert) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(get_auto_size, -1), be_const_func(lvbe_line_get_auto_size) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_line_create) },
|
||||
{ be_const_key(set_auto_size, -1), be_const_func(lvbe_line_set_auto_size) },
|
||||
{ be_const_key(set_points, 8), be_const_func(lvbe_line_set_points) },
|
||||
{ be_const_key(set_y_invert, 3), be_const_func(lvbe_line_set_y_invert) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_line_create) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_line_map,
|
||||
9
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_line,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_line
|
||||
);
|
|
@ -0,0 +1,33 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_linemeter_map) {
|
||||
{ be_const_key(set_mirror, 9), be_const_func(lvbe_linemeter_set_mirror) },
|
||||
{ be_const_key(get_max_value, 10), be_const_func(lvbe_linemeter_get_max_value) },
|
||||
{ be_const_key(tostring, 12), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_value, -1), be_const_func(lvbe_linemeter_set_value) },
|
||||
{ be_const_key(set_angle_offset, -1), be_const_func(lvbe_linemeter_set_angle_offset) },
|
||||
{ be_const_key(draw_scale, -1), be_const_func(lvbe_linemeter_draw_scale) },
|
||||
{ be_const_key(get_mirror, 11), be_const_func(lvbe_linemeter_get_mirror) },
|
||||
{ be_const_key(get_line_count, -1), be_const_func(lvbe_linemeter_get_line_count) },
|
||||
{ be_const_key(set_scale, -1), be_const_func(lvbe_linemeter_set_scale) },
|
||||
{ be_const_key(get_value, -1), be_const_func(lvbe_linemeter_get_value) },
|
||||
{ be_const_key(get_scale_angle, -1), be_const_func(lvbe_linemeter_get_scale_angle) },
|
||||
{ be_const_key(get_angle_offset, -1), be_const_func(lvbe_linemeter_get_angle_offset) },
|
||||
{ be_const_key(set_range, -1), be_const_func(lvbe_linemeter_set_range) },
|
||||
{ be_const_key(dot_p, 5), be_const_int(0) },
|
||||
{ be_const_key(get_min_value, -1), be_const_func(lvbe_linemeter_get_min_value) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_linemeter_create) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_linemeter_create) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_linemeter_map,
|
||||
17
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_linemeter,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_linemeter
|
||||
);
|
|
@ -0,0 +1,45 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_list_map) {
|
||||
{ be_const_key(remove, -1), be_const_func(lvbe_list_remove) },
|
||||
{ be_const_key(get_edge_flash, 16), be_const_func(lvbe_list_get_edge_flash) },
|
||||
{ be_const_key(get_anim_time, -1), be_const_func(lvbe_list_get_anim_time) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(get_btn_label, 24), be_const_func(lvbe_list_get_btn_label) },
|
||||
{ be_const_key(up, -1), be_const_func(lvbe_list_up) },
|
||||
{ be_const_key(get_scrollbar_mode, -1), be_const_func(lvbe_list_get_scrollbar_mode) },
|
||||
{ be_const_key(get_prev_btn, 28), be_const_func(lvbe_list_get_prev_btn) },
|
||||
{ be_const_key(get_scroll_propagation, 14), be_const_func(lvbe_list_get_scroll_propagation) },
|
||||
{ be_const_key(focus, 13), be_const_func(lvbe_list_focus) },
|
||||
{ be_const_key(get_layout, 4), be_const_func(lvbe_list_get_layout) },
|
||||
{ be_const_key(down, -1), be_const_func(lvbe_list_down) },
|
||||
{ be_const_key(get_btn_index, -1), be_const_func(lvbe_list_get_btn_index) },
|
||||
{ be_const_key(clean, -1), be_const_func(lvbe_list_clean) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_list_create) },
|
||||
{ be_const_key(get_next_btn, -1), be_const_func(lvbe_list_get_next_btn) },
|
||||
{ be_const_key(get_btn_img, -1), be_const_func(lvbe_list_get_btn_img) },
|
||||
{ be_const_key(get_btn_selected, -1), be_const_func(lvbe_list_get_btn_selected) },
|
||||
{ be_const_key(set_edge_flash, -1), be_const_func(lvbe_list_set_edge_flash) },
|
||||
{ be_const_key(get_btn_text, -1), be_const_func(lvbe_list_get_btn_text) },
|
||||
{ be_const_key(set_layout, -1), be_const_func(lvbe_list_set_layout) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(set_scrollbar_mode, -1), be_const_func(lvbe_list_set_scrollbar_mode) },
|
||||
{ be_const_key(focus_btn, -1), be_const_func(lvbe_list_focus_btn) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_list_create) },
|
||||
{ be_const_key(set_scroll_propagation, 27), be_const_func(lvbe_list_set_scroll_propagation) },
|
||||
{ be_const_key(get_size, 20), be_const_func(lvbe_list_get_size) },
|
||||
{ be_const_key(set_anim_time, -1), be_const_func(lvbe_list_set_anim_time) },
|
||||
{ be_const_key(add_btn, -1), be_const_func(lvbe_list_add_btn) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_list_map,
|
||||
29
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_list,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_list
|
||||
);
|
|
@ -0,0 +1,33 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_msgbox_map) {
|
||||
{ be_const_key(get_text, 12), be_const_func(lvbe_msgbox_get_text) },
|
||||
{ be_const_key(set_anim_time, 3), be_const_func(lvbe_msgbox_set_anim_time) },
|
||||
{ be_const_key(tostring, 0), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(add_btns, 4), be_const_func(lvbe_msgbox_add_btns) },
|
||||
{ be_const_key(get_active_btn, -1), be_const_func(lvbe_msgbox_get_active_btn) },
|
||||
{ be_const_key(stop_auto_close, -1), be_const_func(lvbe_msgbox_stop_auto_close) },
|
||||
{ be_const_key(start_auto_close, -1), be_const_func(lvbe_msgbox_start_auto_close) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_msgbox_create) },
|
||||
{ be_const_key(get_btnmatrix, -1), be_const_func(lvbe_msgbox_get_btnmatrix) },
|
||||
{ be_const_key(get_anim_time, 6), be_const_func(lvbe_msgbox_get_anim_time) },
|
||||
{ be_const_key(set_text_fmt, -1), be_const_func(lvbe_msgbox_set_text_fmt) },
|
||||
{ be_const_key(set_recolor, 10), be_const_func(lvbe_msgbox_set_recolor) },
|
||||
{ be_const_key(get_active_btn_text, -1), be_const_func(lvbe_msgbox_get_active_btn_text) },
|
||||
{ be_const_key(dot_p, 8), be_const_int(0) },
|
||||
{ be_const_key(get_recolor, -1), be_const_func(lvbe_msgbox_get_recolor) },
|
||||
{ be_const_key(set_text, 7), be_const_func(lvbe_msgbox_set_text) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_msgbox_create) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_msgbox_map,
|
||||
17
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_msgbox,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_msgbox
|
||||
);
|
|
@ -0,0 +1,307 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_obj_map) {
|
||||
{ be_const_key(get_style_border_color, -1), be_const_func(lvbe_obj_get_style_border_color) },
|
||||
{ be_const_key(get_style_scale_grad_color, -1), be_const_func(lvbe_obj_get_style_scale_grad_color) },
|
||||
{ be_const_key(get_state, -1), be_const_func(lvbe_obj_get_state) },
|
||||
{ be_const_key(refresh_style, -1), be_const_func(lvbe_obj_refresh_style) },
|
||||
{ be_const_key(set_style_local_text_opa, -1), be_const_func(lvbe_obj_set_style_local_text_opa) },
|
||||
{ be_const_key(create, 181), be_const_func(lvbe_obj_create) },
|
||||
{ be_const_key(refresh_ext_draw_pad, -1), be_const_func(lvbe_obj_refresh_ext_draw_pad) },
|
||||
{ be_const_key(get_style_pad_top, 75), be_const_func(lvbe_obj_get_style_pad_top) },
|
||||
{ be_const_key(get_style_opa_scale, 82), be_const_func(lvbe_obj_get_style_opa_scale) },
|
||||
{ be_const_key(align_mid_x, 151), be_const_func(lvbe_obj_align_mid_x) },
|
||||
{ be_const_key(set_style_local_margin_top, -1), be_const_func(lvbe_obj_set_style_local_margin_top) },
|
||||
{ be_const_key(align_y, -1), be_const_func(lvbe_obj_align_y) },
|
||||
{ be_const_key(set_ext_click_area, 208), be_const_func(lvbe_obj_set_ext_click_area) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_obj_create) },
|
||||
{ be_const_key(clear_protect, -1), be_const_func(lvbe_obj_clear_protect) },
|
||||
{ be_const_key(set_style_local_transition_prop_1, -1), be_const_func(lvbe_obj_set_style_local_transition_prop_1) },
|
||||
{ be_const_key(set_style_local_shadow_width, -1), be_const_func(lvbe_obj_set_style_local_shadow_width) },
|
||||
{ be_const_key(set_drag_dir, -1), be_const_func(lvbe_obj_set_drag_dir) },
|
||||
{ be_const_key(set_style_local_pattern_recolor, -1), be_const_func(lvbe_obj_set_style_local_pattern_recolor) },
|
||||
{ be_const_key(is_visible, 130), be_const_func(lvbe_obj_is_visible) },
|
||||
{ be_const_key(set_style_local_value_blend_mode, 234), be_const_func(lvbe_obj_set_style_local_value_blend_mode) },
|
||||
{ be_const_key(hittest, -1), be_const_func(lvbe_obj_hittest) },
|
||||
{ be_const_key(is_protected, -1), be_const_func(lvbe_obj_is_protected) },
|
||||
{ be_const_key(get_style_transform_width, 17), be_const_func(lvbe_obj_get_style_transform_width) },
|
||||
{ be_const_key(set_event_cb, 145), be_const_func(lvbe_obj_set_event_cb) },
|
||||
{ be_const_key(align_x, -1), be_const_func(lvbe_obj_align_x) },
|
||||
{ be_const_key(set_style_local_outline_pad, 9), be_const_func(lvbe_obj_set_style_local_outline_pad) },
|
||||
{ be_const_key(set_style_local_text_line_space, -1), be_const_func(lvbe_obj_set_style_local_text_line_space) },
|
||||
{ be_const_key(get_child, -1), be_const_func(lvbe_obj_get_child) },
|
||||
{ be_const_key(set_style_local_margin_left, 195), be_const_func(lvbe_obj_set_style_local_margin_left) },
|
||||
{ be_const_key(set_style_local_shadow_ofs_y, -1), be_const_func(lvbe_obj_set_style_local_shadow_ofs_y) },
|
||||
{ be_const_key(set_top, -1), be_const_func(lvbe_obj_set_top) },
|
||||
{ be_const_key(get_style_pattern_image, -1), be_const_func(lvbe_obj_get_style_pattern_image) },
|
||||
{ be_const_key(get_style_outline_opa, 138), be_const_func(lvbe_obj_get_style_outline_opa) },
|
||||
{ be_const_key(fade_out, 176), be_const_func(lvbe_obj_fade_out) },
|
||||
{ be_const_key(del, -1), be_const_func(lvbe_obj_del) },
|
||||
{ be_const_key(get_style_pad_right, 1), be_const_func(lvbe_obj_get_style_pad_right) },
|
||||
{ be_const_key(clean, -1), be_const_func(lvbe_obj_clean) },
|
||||
{ be_const_key(get_style_border_width, -1), be_const_func(lvbe_obj_get_style_border_width) },
|
||||
{ be_const_key(set_style_local_pattern_opa, 226), be_const_func(lvbe_obj_set_style_local_pattern_opa) },
|
||||
{ be_const_key(align_mid_y, -1), be_const_func(lvbe_obj_align_mid_y) },
|
||||
{ be_const_key(get_style_line_color, -1), be_const_func(lvbe_obj_get_style_line_color) },
|
||||
{ be_const_key(is_focused, -1), be_const_func(lvbe_obj_is_focused) },
|
||||
{ be_const_key(set_style_local_transition_prop_3, 113), be_const_func(lvbe_obj_set_style_local_transition_prop_3) },
|
||||
{ be_const_key(set_style_local_image_opa, -1), be_const_func(lvbe_obj_set_style_local_image_opa) },
|
||||
{ be_const_key(set_style_local_bg_grad_stop, -1), be_const_func(lvbe_obj_set_style_local_bg_grad_stop) },
|
||||
{ be_const_key(del_async, 260), be_const_func(lvbe_obj_del_async) },
|
||||
{ be_const_key(set_y, 119), be_const_func(lvbe_obj_set_y) },
|
||||
{ be_const_key(set_hidden, -1), be_const_func(lvbe_obj_set_hidden) },
|
||||
{ be_const_key(get_adv_hittest, -1), be_const_func(lvbe_obj_get_adv_hittest) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_style_local_value_line_space, -1), be_const_func(lvbe_obj_set_style_local_value_line_space) },
|
||||
{ be_const_key(set_style_local_border_side, -1), be_const_func(lvbe_obj_set_style_local_border_side) },
|
||||
{ be_const_key(set_style_local_bg_grad_color, 136), be_const_func(lvbe_obj_set_style_local_bg_grad_color) },
|
||||
{ be_const_key(set_style_local_shadow_color, -1), be_const_func(lvbe_obj_set_style_local_shadow_color) },
|
||||
{ be_const_key(set_style_local_pad_left, -1), be_const_func(lvbe_obj_set_style_local_pad_left) },
|
||||
{ be_const_key(set_style_local_transition_delay, -1), be_const_func(lvbe_obj_set_style_local_transition_delay) },
|
||||
{ be_const_key(get_auto_realign, 38), be_const_func(lvbe_obj_get_auto_realign) },
|
||||
{ be_const_key(get_style_value_ofs_x, -1), be_const_func(lvbe_obj_get_style_value_ofs_x) },
|
||||
{ be_const_key(set_style_local_image_blend_mode, 56), be_const_func(lvbe_obj_set_style_local_image_blend_mode) },
|
||||
{ be_const_key(set_style_local_pad_bottom, -1), be_const_func(lvbe_obj_set_style_local_pad_bottom) },
|
||||
{ be_const_key(get_style_image_recolor, 255), be_const_func(lvbe_obj_get_style_image_recolor) },
|
||||
{ be_const_key(set_height_fit, -1), be_const_func(lvbe_obj_set_height_fit) },
|
||||
{ be_const_key(set_style_local_line_width, 32), be_const_func(lvbe_obj_set_style_local_line_width) },
|
||||
{ be_const_key(set_style_local_border_color, 135), be_const_func(lvbe_obj_set_style_local_border_color) },
|
||||
{ be_const_key(get_width, -1), be_const_func(lvbe_obj_get_width) },
|
||||
{ be_const_key(set_style_local_scale_width, -1), be_const_func(lvbe_obj_set_style_local_scale_width) },
|
||||
{ be_const_key(get_local_style, 189), be_const_func(lvbe_obj_get_local_style) },
|
||||
{ be_const_key(get_ext_click_pad_bottom, -1), be_const_func(lvbe_obj_get_ext_click_pad_bottom) },
|
||||
{ be_const_key(set_style_local_border_post, -1), be_const_func(lvbe_obj_set_style_local_border_post) },
|
||||
{ be_const_key(get_screen, -1), be_const_func(lvbe_obj_get_screen) },
|
||||
{ be_const_key(set_style_local_line_opa, 162), be_const_func(lvbe_obj_set_style_local_line_opa) },
|
||||
{ be_const_key(set_style_local_pattern_blend_mode, -1), be_const_func(lvbe_obj_set_style_local_pattern_blend_mode) },
|
||||
{ be_const_key(set_style_local_transform_height, -1), be_const_func(lvbe_obj_set_style_local_transform_height) },
|
||||
{ be_const_key(set_style_local_border_opa, 86), be_const_func(lvbe_obj_set_style_local_border_opa) },
|
||||
{ be_const_key(get_style_text_color, -1), be_const_func(lvbe_obj_get_style_text_color) },
|
||||
{ be_const_key(get_style_shadow_ofs_x, 84), be_const_func(lvbe_obj_get_style_shadow_ofs_x) },
|
||||
{ be_const_key(get_ext_click_pad_right, -1), be_const_func(lvbe_obj_get_ext_click_pad_right) },
|
||||
{ be_const_key(get_style_bg_opa, 104), be_const_func(lvbe_obj_get_style_bg_opa) },
|
||||
{ be_const_key(set_style_local_text_sel_bg_color, 219), be_const_func(lvbe_obj_set_style_local_text_sel_bg_color) },
|
||||
{ be_const_key(set_style_local_opa_scale, -1), be_const_func(lvbe_obj_set_style_local_opa_scale) },
|
||||
{ be_const_key(set_style_local_value_opa, -1), be_const_func(lvbe_obj_set_style_local_value_opa) },
|
||||
{ be_const_key(set_style_local_margin_bottom, 242), be_const_func(lvbe_obj_set_style_local_margin_bottom) },
|
||||
{ be_const_key(set_style_local_scale_end_line_width, -1), be_const_func(lvbe_obj_set_style_local_scale_end_line_width) },
|
||||
{ be_const_key(set_gesture_parent, -1), be_const_func(lvbe_obj_set_gesture_parent) },
|
||||
{ be_const_key(get_protect, -1), be_const_func(lvbe_obj_get_protect) },
|
||||
{ be_const_key(set_style_local_bg_main_stop, 281), be_const_func(lvbe_obj_set_style_local_bg_main_stop) },
|
||||
{ be_const_key(get_style_transition_prop_1, -1), be_const_func(lvbe_obj_get_style_transition_prop_1) },
|
||||
{ be_const_key(set_style_local_scale_end_border_width, -1), be_const_func(lvbe_obj_set_style_local_scale_end_border_width) },
|
||||
{ be_const_key(set_style_local_outline_color, -1), be_const_func(lvbe_obj_set_style_local_outline_color) },
|
||||
{ be_const_key(set_style_local_transform_zoom, 128), be_const_func(lvbe_obj_set_style_local_transform_zoom) },
|
||||
{ be_const_key(get_style_image_opa, -1), be_const_func(lvbe_obj_get_style_image_opa) },
|
||||
{ be_const_key(get_focused_obj, -1), be_const_func(lvbe_obj_get_focused_obj) },
|
||||
{ be_const_key(set_user_data, -1), be_const_func(lvbe_obj_set_user_data) },
|
||||
{ be_const_key(set_adv_hittest, -1), be_const_func(lvbe_obj_set_adv_hittest) },
|
||||
{ be_const_key(init_draw_line_dsc, -1), be_const_func(lvbe_obj_init_draw_line_dsc) },
|
||||
{ be_const_key(set_focus_parent, -1), be_const_func(lvbe_obj_set_focus_parent) },
|
||||
{ be_const_key(set_style_local_image_recolor, -1), be_const_func(lvbe_obj_set_style_local_image_recolor) },
|
||||
{ be_const_key(get_parent, -1), be_const_func(lvbe_obj_get_parent) },
|
||||
{ be_const_key(init_draw_rect_dsc, 67), be_const_func(lvbe_obj_init_draw_rect_dsc) },
|
||||
{ be_const_key(set_style_local_line_dash_width, -1), be_const_func(lvbe_obj_set_style_local_line_dash_width) },
|
||||
{ be_const_key(get_style_transition_prop_2, 182), be_const_func(lvbe_obj_get_style_transition_prop_2) },
|
||||
{ be_const_key(get_drag_parent, -1), be_const_func(lvbe_obj_get_drag_parent) },
|
||||
{ be_const_key(get_style_line_opa, -1), be_const_func(lvbe_obj_get_style_line_opa) },
|
||||
{ be_const_key(get_y, -1), be_const_func(lvbe_obj_get_y) },
|
||||
{ be_const_key(set_style_local_shadow_opa, 18), be_const_func(lvbe_obj_set_style_local_shadow_opa) },
|
||||
{ be_const_key(add_protect, 69), be_const_func(lvbe_obj_add_protect) },
|
||||
{ be_const_key(get_width_margin, -1), be_const_func(lvbe_obj_get_width_margin) },
|
||||
{ be_const_key(remove_style_local_prop, -1), be_const_func(lvbe_obj_remove_style_local_prop) },
|
||||
{ be_const_key(set_style_local_value_align, -1), be_const_func(lvbe_obj_set_style_local_value_align) },
|
||||
{ be_const_key(get_style_text_letter_space, -1), be_const_func(lvbe_obj_get_style_text_letter_space) },
|
||||
{ be_const_key(set_style_local_pattern_image, -1), be_const_func(lvbe_obj_set_style_local_pattern_image) },
|
||||
{ be_const_key(get_style_pattern_recolor_opa, -1), be_const_func(lvbe_obj_get_style_pattern_recolor_opa) },
|
||||
{ be_const_key(get_width_grid, 127), be_const_func(lvbe_obj_get_width_grid) },
|
||||
{ be_const_key(get_top, 223), be_const_func(lvbe_obj_get_top) },
|
||||
{ be_const_key(get_style_transition_prop_3, -1), be_const_func(lvbe_obj_get_style_transition_prop_3) },
|
||||
{ be_const_key(get_user_data, 28), be_const_func(lvbe_obj_get_user_data) },
|
||||
{ be_const_key(get_width_fit, 158), be_const_func(lvbe_obj_get_width_fit) },
|
||||
{ be_const_key(align_mid, 283), be_const_func(lvbe_obj_align_mid) },
|
||||
{ be_const_key(get_style_value_str, 178), be_const_func(lvbe_obj_get_style_value_str) },
|
||||
{ be_const_key(set_style_local_outline_width, 175), be_const_func(lvbe_obj_set_style_local_outline_width) },
|
||||
{ be_const_key(set_style_local_value_str, 94), be_const_func(lvbe_obj_set_style_local_value_str) },
|
||||
{ be_const_key(get_drag, 251), be_const_func(lvbe_obj_get_drag) },
|
||||
{ be_const_key(set_style_local_line_rounded, -1), be_const_func(lvbe_obj_set_style_local_line_rounded) },
|
||||
{ be_const_key(get_type, 139), be_const_func(lvbe_obj_get_type) },
|
||||
{ be_const_key(set_style_local_pattern_repeat, -1), be_const_func(lvbe_obj_set_style_local_pattern_repeat) },
|
||||
{ be_const_key(get_style_text_sel_bg_color, 133), be_const_func(lvbe_obj_get_style_text_sel_bg_color) },
|
||||
{ be_const_key(get_style_transition_time, 72), be_const_func(lvbe_obj_get_style_transition_time) },
|
||||
{ be_const_key(invalidate, 184), be_const_func(lvbe_obj_invalidate) },
|
||||
{ be_const_key(get_style_transition_prop_4, 0), be_const_func(lvbe_obj_get_style_transition_prop_4) },
|
||||
{ be_const_key(set_style_local_bg_blend_mode, -1), be_const_func(lvbe_obj_set_style_local_bg_blend_mode) },
|
||||
{ be_const_key(get_style_bg_main_stop, 37), be_const_func(lvbe_obj_get_style_bg_main_stop) },
|
||||
{ be_const_key(get_ext_attr, 80), be_const_func(lvbe_obj_get_ext_attr) },
|
||||
{ be_const_key(set_signal_cb, 51), be_const_func(lvbe_obj_set_signal_cb) },
|
||||
{ be_const_key(get_style_pad_inner, -1), be_const_func(lvbe_obj_get_style_pad_inner) },
|
||||
{ be_const_key(get_x, 272), be_const_func(lvbe_obj_get_x) },
|
||||
{ be_const_key(get_style_bg_grad_stop, -1), be_const_func(lvbe_obj_get_style_bg_grad_stop) },
|
||||
{ be_const_key(add_state, -1), be_const_func(lvbe_obj_add_state) },
|
||||
{ be_const_key(set_x, -1), be_const_func(lvbe_obj_set_x) },
|
||||
{ be_const_key(get_draw_rect_ext_pad_size, -1), be_const_func(lvbe_obj_get_draw_rect_ext_pad_size) },
|
||||
{ be_const_key(get_style_margin_right, -1), be_const_func(lvbe_obj_get_style_margin_right) },
|
||||
{ be_const_key(init_draw_img_dsc, -1), be_const_func(lvbe_obj_init_draw_img_dsc) },
|
||||
{ be_const_key(set_size, -1), be_const_func(lvbe_obj_set_size) },
|
||||
{ be_const_key(get_style_transition_prop_5, 89), be_const_func(lvbe_obj_get_style_transition_prop_5) },
|
||||
{ be_const_key(set_style_local_size, -1), be_const_func(lvbe_obj_set_style_local_size) },
|
||||
{ be_const_key(handle_get_type_signal, -1), be_const_func(lvbe_obj_handle_get_type_signal) },
|
||||
{ be_const_key(get_style_transform_height, -1), be_const_func(lvbe_obj_get_style_transform_height) },
|
||||
{ be_const_key(set_style_local_pad_top, 263), be_const_func(lvbe_obj_set_style_local_pad_top) },
|
||||
{ be_const_key(get_group, 165), be_const_func(lvbe_obj_get_group) },
|
||||
{ be_const_key(set_width_margin, -1), be_const_func(lvbe_obj_set_width_margin) },
|
||||
{ be_const_key(set_style_local_line_dash_gap, 248), be_const_func(lvbe_obj_set_style_local_line_dash_gap) },
|
||||
{ be_const_key(set_parent_event, -1), be_const_func(lvbe_obj_set_parent_event) },
|
||||
{ be_const_key(remove_style, -1), be_const_func(lvbe_obj_remove_style) },
|
||||
{ be_const_key(set_pos, -1), be_const_func(lvbe_obj_set_pos) },
|
||||
{ be_const_key(get_style_value_letter_space, -1), be_const_func(lvbe_obj_get_style_value_letter_space) },
|
||||
{ be_const_key(fade_in, -1), be_const_func(lvbe_obj_fade_in) },
|
||||
{ be_const_key(get_style_text_opa, 213), be_const_func(lvbe_obj_get_style_text_opa) },
|
||||
{ be_const_key(get_style_transition_prop_6, -1), be_const_func(lvbe_obj_get_style_transition_prop_6) },
|
||||
{ be_const_key(set_auto_realign, -1), be_const_func(lvbe_obj_set_auto_realign) },
|
||||
{ be_const_key(set_style_local_shadow_ofs_x, 118), be_const_func(lvbe_obj_set_style_local_shadow_ofs_x) },
|
||||
{ be_const_key(set_style_local_radius, -1), be_const_func(lvbe_obj_set_style_local_radius) },
|
||||
{ be_const_key(get_style_transform_angle, -1), be_const_func(lvbe_obj_get_style_transform_angle) },
|
||||
{ be_const_key(get_drag_throw, 216), be_const_func(lvbe_obj_get_drag_throw) },
|
||||
{ be_const_key(set_style_local_border_width, -1), be_const_func(lvbe_obj_set_style_local_border_width) },
|
||||
{ be_const_key(get_style_bg_grad_color, 132), be_const_func(lvbe_obj_get_style_bg_grad_color) },
|
||||
{ be_const_key(set_style_local_shadow_spread, -1), be_const_func(lvbe_obj_set_style_local_shadow_spread) },
|
||||
{ be_const_key(get_hidden, -1), be_const_func(lvbe_obj_get_hidden) },
|
||||
{ be_const_key(set_base_dir, 134), be_const_func(lvbe_obj_set_base_dir) },
|
||||
{ be_const_key(allocate_ext_attr, -1), be_const_func(lvbe_obj_allocate_ext_attr) },
|
||||
{ be_const_key(set_style_local_scale_border_width, 116), be_const_func(lvbe_obj_set_style_local_scale_border_width) },
|
||||
{ be_const_key(get_style_line_dash_width, -1), be_const_func(lvbe_obj_get_style_line_dash_width) },
|
||||
{ be_const_key(set_style_local_image_recolor_opa, -1), be_const_func(lvbe_obj_set_style_local_image_recolor_opa) },
|
||||
{ be_const_key(set_style_local_outline_opa, -1), be_const_func(lvbe_obj_set_style_local_outline_opa) },
|
||||
{ be_const_key(set_drag_parent, 30), be_const_func(lvbe_obj_set_drag_parent) },
|
||||
{ be_const_key(add_style, -1), be_const_func(lvbe_obj_add_style) },
|
||||
{ be_const_key(get_child_back, 215), be_const_func(lvbe_obj_get_child_back) },
|
||||
{ be_const_key(get_style_scale_end_color, 10), be_const_func(lvbe_obj_get_style_scale_end_color) },
|
||||
{ be_const_key(get_style_bg_color, 171), be_const_func(lvbe_obj_get_style_bg_color) },
|
||||
{ be_const_key(get_style_outline_pad, -1), be_const_func(lvbe_obj_get_style_outline_pad) },
|
||||
{ be_const_key(get_style_transition_delay, -1), be_const_func(lvbe_obj_get_style_transition_delay) },
|
||||
{ be_const_key(get_style_text_sel_color, -1), be_const_func(lvbe_obj_get_style_text_sel_color) },
|
||||
{ be_const_key(set_style_local_text_sel_color, -1), be_const_func(lvbe_obj_set_style_local_text_sel_color) },
|
||||
{ be_const_key(set_style_local_transform_width, -1), be_const_func(lvbe_obj_set_style_local_transform_width) },
|
||||
{ be_const_key(get_height_margin, 60), be_const_func(lvbe_obj_get_height_margin) },
|
||||
{ be_const_key(get_style_shadow_ofs_y, -1), be_const_func(lvbe_obj_get_style_shadow_ofs_y) },
|
||||
{ be_const_key(get_style_shadow_color, 150), be_const_func(lvbe_obj_get_style_shadow_color) },
|
||||
{ be_const_key(get_height_fit, -1), be_const_func(lvbe_obj_get_height_fit) },
|
||||
{ be_const_key(get_style_value_opa, -1), be_const_func(lvbe_obj_get_style_value_opa) },
|
||||
{ be_const_key(set_parent, -1), be_const_func(lvbe_obj_set_parent) },
|
||||
{ be_const_key(clear_state, 142), be_const_func(lvbe_obj_clear_state) },
|
||||
{ be_const_key(invalidate_area, -1), be_const_func(lvbe_obj_invalidate_area) },
|
||||
{ be_const_key(is_point_on_coords, -1), be_const_func(lvbe_obj_is_point_on_coords) },
|
||||
{ be_const_key(set_style_local_scale_grad_color, -1), be_const_func(lvbe_obj_set_style_local_scale_grad_color) },
|
||||
{ be_const_key(get_style_line_rounded, 217), be_const_func(lvbe_obj_get_style_line_rounded) },
|
||||
{ be_const_key(set_style_local_transform_angle, 117), be_const_func(lvbe_obj_set_style_local_transform_angle) },
|
||||
{ be_const_key(set_style_local_transition_prop_2, -1), be_const_func(lvbe_obj_set_style_local_transition_prop_2) },
|
||||
{ be_const_key(set_style_local_value_ofs_y, -1), be_const_func(lvbe_obj_set_style_local_value_ofs_y) },
|
||||
{ be_const_key(get_style_transform_zoom, 229), be_const_func(lvbe_obj_get_style_transform_zoom) },
|
||||
{ be_const_key(get_style_size, -1), be_const_func(lvbe_obj_get_style_size) },
|
||||
{ be_const_key(get_style_margin_top, -1), be_const_func(lvbe_obj_get_style_margin_top) },
|
||||
{ be_const_key(set_style_local_text_letter_space, -1), be_const_func(lvbe_obj_set_style_local_text_letter_space) },
|
||||
{ be_const_key(set_style_local_pattern_recolor_opa, -1), be_const_func(lvbe_obj_set_style_local_pattern_recolor_opa) },
|
||||
{ be_const_key(set_style_local_scale_end_color, 271), be_const_func(lvbe_obj_set_style_local_scale_end_color) },
|
||||
{ be_const_key(area_is_visible, -1), be_const_func(lvbe_obj_area_is_visible) },
|
||||
{ be_const_key(get_height_grid, -1), be_const_func(lvbe_obj_get_height_grid) },
|
||||
{ be_const_key(get_style_text_line_space, 107), be_const_func(lvbe_obj_get_style_text_line_space) },
|
||||
{ be_const_key(set_style_local_shadow_blend_mode, -1), be_const_func(lvbe_obj_set_style_local_shadow_blend_mode) },
|
||||
{ be_const_key(set_style_local_border_blend_mode, 13), be_const_func(lvbe_obj_set_style_local_border_blend_mode) },
|
||||
{ be_const_key(get_base_dir, -1), be_const_func(lvbe_obj_get_base_dir) },
|
||||
{ be_const_key(get_focus_parent, -1), be_const_func(lvbe_obj_get_focus_parent) },
|
||||
{ be_const_key(set_style_local_bg_color, 249), be_const_func(lvbe_obj_set_style_local_bg_color) },
|
||||
{ be_const_key(get_style_pattern_repeat, -1), be_const_func(lvbe_obj_get_style_pattern_repeat) },
|
||||
{ be_const_key(get_coords, -1), be_const_func(lvbe_obj_get_coords) },
|
||||
{ be_const_key(get_style_shadow_spread, -1), be_const_func(lvbe_obj_get_style_shadow_spread) },
|
||||
{ be_const_key(set_width_fit, -1), be_const_func(lvbe_obj_set_width_fit) },
|
||||
{ be_const_key(set_style_local_value_font, -1), be_const_func(lvbe_obj_set_style_local_value_font) },
|
||||
{ be_const_key(set_width, -1), be_const_func(lvbe_obj_set_width) },
|
||||
{ be_const_key(set_style_local_text_font, 209), be_const_func(lvbe_obj_set_style_local_text_font) },
|
||||
{ be_const_key(align, -1), be_const_func(lvbe_obj_align) },
|
||||
{ be_const_key(set_design_cb, -1), be_const_func(lvbe_obj_set_design_cb) },
|
||||
{ be_const_key(reset_style_list, 102), be_const_func(lvbe_obj_reset_style_list) },
|
||||
{ be_const_key(set_drag_throw, -1), be_const_func(lvbe_obj_set_drag_throw) },
|
||||
{ be_const_key(get_ext_click_pad_top, -1), be_const_func(lvbe_obj_get_ext_click_pad_top) },
|
||||
{ be_const_key(set_style_local_value_letter_space, 211), be_const_func(lvbe_obj_set_style_local_value_letter_space) },
|
||||
{ be_const_key(get_click, -1), be_const_func(lvbe_obj_get_click) },
|
||||
{ be_const_key(get_style_value_ofs_y, -1), be_const_func(lvbe_obj_get_style_value_ofs_y) },
|
||||
{ be_const_key(get_style_pattern_opa, -1), be_const_func(lvbe_obj_get_style_pattern_opa) },
|
||||
{ be_const_key(set_style_local_line_blend_mode, -1), be_const_func(lvbe_obj_set_style_local_line_blend_mode) },
|
||||
{ be_const_key(get_inner_coords, -1), be_const_func(lvbe_obj_get_inner_coords) },
|
||||
{ be_const_key(get_style_radius, -1), be_const_func(lvbe_obj_get_style_radius) },
|
||||
{ be_const_key(get_style_line_width, -1), be_const_func(lvbe_obj_get_style_line_width) },
|
||||
{ be_const_key(set_style_local_pad_inner, -1), be_const_func(lvbe_obj_set_style_local_pad_inner) },
|
||||
{ be_const_key(set_style_local_line_color, 124), be_const_func(lvbe_obj_set_style_local_line_color) },
|
||||
{ be_const_key(set_style_local_pad_right, -1), be_const_func(lvbe_obj_set_style_local_pad_right) },
|
||||
{ be_const_key(set_state, -1), be_const_func(lvbe_obj_set_state) },
|
||||
{ be_const_key(move_background, -1), be_const_func(lvbe_obj_move_background) },
|
||||
{ be_const_key(set_style_local_transition_prop_4, -1), be_const_func(lvbe_obj_set_style_local_transition_prop_4) },
|
||||
{ be_const_key(get_ext_click_pad_left, -1), be_const_func(lvbe_obj_get_ext_click_pad_left) },
|
||||
{ be_const_key(get_ext_draw_pad, -1), be_const_func(lvbe_obj_get_ext_draw_pad) },
|
||||
{ be_const_key(get_style_shadow_width, 58), be_const_func(lvbe_obj_get_style_shadow_width) },
|
||||
{ be_const_key(clean_style_list, -1), be_const_func(lvbe_obj_clean_style_list) },
|
||||
{ be_const_key(get_style_pad_bottom, -1), be_const_func(lvbe_obj_get_style_pad_bottom) },
|
||||
{ be_const_key(set_style_local_value_color, -1), be_const_func(lvbe_obj_set_style_local_value_color) },
|
||||
{ be_const_key(get_style_value_line_space, 44), be_const_func(lvbe_obj_get_style_value_line_space) },
|
||||
{ be_const_key(get_style_shadow_opa, 62), be_const_func(lvbe_obj_get_style_shadow_opa) },
|
||||
{ be_const_key(get_style_margin_left, -1), be_const_func(lvbe_obj_get_style_margin_left) },
|
||||
{ be_const_key(get_style_scale_end_line_width, -1), be_const_func(lvbe_obj_get_style_scale_end_line_width) },
|
||||
{ be_const_key(get_style_scale_width, 50), be_const_func(lvbe_obj_get_style_scale_width) },
|
||||
{ be_const_key(finish_transitions, -1), be_const_func(lvbe_obj_finish_transitions) },
|
||||
{ be_const_key(set_style_local_value_ofs_x, -1), be_const_func(lvbe_obj_set_style_local_value_ofs_x) },
|
||||
{ be_const_key(set_style_local_transition_prop_5, 53), be_const_func(lvbe_obj_set_style_local_transition_prop_5) },
|
||||
{ be_const_key(get_drag_dir, -1), be_const_func(lvbe_obj_get_drag_dir) },
|
||||
{ be_const_key(set_style_local_text_decor, -1), be_const_func(lvbe_obj_set_style_local_text_decor) },
|
||||
{ be_const_key(get_style_outline_color, -1), be_const_func(lvbe_obj_get_style_outline_color) },
|
||||
{ be_const_key(count_children, 79), be_const_func(lvbe_obj_count_children) },
|
||||
{ be_const_key(del_anim_ready_cb, 98), be_const_func(lvbe_obj_del_anim_ready_cb) },
|
||||
{ be_const_key(get_style_pattern_recolor, 227), be_const_func(lvbe_obj_get_style_pattern_recolor) },
|
||||
{ be_const_key(get_gesture_parent, 282), be_const_func(lvbe_obj_get_gesture_parent) },
|
||||
{ be_const_key(get_style_image_recolor_opa, -1), be_const_func(lvbe_obj_get_style_image_recolor_opa) },
|
||||
{ be_const_key(realign, -1), be_const_func(lvbe_obj_realign) },
|
||||
{ be_const_key(get_parent_event, -1), be_const_func(lvbe_obj_get_parent_event) },
|
||||
{ be_const_key(set_style_local_bg_grad_dir, -1), be_const_func(lvbe_obj_set_style_local_bg_grad_dir) },
|
||||
{ be_const_key(set_style_local_transition_path, -1), be_const_func(lvbe_obj_set_style_local_transition_path) },
|
||||
{ be_const_key(get_style_line_dash_gap, -1), be_const_func(lvbe_obj_get_style_line_dash_gap) },
|
||||
{ be_const_key(set_style_local_transition_prop_6, 95), be_const_func(lvbe_obj_set_style_local_transition_prop_6) },
|
||||
{ be_const_key(set_click, -1), be_const_func(lvbe_obj_set_click) },
|
||||
{ be_const_key(count_children_recursive, -1), be_const_func(lvbe_obj_count_children_recursive) },
|
||||
{ be_const_key(set_height, 154), be_const_func(lvbe_obj_set_height) },
|
||||
{ be_const_key(get_style_border_opa, -1), be_const_func(lvbe_obj_get_style_border_opa) },
|
||||
{ be_const_key(set_style_local_text_color, 140), be_const_func(lvbe_obj_set_style_local_text_color) },
|
||||
{ be_const_key(set_style_local_clip_corner, -1), be_const_func(lvbe_obj_set_style_local_clip_corner) },
|
||||
{ be_const_key(get_style_outline_width, -1), be_const_func(lvbe_obj_get_style_outline_width) },
|
||||
{ be_const_key(set_style_local_text_blend_mode, -1), be_const_func(lvbe_obj_set_style_local_text_blend_mode) },
|
||||
{ be_const_key(get_style_margin_bottom, -1), be_const_func(lvbe_obj_get_style_margin_bottom) },
|
||||
{ be_const_key(get_style_scale_border_width, -1), be_const_func(lvbe_obj_get_style_scale_border_width) },
|
||||
{ be_const_key(set_style_local_transition_time, -1), be_const_func(lvbe_obj_set_style_local_transition_time) },
|
||||
{ be_const_key(move_foreground, -1), be_const_func(lvbe_obj_move_foreground) },
|
||||
{ be_const_key(set_style_local_outline_blend_mode, -1), be_const_func(lvbe_obj_set_style_local_outline_blend_mode) },
|
||||
{ be_const_key(set_drag, -1), be_const_func(lvbe_obj_set_drag) },
|
||||
{ be_const_key(get_style_clip_corner, -1), be_const_func(lvbe_obj_get_style_clip_corner) },
|
||||
{ be_const_key(get_height, 285), be_const_func(lvbe_obj_get_height) },
|
||||
{ be_const_key(set_style_local_bg_opa, -1), be_const_func(lvbe_obj_set_style_local_bg_opa) },
|
||||
{ be_const_key(init_draw_label_dsc, -1), be_const_func(lvbe_obj_init_draw_label_dsc) },
|
||||
{ be_const_key(get_style_border_post, -1), be_const_func(lvbe_obj_get_style_border_post) },
|
||||
{ be_const_key(get_style_value_color, -1), be_const_func(lvbe_obj_get_style_value_color) },
|
||||
{ be_const_key(set_height_margin, 289), be_const_func(lvbe_obj_set_height_margin) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(get_style_pad_left, -1), be_const_func(lvbe_obj_get_style_pad_left) },
|
||||
{ be_const_key(report_style_mod, -1), be_const_func(lvbe_obj_report_style_mod) },
|
||||
{ be_const_key(set_style_local_margin_right, -1), be_const_func(lvbe_obj_set_style_local_margin_right) },
|
||||
{ be_const_key(get_style_scale_end_border_width, 141), be_const_func(lvbe_obj_get_style_scale_end_border_width) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_obj_map,
|
||||
291
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_obj,
|
||||
1,
|
||||
NULL,
|
||||
lv_obj
|
||||
);
|
|
@ -0,0 +1,22 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_objmask_map) {
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(tostring, 0), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(remove_mask, -1), be_const_func(lvbe_objmask_remove_mask) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_objmask_create) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_objmask_create) },
|
||||
{ be_const_key(update_mask, 4), be_const_func(lvbe_objmask_update_mask) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_objmask_map,
|
||||
6
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_objmask,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_objmask
|
||||
);
|
|
@ -0,0 +1,52 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_page_map) {
|
||||
{ be_const_key(on_edge, -1), be_const_func(lvbe_page_on_edge) },
|
||||
{ be_const_key(glue_obj, -1), be_const_func(lvbe_page_glue_obj) },
|
||||
{ be_const_key(scroll_ver, -1), be_const_func(lvbe_page_scroll_ver) },
|
||||
{ be_const_key(get_height_fit, -1), be_const_func(lvbe_page_get_height_fit) },
|
||||
{ be_const_key(get_scrollbar_mode, 16), be_const_func(lvbe_page_get_scrollbar_mode) },
|
||||
{ be_const_key(create, 29), be_const_func(lvbe_page_create) },
|
||||
{ be_const_key(get_scrl_height, -1), be_const_func(lvbe_page_get_scrl_height) },
|
||||
{ be_const_key(set_scrl_layout, -1), be_const_func(lvbe_page_set_scrl_layout) },
|
||||
{ be_const_key(set_edge_flash, -1), be_const_func(lvbe_page_set_edge_flash) },
|
||||
{ be_const_key(get_height_grid, -1), be_const_func(lvbe_page_get_height_grid) },
|
||||
{ be_const_key(get_scrl_fit_bottom, 1), be_const_func(lvbe_page_get_scrl_fit_bottom) },
|
||||
{ be_const_key(get_scrl_layout, 18), be_const_func(lvbe_page_get_scrl_layout) },
|
||||
{ be_const_key(get_scrl_fit_left, 33), be_const_func(lvbe_page_get_scrl_fit_left) },
|
||||
{ be_const_key(get_width_grid, -1), be_const_func(lvbe_page_get_width_grid) },
|
||||
{ be_const_key(set_scrl_height, 6), be_const_func(lvbe_page_set_scrl_height) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_page_create) },
|
||||
{ be_const_key(get_edge_flash, -1), be_const_func(lvbe_page_get_edge_flash) },
|
||||
{ be_const_key(focus, -1), be_const_func(lvbe_page_focus) },
|
||||
{ be_const_key(set_anim_time, -1), be_const_func(lvbe_page_set_anim_time) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(get_width_fit, 22), be_const_func(lvbe_page_get_width_fit) },
|
||||
{ be_const_key(get_scrollable, 34), be_const_func(lvbe_page_get_scrollable) },
|
||||
{ be_const_key(get_scroll_propagation, -1), be_const_func(lvbe_page_get_scroll_propagation) },
|
||||
{ be_const_key(get_scrl_width, -1), be_const_func(lvbe_page_get_scrl_width) },
|
||||
{ be_const_key(set_scrollbar_mode, 9), be_const_func(lvbe_page_set_scrollbar_mode) },
|
||||
{ be_const_key(tostring, 27), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(clean, -1), be_const_func(lvbe_page_clean) },
|
||||
{ be_const_key(set_scrollable_fit2, -1), be_const_func(lvbe_page_set_scrollable_fit2) },
|
||||
{ be_const_key(set_scroll_propagation, 32), be_const_func(lvbe_page_set_scroll_propagation) },
|
||||
{ be_const_key(set_scrollable_fit, -1), be_const_func(lvbe_page_set_scrollable_fit) },
|
||||
{ be_const_key(scroll_hor, -1), be_const_func(lvbe_page_scroll_hor) },
|
||||
{ be_const_key(get_anim_time, 17), be_const_func(lvbe_page_get_anim_time) },
|
||||
{ be_const_key(start_edge_flash, -1), be_const_func(lvbe_page_start_edge_flash) },
|
||||
{ be_const_key(get_scrl_fit_top, -1), be_const_func(lvbe_page_get_scrl_fit_top) },
|
||||
{ be_const_key(get_scrl_fit_right, -1), be_const_func(lvbe_page_get_scrl_fit_right) },
|
||||
{ be_const_key(set_scrl_width, -1), be_const_func(lvbe_page_set_scrl_width) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_page_map,
|
||||
36
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_page,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_page
|
||||
);
|
|
@ -0,0 +1,33 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_roller_map) {
|
||||
{ be_const_key(set_options, -1), be_const_func(lvbe_roller_set_options) },
|
||||
{ be_const_key(get_align, 6), be_const_func(lvbe_roller_get_align) },
|
||||
{ be_const_key(set_visible_row_count, 12), be_const_func(lvbe_roller_set_visible_row_count) },
|
||||
{ be_const_key(get_selected_str, -1), be_const_func(lvbe_roller_get_selected_str) },
|
||||
{ be_const_key(get_selected, -1), be_const_func(lvbe_roller_get_selected) },
|
||||
{ be_const_key(set_selected, -1), be_const_func(lvbe_roller_set_selected) },
|
||||
{ be_const_key(set_anim_time, 0), be_const_func(lvbe_roller_set_anim_time) },
|
||||
{ be_const_key(set_align, -1), be_const_func(lvbe_roller_set_align) },
|
||||
{ be_const_key(get_auto_fit, -1), be_const_func(lvbe_roller_get_auto_fit) },
|
||||
{ be_const_key(set_auto_fit, 10), be_const_func(lvbe_roller_set_auto_fit) },
|
||||
{ be_const_key(get_anim_time, -1), be_const_func(lvbe_roller_get_anim_time) },
|
||||
{ be_const_key(get_option_cnt, 5), be_const_func(lvbe_roller_get_option_cnt) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(get_options, 14), be_const_func(lvbe_roller_get_options) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(init, 7), be_const_func(lvbe_roller_create) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_roller_create) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_roller_map,
|
||||
17
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_roller,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_roller
|
||||
);
|
|
@ -0,0 +1,32 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_slider_map) {
|
||||
{ be_const_key(get_type, -1), be_const_func(lvbe_slider_get_type) },
|
||||
{ be_const_key(get_anim_time, -1), be_const_func(lvbe_slider_get_anim_time) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(init, 10), be_const_func(lvbe_slider_create) },
|
||||
{ be_const_key(is_dragged, -1), be_const_func(lvbe_slider_is_dragged) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_slider_create) },
|
||||
{ be_const_key(get_value, -1), be_const_func(lvbe_slider_get_value) },
|
||||
{ be_const_key(get_max_value, -1), be_const_func(lvbe_slider_get_max_value) },
|
||||
{ be_const_key(set_range, 7), be_const_func(lvbe_slider_set_range) },
|
||||
{ be_const_key(set_anim_time, 2), be_const_func(lvbe_slider_set_anim_time) },
|
||||
{ be_const_key(get_left_value, -1), be_const_func(lvbe_slider_get_left_value) },
|
||||
{ be_const_key(set_type, -1), be_const_func(lvbe_slider_set_type) },
|
||||
{ be_const_key(set_value, 6), be_const_func(lvbe_slider_set_value) },
|
||||
{ be_const_key(get_min_value, -1), be_const_func(lvbe_slider_get_min_value) },
|
||||
{ be_const_key(set_left_value, 1), be_const_func(lvbe_slider_set_left_value) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_slider_map,
|
||||
16
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_slider,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_slider
|
||||
);
|
|
@ -0,0 +1,33 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_spinbox_map) {
|
||||
{ be_const_key(get_value, 6), be_const_func(lvbe_spinbox_get_value) },
|
||||
{ be_const_key(decrement, -1), be_const_func(lvbe_spinbox_decrement) },
|
||||
{ be_const_key(tostring, 4), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_value, -1), be_const_func(lvbe_spinbox_set_value) },
|
||||
{ be_const_key(step_next, 11), be_const_func(lvbe_spinbox_step_next) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_spinbox_create) },
|
||||
{ be_const_key(set_rollover, -1), be_const_func(lvbe_spinbox_set_rollover) },
|
||||
{ be_const_key(get_step, -1), be_const_func(lvbe_spinbox_get_step) },
|
||||
{ be_const_key(set_padding_left, -1), be_const_func(lvbe_spinbox_set_padding_left) },
|
||||
{ be_const_key(set_digit_format, -1), be_const_func(lvbe_spinbox_set_digit_format) },
|
||||
{ be_const_key(increment, -1), be_const_func(lvbe_spinbox_increment) },
|
||||
{ be_const_key(set_range, -1), be_const_func(lvbe_spinbox_set_range) },
|
||||
{ be_const_key(get_rollover, -1), be_const_func(lvbe_spinbox_get_rollover) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(set_step, -1), be_const_func(lvbe_spinbox_set_step) },
|
||||
{ be_const_key(step_prev, 5), be_const_func(lvbe_spinbox_step_prev) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_spinbox_create) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_spinbox_map,
|
||||
17
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_spinbox,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_spinbox
|
||||
);
|
|
@ -0,0 +1,29 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_spinner_map) {
|
||||
{ be_const_key(tostring, 8), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(get_dir, -1), be_const_func(lvbe_spinner_get_dir) },
|
||||
{ be_const_key(get_arc_length, -1), be_const_func(lvbe_spinner_get_arc_length) },
|
||||
{ be_const_key(dot_p, 4), be_const_int(0) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_spinner_create) },
|
||||
{ be_const_key(get_spin_time, -1), be_const_func(lvbe_spinner_get_spin_time) },
|
||||
{ be_const_key(init, 1), be_const_func(lvbe_spinner_create) },
|
||||
{ be_const_key(anim_cb, -1), be_const_func(lvbe_spinner_anim_cb) },
|
||||
{ be_const_key(set_spin_time, 10), be_const_func(lvbe_spinner_set_spin_time) },
|
||||
{ be_const_key(set_arc_length, -1), be_const_func(lvbe_spinner_set_arc_length) },
|
||||
{ be_const_key(set_type, 7), be_const_func(lvbe_spinner_set_type) },
|
||||
{ be_const_key(get_type, 3), be_const_func(lvbe_spinner_get_type) },
|
||||
{ be_const_key(set_dir, 5), be_const_func(lvbe_spinner_set_dir) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_spinner_map,
|
||||
13
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_spinner,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_spinner
|
||||
);
|
|
@ -0,0 +1,119 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_style_map) {
|
||||
{ be_const_key(set_line_dash_width, -1), be_const_func(lvbe_style_set_line_dash_width) },
|
||||
{ be_const_key(set_bg_grad_dir, -1), be_const_func(lvbe_style_set_bg_grad_dir) },
|
||||
{ be_const_key(set_text_blend_mode, 84), be_const_func(lvbe_style_set_text_blend_mode) },
|
||||
{ be_const_key(set_border_blend_mode, 75), be_const_func(lvbe_style_set_border_blend_mode) },
|
||||
{ be_const_key(set_bg_main_stop, -1), be_const_func(lvbe_style_set_bg_main_stop) },
|
||||
{ be_const_key(list_get_local_style, -1), be_const_func(lvbe_style_list_get_local_style) },
|
||||
{ be_const_key(set_transform_height, 40), be_const_func(lvbe_style_set_transform_height) },
|
||||
{ be_const_key(set_shadow_opa, 33), be_const_func(lvbe_style_set_shadow_opa) },
|
||||
{ be_const_key(set_value_blend_mode, 51), be_const_func(lvbe_style_set_value_blend_mode) },
|
||||
{ be_const_key(set_shadow_ofs_x, -1), be_const_func(lvbe_style_set_shadow_ofs_x) },
|
||||
{ be_const_key(set_pattern_blend_mode, -1), be_const_func(lvbe_style_set_pattern_blend_mode) },
|
||||
{ be_const_key(set_text_letter_space, -1), be_const_func(lvbe_style_set_text_letter_space) },
|
||||
{ be_const_key(set_margin_right, 14), be_const_func(lvbe_style_set_margin_right) },
|
||||
{ be_const_key(set_transition_delay, -1), be_const_func(lvbe_style_set_transition_delay) },
|
||||
{ be_const_key(set_shadow_blend_mode, -1), be_const_func(lvbe_style_set_shadow_blend_mode) },
|
||||
{ be_const_key(set_value_color, -1), be_const_func(lvbe_style_set_value_color) },
|
||||
{ be_const_key(set_text_line_space, -1), be_const_func(lvbe_style_set_text_line_space) },
|
||||
{ be_const_key(set_transition_prop_1, -1), be_const_func(lvbe_style_set_transition_prop_1) },
|
||||
{ be_const_key(set_pattern_image, 47), be_const_func(lvbe_style_set_pattern_image) },
|
||||
{ be_const_key(set_image_recolor, -1), be_const_func(lvbe_style_set_image_recolor) },
|
||||
{ be_const_key(set_pattern_opa, -1), be_const_func(lvbe_style_set_pattern_opa) },
|
||||
{ be_const_key(set_outline_blend_mode, -1), be_const_func(lvbe_style_set_outline_blend_mode) },
|
||||
{ be_const_key(set_radius, -1), be_const_func(lvbe_style_set_radius) },
|
||||
{ be_const_key(set_text_color, -1), be_const_func(lvbe_style_set_text_color) },
|
||||
{ be_const_key(set_pattern_repeat, -1), be_const_func(lvbe_style_set_pattern_repeat) },
|
||||
{ be_const_key(set_value_align, -1), be_const_func(lvbe_style_set_value_align) },
|
||||
{ be_const_key(set_scale_width, 82), be_const_func(lvbe_style_set_scale_width) },
|
||||
{ be_const_key(set_line_color, -1), be_const_func(lvbe_style_set_line_color) },
|
||||
{ be_const_key(set_text_opa, 4), be_const_func(lvbe_style_set_text_opa) },
|
||||
{ be_const_key(set_size, -1), be_const_func(lvbe_style_set_size) },
|
||||
{ be_const_key(set_border_opa, 72), be_const_func(lvbe_style_set_border_opa) },
|
||||
{ be_const_key(set_line_opa, 12), be_const_func(lvbe_style_set_line_opa) },
|
||||
{ be_const_key(set_pad_inner, -1), be_const_func(lvbe_style_set_pad_inner) },
|
||||
{ be_const_key(set_margin_bottom, -1), be_const_func(lvbe_style_set_margin_bottom) },
|
||||
{ be_const_key(set_margin_top, 66), be_const_func(lvbe_style_set_margin_top) },
|
||||
{ be_const_key(init, -1), be_const_func(lvs_init) },
|
||||
{ be_const_key(set_transition_prop_2, -1), be_const_func(lvbe_style_set_transition_prop_2) },
|
||||
{ be_const_key(set_transition_prop_5, -1), be_const_func(lvbe_style_set_transition_prop_5) },
|
||||
{ be_const_key(set_transition_prop_6, 26), be_const_func(lvbe_style_set_transition_prop_6) },
|
||||
{ be_const_key(set_border_post, 30), be_const_func(lvbe_style_set_border_post) },
|
||||
{ be_const_key(set_scale_end_line_width, -1), be_const_func(lvbe_style_set_scale_end_line_width) },
|
||||
{ be_const_key(set_pad_left, 64), be_const_func(lvbe_style_set_pad_left) },
|
||||
{ be_const_key(set_scale_border_width, -1), be_const_func(lvbe_style_set_scale_border_width) },
|
||||
{ be_const_key(set_line_blend_mode, 34), be_const_func(lvbe_style_set_line_blend_mode) },
|
||||
{ be_const_key(set_image_recolor_opa, -1), be_const_func(lvbe_style_set_image_recolor_opa) },
|
||||
{ be_const_key(set_bg_color, -1), be_const_func(lvbe_style_set_bg_color) },
|
||||
{ be_const_key(set_pad_bottom, -1), be_const_func(lvbe_style_set_pad_bottom) },
|
||||
{ be_const_key(set_transition_time, -1), be_const_func(lvbe_style_set_transition_time) },
|
||||
{ be_const_key(set_outline_pad, 67), be_const_func(lvbe_style_set_outline_pad) },
|
||||
{ be_const_key(set_transform_angle, 32), be_const_func(lvbe_style_set_transform_angle) },
|
||||
{ be_const_key(set_value_line_space, -1), be_const_func(lvbe_style_set_value_line_space) },
|
||||
{ be_const_key(set_image_opa, 76), be_const_func(lvbe_style_set_image_opa) },
|
||||
{ be_const_key(set_pattern_recolor, -1), be_const_func(lvbe_style_set_pattern_recolor) },
|
||||
{ be_const_key(set_bg_grad_color, 85), be_const_func(lvbe_style_set_bg_grad_color) },
|
||||
{ be_const_key(set_value_letter_space, -1), be_const_func(lvbe_style_set_value_letter_space) },
|
||||
{ be_const_key(set_shadow_spread, 0), be_const_func(lvbe_style_set_shadow_spread) },
|
||||
{ be_const_key(set_text_font, 97), be_const_func(lvbe_style_set_text_font) },
|
||||
{ be_const_key(set_line_width, -1), be_const_func(lvbe_style_set_line_width) },
|
||||
{ be_const_key(set_shadow_color, -1), be_const_func(lvbe_style_set_shadow_color) },
|
||||
{ be_const_key(set_transform_zoom, -1), be_const_func(lvbe_style_set_transform_zoom) },
|
||||
{ be_const_key(set_outline_color, 79), be_const_func(lvbe_style_set_outline_color) },
|
||||
{ be_const_key(set_shadow_ofs_y, 87), be_const_func(lvbe_style_set_shadow_ofs_y) },
|
||||
{ be_const_key(set_text_sel_bg_color, -1), be_const_func(lvbe_style_set_text_sel_bg_color) },
|
||||
{ be_const_key(set_text_decor, -1), be_const_func(lvbe_style_set_text_decor) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvs_tostring) },
|
||||
{ be_const_key(set_clip_corner, -1), be_const_func(lvbe_style_set_clip_corner) },
|
||||
{ be_const_key(set_value_str, -1), be_const_func(lvbe_style_set_value_str) },
|
||||
{ be_const_key(set_pattern_recolor_opa, 16), be_const_func(lvbe_style_set_pattern_recolor_opa) },
|
||||
{ be_const_key(set_border_side, -1), be_const_func(lvbe_style_set_border_side) },
|
||||
{ be_const_key(set_scale_grad_color, -1), be_const_func(lvbe_style_set_scale_grad_color) },
|
||||
{ be_const_key(set_line_rounded, 10), be_const_func(lvbe_style_set_line_rounded) },
|
||||
{ be_const_key(set_pad_right, 35), be_const_func(lvbe_style_set_pad_right) },
|
||||
{ be_const_key(set_transition_prop_4, -1), be_const_func(lvbe_style_set_transition_prop_4) },
|
||||
{ be_const_key(set_transition_prop_3, 99), be_const_func(lvbe_style_set_transition_prop_3) },
|
||||
{ be_const_key(list_init, -1), be_const_func(lvbe_style_list_init) },
|
||||
{ be_const_key(set_transform_width, -1), be_const_func(lvbe_style_set_transform_width) },
|
||||
{ be_const_key(set_bg_grad_stop, -1), be_const_func(lvbe_style_set_bg_grad_stop) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(set_value_opa, 50), be_const_func(lvbe_style_set_value_opa) },
|
||||
{ be_const_key(set_value_font, -1), be_const_func(lvbe_style_set_value_font) },
|
||||
{ be_const_key(set_text_sel_color, -1), be_const_func(lvbe_style_set_text_sel_color) },
|
||||
{ be_const_key(set_outline_width, -1), be_const_func(lvbe_style_set_outline_width) },
|
||||
{ be_const_key(set_value_ofs_x, 11), be_const_func(lvbe_style_set_value_ofs_x) },
|
||||
{ be_const_key(set_scale_end_color, -1), be_const_func(lvbe_style_set_scale_end_color) },
|
||||
{ be_const_key(set_margin_left, -1), be_const_func(lvbe_style_set_margin_left) },
|
||||
{ be_const_key(copy, -1), be_const_func(lvbe_style_copy) },
|
||||
{ be_const_key(set_shadow_width, -1), be_const_func(lvbe_style_set_shadow_width) },
|
||||
{ be_const_key(set_bg_opa, -1), be_const_func(lvbe_style_set_bg_opa) },
|
||||
{ be_const_key(list_copy, 73), be_const_func(lvbe_style_list_copy) },
|
||||
{ be_const_key(set_value_ofs_y, 17), be_const_func(lvbe_style_set_value_ofs_y) },
|
||||
{ be_const_key(set_opa_scale, 15), be_const_func(lvbe_style_set_opa_scale) },
|
||||
{ be_const_key(set_scale_end_border_width, 37), be_const_func(lvbe_style_set_scale_end_border_width) },
|
||||
{ be_const_key(set_border_color, 81), be_const_func(lvbe_style_set_border_color) },
|
||||
{ be_const_key(set_line_dash_gap, 95), be_const_func(lvbe_style_set_line_dash_gap) },
|
||||
{ be_const_key(set_bg_blend_mode, -1), be_const_func(lvbe_style_set_bg_blend_mode) },
|
||||
{ be_const_key(remove_prop, 77), be_const_func(lvbe_style_remove_prop) },
|
||||
{ be_const_key(set_border_width, -1), be_const_func(lvbe_style_set_border_width) },
|
||||
{ be_const_key(set_image_blend_mode, -1), be_const_func(lvbe_style_set_image_blend_mode) },
|
||||
{ be_const_key(set_transition_path, -1), be_const_func(lvbe_style_set_transition_path) },
|
||||
{ be_const_key(set_outline_opa, 29), be_const_func(lvbe_style_set_outline_opa) },
|
||||
{ be_const_key(reset, -1), be_const_func(lvbe_style_reset) },
|
||||
{ be_const_key(set_pad_top, 45), be_const_func(lvbe_style_set_pad_top) },
|
||||
{ be_const_key(list_get_style, -1), be_const_func(lvbe_style_list_get_style) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_style_map,
|
||||
103
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_style,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_style
|
||||
);
|
|
@ -0,0 +1,26 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_switch_map) {
|
||||
{ be_const_key(get_anim_time, 1), be_const_func(lvbe_switch_get_anim_time) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_switch_create) },
|
||||
{ be_const_key(off, -1), be_const_func(lvbe_switch_off) },
|
||||
{ be_const_key(toggle, -1), be_const_func(lvbe_switch_toggle) },
|
||||
{ be_const_key(on, -1), be_const_func(lvbe_switch_on) },
|
||||
{ be_const_key(tostring, 0), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(get_state, -1), be_const_func(lvbe_switch_get_state) },
|
||||
{ be_const_key(set_anim_time, 8), be_const_func(lvbe_switch_set_anim_time) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_switch_create) },
|
||||
{ be_const_key(dot_p, 6), be_const_int(0) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_switch_map,
|
||||
10
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_switch,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_switch
|
||||
);
|
|
@ -0,0 +1,38 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_table_map) {
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_table_create) },
|
||||
{ be_const_key(set_cell_crop, -1), be_const_func(lvbe_table_set_cell_crop) },
|
||||
{ be_const_key(set_cell_value, -1), be_const_func(lvbe_table_set_cell_value) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_cell_merge_right, -1), be_const_func(lvbe_table_set_cell_merge_right) },
|
||||
{ be_const_key(set_cell_type, -1), be_const_func(lvbe_table_set_cell_type) },
|
||||
{ be_const_key(get_col_width, 15), be_const_func(lvbe_table_get_col_width) },
|
||||
{ be_const_key(get_row_cnt, 12), be_const_func(lvbe_table_get_row_cnt) },
|
||||
{ be_const_key(set_row_cnt, -1), be_const_func(lvbe_table_set_row_cnt) },
|
||||
{ be_const_key(get_cell_crop, 0), be_const_func(lvbe_table_get_cell_crop) },
|
||||
{ be_const_key(get_cell_align, 14), be_const_func(lvbe_table_get_cell_align) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_table_create) },
|
||||
{ be_const_key(get_cell_merge_right, -1), be_const_func(lvbe_table_get_cell_merge_right) },
|
||||
{ be_const_key(set_col_width, -1), be_const_func(lvbe_table_set_col_width) },
|
||||
{ be_const_key(set_cell_align, -1), be_const_func(lvbe_table_set_cell_align) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(set_cell_value_fmt, 10), be_const_func(lvbe_table_set_cell_value_fmt) },
|
||||
{ be_const_key(set_col_cnt, -1), be_const_func(lvbe_table_set_col_cnt) },
|
||||
{ be_const_key(get_col_cnt, 17), be_const_func(lvbe_table_get_col_cnt) },
|
||||
{ be_const_key(get_cell_type, 6), be_const_func(lvbe_table_get_cell_type) },
|
||||
{ be_const_key(get_cell_value, 7), be_const_func(lvbe_table_get_cell_value) },
|
||||
{ be_const_key(get_pressed_cell, 13), be_const_func(lvbe_table_get_pressed_cell) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_table_map,
|
||||
22
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_table,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_table
|
||||
);
|
|
@ -0,0 +1,31 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_tabview_map) {
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_tabview_create) },
|
||||
{ be_const_key(get_anim_time, 13), be_const_func(lvbe_tabview_get_anim_time) },
|
||||
{ be_const_key(set_anim_time, 8), be_const_func(lvbe_tabview_set_anim_time) },
|
||||
{ be_const_key(add_tab, 6), be_const_func(lvbe_tabview_add_tab) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(set_btns_pos, 12), be_const_func(lvbe_tabview_set_btns_pos) },
|
||||
{ be_const_key(get_tab_count, -1), be_const_func(lvbe_tabview_get_tab_count) },
|
||||
{ be_const_key(get_tab_act, 11), be_const_func(lvbe_tabview_get_tab_act) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_tabview_create) },
|
||||
{ be_const_key(get_btns_pos, -1), be_const_func(lvbe_tabview_get_btns_pos) },
|
||||
{ be_const_key(set_tab_act, 1), be_const_func(lvbe_tabview_set_tab_act) },
|
||||
{ be_const_key(clean_tab, -1), be_const_func(lvbe_tabview_clean_tab) },
|
||||
{ be_const_key(get_tab, -1), be_const_func(lvbe_tabview_get_tab) },
|
||||
{ be_const_key(tostring, 14), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_tab_name, -1), be_const_func(lvbe_tabview_set_tab_name) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_tabview_map,
|
||||
15
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_tabview,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_tabview
|
||||
);
|
|
@ -0,0 +1,63 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_textarea_map) {
|
||||
{ be_const_key(get_text, -1), be_const_func(lvbe_textarea_get_text) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(get_pwd_mode, 10), be_const_func(lvbe_textarea_get_pwd_mode) },
|
||||
{ be_const_key(get_text_sel_en, 27), be_const_func(lvbe_textarea_get_text_sel_en) },
|
||||
{ be_const_key(set_scrollbar_mode, 41), be_const_func(lvbe_textarea_set_scrollbar_mode) },
|
||||
{ be_const_key(set_cursor_click_pos, -1), be_const_func(lvbe_textarea_set_cursor_click_pos) },
|
||||
{ be_const_key(set_text, 9), be_const_func(lvbe_textarea_set_text) },
|
||||
{ be_const_key(del_char, 39), be_const_func(lvbe_textarea_del_char) },
|
||||
{ be_const_key(cursor_right, 42), be_const_func(lvbe_textarea_cursor_right) },
|
||||
{ be_const_key(cursor_up, -1), be_const_func(lvbe_textarea_cursor_up) },
|
||||
{ be_const_key(cursor_down, -1), be_const_func(lvbe_textarea_cursor_down) },
|
||||
{ be_const_key(set_text_align, 45), be_const_func(lvbe_textarea_set_text_align) },
|
||||
{ be_const_key(set_pwd_mode, -1), be_const_func(lvbe_textarea_set_pwd_mode) },
|
||||
{ be_const_key(del_char_forward, -1), be_const_func(lvbe_textarea_del_char_forward) },
|
||||
{ be_const_key(text_is_selected, 38), be_const_func(lvbe_textarea_text_is_selected) },
|
||||
{ be_const_key(get_cursor_hidden, -1), be_const_func(lvbe_textarea_get_cursor_hidden) },
|
||||
{ be_const_key(set_text_sel, -1), be_const_func(lvbe_textarea_set_text_sel) },
|
||||
{ be_const_key(set_insert_replace, -1), be_const_func(lvbe_textarea_set_insert_replace) },
|
||||
{ be_const_key(get_max_length, 34), be_const_func(lvbe_textarea_get_max_length) },
|
||||
{ be_const_key(set_cursor_blink_time, 25), be_const_func(lvbe_textarea_set_cursor_blink_time) },
|
||||
{ be_const_key(add_char, 19), be_const_func(lvbe_textarea_add_char) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_textarea_create) },
|
||||
{ be_const_key(get_edge_flash, -1), be_const_func(lvbe_textarea_get_edge_flash) },
|
||||
{ be_const_key(set_cursor_hidden, 0), be_const_func(lvbe_textarea_set_cursor_hidden) },
|
||||
{ be_const_key(get_one_line, -1), be_const_func(lvbe_textarea_get_one_line) },
|
||||
{ be_const_key(get_placeholder_text, -1), be_const_func(lvbe_textarea_get_placeholder_text) },
|
||||
{ be_const_key(set_cursor_pos, -1), be_const_func(lvbe_textarea_set_cursor_pos) },
|
||||
{ be_const_key(get_scrollbar_mode, -1), be_const_func(lvbe_textarea_get_scrollbar_mode) },
|
||||
{ be_const_key(get_cursor_blink_time, 17), be_const_func(lvbe_textarea_get_cursor_blink_time) },
|
||||
{ be_const_key(get_scroll_propagation, 28), be_const_func(lvbe_textarea_get_scroll_propagation) },
|
||||
{ be_const_key(get_label, 18), be_const_func(lvbe_textarea_get_label) },
|
||||
{ be_const_key(cursor_left, -1), be_const_func(lvbe_textarea_cursor_left) },
|
||||
{ be_const_key(set_accepted_chars, -1), be_const_func(lvbe_textarea_set_accepted_chars) },
|
||||
{ be_const_key(set_placeholder_text, 31), be_const_func(lvbe_textarea_set_placeholder_text) },
|
||||
{ be_const_key(set_max_length, -1), be_const_func(lvbe_textarea_set_max_length) },
|
||||
{ be_const_key(get_accepted_chars, 37), be_const_func(lvbe_textarea_get_accepted_chars) },
|
||||
{ be_const_key(get_cursor_click_pos, -1), be_const_func(lvbe_textarea_get_cursor_click_pos) },
|
||||
{ be_const_key(get_cursor_pos, -1), be_const_func(lvbe_textarea_get_cursor_pos) },
|
||||
{ be_const_key(set_pwd_show_time, -1), be_const_func(lvbe_textarea_set_pwd_show_time) },
|
||||
{ be_const_key(set_edge_flash, -1), be_const_func(lvbe_textarea_set_edge_flash) },
|
||||
{ be_const_key(clear_selection, 22), be_const_func(lvbe_textarea_clear_selection) },
|
||||
{ be_const_key(get_pwd_show_time, -1), be_const_func(lvbe_textarea_get_pwd_show_time) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_one_line, -1), be_const_func(lvbe_textarea_set_one_line) },
|
||||
{ be_const_key(add_text, 7), be_const_func(lvbe_textarea_add_text) },
|
||||
{ be_const_key(set_scroll_propagation, -1), be_const_func(lvbe_textarea_set_scroll_propagation) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_textarea_create) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_textarea_map,
|
||||
47
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_textarea,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_textarea
|
||||
);
|
|
@ -0,0 +1,28 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_tileview_map) {
|
||||
{ be_const_key(get_tile_act, 2), be_const_func(lvbe_tileview_get_tile_act) },
|
||||
{ be_const_key(tostring, -1), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_tileview_create) },
|
||||
{ be_const_key(add_element, 0), be_const_func(lvbe_tileview_add_element) },
|
||||
{ be_const_key(get_edge_flash, -1), be_const_func(lvbe_tileview_get_edge_flash) },
|
||||
{ be_const_key(set_valid_positions, 6), be_const_func(lvbe_tileview_set_valid_positions) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_tileview_create) },
|
||||
{ be_const_key(set_tile_act, 9), be_const_func(lvbe_tileview_set_tile_act) },
|
||||
{ be_const_key(set_edge_flash, -1), be_const_func(lvbe_tileview_set_edge_flash) },
|
||||
{ be_const_key(dot_p, 10), be_const_int(0) },
|
||||
{ be_const_key(get_anim_time, -1), be_const_func(lvbe_tileview_get_anim_time) },
|
||||
{ be_const_key(set_anim_time, -1), be_const_func(lvbe_tileview_set_anim_time) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_tileview_map,
|
||||
12
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_tileview,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_tileview
|
||||
);
|
|
@ -0,0 +1,47 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_lv_win_map) {
|
||||
{ be_const_key(set_content_size, 10), be_const_func(lvbe_win_set_content_size) },
|
||||
{ be_const_key(set_layout, -1), be_const_func(lvbe_win_set_layout) },
|
||||
{ be_const_key(dot_p, -1), be_const_int(0) },
|
||||
{ be_const_key(get_title, -1), be_const_func(lvbe_win_get_title) },
|
||||
{ be_const_key(clean, 8), be_const_func(lvbe_win_clean) },
|
||||
{ be_const_key(get_content, -1), be_const_func(lvbe_win_get_content) },
|
||||
{ be_const_key(set_btn_width, -1), be_const_func(lvbe_win_set_btn_width) },
|
||||
{ be_const_key(title_get_alignment, -1), be_const_func(lvbe_win_title_get_alignment) },
|
||||
{ be_const_key(scroll_hor, -1), be_const_func(lvbe_win_scroll_hor) },
|
||||
{ be_const_key(add_btn_right, -1), be_const_func(lvbe_win_add_btn_right) },
|
||||
{ be_const_key(get_anim_time, 13), be_const_func(lvbe_win_get_anim_time) },
|
||||
{ be_const_key(init, -1), be_const_func(lvbe_win_create) },
|
||||
{ be_const_key(get_from_btn, 15), be_const_func(lvbe_win_get_from_btn) },
|
||||
{ be_const_key(add_btn_left, -1), be_const_func(lvbe_win_add_btn_left) },
|
||||
{ be_const_key(title_set_alignment, -1), be_const_func(lvbe_win_title_set_alignment) },
|
||||
{ be_const_key(scroll_ver, -1), be_const_func(lvbe_win_scroll_ver) },
|
||||
{ be_const_key(set_header_height, -1), be_const_func(lvbe_win_set_header_height) },
|
||||
{ be_const_key(focus, 19), be_const_func(lvbe_win_focus) },
|
||||
{ be_const_key(set_anim_time, 5), be_const_func(lvbe_win_set_anim_time) },
|
||||
{ be_const_key(close_event_cb, -1), be_const_func(lvbe_win_close_event_cb) },
|
||||
{ be_const_key(create, -1), be_const_func(lvbe_win_create) },
|
||||
{ be_const_key(get_sb_mode, 7), be_const_func(lvbe_win_get_sb_mode) },
|
||||
{ be_const_key(get_btn_width, -1), be_const_func(lvbe_win_get_btn_width) },
|
||||
{ be_const_key(get_width, -1), be_const_func(lvbe_win_get_width) },
|
||||
{ be_const_key(get_layout, -1), be_const_func(lvbe_win_get_layout) },
|
||||
{ be_const_key(set_drag, 2), be_const_func(lvbe_win_set_drag) },
|
||||
{ be_const_key(tostring, 3), be_const_func(lvx_tostring) },
|
||||
{ be_const_key(set_scrollbar_mode, -1), be_const_func(lvbe_win_set_scrollbar_mode) },
|
||||
{ be_const_key(set_title, 24), be_const_func(lvbe_win_set_title) },
|
||||
{ be_const_key(get_drag, 11), be_const_func(lvbe_win_get_drag) },
|
||||
{ be_const_key(get_header_height, -1), be_const_func(lvbe_win_get_header_height) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_lv_win_map,
|
||||
31
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
be_class_lv_win,
|
||||
1,
|
||||
(bclass *)&be_class_lv_obj,
|
||||
lv_win
|
||||
);
|
|
@ -0,0 +1,472 @@
|
|||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(m_liblvgl_map) {
|
||||
{ be_const_key(SYMBOL_RIGHT, 114), be_const_str(&be_local_const_str_SYMBOL_RIGHT) },
|
||||
{ be_const_key(CALENDAR_PART_BG, -1), be_const_int(0) },
|
||||
{ be_const_key(FS_RES_LOCKED, 106), be_const_int(5) },
|
||||
{ be_const_key(STYLE_PAD_INNER, 28), be_const_int(20) },
|
||||
{ be_const_key(DISP_SIZE_MEDIUM, 96), be_const_int(1) },
|
||||
{ be_const_key(BTNMATRIX_CTRL_CHECKABLE, -1), be_const_int(64) },
|
||||
{ be_const_key(OPA_40, 53), be_const_int(102) },
|
||||
{ be_const_key(SYMBOL_IMAGE, 277), be_const_str(&be_local_const_str_SYMBOL_IMAGE) },
|
||||
{ be_const_key(STYLE_TRANSITION_PROP_6, -1), be_const_int(183) },
|
||||
{ be_const_key(RED, 270), be_const_int(16711680) },
|
||||
{ be_const_key(BTN_STATE_RELEASED, -1), be_const_int(0) },
|
||||
{ be_const_key(FIT_TIGHT, -1), be_const_int(1) },
|
||||
{ be_const_key(ALIGN_IN_TOP_LEFT, 396), be_const_int(1) },
|
||||
{ be_const_key(STYLE_BG_GRAD_DIR, 323), be_const_int(35) },
|
||||
{ be_const_key(OPA_100, -1), be_const_int(255) },
|
||||
{ be_const_key(LABEL_ALIGN_LEFT, 10), be_const_int(0) },
|
||||
{ be_const_key(SYMBOL_BATTERY_FULL, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_FULL) },
|
||||
{ be_const_key(EVENT_FOCUSED, 376), be_const_int(13) },
|
||||
{ be_const_key(SYMBOL_DUMMY, -1), be_const_str(&be_local_const_str_SYMBOL_DUMMY) },
|
||||
{ be_const_key(OPA_10, -1), be_const_int(25) },
|
||||
{ be_const_key(ALIGN_IN_RIGHT_MID, -1), be_const_int(8) },
|
||||
{ be_const_key(STYLE_BG_OPA, -1), be_const_int(44) },
|
||||
{ be_const_key(KEY_END, 85), be_const_int(3) },
|
||||
{ be_const_key(SYMBOL_BATTERY_1, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_1) },
|
||||
{ be_const_key(CHART_CURSOR_RIGHT, -1), be_const_int(1) },
|
||||
{ be_const_key(KEY_ESC, -1), be_const_int(27) },
|
||||
{ be_const_key(OPA_70, 255), be_const_int(178) },
|
||||
{ be_const_key(LAYOUT_PRETTY_TOP, -1), be_const_int(8) },
|
||||
{ be_const_key(I2C, -1), be_const_int(1) },
|
||||
{ be_const_key(CALENDAR_PART_DAY_NAMES, -1), be_const_int(2) },
|
||||
{ be_const_key(ALIGN_OUT_RIGHT_BOTTOM, -1), be_const_int(20) },
|
||||
{ be_const_key(KEYBOARD_MODE_TEXT_LOWER, -1), be_const_int(0) },
|
||||
{ be_const_key(TABVIEW_TAB_POS_TOP, -1), be_const_int(1) },
|
||||
{ be_const_key(YELLOW, -1), be_const_int(16776960) },
|
||||
{ be_const_key(SYMBOL_BATTERY_2, 82), be_const_str(&be_local_const_str_SYMBOL_BATTERY_2) },
|
||||
{ be_const_key(ALIGN_OUT_TOP_RIGHT, 435), be_const_int(11) },
|
||||
{ be_const_key(LABEL_LONG_SROLL_CIRC, -1), be_const_int(4) },
|
||||
{ be_const_key(LAYOUT_PRETTY_MID, 254), be_const_int(9) },
|
||||
{ be_const_key(KEY_PREV, 170), be_const_int(11) },
|
||||
{ be_const_key(OPA_50, -1), be_const_int(127) },
|
||||
{ be_const_key(EVENT_INSERT, -1), be_const_int(17) },
|
||||
{ be_const_key(FS_RES_INV_PARAM, -1), be_const_int(11) },
|
||||
{ be_const_key(KEYBOARD_MODE_SPECIAL, 384), be_const_int(2) },
|
||||
{ be_const_key(KEYBOARD_MODE_TEXT_UPPER, -1), be_const_int(1) },
|
||||
{ be_const_key(EVENT_DEFOCUSED, -1), be_const_int(14) },
|
||||
{ be_const_key(SYMBOL_BATTERY_3, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_3) },
|
||||
{ be_const_key(TXT_FLAG_FIT, 299), be_const_int(16) },
|
||||
{ be_const_key(LABEL_LONG_SROLL, -1), be_const_int(3) },
|
||||
{ be_const_key(ALIGN_OUT_RIGHT_TOP, -1), be_const_int(18) },
|
||||
{ be_const_key(ARC_TYPE_REVERSE, -1), be_const_int(2) },
|
||||
{ be_const_key(FS_RES_NOT_IMP, 212), be_const_int(9) },
|
||||
{ be_const_key(STYLE_SHADOW_COLOR, 140), be_const_int(89) },
|
||||
{ be_const_key(STYLE_TEXT_LETTER_SPACE, 256), be_const_int(32896) },
|
||||
{ be_const_key(SYMBOL_MINUS, 74), be_const_str(&be_local_const_str_SYMBOL_MINUS) },
|
||||
{ be_const_key(TABVIEW_TAB_POS_BOTTOM, -1), be_const_int(2) },
|
||||
{ be_const_key(SLIDER_TYPE_RANGE, -1), be_const_int(2) },
|
||||
{ be_const_key(LAYOUT_CENTER, -1), be_const_int(1) },
|
||||
{ be_const_key(SYMBOL_DIRECTORY, -1), be_const_str(&be_local_const_str_SYMBOL_DIRECTORY) },
|
||||
{ be_const_key(STATE_HOVERED, -1), be_const_int(8) },
|
||||
{ be_const_key(ALIGN_IN_BOTTOM_MID, -1), be_const_int(5) },
|
||||
{ be_const_key(CHART_AXIS_PRIMARY_Y, -1), be_const_int(0) },
|
||||
{ be_const_key(SCROLLBAR_MODE_HIDE, 25), be_const_int(4) },
|
||||
{ be_const_key(CHART_AXIS_SKIP_LAST_TICK, 322), be_const_int(0) },
|
||||
{ be_const_key(ALIGN_OUT_LEFT_BOTTOM, -1), be_const_int(17) },
|
||||
{ be_const_key(layer_sys, -1), be_const_func(lv0_layer_sys) },
|
||||
{ be_const_key(FS_RES_FULL, 400), be_const_int(4) },
|
||||
{ be_const_key(SYMBOL_STOP, -1), be_const_str(&be_local_const_str_SYMBOL_STOP) },
|
||||
{ be_const_key(BLEND_MODE_ADDITIVE, -1), be_const_int(1) },
|
||||
{ be_const_key(DROPDOWN_PART_MAIN, -1), be_const_int(0) },
|
||||
{ be_const_key(CHART_AXIS_DRAW_LAST_TICK, 362), be_const_int(1) },
|
||||
{ be_const_key(OPA_0, -1), be_const_int(0) },
|
||||
{ be_const_key(STYLE_TEXT_BLEND_MODE, 193), be_const_int(32899) },
|
||||
{ be_const_key(STYLE_VALUE_STR, 202), be_const_int(127) },
|
||||
{ be_const_key(GRAD_DIR_VER, 291), be_const_int(1) },
|
||||
{ be_const_key(CHART_UPDATE_MODE_SHIFT, 269), be_const_int(0) },
|
||||
{ be_const_key(TEXTAREA_CURSOR_LAST, 157), be_const_int(32767) },
|
||||
{ be_const_key(CPICKER_PART_MAIN, -1), be_const_int(0) },
|
||||
{ be_const_key(CPICKER_PART_KNOB, -1), be_const_int(1) },
|
||||
{ be_const_key(LAYOUT_ROW_BOTTOM, 205), be_const_int(7) },
|
||||
{ be_const_key(SCROLLBAR_MODE_OFF, -1), be_const_int(0) },
|
||||
{ be_const_key(BTN_STATE_CHECKED_DISABLED, -1), be_const_int(5) },
|
||||
{ be_const_key(EVENT_PRESSING, 280), be_const_int(1) },
|
||||
{ be_const_key(GESTURE_DIR_BOTTOM, -1), be_const_int(1) },
|
||||
{ be_const_key(EVENT_RELEASED, -1), be_const_int(7) },
|
||||
{ be_const_key(GAUGE_PART_MAIN, -1), be_const_int(0) },
|
||||
{ be_const_key(EVENT_PRESS_LOST, 300), be_const_int(2) },
|
||||
{ be_const_key(FS_RES_OK, -1), be_const_int(0) },
|
||||
{ be_const_key(CHART_AXIS_INVERSE_LABELS_ORDER, 389), be_const_int(2) },
|
||||
{ be_const_key(STYLE_TEXT_FONT, -1), be_const_int(32910) },
|
||||
{ be_const_key(STYLE_VALUE_OFS_Y, -1), be_const_int(116) },
|
||||
{ be_const_key(CPICKER_COLOR_MODE_VALUE, 194), be_const_int(2) },
|
||||
{ be_const_key(STYLE_PATTERN_REPEAT, -1), be_const_int(97) },
|
||||
{ be_const_key(OPA_80, -1), be_const_int(204) },
|
||||
{ be_const_key(PROTECT_POS, 265), be_const_int(4) },
|
||||
{ be_const_key(OBJMASK_PART_MAIN, 6), be_const_int(0) },
|
||||
{ be_const_key(STYLE_PATTERN_IMAGE, 455), be_const_int(110) },
|
||||
{ be_const_key(STYLE_TEXT_SEL_COLOR, -1), be_const_int(32906) },
|
||||
{ be_const_key(DROPDOWN_DIR_UP, -1), be_const_int(1) },
|
||||
{ be_const_key(STYLE_TRANSFORM_HEIGHT, -1), be_const_int(5) },
|
||||
{ be_const_key(OBJ_PART_VIRTUAL_FIRST, -1), be_const_int(1) },
|
||||
{ be_const_key(STYLE_TRANSITION_DELAY, 148), be_const_int(177) },
|
||||
{ be_const_key(STYLE_TRANSFORM_ZOOM, -1), be_const_int(7) },
|
||||
{ be_const_key(BAR_TYPE_CUSTOM, 375), be_const_int(2) },
|
||||
{ be_const_key(ALIGN_OUT_BOTTOM_LEFT, -1), be_const_int(12) },
|
||||
{ be_const_key(scr_act, 50), be_const_func(lv0_scr_act) },
|
||||
{ be_const_key(OPA_COVER, -1), be_const_int(255) },
|
||||
{ be_const_key(GRAY, -1), be_const_int(8421504) },
|
||||
{ be_const_key(BORDER_SIDE_FULL, 36), be_const_int(15) },
|
||||
{ be_const_key(BLACK, -1), be_const_int(0) },
|
||||
{ be_const_key(MAROON, 98), be_const_int(8388608) },
|
||||
{ be_const_key(FS_RES_UNKNOWN, -1), be_const_int(12) },
|
||||
{ be_const_key(CALENDAR_PART_HEADER, -1), be_const_int(1) },
|
||||
{ be_const_key(ALIGN_OUT_TOP_MID, -1), be_const_int(10) },
|
||||
{ be_const_key(STYLE_IMAGE_OPA, 95), be_const_int(32940) },
|
||||
{ be_const_key(FS_MODE_WR, -1), be_const_int(1) },
|
||||
{ be_const_key(BAR_TYPE_SYMMETRICAL, -1), be_const_int(1) },
|
||||
{ be_const_key(PROTECT_CLICK_FOCUS, 97), be_const_int(32) },
|
||||
{ be_const_key(SYMBOL_PASTE, -1), be_const_str(&be_local_const_str_SYMBOL_PASTE) },
|
||||
{ be_const_key(OBJ_PART_MAIN, -1), be_const_int(0) },
|
||||
{ be_const_key(STYLE_OUTLINE_BLEND_MODE, -1), be_const_int(66) },
|
||||
{ be_const_key(DROPDOWN_DIR_DOWN, -1), be_const_int(0) },
|
||||
{ be_const_key(SYMBOL_VIDEO, -1), be_const_str(&be_local_const_str_SYMBOL_VIDEO) },
|
||||
{ be_const_key(LAYOUT_PRETTY_BOTTOM, -1), be_const_int(10) },
|
||||
{ be_const_key(SYMBOL_POWER, -1), be_const_str(&be_local_const_str_SYMBOL_POWER) },
|
||||
{ be_const_key(BTNMATRIX_CTRL_CLICK_TRIG, -1), be_const_int(256) },
|
||||
{ be_const_key(BTNMATRIX_CTRL_DISABLED, -1), be_const_int(32) },
|
||||
{ be_const_key(CHART_CURSOR_UP, -1), be_const_int(2) },
|
||||
{ be_const_key(LINEMETER_PART_MAIN, -1), be_const_int(0) },
|
||||
{ be_const_key(SYMBOL_EYE_OPEN, 309), be_const_str(&be_local_const_str_SYMBOL_EYE_OPEN) },
|
||||
{ be_const_key(OPA_30, 107), be_const_int(76) },
|
||||
{ be_const_key(STYLE_SIZE, -1), be_const_int(3) },
|
||||
{ be_const_key(ALIGN_IN_BOTTOM_RIGHT, -1), be_const_int(6) },
|
||||
{ be_const_key(STATE_FOCUSED, -1), be_const_int(2) },
|
||||
{ be_const_key(DRAG_DIR_BOTH, -1), be_const_int(3) },
|
||||
{ be_const_key(STYLE_TEXT_DECOR, -1), be_const_int(32898) },
|
||||
{ be_const_key(TEXT_DECOR_UNDERLINE, -1), be_const_int(1) },
|
||||
{ be_const_key(LABEL_ALIGN_RIGHT, 290), be_const_int(2) },
|
||||
{ be_const_key(TXT_FLAG_NONE, -1), be_const_int(0) },
|
||||
{ be_const_key(STYLE_IMAGE_BLEND_MODE, 258), be_const_int(32928) },
|
||||
{ be_const_key(STATE_PRESSED, -1), be_const_int(16) },
|
||||
{ be_const_key(BTNMATRIX_CTRL_CHECK_STATE, -1), be_const_int(128) },
|
||||
{ be_const_key(ARC_PART_BG, 392), be_const_int(0) },
|
||||
{ be_const_key(STYLE_SHADOW_OPA, 208), be_const_int(92) },
|
||||
{ be_const_key(EVENT_DRAG_THROW_BEGIN, -1), be_const_int(10) },
|
||||
{ be_const_key(LABEL_LONG_DOT, -1), be_const_int(2) },
|
||||
{ be_const_key(TABVIEW_TAB_POS_RIGHT, 242), be_const_int(4) },
|
||||
{ be_const_key(CHART_PART_SERIES, 51), be_const_int(2) },
|
||||
{ be_const_key(STYLE_MARGIN_LEFT, 83), be_const_int(23) },
|
||||
{ be_const_key(GREEN, -1), be_const_int(32768) },
|
||||
{ be_const_key(STYLE_BORDER_SIDE, 286), be_const_int(49) },
|
||||
{ be_const_key(SYMBOL_DRIVE, -1), be_const_str(&be_local_const_str_SYMBOL_DRIVE) },
|
||||
{ be_const_key(SYMBOL_UP, -1), be_const_str(&be_local_const_str_SYMBOL_UP) },
|
||||
{ be_const_key(STYLE_PAD_BOTTOM, -1), be_const_int(17) },
|
||||
{ be_const_key(SCROLLBAR_MODE_UNHIDE, 369), be_const_int(8) },
|
||||
{ be_const_key(DISP_ROT_90, -1), be_const_int(1) },
|
||||
{ be_const_key(STYLE_SHADOW_BLEND_MODE, 43), be_const_int(84) },
|
||||
{ be_const_key(SCROLLBAR_MODE_DRAG, -1), be_const_int(2) },
|
||||
{ be_const_key(EVENT_DELETE, -1), be_const_int(21) },
|
||||
{ be_const_key(SYMBOL_PLUS, -1), be_const_str(&be_local_const_str_SYMBOL_PLUS) },
|
||||
{ be_const_key(PAGE_EDGE_RIGHT, -1), be_const_int(4) },
|
||||
{ be_const_key(ANIM_ON, -1), be_const_int(1) },
|
||||
{ be_const_key(FS_RES_BUSY, 16), be_const_int(7) },
|
||||
{ be_const_key(PAGE_EDGE_TOP, 395), be_const_int(2) },
|
||||
{ be_const_key(SPINNER_TYPE_CONSTANT_ARC, 146), be_const_int(2) },
|
||||
{ be_const_key(STYLE_SCALE_GRAD_COLOR, -1), be_const_int(201) },
|
||||
{ be_const_key(BTN_STATE_CHECKED_PRESSED, -1), be_const_int(4) },
|
||||
{ be_const_key(KEY_UP, 222), be_const_int(17) },
|
||||
{ be_const_key(FS_MODE_RD, 213), be_const_int(2) },
|
||||
{ be_const_key(LABEL_LONG_BREAK, 333), be_const_int(1) },
|
||||
{ be_const_key(KEY_DOWN, 246), be_const_int(18) },
|
||||
{ be_const_key(ALIGN_OUT_BOTTOM_RIGHT, -1), be_const_int(14) },
|
||||
{ be_const_key(LAYOUT_COLUMN_RIGHT, 211), be_const_int(4) },
|
||||
{ be_const_key(ALIGN_OUT_BOTTOM_MID, -1), be_const_int(13) },
|
||||
{ be_const_key(DROPDOWN_PART_LIST, 37), be_const_int(64) },
|
||||
{ be_const_key(KEY_DEL, 31), be_const_int(127) },
|
||||
{ be_const_key(SYMBOL_SETTINGS, -1), be_const_str(&be_local_const_str_SYMBOL_SETTINGS) },
|
||||
{ be_const_key(SYMBOL_USB, -1), be_const_str(&be_local_const_str_SYMBOL_USB) },
|
||||
{ be_const_key(CALENDAR_PART_DATE, 346), be_const_int(3) },
|
||||
{ be_const_key(layer_top, 342), be_const_func(lv0_layer_top) },
|
||||
{ be_const_key(STYLE_PATTERN_BLEND_MODE, -1), be_const_int(96) },
|
||||
{ be_const_key(ARC_TYPE_SYMMETRIC, 38), be_const_int(1) },
|
||||
{ be_const_key(GESTURE_DIR_RIGHT, 47), be_const_int(3) },
|
||||
{ be_const_key(BTN_STATE_DISABLED, 71), be_const_int(2) },
|
||||
{ be_const_key(EVENT_KEY, -1), be_const_int(12) },
|
||||
{ be_const_key(TEMPL_STYLE_X, 326), be_const_int(0) },
|
||||
{ be_const_key(SLIDER_TYPE_NORMAL, -1), be_const_int(0) },
|
||||
{ be_const_key(LIST_PART_SCROLLBAR, -1), be_const_int(1) },
|
||||
{ be_const_key(CPICKER_COLOR_MODE_SATURATION, -1), be_const_int(1) },
|
||||
{ be_const_key(STYLE_TEXT_LINE_SPACE, -1), be_const_int(32897) },
|
||||
{ be_const_key(SYMBOL_HOME, -1), be_const_str(&be_local_const_str_SYMBOL_HOME) },
|
||||
{ be_const_key(STYLE_BG_GRAD_STOP, 315), be_const_int(34) },
|
||||
{ be_const_key(TEAL, -1), be_const_int(32896) },
|
||||
{ be_const_key(LIST_PART_EDGE_FLASH, -1), be_const_int(2) },
|
||||
{ be_const_key(STYLE_LINE_WIDTH, 427), be_const_int(144) },
|
||||
{ be_const_key(LIME, -1), be_const_int(65280) },
|
||||
{ be_const_key(TEMPL_STYLE_Y, 125), be_const_int(1) },
|
||||
{ be_const_key(EVENT_CANCEL, -1), be_const_int(20) },
|
||||
{ be_const_key(STYLE_MARGIN_BOTTOM, -1), be_const_int(22) },
|
||||
{ be_const_key(SYMBOL_EDIT, 426), be_const_str(&be_local_const_str_SYMBOL_EDIT) },
|
||||
{ be_const_key(SYMBOL_KEYBOARD, 69), be_const_str(&be_local_const_str_SYMBOL_KEYBOARD) },
|
||||
{ be_const_key(LAYOUT_GRID, 447), be_const_int(11) },
|
||||
{ be_const_key(SPINNER_DIR_BACKWARD, 252), be_const_int(1) },
|
||||
{ be_const_key(SILVER, 365), be_const_int(12632256) },
|
||||
{ be_const_key(SYMBOL_SHUFFLE, -1), be_const_str(&be_local_const_str_SYMBOL_SHUFFLE) },
|
||||
{ be_const_key(OPA_TRANSP, -1), be_const_int(0) },
|
||||
{ be_const_key(STYLE_VALUE_OFS_X, 436), be_const_int(115) },
|
||||
{ be_const_key(STYLE_TRANSITION_PROP_3, -1), be_const_int(180) },
|
||||
{ be_const_key(SPINNER_DIR_FORWARD, 27), be_const_int(0) },
|
||||
{ be_const_key(SPINNER_TYPE_FILLSPIN_ARC, -1), be_const_int(1) },
|
||||
{ be_const_key(STYLE_MARGIN_TOP, 454), be_const_int(21) },
|
||||
{ be_const_key(SYMBOL_BULLET, -1), be_const_str(&be_local_const_str_SYMBOL_BULLET) },
|
||||
{ be_const_key(LAYOUT_COLUMN_MID, -1), be_const_int(3) },
|
||||
{ be_const_key(SSPI, 397), be_const_int(2) },
|
||||
{ be_const_key(STYLE_IMAGE_RECOLOR, 284), be_const_int(32937) },
|
||||
{ be_const_key(KEYBOARD_PART_BG, -1), be_const_int(0) },
|
||||
{ be_const_key(SYMBOL_COPY, 282), be_const_str(&be_local_const_str_SYMBOL_COPY) },
|
||||
{ be_const_key(STYLE_BG_BLEND_MODE, 273), be_const_int(32) },
|
||||
{ be_const_key(STYLE_TRANSITION_PROP_2, 388), be_const_int(179) },
|
||||
{ be_const_key(TXT_FLAG_CENTER, -1), be_const_int(4) },
|
||||
{ be_const_key(OPA_90, -1), be_const_int(229) },
|
||||
{ be_const_key(PAGE_EDGE_BOTTOM, 166), be_const_int(8) },
|
||||
{ be_const_key(FIT_MAX, 26), be_const_int(3) },
|
||||
{ be_const_key(CHART_AXIS_SECONDARY_Y, -1), be_const_int(1) },
|
||||
{ be_const_key(LIST_PART_BG, 237), be_const_int(0) },
|
||||
{ be_const_key(EVENT_DRAG_BEGIN, 35), be_const_int(8) },
|
||||
{ be_const_key(FIT_PARENT, 424), be_const_int(2) },
|
||||
{ be_const_key(CHART_CURSOR_LEFT, 177), be_const_int(4) },
|
||||
{ be_const_key(PROTECT_PRESS_LOST, -1), be_const_int(16) },
|
||||
{ be_const_key(STYLE_TRANSITION_PROP_5, -1), be_const_int(182) },
|
||||
{ be_const_key(DROPDOWN_PART_SCROLLBAR, 243), be_const_int(65) },
|
||||
{ be_const_key(GAUGE_PART_NEEDLE, -1), be_const_int(2) },
|
||||
{ be_const_key(LABEL_LONG_CROP, -1), be_const_int(5) },
|
||||
{ be_const_key(SYMBOL_TRASH, 127), be_const_str(&be_local_const_str_SYMBOL_TRASH) },
|
||||
{ be_const_key(STYLE_LINE_BLEND_MODE, 81), be_const_int(145) },
|
||||
{ be_const_key(STYLE_TRANSFORM_WIDTH, 196), be_const_int(4) },
|
||||
{ be_const_key(TXT_FLAG_RIGHT, -1), be_const_int(8) },
|
||||
{ be_const_key(STYLE_LINE_OPA, -1), be_const_int(156) },
|
||||
{ be_const_key(ALIGN_OUT_LEFT_TOP, -1), be_const_int(15) },
|
||||
{ be_const_key(ARC_TYPE_NORMAL, 210), be_const_int(0) },
|
||||
{ be_const_key(STYLE_TRANSITION_PROP_4, -1), be_const_int(181) },
|
||||
{ be_const_key(CHART_PART_CURSOR, 356), be_const_int(3) },
|
||||
{ be_const_key(STYLE_PATTERN_RECOLOR_OPA, -1), be_const_int(109) },
|
||||
{ be_const_key(STYLE_BG_MAIN_STOP, 301), be_const_int(33) },
|
||||
{ be_const_key(AQUA, -1), be_const_int(65535) },
|
||||
{ be_const_key(STATE_CHECKED, 90), be_const_int(1) },
|
||||
{ be_const_key(CHART_PART_BG, -1), be_const_int(0) },
|
||||
{ be_const_key(STYLE_LINE_DASH_GAP, 321), be_const_int(147) },
|
||||
{ be_const_key(SYMBOL_NEXT, -1), be_const_str(&be_local_const_str_SYMBOL_NEXT) },
|
||||
{ be_const_key(STYLE_SCALE_WIDTH, -1), be_const_int(192) },
|
||||
{ be_const_key(STYLE_RADIUS, -1), be_const_int(1) },
|
||||
{ be_const_key(montserrat_font, -1), be_const_func(lv0_load_montserrat_font) },
|
||||
{ be_const_key(EVENT_LONG_PRESSED_REPEAT, -1), be_const_int(5) },
|
||||
{ be_const_key(SYMBOL_CHARGE, 316), be_const_str(&be_local_const_str_SYMBOL_CHARGE) },
|
||||
{ be_const_key(ALIGN_IN_LEFT_MID, -1), be_const_int(7) },
|
||||
{ be_const_key(STYLE_LINE_COLOR, -1), be_const_int(153) },
|
||||
{ be_const_key(BORDER_SIDE_LEFT, -1), be_const_int(4) },
|
||||
{ be_const_key(STYLE_BG_COLOR, 298), be_const_int(41) },
|
||||
{ be_const_key(PROTECT_PARENT, -1), be_const_int(2) },
|
||||
{ be_const_key(STYLE_OPA_SCALE, -1), be_const_int(32780) },
|
||||
{ be_const_key(STYLE_SHADOW_SPREAD, -1), be_const_int(83) },
|
||||
{ be_const_key(SYMBOL_OK, 337), be_const_str(&be_local_const_str_SYMBOL_OK) },
|
||||
{ be_const_key(STYLE_TEXT_OPA, 8), be_const_int(32908) },
|
||||
{ be_const_key(STYLE_PATTERN_OPA, -1), be_const_int(108) },
|
||||
{ be_const_key(TXT_FLAG_EXPAND, 410), be_const_int(2) },
|
||||
{ be_const_key(DRAG_DIR_ONE, -1), be_const_int(4) },
|
||||
{ be_const_key(STYLE_OUTLINE_PAD, -1), be_const_int(65) },
|
||||
{ be_const_key(STYLE_BORDER_WIDTH, 201), be_const_int(48) },
|
||||
{ be_const_key(EVENT_LONG_PRESSED, 73), be_const_int(4) },
|
||||
{ be_const_key(CPICKER_TYPE_RECT, 409), be_const_int(0) },
|
||||
{ be_const_key(BORDER_SIDE_RIGHT, -1), be_const_int(8) },
|
||||
{ be_const_key(STYLE_OUTLINE_WIDTH, -1), be_const_int(64) },
|
||||
{ be_const_key(ARC_PART_INDIC, -1), be_const_int(1) },
|
||||
{ be_const_key(STYLE_PATTERN_RECOLOR, -1), be_const_int(105) },
|
||||
{ be_const_key(TXT_CMD_STATE_PAR, 115), be_const_int(1) },
|
||||
{ be_const_key(STYLE_SCALE_BORDER_WIDTH, -1), be_const_int(193) },
|
||||
{ be_const_key(SYMBOL_MUTE, 102), be_const_str(&be_local_const_str_SYMBOL_MUTE) },
|
||||
{ be_const_key(BTN_STATE_PRESSED, 353), be_const_int(1) },
|
||||
{ be_const_key(STYLE_SCALE_END_BORDER_WIDTH, -1), be_const_int(194) },
|
||||
{ be_const_key(STATE_EDITED, -1), be_const_int(4) },
|
||||
{ be_const_key(SYMBOL_LEFT, -1), be_const_str(&be_local_const_str_SYMBOL_LEFT) },
|
||||
{ be_const_key(LABEL_ALIGN_CENTER, -1), be_const_int(1) },
|
||||
{ be_const_key(STYLE_BG_GRAD_COLOR, 274), be_const_int(42) },
|
||||
{ be_const_key(STYLE_SCALE_END_LINE_WIDTH, -1), be_const_int(195) },
|
||||
{ be_const_key(DISP_ROT_180, 103), be_const_int(2) },
|
||||
{ be_const_key(FIT_NONE, -1), be_const_int(0) },
|
||||
{ be_const_key(LAYOUT_OFF, 40), be_const_int(0) },
|
||||
{ be_const_key(BORDER_SIDE_INTERNAL, -1), be_const_int(16) },
|
||||
{ be_const_key(BORDER_SIDE_TOP, -1), be_const_int(2) },
|
||||
{ be_const_key(BLEND_MODE_NORMAL, -1), be_const_int(0) },
|
||||
{ be_const_key(KEY_RIGHT, 154), be_const_int(19) },
|
||||
{ be_const_key(CHECKBOX_PART_BG, -1), be_const_int(0) },
|
||||
{ be_const_key(CHART_UPDATE_MODE_CIRCULAR, -1), be_const_int(1) },
|
||||
{ be_const_key(TEXT_DECOR_STRIKETHROUGH, -1), be_const_int(2) },
|
||||
{ be_const_key(ROLLER_MODE_INFINITE, -1), be_const_int(1) },
|
||||
{ be_const_key(SYMBOL_PAUSE, -1), be_const_str(&be_local_const_str_SYMBOL_PAUSE) },
|
||||
{ be_const_key(FS_RES_DENIED, 215), be_const_int(6) },
|
||||
{ be_const_key(SLIDER_TYPE_SYMMETRICAL, -1), be_const_int(1) },
|
||||
{ be_const_key(SYMBOL_REFRESH, -1), be_const_str(&be_local_const_str_SYMBOL_REFRESH) },
|
||||
{ be_const_key(SYMBOL_AUDIO, -1), be_const_str(&be_local_const_str_SYMBOL_AUDIO) },
|
||||
{ be_const_key(FS_RES_OUT_OF_MEM, 293), be_const_int(10) },
|
||||
{ be_const_key(PROTECT_EVENT_TO_DISABLED, -1), be_const_int(64) },
|
||||
{ be_const_key(DRAG_DIR_HOR, -1), be_const_int(1) },
|
||||
{ be_const_key(STYLE_VALUE_ALIGN, -1), be_const_int(117) },
|
||||
{ be_const_key(KEY_BACKSPACE, -1), be_const_int(8) },
|
||||
{ be_const_key(EVENT_LEAVE, -1), be_const_int(15) },
|
||||
{ be_const_key(DRAG_DIR_VER, -1), be_const_int(2) },
|
||||
{ be_const_key(TXT_CMD_STATE_WAIT, -1), be_const_int(0) },
|
||||
{ be_const_key(SCROLLBAR_MODE_ON, 442), be_const_int(1) },
|
||||
{ be_const_key(STYLE_MARGIN_RIGHT, 207), be_const_int(24) },
|
||||
{ be_const_key(DROPDOWN_DIR_LEFT, -1), be_const_int(2) },
|
||||
{ be_const_key(STYLE_TEXT_COLOR, -1), be_const_int(32905) },
|
||||
{ be_const_key(KEYBOARD_PART_BTN, 370), be_const_int(1) },
|
||||
{ be_const_key(STYLE_TRANSITION_TIME, 272), be_const_int(176) },
|
||||
{ be_const_key(EVENT_CLICKED, -1), be_const_int(6) },
|
||||
{ be_const_key(SYMBOL_GPS, 92), be_const_str(&be_local_const_str_SYMBOL_GPS) },
|
||||
{ be_const_key(DISP_SIZE_EXTRA_LARGE, -1), be_const_int(3) },
|
||||
{ be_const_key(KEY_HOME, -1), be_const_int(2) },
|
||||
{ be_const_key(SYMBOL_BATTERY_EMPTY, -1), be_const_str(&be_local_const_str_SYMBOL_BATTERY_EMPTY) },
|
||||
{ be_const_key(STYLE_VALUE_COLOR, -1), be_const_int(121) },
|
||||
{ be_const_key(FS_RES_FS_ERR, 390), be_const_int(2) },
|
||||
{ be_const_key(MAGENTA, 303), be_const_int(16711935) },
|
||||
{ be_const_key(ROLLER_MODE_NORMAL, -1), be_const_int(0) },
|
||||
{ be_const_key(GAUGE_PART_MAJOR, -1), be_const_int(1) },
|
||||
{ be_const_key(SYMBOL_VOLUME_MAX, -1), be_const_str(&be_local_const_str_SYMBOL_VOLUME_MAX) },
|
||||
{ be_const_key(STYLE_PAD_LEFT, 310), be_const_int(18) },
|
||||
{ be_const_key(BLUE, -1), be_const_int(255) },
|
||||
{ be_const_key(STYLE_TRANSITION_PROP_1, -1), be_const_int(178) },
|
||||
{ be_const_key(STYLE_OUTLINE_COLOR, -1), be_const_int(73) },
|
||||
{ be_const_key(TXT_CMD_STATE_IN, 329), be_const_int(2) },
|
||||
{ be_const_key(GRAD_DIR_NONE, 318), be_const_int(0) },
|
||||
{ be_const_key(STYLE_SHADOW_OFS_Y, 61), be_const_int(82) },
|
||||
{ be_const_key(EVENT_GESTURE, -1), be_const_int(11) },
|
||||
{ be_const_key(EVENT_DRAG_END, 294), be_const_int(9) },
|
||||
{ be_const_key(STYLE_BORDER_POST, 48), be_const_int(51) },
|
||||
{ be_const_key(SYMBOL_CALL, 152), be_const_str(&be_local_const_str_SYMBOL_CALL) },
|
||||
{ be_const_key(PURPLE, 382), be_const_int(8388736) },
|
||||
{ be_const_key(DROPDOWN_PART_SELECTED, -1), be_const_int(66) },
|
||||
{ be_const_key(FS_RES_TOUT, -1), be_const_int(8) },
|
||||
{ be_const_key(OBJ_PART_ALL, -1), be_const_int(255) },
|
||||
{ be_const_key(CPICKER_TYPE_DISC, -1), be_const_int(1) },
|
||||
{ be_const_key(CYAN, -1), be_const_int(65535) },
|
||||
{ be_const_key(STYLE_SHADOW_OFS_X, 317), be_const_int(81) },
|
||||
{ be_const_key(PAGE_EDGE_LEFT, -1), be_const_int(1) },
|
||||
{ be_const_key(ALIGN_OUT_TOP_LEFT, -1), be_const_int(9) },
|
||||
{ be_const_key(PROTECT_NONE, -1), be_const_int(0) },
|
||||
{ be_const_key(KEY_ENTER, 120), be_const_int(10) },
|
||||
{ be_const_key(DISP_ROT_NONE, -1), be_const_int(0) },
|
||||
{ be_const_key(GRAD_DIR_HOR, -1), be_const_int(2) },
|
||||
{ be_const_key(OPA_60, -1), be_const_int(153) },
|
||||
{ be_const_key(CHART_CURSOR_NONE, -1), be_const_int(0) },
|
||||
{ be_const_key(WHITE, -1), be_const_int(16777215) },
|
||||
{ be_const_key(SYMBOL_EJECT, 304), be_const_str(&be_local_const_str_SYMBOL_EJECT) },
|
||||
{ be_const_key(STYLE_SHADOW_WIDTH, -1), be_const_int(80) },
|
||||
{ be_const_key(GESTURE_DIR_TOP, -1), be_const_int(0) },
|
||||
{ be_const_key(STYLE_IMAGE_RECOLOR_OPA, -1), be_const_int(32941) },
|
||||
{ be_const_key(CHART_TYPE_LINE, 29), be_const_int(1) },
|
||||
{ be_const_key(GESTURE_DIR_LEFT, -1), be_const_int(2) },
|
||||
{ be_const_key(SPI, -1), be_const_int(0) },
|
||||
{ be_const_key(LAYOUT_COLUMN_LEFT, 367), be_const_int(2) },
|
||||
{ be_const_key(HSPI, -1), be_const_int(0) },
|
||||
{ be_const_key(SYMBOL_EYE_CLOSE, 124), be_const_str(&be_local_const_str_SYMBOL_EYE_CLOSE) },
|
||||
{ be_const_key(KEYBOARD_MODE_NUM, 56), be_const_int(3) },
|
||||
{ be_const_key(SYMBOL_BELL, -1), be_const_str(&be_local_const_str_SYMBOL_BELL) },
|
||||
{ be_const_key(STYLE_TEXT_SEL_BG_COLOR, -1), be_const_int(32907) },
|
||||
{ be_const_key(STATE_DEFAULT, 60), be_const_int(0) },
|
||||
{ be_const_key(LAYOUT_ROW_TOP, -1), be_const_int(5) },
|
||||
{ be_const_key(ALIGN_OUT_LEFT_MID, 216), be_const_int(16) },
|
||||
{ be_const_key(SYMBOL_CLOSE, -1), be_const_str(&be_local_const_str_SYMBOL_CLOSE) },
|
||||
{ be_const_key(STYLE_VALUE_LETTER_SPACE, -1), be_const_int(112) },
|
||||
{ be_const_key(NAVY, 414), be_const_int(128) },
|
||||
{ be_const_key(SYMBOL_SAVE, 420), be_const_str(&be_local_const_str_SYMBOL_SAVE) },
|
||||
{ be_const_key(SYMBOL_NEW_LINE, -1), be_const_str(&be_local_const_str_SYMBOL_NEW_LINE) },
|
||||
{ be_const_key(SYMBOL_FILE, -1), be_const_str(&be_local_const_str_SYMBOL_FILE) },
|
||||
{ be_const_key(SYMBOL_DOWNLOAD, -1), be_const_str(&be_local_const_str_SYMBOL_DOWNLOAD) },
|
||||
{ be_const_key(ARC_PART_KNOB, -1), be_const_int(2) },
|
||||
{ be_const_key(BAR_TYPE_NORMAL, -1), be_const_int(0) },
|
||||
{ be_const_key(VSPI, -1), be_const_int(1) },
|
||||
{ be_const_key(STYLE_VALUE_OPA, 14), be_const_int(124) },
|
||||
{ be_const_key(SYMBOL_DOWN, -1), be_const_str(&be_local_const_str_SYMBOL_DOWN) },
|
||||
{ be_const_key(EVENT_REFRESH, -1), be_const_int(18) },
|
||||
{ be_const_key(EVENT_APPLY, -1), be_const_int(19) },
|
||||
{ be_const_key(STYLE_BORDER_BLEND_MODE, -1), be_const_int(50) },
|
||||
{ be_const_key(CPICKER_COLOR_MODE_HUE, 429), be_const_int(0) },
|
||||
{ be_const_key(start, -1), be_const_func(lv0_start) },
|
||||
{ be_const_key(ANIM_OFF, -1), be_const_int(0) },
|
||||
{ be_const_key(STYLE_CLIP_CORNER, -1), be_const_int(2) },
|
||||
{ be_const_key(BTNMATRIX_CTRL_NO_REPEAT, -1), be_const_int(16) },
|
||||
{ be_const_key(TEXT_DECOR_NONE, -1), be_const_int(0) },
|
||||
{ be_const_key(ALIGN_IN_TOP_RIGHT, -1), be_const_int(3) },
|
||||
{ be_const_key(BLEND_MODE_SUBTRACTIVE, 439), be_const_int(2) },
|
||||
{ be_const_key(BORDER_SIDE_BOTTOM, 143), be_const_int(1) },
|
||||
{ be_const_key(CHART_TYPE_NONE, 344), be_const_int(0) },
|
||||
{ be_const_key(FS_RES_HW_ERR, -1), be_const_int(1) },
|
||||
{ be_const_key(LABEL_LONG_EXPAND, -1), be_const_int(0) },
|
||||
{ be_const_key(SYMBOL_CUT, 340), be_const_str(&be_local_const_str_SYMBOL_CUT) },
|
||||
{ be_const_key(STYLE_OUTLINE_OPA, -1), be_const_int(76) },
|
||||
{ be_const_key(SYMBOL_SD_CARD, 448), be_const_str(&be_local_const_str_SYMBOL_SD_CARD) },
|
||||
{ be_const_key(EVENT_SHORT_CLICKED, 405), be_const_int(3) },
|
||||
{ be_const_key(BORDER_SIDE_NONE, -1), be_const_int(0) },
|
||||
{ be_const_key(CHART_CURSOR_DOWN, -1), be_const_int(8) },
|
||||
{ be_const_key(ALIGN_OUT_RIGHT_MID, -1), be_const_int(19) },
|
||||
{ be_const_key(SYMBOL_BACKSPACE, 15), be_const_str(&be_local_const_str_SYMBOL_BACKSPACE) },
|
||||
{ be_const_key(STYLE_TRANSITION_PATH, 188), be_const_int(190) },
|
||||
{ be_const_key(STYLE_LINE_ROUNDED, -1), be_const_int(148) },
|
||||
{ be_const_key(OLIVE, 9), be_const_int(8421376) },
|
||||
{ be_const_key(SYMBOL_LOOP, -1), be_const_str(&be_local_const_str_SYMBOL_LOOP) },
|
||||
{ be_const_key(STYLE_VALUE_LINE_SPACE, -1), be_const_int(113) },
|
||||
{ be_const_key(CHART_PART_SERIES_BG, 4), be_const_int(1) },
|
||||
{ be_const_key(STYLE_VALUE_FONT, -1), be_const_int(126) },
|
||||
{ be_const_key(SYMBOL_PLAY, -1), be_const_str(&be_local_const_str_SYMBOL_PLAY) },
|
||||
{ be_const_key(DISP_SIZE_LARGE, -1), be_const_int(2) },
|
||||
{ be_const_key(BTN_STATE_CHECKED_RELEASED, 133), be_const_int(3) },
|
||||
{ be_const_key(SYMBOL_BLUETOOTH, -1), be_const_str(&be_local_const_str_SYMBOL_BLUETOOTH) },
|
||||
{ be_const_key(STYLE_SCALE_END_COLOR, -1), be_const_int(202) },
|
||||
{ be_const_key(SPINNER_TYPE_SPINNING_ARC, 443), be_const_int(0) },
|
||||
{ be_const_key(SYMBOL_WIFI, 24), be_const_str(&be_local_const_str_SYMBOL_WIFI) },
|
||||
{ be_const_key(STYLE_BORDER_OPA, -1), be_const_int(60) },
|
||||
{ be_const_key(STYLE_PAD_RIGHT, -1), be_const_int(19) },
|
||||
{ be_const_key(OBJ_PART_REAL_FIRST, 136), be_const_int(64) },
|
||||
{ be_const_key(STATE_DISABLED, -1), be_const_int(32) },
|
||||
{ be_const_key(SYMBOL_UPLOAD, -1), be_const_str(&be_local_const_str_SYMBOL_UPLOAD) },
|
||||
{ be_const_key(STYLE_TRANSFORM_ANGLE, -1), be_const_int(6) },
|
||||
{ be_const_key(EVENT_VALUE_CHANGED, -1), be_const_int(16) },
|
||||
{ be_const_key(TABVIEW_TAB_POS_NONE, -1), be_const_int(0) },
|
||||
{ be_const_key(SYMBOL_VOLUME_MID, -1), be_const_str(&be_local_const_str_SYMBOL_VOLUME_MID) },
|
||||
{ be_const_key(STYLE_LINE_DASH_WIDTH, -1), be_const_int(146) },
|
||||
{ be_const_key(SYMBOL_WARNING, -1), be_const_str(&be_local_const_str_SYMBOL_WARNING) },
|
||||
{ be_const_key(ALIGN_IN_BOTTOM_LEFT, -1), be_const_int(4) },
|
||||
{ be_const_key(TABVIEW_TAB_POS_LEFT, 88), be_const_int(3) },
|
||||
{ be_const_key(DISP_SIZE_SMALL, -1), be_const_int(0) },
|
||||
{ be_const_key(ALIGN_CENTER, -1), be_const_int(0) },
|
||||
{ be_const_key(SYMBOL_PREV, 385), be_const_str(&be_local_const_str_SYMBOL_PREV) },
|
||||
{ be_const_key(get_hor_res, -1), be_const_func(lv0_get_hor_res) },
|
||||
{ be_const_key(DISP_ROT_270, -1), be_const_int(3) },
|
||||
{ be_const_key(PROTECT_CHILD_CHG, -1), be_const_int(1) },
|
||||
{ be_const_key(OPA_20, -1), be_const_int(51) },
|
||||
{ be_const_key(LED_PART_MAIN, -1), be_const_int(0) },
|
||||
{ be_const_key(CHECKBOX_PART_BULLET, -1), be_const_int(64) },
|
||||
{ be_const_key(EVENT_PRESSED, -1), be_const_int(0) },
|
||||
{ be_const_key(LABEL_ALIGN_AUTO, -1), be_const_int(3) },
|
||||
{ be_const_key(get_ver_res, -1), be_const_func(lv0_get_ver_res) },
|
||||
{ be_const_key(STYLE_BORDER_COLOR, -1), be_const_int(57) },
|
||||
{ be_const_key(BTNMATRIX_CTRL_HIDDEN, 453), be_const_int(8) },
|
||||
{ be_const_key(TXT_FLAG_RECOLOR, -1), be_const_int(1) },
|
||||
{ be_const_key(KEY_LEFT, -1), be_const_int(20) },
|
||||
{ be_const_key(SCROLLBAR_MODE_AUTO, -1), be_const_int(3) },
|
||||
{ be_const_key(SYMBOL_LIST, 165), be_const_str(&be_local_const_str_SYMBOL_LIST) },
|
||||
{ be_const_key(STYLE_PAD_TOP, -1), be_const_int(16) },
|
||||
{ be_const_key(PROTECT_FOLLOW, -1), be_const_int(8) },
|
||||
{ be_const_key(LAYOUT_ROW_MID, -1), be_const_int(6) },
|
||||
{ be_const_key(STYLE_VALUE_BLEND_MODE, 373), be_const_int(114) },
|
||||
{ be_const_key(CHART_TYPE_COLUMN, 91), be_const_int(2) },
|
||||
{ be_const_key(KEY_NEXT, 128), be_const_int(9) },
|
||||
{ be_const_key(FS_RES_NOT_EX, -1), be_const_int(3) },
|
||||
{ be_const_key(DROPDOWN_DIR_RIGHT, -1), be_const_int(3) },
|
||||
{ be_const_key(ALIGN_IN_TOP_MID, -1), be_const_int(2) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
m_liblvgl_map,
|
||||
456
|
||||
);
|
||||
|
||||
static be_define_const_module(
|
||||
m_liblvgl,
|
||||
"lvgl"
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_native_module(lvgl, NULL);
|
|
@ -24,6 +24,7 @@
|
|||
"+<../default/*.hpp>",
|
||||
"+<*.cpp>",
|
||||
"+<*.h>"
|
||||
]
|
||||
],
|
||||
"flags": [ "-I$PROJECT_DIR/tasmota", "-DCOMPILE_BERRY_LIB" ]
|
||||
}
|
||||
}
|
|
@ -390,6 +390,12 @@ BERRY_API void be_pushclass(bvm *vm, const char *name, const bnfuncinfo *lib)
|
|||
var_setclass(vm->top - 1, c);
|
||||
}
|
||||
|
||||
BERRY_API void be_pushntvclass(bvm *vm, const struct bclass * c)
|
||||
{
|
||||
bvalue *top = be_incrtop(vm);
|
||||
var_setclass(top, (bclass *) c);
|
||||
}
|
||||
|
||||
BERRY_API void be_pushcomptr(bvm *vm, void *ptr)
|
||||
{
|
||||
bvalue *top = be_incrtop(vm);
|
||||
|
|
|
@ -47,6 +47,11 @@ extern "C" {
|
|||
.type = BE_REAL \
|
||||
}
|
||||
|
||||
#define be_const_str(_val) { \
|
||||
.v.s = (bstring*)(_val), \
|
||||
.type = BE_STRING \
|
||||
}
|
||||
|
||||
#define be_const_class(_class) { \
|
||||
.v.c = &(_class), \
|
||||
.type = BE_CLASS \
|
||||
|
|
|
@ -81,7 +81,7 @@ static void m_solidify_proto(bvm *vm, bproto *pr, const char * func_name, int bu
|
|||
|
||||
/* create static strings for name and source */
|
||||
logfmt("be_define_local_const_str(%s_str_name, \"%s\", %i, 0, %u, 0);\n",
|
||||
func_name, func_name, be_strhash(pr->name), str_len(pr->name));
|
||||
func_name, str(pr->name), be_strhash(pr->name), str_len(pr->name));
|
||||
logfmt("be_define_local_const_str(%s_str_source, \"%s\", %i, 0, %u, 0);\n",
|
||||
func_name, func_source, be_strhash(pr->source), str_len(pr->source));
|
||||
|
||||
|
|
|
@ -120,6 +120,7 @@ enum berrorcode {
|
|||
|
||||
typedef struct bvm bvm; /* virtual machine structure */
|
||||
typedef int (*bntvfunc)(bvm*); /* native function pointer */
|
||||
struct bclass;
|
||||
|
||||
/* native function information */
|
||||
typedef struct {
|
||||
|
@ -428,6 +429,7 @@ BERRY_API void be_pushclosure(bvm *vm, void *cl);
|
|||
BERRY_API void be_pushntvclosure(bvm *vm, bntvfunc f, int nupvals);
|
||||
BERRY_API void be_pushntvfunction(bvm *vm, bntvfunc f);
|
||||
BERRY_API void be_pushclass(bvm *vm, const char *name, const bnfuncinfo *lib);
|
||||
BERRY_API void be_pushntvclass(bvm *vm, const struct bclass * c);
|
||||
BERRY_API void be_pushcomptr(bvm *vm, void *ptr);
|
||||
BERRY_API bbool be_pushiter(bvm *vm, int index);
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
#include "../default/berry_conf.h"
|
||||
#include "../default/berry_conf.h"
|
||||
|
|
|
@ -27,6 +27,12 @@ block_builder::block_builder(const object_block *object, const macro_table *macr
|
|||
if (depend(object, macro)) {
|
||||
m_block.type = object->type;
|
||||
m_block.attr = object->attr;
|
||||
|
||||
auto it = object->attr.find("name");
|
||||
if (it != object->attr.end()) {
|
||||
m_strtab.push_back(it->second);
|
||||
}
|
||||
|
||||
for (auto i : object->data) {
|
||||
if (i.second.depend.empty() || macro->query(i.second.depend)) {
|
||||
m_block.data[i.first] = i.second.value;
|
||||
|
|
|
@ -0,0 +1,447 @@
|
|||
#include "Adafruit_LvGL_Glue.h"
|
||||
#include <lvgl.h>
|
||||
|
||||
// ARCHITECTURE-SPECIFIC TIMER STUFF ---------------------------------------
|
||||
|
||||
// Tick interval for LittlevGL internal timekeeping; 1 to 10 ms recommended
|
||||
static const int lv_tick_interval_ms = 10;
|
||||
|
||||
#if defined(ARDUINO_ARCH_SAMD) // --------------------------------------
|
||||
|
||||
// Because of the way timer/counters are paired, and because parallel TFT
|
||||
// uses timer 2 for write strobe, this needs to use timer 4 or above...
|
||||
#define TIMER_NUM 4
|
||||
#define TIMER_ISR TC4_Handler
|
||||
|
||||
// Interrupt service routine for zerotimer object
|
||||
void TIMER_ISR(void) { Adafruit_ZeroTimer::timerHandler(TIMER_NUM); }
|
||||
|
||||
// Timer compare match 0 callback -- invokes LittlevGL timekeeper.
|
||||
static void timerCallback0(void) { lv_tick_inc(lv_tick_interval_ms); }
|
||||
|
||||
#elif defined(ESP32) // ------------------------------------------------
|
||||
|
||||
static void lv_tick_handler(void) { lv_tick_inc(lv_tick_interval_ms); }
|
||||
|
||||
#elif defined(NRF52_SERIES) // -----------------------------------------
|
||||
|
||||
#define TIMER_ID NRF_TIMER4
|
||||
#define TIMER_IRQN TIMER4_IRQn
|
||||
#define TIMER_ISR TIMER4_IRQHandler
|
||||
#define TIMER_FREQ 16000000
|
||||
|
||||
extern "C" {
|
||||
// Timer interrupt service routine
|
||||
void TIMER_ISR(void) {
|
||||
if (TIMER_ID->EVENTS_COMPARE[0]) {
|
||||
TIMER_ID->EVENTS_COMPARE[0] = 0;
|
||||
}
|
||||
lv_tick_inc(lv_tick_interval_ms);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// TOUCHSCREEN STUFF -------------------------------------------------------
|
||||
|
||||
// STMPE610 calibration for raw touch data
|
||||
#define TS_MINX 100
|
||||
#define TS_MAXX 3800
|
||||
#define TS_MINY 100
|
||||
#define TS_MAXY 3750
|
||||
|
||||
// Same, for ADC touchscreen
|
||||
#define ADC_XMIN 325
|
||||
#define ADC_XMAX 750
|
||||
#define ADC_YMIN 240
|
||||
#define ADC_YMAX 840
|
||||
|
||||
static bool touchscreen_read(struct _lv_indev_drv_t *indev_drv,
|
||||
lv_indev_data_t *data) {
|
||||
static lv_coord_t last_x = 0, last_y = 0;
|
||||
static uint8_t release_count = 0;
|
||||
|
||||
// Get pointer to glue object from indev user data
|
||||
Adafruit_LvGL_Glue *glue = (Adafruit_LvGL_Glue *)indev_drv->user_data;
|
||||
uDisplay_lvgl *disp = glue->display;
|
||||
|
||||
if (glue->is_adc_touch) {
|
||||
TouchScreen *touch = (TouchScreen *)glue->touchscreen;
|
||||
TSPoint p = touch->getPoint();
|
||||
// Serial.printf("%d %d %d\r\n", p.x, p.y, p.z);
|
||||
// Having an issue with spurious z=0 results from TouchScreen lib.
|
||||
// Since touch is polled periodically, workaround is to watch for
|
||||
// several successive z=0 results, and only then regard it as
|
||||
// a release event (otherwise still touched).
|
||||
if (p.z < touch->pressureThreshhold) { // A zero-ish value
|
||||
release_count += (release_count < 255);
|
||||
if (release_count >= 4) {
|
||||
data->state = LV_INDEV_STATE_REL; // Is REALLY RELEASED
|
||||
} else {
|
||||
data->state = LV_INDEV_STATE_PR; // Is STILL PRESSED
|
||||
}
|
||||
} else {
|
||||
release_count = 0; // Reset release counter
|
||||
data->state = LV_INDEV_STATE_PR; // Is PRESSED
|
||||
switch (glue->display->getRotation()) {
|
||||
case 0:
|
||||
last_x = map(p.x, ADC_XMIN, ADC_XMAX, 0, disp->width() - 1);
|
||||
last_y = map(p.y, ADC_YMAX, ADC_YMIN, 0, disp->height() - 1);
|
||||
break;
|
||||
case 1:
|
||||
last_x = map(p.y, ADC_YMAX, ADC_YMIN, 0, disp->width() - 1);
|
||||
last_y = map(p.x, ADC_XMAX, ADC_XMIN, 0, disp->height() - 1);
|
||||
break;
|
||||
case 2:
|
||||
last_x = map(p.x, ADC_XMAX, ADC_XMIN, 0, disp->width() - 1);
|
||||
last_y = map(p.y, ADC_YMIN, ADC_YMAX, 0, disp->height() - 1);
|
||||
break;
|
||||
case 3:
|
||||
last_x = map(p.y, ADC_YMIN, ADC_YMAX, 0, disp->width() - 1);
|
||||
last_y = map(p.x, ADC_XMIN, ADC_XMAX, 0, disp->height() - 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
data->point.x = last_x; // Last-pressed coordinates
|
||||
data->point.y = last_y;
|
||||
return false; // No buffering of ADC touch data
|
||||
} else {
|
||||
uint8_t fifo; // Number of points in touchscreen FIFO
|
||||
bool moar = false;
|
||||
Adafruit_STMPE610 *touch = (Adafruit_STMPE610 *)glue->touchscreen;
|
||||
// Before accessing SPI touchscreen, wait on any in-progress
|
||||
// DMA screen transfer to finish (shared bus).
|
||||
//disp->dmaWait();
|
||||
disp->endWrite();
|
||||
if ((fifo = touch->bufferSize())) { // 1 or more points await
|
||||
data->state = LV_INDEV_STATE_PR; // Is PRESSED
|
||||
TS_Point p = touch->getPoint();
|
||||
// Serial.printf("%d %d %d\r\n", p.x, p.y, p.z);
|
||||
// On big TFT FeatherWing, raw X axis is flipped??
|
||||
if ((glue->display->width() == 480) || (glue->display->height() == 480)) {
|
||||
p.x = (TS_MINX + TS_MAXX) - p.x;
|
||||
}
|
||||
switch (glue->display->getRotation()) {
|
||||
case 0:
|
||||
last_x = map(p.x, TS_MAXX, TS_MINX, 0, disp->width() - 1);
|
||||
last_y = map(p.y, TS_MINY, TS_MAXY, 0, disp->height() - 1);
|
||||
break;
|
||||
case 1:
|
||||
last_x = map(p.y, TS_MINY, TS_MAXY, 0, disp->width() - 1);
|
||||
last_y = map(p.x, TS_MINX, TS_MAXX, 0, disp->height() - 1);
|
||||
break;
|
||||
case 2:
|
||||
last_x = map(p.x, TS_MINX, TS_MAXX, 0, disp->width() - 1);
|
||||
last_y = map(p.y, TS_MAXY, TS_MINY, 0, disp->height() - 1);
|
||||
break;
|
||||
case 3:
|
||||
last_x = map(p.y, TS_MAXY, TS_MINY, 0, disp->width() - 1);
|
||||
last_y = map(p.x, TS_MAXX, TS_MINX, 0, disp->height() - 1);
|
||||
break;
|
||||
}
|
||||
moar = (fifo > 1); // true if more in FIFO, false if last point
|
||||
#if defined(NRF52_SERIES)
|
||||
// Not sure what's up here, but nRF doesn't seem to always poll
|
||||
// the FIFO size correctly, causing false release events. If it
|
||||
// looks like we've read the last point from the FIFO, pause
|
||||
// briefly to allow any more FIFO events to pile up. This
|
||||
// doesn't seem to be necessary on SAMD or ESP32. ???
|
||||
if (!moar) {
|
||||
delay(50);
|
||||
}
|
||||
#endif
|
||||
} else { // FIFO empty
|
||||
data->state = LV_INDEV_STATE_REL; // Is RELEASED
|
||||
}
|
||||
|
||||
data->point.x = last_x; // Last-pressed coordinates
|
||||
data->point.y = last_y;
|
||||
return moar;
|
||||
}
|
||||
}
|
||||
|
||||
// OTHER LITTLEVGL VITALS --------------------------------------------------
|
||||
|
||||
#if LV_COLOR_DEPTH != 16
|
||||
#pragma error("LV_COLOR_DEPTH must be 16")
|
||||
#endif
|
||||
// This isn't necessarily true, don't mention it for now. See notes later.
|
||||
//#if LV_COLOR_16_SWAP != 0
|
||||
// #pragma message("Set LV_COLOR_16_SWAP to 0 for best display performance")
|
||||
//#endif
|
||||
|
||||
// Actual RAM usage will be 2X these figures, since using 2 DMA buffers...
|
||||
#define LV_BUFFER_ROWS 60 // Most others have a bit more space
|
||||
|
||||
// This is the flush function required for LittlevGL screen updates.
|
||||
// It receives a bounding rect and an array of pixel data (conveniently
|
||||
// already in 565 format, so the Earth was lucky there).
|
||||
static void lv_flush_callback(lv_disp_drv_t *disp, const lv_area_t *area,
|
||||
lv_color_t *color_p) {
|
||||
// Get pointer to glue object from indev user data
|
||||
Adafruit_LvGL_Glue *glue = (Adafruit_LvGL_Glue *)disp->user_data;
|
||||
uDisplay_lvgl *display = glue->display;
|
||||
|
||||
if (!glue->first_frame) {
|
||||
//display->dmaWait(); // Wait for prior DMA transfer to complete
|
||||
display->endWrite(); // End transaction from any prior call
|
||||
} else {
|
||||
glue->first_frame = false;
|
||||
}
|
||||
|
||||
uint16_t width = (area->x2 - area->x1 + 1);
|
||||
uint16_t height = (area->y2 - area->y1 + 1);
|
||||
// display->startWrite();
|
||||
// display->setAddrWindow(area->x1, area->y1, width, height);
|
||||
display->writePixels(area->x1, area->y1, width, height,
|
||||
(uint16_t *)color_p, width * height);
|
||||
// display->pushColors((uint16_t *)color_p, width * height, false);
|
||||
|
||||
lv_disp_flush_ready(disp);
|
||||
}
|
||||
|
||||
#if (LV_USE_LOG)
|
||||
// Optional LittlevGL debug print function, writes to Serial if debug is
|
||||
// enabled when calling glue begin() function.
|
||||
static void lv_debug(lv_log_level_t level, const char *file, uint32_t line, const char *fname,
|
||||
const char *dsc) {
|
||||
Serial.print(file);
|
||||
Serial.write('@');
|
||||
Serial.print(line);
|
||||
Serial.print(":");
|
||||
Serial.print(fname);
|
||||
Serial.write("->");
|
||||
Serial.println(dsc);
|
||||
}
|
||||
#endif
|
||||
|
||||
// GLUE LIB FUNCTIONS ------------------------------------------------------
|
||||
|
||||
// Constructor
|
||||
/**
|
||||
* @brief Construct a new Adafruit_LvGL_Glue::Adafruit_LvGL_Glue object,
|
||||
* initializing minimal variables
|
||||
*
|
||||
*/
|
||||
Adafruit_LvGL_Glue::Adafruit_LvGL_Glue(void)
|
||||
: first_frame(true), lv_pixel_buf(NULL) {
|
||||
#if defined(ARDUINO_ARCH_SAMD)
|
||||
zerotimer = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Destructor
|
||||
/**
|
||||
* @brief Destroy the Adafruit_LvGL_Glue::Adafruit_LvGL_Glue object, freeing any
|
||||
* memory previously allocated within this library.
|
||||
*
|
||||
*/
|
||||
Adafruit_LvGL_Glue::~Adafruit_LvGL_Glue(void) {
|
||||
delete[] lv_pixel_buf;
|
||||
#if defined(ARDUINO_ARCH_SAMD)
|
||||
delete zerotimer;
|
||||
#endif
|
||||
// Probably other stuff that could be deallocated here
|
||||
}
|
||||
|
||||
// begin() function is overloaded for STMPE610 touch, ADC touch, or none.
|
||||
|
||||
// Pass in POINTERS to ALREADY INITIALIZED display & touch objects (user code
|
||||
// should have previously called corresponding begin() functions and checked
|
||||
// return states before invoking this),
|
||||
// they are NOT initialized here. Debug arg is
|
||||
// touch arg can be NULL (or left off) if using LittlevGL as a passive widget
|
||||
// display.
|
||||
|
||||
/**
|
||||
* @brief Configure the glue layer and the underlying LvGL code to use the given
|
||||
* TFT display driver instance and touchscreen controller
|
||||
*
|
||||
* @param tft Pointer to an **already initialized** display object instance
|
||||
* @param touch Pointer to an **already initialized** `Adafruit_STMPE610`
|
||||
* touchscreen controller object instance
|
||||
* @param debug Debug flag to enable debug messages. Only used if LV_USE_LOG is
|
||||
* configured in LittleLVGL's lv_conf.h
|
||||
* @return LvGLStatus The status of the initialization:
|
||||
* * LVGL_OK : Success
|
||||
* * LVGL_ERR_TIMER : Failure to set up timers
|
||||
* * LVGL_ERR_ALLOC : Failure to allocate memory
|
||||
*/
|
||||
LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft,
|
||||
Adafruit_STMPE610 *touch, bool debug) {
|
||||
is_adc_touch = false;
|
||||
return begin(tft, (void *)touch, debug);
|
||||
}
|
||||
/**
|
||||
* @brief Configure the glue layer and the underlying LvGL code to use the given
|
||||
* TFT display driver and touchscreen controller instances
|
||||
*
|
||||
* @param tft Pointer to an **already initialized** display object instance
|
||||
* @param touch Pointer to an **already initialized** `TouchScreen` touchscreen
|
||||
* controller object instance
|
||||
* @param debug Debug flag to enable debug messages. Only used if LV_USE_LOG is
|
||||
* configured in LittleLVGL's lv_conf.h
|
||||
* @return LvGLStatus The status of the initialization:
|
||||
* * LVGL_OK : Success
|
||||
* * LVGL_ERR_TIMER : Failure to set up timers
|
||||
* * LVGL_ERR_ALLOC : Failure to allocate memory
|
||||
*/
|
||||
LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft, TouchScreen *touch,
|
||||
bool debug) {
|
||||
is_adc_touch = true;
|
||||
return begin(tft, (void *)touch, debug);
|
||||
}
|
||||
/**
|
||||
* @brief Configure the glue layer and the underlying LvGL code to use the given
|
||||
* TFT display driver and touchscreen controller instances
|
||||
*
|
||||
* @param tft Pointer to an **already initialized** display object instance
|
||||
* @param debug Debug flag to enable debug messages. Only used if LV_USE_LOG is
|
||||
* configured in LittleLVGL's lv_conf.h
|
||||
* @return LvGLStatus The status of the initialization:
|
||||
* * LVGL_OK : Success
|
||||
* * LVGL_ERR_TIMER : Failure to set up timers
|
||||
* * LVGL_ERR_ALLOC : Failure to allocate memory
|
||||
*/
|
||||
LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft, bool debug) {
|
||||
return begin(tft, (void *)NULL, debug);
|
||||
}
|
||||
|
||||
LvGLStatus Adafruit_LvGL_Glue::begin(uDisplay_lvgl *tft, void *touch,
|
||||
bool debug) {
|
||||
|
||||
lv_init();
|
||||
// #if (LV_USE_LOG)
|
||||
// if (debug) {
|
||||
// lv_log_register_print_cb(lv_debug); // Register debug print function
|
||||
// }
|
||||
// #endif
|
||||
|
||||
// Allocate LvGL display buffer (x2 because DMA double buffering)
|
||||
LvGLStatus status = LVGL_ERR_ALLOC;
|
||||
// if ((lv_pixel_buf = new lv_color_t[LV_HOR_RES_MAX * LV_BUFFER_ROWS * 2])) {
|
||||
if ((lv_pixel_buf = new lv_color_t[LV_HOR_RES_MAX * LV_BUFFER_ROWS])) {
|
||||
|
||||
display = tft;
|
||||
touchscreen = (void *)touch;
|
||||
|
||||
// // Initialize LvGL display buffers
|
||||
// lv_disp_buf_init(
|
||||
// &lv_disp_buf, lv_pixel_buf, // 1st half buf
|
||||
// &lv_pixel_buf[LV_HOR_RES_MAX * LV_BUFFER_ROWS], // 2nd half buf
|
||||
// LV_HOR_RES_MAX * LV_BUFFER_ROWS);
|
||||
|
||||
// Initialize LvGL display buffers
|
||||
lv_disp_buf_init(
|
||||
&lv_disp_buf, lv_pixel_buf, // 1st half buf
|
||||
nullptr, // 2nd half buf
|
||||
LV_HOR_RES_MAX * LV_BUFFER_ROWS);
|
||||
|
||||
// Initialize LvGL display driver
|
||||
lv_disp_drv_init(&lv_disp_drv);
|
||||
lv_disp_drv.hor_res = tft->width();
|
||||
lv_disp_drv.ver_res = tft->height();
|
||||
lv_disp_drv.flush_cb = lv_flush_callback;
|
||||
lv_disp_drv.buffer = &lv_disp_buf;
|
||||
lv_disp_drv.user_data = (lv_disp_drv_user_data_t)this;
|
||||
lv_disp_drv_register(&lv_disp_drv);
|
||||
|
||||
// Initialize LvGL input device (touchscreen already started)
|
||||
if ((touch)) { // Can also pass NULL if passive widget display
|
||||
lv_indev_drv_init(&lv_indev_drv); // Basic init
|
||||
lv_indev_drv.type = LV_INDEV_TYPE_POINTER; // Is pointer dev
|
||||
lv_indev_drv.read_cb = touchscreen_read; // Read callback
|
||||
lv_indev_drv.user_data = (lv_indev_drv_user_data_t)this;
|
||||
lv_input_dev_ptr = lv_indev_drv_register(&lv_indev_drv);
|
||||
}
|
||||
|
||||
// TIMER SETUP is architecture-specific ----------------------------
|
||||
|
||||
#if defined(ARDUINO_ARCH_SAMD) // --------------------------------------
|
||||
|
||||
// status is still ERR_ALLOC until proven otherwise...
|
||||
if ((zerotimer = new Adafruit_ZeroTimer(TIMER_NUM))) {
|
||||
uint8_t divider = 1;
|
||||
uint16_t compare = 0;
|
||||
tc_clock_prescaler prescaler = TC_CLOCK_PRESCALER_DIV1;
|
||||
|
||||
status = LVGL_OK; // We're prob good now, but one more test...
|
||||
|
||||
int freq = 1000 / lv_tick_interval_ms;
|
||||
|
||||
if ((freq < (48000000 / 2)) && (freq > (48000000 / 65536))) {
|
||||
divider = 1;
|
||||
prescaler = TC_CLOCK_PRESCALER_DIV1;
|
||||
} else if (freq > (48000000 / 65536 / 2)) {
|
||||
divider = 2;
|
||||
prescaler = TC_CLOCK_PRESCALER_DIV2;
|
||||
} else if (freq > (48000000 / 65536 / 4)) {
|
||||
divider = 4;
|
||||
prescaler = TC_CLOCK_PRESCALER_DIV4;
|
||||
} else if (freq > (48000000 / 65536 / 8)) {
|
||||
divider = 8;
|
||||
prescaler = TC_CLOCK_PRESCALER_DIV8;
|
||||
} else if (freq > (48000000 / 65536 / 16)) {
|
||||
divider = 16;
|
||||
prescaler = TC_CLOCK_PRESCALER_DIV16;
|
||||
} else if (freq > (48000000 / 65536 / 64)) {
|
||||
divider = 64;
|
||||
prescaler = TC_CLOCK_PRESCALER_DIV64;
|
||||
} else if (freq > (48000000 / 65536 / 256)) {
|
||||
divider = 256;
|
||||
prescaler = TC_CLOCK_PRESCALER_DIV256;
|
||||
} else {
|
||||
status = LVGL_ERR_TIMER; // Invalid frequency
|
||||
}
|
||||
|
||||
if (status == LVGL_OK) {
|
||||
compare = (48000000 / divider) / freq;
|
||||
// Initialize timer
|
||||
zerotimer->configure(prescaler, TC_COUNTER_SIZE_16BIT,
|
||||
TC_WAVE_GENERATION_MATCH_PWM);
|
||||
zerotimer->setCompare(0, compare);
|
||||
zerotimer->setCallback(true, TC_CALLBACK_CC_CHANNEL0, timerCallback0);
|
||||
zerotimer->enable(true);
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(ESP32) // ------------------------------------------------
|
||||
|
||||
tick.attach_ms(lv_tick_interval_ms, lv_tick_handler);
|
||||
status = LVGL_OK;
|
||||
|
||||
#elif defined(NRF52_SERIES) // -----------------------------------------
|
||||
|
||||
TIMER_ID->TASKS_STOP = 1; // Stop timer
|
||||
TIMER_ID->MODE = TIMER_MODE_MODE_Timer; // Not counter mode
|
||||
TIMER_ID->TASKS_CLEAR = 1;
|
||||
TIMER_ID->BITMODE = TIMER_BITMODE_BITMODE_16Bit
|
||||
<< TIMER_BITMODE_BITMODE_Pos;
|
||||
TIMER_ID->PRESCALER = 0; // 1:1 prescale (16 MHz)
|
||||
TIMER_ID->INTENSET = TIMER_INTENSET_COMPARE0_Enabled
|
||||
<< TIMER_INTENSET_COMPARE0_Pos; // Event 0 int
|
||||
TIMER_ID->CC[0] = TIMER_FREQ / (lv_tick_interval_ms * 1000);
|
||||
|
||||
NVIC_DisableIRQ(TIMER_IRQN);
|
||||
NVIC_ClearPendingIRQ(TIMER_IRQN);
|
||||
NVIC_SetPriority(TIMER_IRQN, 2); // Lower priority than soft device
|
||||
NVIC_EnableIRQ(TIMER_IRQN);
|
||||
|
||||
TIMER_ID->TASKS_START = 1; // Start timer
|
||||
|
||||
status = LVGL_OK;
|
||||
|
||||
#endif // end timer setup --------------------------------------------------
|
||||
}
|
||||
|
||||
if (status != LVGL_OK) {
|
||||
delete[] lv_pixel_buf;
|
||||
lv_pixel_buf = NULL;
|
||||
#if defined(ARDUINO_ARCH_SAMD)
|
||||
delete zerotimer;
|
||||
zerotimer = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
#ifndef _ADAFRUIT_LVGL_GLUE_H_
|
||||
#define _ADAFRUIT_LVGL_GLUE_H_
|
||||
|
||||
#include <Adafruit_SPITFT.h> // GFX lib for SPI and parallel displays
|
||||
#include <Adafruit_STMPE610.h> // SPI Touchscreen lib
|
||||
#include <TouchScreen.h> // ADC touchscreen lib
|
||||
#include <lvgl.h> // LittlevGL core lib
|
||||
#include <uDisplay_lvgl.h>
|
||||
#if defined(ARDUINO_ARCH_SAMD)
|
||||
#include <Adafruit_ZeroTimer.h> // SAMD-specific timer lib
|
||||
#elif defined(ESP32)
|
||||
#include <Ticker.h> // ESP32-specific timer lib
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
LVGL_OK,
|
||||
LVGL_ERR_ALLOC,
|
||||
LVGL_ERR_TIMER,
|
||||
} LvGLStatus;
|
||||
|
||||
/**
|
||||
* @brief Class to act as a "glue" layer between the LvGL graphics library and
|
||||
* most of Adafruit's TFT displays
|
||||
*
|
||||
*/
|
||||
class Adafruit_LvGL_Glue {
|
||||
public:
|
||||
Adafruit_LvGL_Glue(void);
|
||||
~Adafruit_LvGL_Glue(void);
|
||||
// Different begin() funcs for STMPE610, ADC or no touch
|
||||
LvGLStatus begin(uDisplay_lvgl *tft, Adafruit_STMPE610 *touch,
|
||||
bool debug = false);
|
||||
LvGLStatus begin(uDisplay_lvgl *tft, TouchScreen *touch,
|
||||
bool debug = false);
|
||||
LvGLStatus begin(uDisplay_lvgl *tft, bool debug = false);
|
||||
// These items need to be public for some internal callbacks,
|
||||
// but should be avoided by user code please!
|
||||
uDisplay_lvgl *display; ///< Pointer to the SPITFT display instance
|
||||
void *touchscreen; ///< Pointer to the touchscreen object to use
|
||||
bool is_adc_touch; ///< determines if the touchscreen controlelr is ADC based
|
||||
bool first_frame; ///< Tracks if a call to `lv_flush_callback` needs to wait
|
||||
///< for DMA transfer to complete
|
||||
|
||||
private:
|
||||
LvGLStatus begin(uDisplay_lvgl *tft, void *touch, bool debug);
|
||||
lv_disp_drv_t lv_disp_drv;
|
||||
lv_disp_buf_t lv_disp_buf;
|
||||
lv_color_t *lv_pixel_buf;
|
||||
lv_indev_drv_t lv_indev_drv;
|
||||
lv_indev_t *lv_input_dev_ptr;
|
||||
#if defined(ARDUINO_ARCH_SAMD)
|
||||
Adafruit_ZeroTimer *zerotimer;
|
||||
#elif defined(ESP32)
|
||||
Ticker tick;
|
||||
#elif defined(NRF52_SERIES)
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // _ADAFRUIT_LVGL_GLUE_H_
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,50 @@
|
|||
# Adafruit LvGL Glue [![Build Status](https://github.com/adafruit/Adafruit_LvGL_Glue/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_LvGL_Glue/actions)
|
||||
|
||||
This Arduino library provides a layer between LittlevGL (a UI library for
|
||||
embedded systems) and most of Adafruit's color TFT displays (anything that's
|
||||
a subclass of SPITFT).
|
||||
|
||||
Examples show basic use on PyPortal, FeatherWing, CLUE and TFT Gizmo.
|
||||
Use these as a starting point, see LittlevGL documentation at
|
||||
docs.littlevgl.com for a thorough explanation of capabilities and use.
|
||||
|
||||
# Dependencies
|
||||
* [LittlevGL](https://github.com/littlevgl/lvgl)
|
||||
* [Adafruit GFX Library](https://github.com/adafruit/Adafruit-GFX-Library)
|
||||
* [Adafruit HX8357 Library](https://github.com/adafruit/Adafruit_HX8357_Library)
|
||||
* [Adafruit ILI9341](https://github.com/adafruit/Adafruit_ILI9341)
|
||||
* [Adafruit ST7735 and ST7789 Library](https://github.com/adafruit/Adafruit-ST7735-Library)
|
||||
* [Adafruit STMPE610](https://github.com/adafruit/Adafruit_STMPE610)
|
||||
* [Adafruit TouchScreen](https://github.com/adafruit/Adafruit_TouchScreen)
|
||||
* [Adafruit Zero DMA Library](https://github.com/adafruit/Adafruit_ZeroDMA)
|
||||
* [Adafruit ZeroTimer Library](https://github.com/adafruit/Adafruit_ZeroTimer)
|
||||
|
||||
# Compatibility
|
||||
Version 2.0.0 is a breaking change, mostly due to significant structural
|
||||
changes in the LittlevGL library for Arduino. If you were previously using
|
||||
an earlier version of this library and/or LittlevGL, both will need updating,
|
||||
and you should skim the examples and read through the hello_changes example
|
||||
specifically.
|
||||
|
||||
Use on M0 (SAMD21) boards isn't recommended anymore, as LittlevGL has grown.
|
||||
Simple programs might still work, but it's better to move up to a device
|
||||
with more RAM -- M4 (SAMD51), nRF52 and ESP32 are currently supported.
|
||||
|
||||
# Contributing
|
||||
Contributions are welcome! Please read our [Code of Conduct](https://github.com/adafruit/Adafruit_LvGL_Glue/blob/master/CODE_OF_CONDUCT.md>)
|
||||
before contributing to help this project stay welcoming.
|
||||
|
||||
## Documentation and doxygen
|
||||
Documentation is produced by doxygen. Contributions should include documentation for any new code added.
|
||||
|
||||
Some examples of how to use doxygen can be found in these guide pages:
|
||||
|
||||
https://learn.adafruit.com/the-well-automated-arduino-library/doxygen
|
||||
|
||||
https://learn.adafruit.com/the-well-automated-arduino-library/doxygen-tips
|
||||
|
||||
Written by Phil Burgess aka Paint Your Dragon for Adafruit Industries.
|
||||
BSD license, check license.txt for more information
|
||||
All text above must be included in any redistribution
|
||||
|
||||
To install, use the Arduino Library Manager and search for "Adafruit LvGL Glue Library" and install the library.
|
|
@ -0,0 +1,127 @@
|
|||
# Adafruit Community Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and leaders pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level or type of
|
||||
experience, education, socio-economic status, nationality, personal appearance,
|
||||
race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
We are committed to providing a friendly, safe and welcoming environment for
|
||||
all.
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Be kind and courteous to others
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Collaborating with other community members
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and sexual attention or advances
|
||||
* The use of inappropriate images, including in a community member's avatar
|
||||
* The use of inappropriate language, including in a community member's nickname
|
||||
* Any spamming, flaming, baiting or other attention-stealing behavior
|
||||
* Excessive or unwelcome helping; answering outside the scope of the question
|
||||
asked
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate
|
||||
|
||||
The goal of the standards and moderation guidelines outlined here is to build
|
||||
and maintain a respectful community. We ask that you don’t just aim to be
|
||||
"technically unimpeachable", but rather try to be your best self.
|
||||
|
||||
We value many things beyond technical expertise, including collaboration and
|
||||
supporting others within our community. Providing a positive experience for
|
||||
other community members can have a much more significant impact than simply
|
||||
providing the correct answer.
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project leaders are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project leaders have the right and responsibility to remove, edit, or
|
||||
reject messages, comments, commits, code, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any community member for other behaviors that they deem
|
||||
inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Moderation
|
||||
|
||||
Instances of behaviors that violate the Adafruit Community Code of Conduct
|
||||
may be reported by any member of the community. Community members are
|
||||
encouraged to report these situations, including situations they witness
|
||||
involving other community members.
|
||||
|
||||
You may report in the following ways:
|
||||
|
||||
In any situation, you may send an email to <support@adafruit.com>.
|
||||
|
||||
On the Adafruit Discord, you may send an open message from any channel
|
||||
to all Community Helpers by tagging @community helpers. You may also send an
|
||||
open message from any channel, or a direct message to @kattni#1507,
|
||||
@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or
|
||||
@Andon#8175.
|
||||
|
||||
Email and direct message reports will be kept confidential.
|
||||
|
||||
In situations on Discord where the issue is particularly egregious, possibly
|
||||
illegal, requires immediate action, or violates the Discord terms of service,
|
||||
you should also report the message directly to Discord.
|
||||
|
||||
These are the steps for upholding our community’s standards of conduct.
|
||||
|
||||
1. Any member of the community may report any situation that violates the
|
||||
Adafruit Community Code of Conduct. All reports will be reviewed and
|
||||
investigated.
|
||||
2. If the behavior is an egregious violation, the community member who
|
||||
committed the violation may be banned immediately, without warning.
|
||||
3. Otherwise, moderators will first respond to such behavior with a warning.
|
||||
4. Moderators follow a soft "three strikes" policy - the community member may
|
||||
be given another chance, if they are receptive to the warning and change their
|
||||
behavior.
|
||||
5. If the community member is unreceptive or unreasonable when warned by a
|
||||
moderator, or the warning goes unheeded, they may be banned for a first or
|
||||
second offense. Repeated offenses will result in the community member being
|
||||
banned.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct and the enforcement policies listed above apply to all
|
||||
Adafruit Community venues. This includes but is not limited to any community
|
||||
spaces (both public and private), the entire Adafruit Discord server, and
|
||||
Adafruit GitHub repositories. Examples of Adafruit Community spaces include
|
||||
but are not limited to meet-ups, audio chats on the Adafruit Discord, or
|
||||
interaction at a conference.
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. As a community
|
||||
member, you are representing our community, and are expected to behave
|
||||
accordingly.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 1.4, available at
|
||||
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
|
||||
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
|
||||
|
||||
For other projects adopting the Adafruit Community Code of
|
||||
Conduct, please contact the maintainers of those projects for enforcement.
|
||||
If you wish to use this code of conduct for your own project, consider
|
||||
explicitly mentioning your moderation policy or making a copy with your
|
||||
own moderation policy so as to avoid confusion.
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
THIS EXAMPLE IS REALLY JUST DOCUMENTATION TO GUIDE YOU THROUGH CHANGES IN
|
||||
Adafruit_LvGL_Glue 2.0.
|
||||
|
||||
If you’re coming to Adafruit_LvGL_Glue for the first time as a current user
|
||||
of LittlevGL on other platforms, you're fine, there are no surprises here,
|
||||
have a look at the other examples to see how to set up an Adafruit display
|
||||
for your LittlevGL application.
|
||||
|
||||
BUT...if you've used a prior version of Adafruit_LvGL_Glue, and had written
|
||||
Arduino sketches around it, you're unfortunately in for some extra work.
|
||||
The "glue" hasn't changed at all, but LittlevGL has seen repeated overhauls,
|
||||
and projects using earlier versions of Adafruit_LvGL_Glue will no longer
|
||||
compile in the new system without substantial changes. Many function names,
|
||||
constants, and styles in particular, will require updating. Many LittlevGL
|
||||
projects are too much to fit on M0 (SAMD21) boards now -- it's best to work
|
||||
with a device with more RAM -- M4 (SAMD51), nRF52 and ESP32 are currently
|
||||
supported.
|
||||
|
||||
If desperate to get old code working, you can downgrade to lv_arduino 2.1.5
|
||||
and Adafruit_LvGL_Glue 1.0.2, but this is NOT recommended when developing
|
||||
for the long haul -- lv_arduino is altogether deprecated now and won't be
|
||||
staging a comeback.
|
||||
|
||||
For starters, LittlevGL has moved to an entirely different Arduino library.
|
||||
"lv_arduino" should be UNINSTALLED, and in its place, "lvgl" should be
|
||||
INSTALLED. The latter is at version 7.11.0 as this is being written...if
|
||||
there's a newer release, and if you find our glue examples failing to
|
||||
compile, it's recommended to install that version until this library can be
|
||||
updated. The LittlevGL developers' preference favors structural and
|
||||
consistency upgrades over backwards compatibility -- and that's fine, their
|
||||
project, their rules -- just explaining why this overhaul is necessary.
|
||||
|
||||
To repeat: in the Arduino Library Manager, uninstall lv_arduino, install
|
||||
lvgl.
|
||||
|
||||
Also in the Arduino Library Manager, you'll see a related library called
|
||||
"lv_examples" from the same developer. You can install that if you want, but
|
||||
understand that this is not actually a library, nor will any of the examples
|
||||
there compile in the Arduino IDE! But if you pick through these files
|
||||
manually, there's C code you can dissect for insights in creating interfaces
|
||||
with LittlevGL, and might create mash-ups with Adafruit_LvGL_Glue examples.
|
||||
|
||||
Adafruit_LvGL_Glue includes a lv_conf.file (LittlevGL configuration) that
|
||||
should "just work" and enables some settings for best compatibility with
|
||||
Adafruit displays. The only "gotcha" here is that user sketches MUST
|
||||
#include Adafruit_LvGL_Glue.h BEFORE including lvgl.h, in order for
|
||||
LittlevGL to pick up on the location of this header file.
|
||||
|
||||
BELOW IS A HYPOTHETICAL AND MINIMAL BUT ESSENTIALLY VALID ADAFRUIT_LVGL_GLUE
|
||||
ARDUINO SKETCH. Please see the other examples for more realistic use. Actual
|
||||
projects will have different display interfacing, backlight control, a set
|
||||
of UI widgets and so forth.
|
||||
*/
|
||||
|
||||
#include <Adafruit_LvGL_Glue.h> // Glue library header INCLUDE THIS FIRST!
|
||||
#include <lvgl.h> // LittlevGL header
|
||||
#include <Adafruit_ST7789.h> // Display-specific header
|
||||
|
||||
#define TFT_CS 1 // Display chip-select pin
|
||||
#define TFT_DC 2 // Display data/command pin
|
||||
#define TFT_RST 3 // Display reset pin
|
||||
|
||||
Adafruit_ST7789 tft(TFT_CS, TFT_DC, TFT_RST); // TFT on default SPI port
|
||||
Adafruit_LvGL_Glue glue;
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
||||
tft.init(240, 240); // Initialize display
|
||||
|
||||
// Initialize glue, passing in address of display
|
||||
LvGLStatus status = glue.begin(&tft);
|
||||
if(status != LVGL_OK) {
|
||||
Serial.printf("Glue error %d\r\n", (int)status);
|
||||
for(;;);
|
||||
}
|
||||
|
||||
// Create simple label centered on screen
|
||||
lv_obj_t *label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(label, "Hello Arduino!");
|
||||
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
lv_task_handler(); // Call LittleVGL task handler periodically
|
||||
delay(5);
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
// Minimal "Hello" example for LittlevGL on Adafruit CLUE. Requires
|
||||
// LittlevGL, Adafruit_LvGL_Glue, Adafruit_GFX and Adafruit_ST7735
|
||||
// libraries.
|
||||
|
||||
// Prior Adafruit_LvGL_Glue users: see hello_changes example for updates!
|
||||
|
||||
#include <Adafruit_LvGL_Glue.h> // Always include this BEFORE lvgl.h!
|
||||
#include <lvgl.h>
|
||||
#include <Adafruit_ST7789.h>
|
||||
|
||||
#define TFT_ROTATION 1 // Landscape orientation on CLUE
|
||||
#define TFT_SPI SPI1 // CLUE display peripheral & pins
|
||||
#define TFT_CS 31
|
||||
#define TFT_DC 32
|
||||
#define TFT_RST 33
|
||||
#define TFT_BACKLIGHT 34
|
||||
|
||||
Adafruit_ST7789 tft(&TFT_SPI, TFT_CS, TFT_DC, TFT_RST);
|
||||
Adafruit_LvGL_Glue glue;
|
||||
|
||||
// This example sketch's LittlevGL UI-building calls are all in this
|
||||
// function rather than in setup(), so simple programs can just
|
||||
// copy-and-paste this sketch as a starting point, then embellish here:
|
||||
void lvgl_setup(void) {
|
||||
// Create simple label centered on screen
|
||||
lv_obj_t *label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(label, "Hello Arduino!");
|
||||
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
||||
// Initialize display BEFORE glue setup
|
||||
tft.init(240, 240);
|
||||
tft.setRotation(TFT_ROTATION);
|
||||
pinMode(TFT_BACKLIGHT, OUTPUT);
|
||||
digitalWrite(TFT_BACKLIGHT, HIGH);
|
||||
|
||||
// Initialize glue, passing in address of display
|
||||
LvGLStatus status = glue.begin(&tft);
|
||||
if(status != LVGL_OK) {
|
||||
Serial.printf("Glue error %d\r\n", (int)status);
|
||||
for(;;);
|
||||
}
|
||||
|
||||
lvgl_setup(); // Call UI-building function above
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
lv_task_handler(); // Call LittleVGL task handler periodically
|
||||
delay(5);
|
||||
}
|
||||
|
||||
// NOTE TO FUTURE SELF: this sketch is essentially the same as the Gizmo
|
||||
// widgets example. If updating one sketch, make sure the other is kept
|
||||
// in sync. Aside from screen setup, differences include backlight control
|
||||
// and A/B button setup & read (CPX is active high, CLUE is active low).
|
|
@ -0,0 +1,74 @@
|
|||
// Minimal "Hello" example for LittlevGL on Adafruit TFT FeatherWings.
|
||||
// Requires LittlevGL, Adafruit_LvGL_Glue, Adafruit_STMPE610, Adafruit_GFX
|
||||
// and Adafruit_ILI9341 (2.4" TFT) or Adafruit_HX8357 (3.5") libraries.
|
||||
// This example doesn't use any touchscreen input, but it's declared anyway
|
||||
// so this sketch can be copied-and-pasted to serve as a starting point for
|
||||
// other projects. If display is scrambled, check that correct FeatherWing
|
||||
// type is selected below (set BIG_FEATHERWING to 0 or 1 as needed).
|
||||
|
||||
// Prior Adafruit_LvGL_Glue users: see hello_changes example for updates!
|
||||
|
||||
#define BIG_FEATHERWING 0 // Set this to 1 for 3.5" (480x320) FeatherWing!
|
||||
|
||||
#include <Adafruit_LvGL_Glue.h> // Always include this BEFORE lvgl.h!
|
||||
#include <lvgl.h>
|
||||
#include <Adafruit_STMPE610.h>
|
||||
|
||||
#ifdef ESP32
|
||||
#define TFT_CS 15
|
||||
#define TFT_DC 33
|
||||
#define STMPE_CS 32
|
||||
#else
|
||||
#define TFT_CS 9
|
||||
#define TFT_DC 10
|
||||
#define STMPE_CS 6
|
||||
#endif
|
||||
#define TFT_ROTATION 1 // Landscape orientation on FeatherWing
|
||||
#define TFT_RST -1
|
||||
|
||||
#if BIG_FEATHERWING
|
||||
#include <Adafruit_HX8357.h>
|
||||
Adafruit_HX8357 tft(TFT_CS, TFT_DC, TFT_RST);
|
||||
#else
|
||||
#include <Adafruit_ILI9341.h>
|
||||
Adafruit_ILI9341 tft(TFT_CS, TFT_DC);
|
||||
#endif
|
||||
|
||||
Adafruit_STMPE610 ts(STMPE_CS);
|
||||
Adafruit_LvGL_Glue glue;
|
||||
|
||||
// This example sketch's LittlevGL UI-building calls are all in this
|
||||
// function rather than in setup(), so simple programs can just
|
||||
// copy-and-paste this sketch as a starting point, then embellish here:
|
||||
void lvgl_setup(void) {
|
||||
// Create simple label centered on screen
|
||||
lv_obj_t *label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(label, "Hello Arduino!");
|
||||
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
||||
// Initialize display and touchscreen BEFORE glue setup
|
||||
tft.begin();
|
||||
tft.setRotation(TFT_ROTATION);
|
||||
if(!ts.begin()) {
|
||||
Serial.println("Couldn't start touchscreen controller");
|
||||
for(;;);
|
||||
}
|
||||
|
||||
// Initialize glue, passing in address of display & touchscreen
|
||||
LvGLStatus status = glue.begin(&tft, &ts);
|
||||
if(status != LVGL_OK) {
|
||||
Serial.printf("Glue error %d\r\n", (int)status);
|
||||
for(;;);
|
||||
}
|
||||
|
||||
lvgl_setup(); // Call UI-building function above
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
lv_task_handler(); // Call LittleVGL task handler periodically
|
||||
delay(5);
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
// Minimal "Hello" example for LittlevGL on TFT Gizmo display for Adafruit
|
||||
// Circuit Playground Express or Circuit Playground Bluefruit. Requires
|
||||
// LittlevGL, Adafruit_LvGL_Glue, Adafruit_GFX and Adafruit_ST7735 libraries.
|
||||
|
||||
// Prior Adafruit_LvGL_Glue users: see hello_changes example for updates!
|
||||
|
||||
#include <Adafruit_LvGL_Glue.h> // Always include this BEFORE lvgl.h!
|
||||
#include <lvgl.h>
|
||||
#include <Adafruit_ST7789.h>
|
||||
|
||||
#define TFT_ROTATION 2
|
||||
#define TFT_CS A6
|
||||
#define TFT_DC A7
|
||||
#define TFT_RST -1
|
||||
#define TFT_BACKLIGHT A3
|
||||
#if defined(NRF52_SERIES) // Circuit Playground Bluefruit
|
||||
#define TFT_SPI SPI
|
||||
#else // Circuit Playground Express
|
||||
#define TFT_SPI SPI1
|
||||
#endif
|
||||
|
||||
Adafruit_ST7789 tft(&TFT_SPI, TFT_CS, TFT_DC, TFT_RST);
|
||||
Adafruit_LvGL_Glue glue;
|
||||
|
||||
// This example sketch's LittlevGL UI-building calls are all in this
|
||||
// function rather than in setup(), so simple programs can just
|
||||
// copy-and-paste this sketch as a starting point, then embellish here:
|
||||
void lvgl_setup(void) {
|
||||
// Create simple label centered on screen
|
||||
lv_obj_t *label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(label, "Hello Arduino!");
|
||||
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
||||
// Initialize display BEFORE glue setup
|
||||
tft.init(240, 240);
|
||||
tft.setRotation(TFT_ROTATION);
|
||||
pinMode(TFT_BACKLIGHT, OUTPUT);
|
||||
analogWrite(TFT_BACKLIGHT, 255); // USE analogWrite() FOR GIZMO BACKLIGHT!
|
||||
|
||||
// Initialize glue, passing in address of display
|
||||
LvGLStatus status = glue.begin(&tft);
|
||||
if(status != LVGL_OK) {
|
||||
Serial.printf("Glue error %d\r\n", (int)status);
|
||||
for(;;);
|
||||
}
|
||||
|
||||
lvgl_setup(); // Call UI-building function above
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
lv_task_handler(); // Call LittleVGL task handler periodically
|
||||
delay(5);
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
// Minimal "Hello" example for LittlevGL on Adafruit PyPortal. Requires
|
||||
// LittlevGL, Adafruit_LvGL_Glue, Adafruit Touchscreen, Adafruit_GFX and
|
||||
// Adafruit_ILI9341 (PyPortal, PyPortal Pynt) or Adafruit_HX8357 (PyPortal
|
||||
// Titano) libraries. This example doesn't use any touchscreen input, but
|
||||
// it's declared anyway so this sketch can be copied-and-pasted to serve
|
||||
// as a starting point for other projects. If display is scrambled, check
|
||||
// that the correct board is selected -- PyPortal vs PyPortal Titano.
|
||||
|
||||
// Prior Adafruit_LvGL_Glue users: see hello_changes example for updates!
|
||||
|
||||
#include <Adafruit_LvGL_Glue.h> // Always include this BEFORE lvgl.h!
|
||||
#include <lvgl.h>
|
||||
#include <TouchScreen.h>
|
||||
|
||||
#define TFT_ROTATION 3 // Landscape orientation on PyPortal
|
||||
#define TFT_D0 34 // PyPortal TFT pins
|
||||
#define TFT_WR 26
|
||||
#define TFT_DC 10
|
||||
#define TFT_CS 11
|
||||
#define TFT_RST 24
|
||||
#define TFT_RD 9
|
||||
#define TFT_BACKLIGHT 25
|
||||
#define YP A4 // PyPortal touchscreen pins
|
||||
#define XP A5
|
||||
#define YM A6
|
||||
#define XM A7
|
||||
|
||||
#if defined(ADAFRUIT_PYPORTAL_M4_TITANO)
|
||||
#include <Adafruit_HX8357.h>
|
||||
Adafruit_HX8357 tft(tft8bitbus, TFT_D0, TFT_WR, TFT_DC, TFT_CS, TFT_RST,
|
||||
TFT_RD);
|
||||
#else
|
||||
#include <Adafruit_ILI9341.h>
|
||||
Adafruit_ILI9341 tft(tft8bitbus, TFT_D0, TFT_WR, TFT_DC, TFT_CS, TFT_RST,
|
||||
TFT_RD);
|
||||
#endif
|
||||
TouchScreen ts(XP, YP, XM, YM, 300);
|
||||
Adafruit_LvGL_Glue glue;
|
||||
|
||||
// This example sketch's LittlevGL UI-building calls are all in this
|
||||
// function rather than in setup(), so simple programs can just
|
||||
// copy-and-paste this sketch as a starting point, then embellish here:
|
||||
void lvgl_setup(void) {
|
||||
// Create simple label centered on screen
|
||||
lv_obj_t *label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(label, "Hello Arduino!");
|
||||
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
||||
// Initialize display BEFORE glue setup
|
||||
tft.begin();
|
||||
tft.setRotation(TFT_ROTATION);
|
||||
pinMode(TFT_BACKLIGHT, OUTPUT);
|
||||
digitalWrite(TFT_BACKLIGHT, HIGH);
|
||||
|
||||
// PyPortal touchscreen needs no init
|
||||
|
||||
// Initialize glue, passing in address of display & touchscreen
|
||||
LvGLStatus status = glue.begin(&tft, &ts);
|
||||
if(status != LVGL_OK) {
|
||||
Serial.printf("Glue error %d\r\n", (int)status);
|
||||
for(;;);
|
||||
}
|
||||
|
||||
lvgl_setup(); // Call UI-building function above
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
lv_task_handler(); // Call LittleVGL task handler periodically
|
||||
delay(5);
|
||||
}
|
|
@ -0,0 +1,203 @@
|
|||
// A more functional example for LittlevGL on Adafruit CLUE. Lacking
|
||||
// touchscreen input, interaction options are limited (but not impossible).
|
||||
// In this case we'll pretend like it's a status display for something --
|
||||
// the left and right buttons switch between three different tabs, each
|
||||
// displaying different information. The code's a bit more complex than
|
||||
// the hello_clue example, so best get that working before trying this.
|
||||
|
||||
// Prior Adafruit_LvGL_Glue users: see hello_changes example for updates!
|
||||
|
||||
#include <Adafruit_LvGL_Glue.h> // Always include this BEFORE lvgl.h!
|
||||
#include <lvgl.h>
|
||||
#include <Adafruit_ST7789.h>
|
||||
|
||||
#define TFT_ROTATION 1 // Landscape orientation on CLUE
|
||||
#define TFT_SPI SPI1 // CLUE display peripheral & pins
|
||||
#define TFT_CS 31
|
||||
#define TFT_DC 32
|
||||
#define TFT_RST 33
|
||||
#define TFT_BACKLIGHT 34
|
||||
|
||||
Adafruit_ST7789 tft(&TFT_SPI, TFT_CS, TFT_DC, TFT_RST);
|
||||
Adafruit_LvGL_Glue glue;
|
||||
|
||||
lv_obj_t *tabview, // LittlevGL tabview object
|
||||
*gauge, // Gauge object (on first of three tabs)
|
||||
*chart, // Chart object (second tab)
|
||||
*canvas; // Canvas object (third tab)
|
||||
uint8_t active_tab = 0, // Index of currently-active tab (0-2)
|
||||
prev_tab = 0; // Index of previously-active tab
|
||||
lv_chart_series_t *series; // 'Series' data for the bar chart
|
||||
|
||||
// Canvas object is an image in memory. Although LittlevGL supports several
|
||||
// internal image formats, only the TRUE_COLOR variety allows drawing
|
||||
// operations. Fortunately nRF52840 has gobs of RAM for this. The canvas
|
||||
// buffer is global because it's referenced both in the setup and main loop.
|
||||
#define CANVAS_WIDTH 200 // Dimensions in pixels
|
||||
#define CANVAS_HEIGHT 150
|
||||
lv_color_t canvas_buffer[
|
||||
LV_CANVAS_BUF_SIZE_TRUE_COLOR(CANVAS_WIDTH, CANVAS_HEIGHT)];
|
||||
lv_draw_line_dsc_t draw_dsc; // Drawing style (for canvas) is similarly global
|
||||
|
||||
void lvgl_setup(void) {
|
||||
// Create a tabview object, by default this covers the full display.
|
||||
tabview = lv_tabview_create(lv_disp_get_scr_act(NULL), NULL);
|
||||
// The CLUE display has a lot of pixels and can't refresh very fast.
|
||||
// To show off the tabview animation, let's slow it down to 1 second.
|
||||
lv_tabview_set_anim_time(tabview, 1000);
|
||||
|
||||
// Because they're referenced any time an object is drawn, styles need
|
||||
// to be permanent in scope; either declared globally (outside all
|
||||
// functions), or static. The styles used on tabs are never modified after
|
||||
// they're used here, so let's use static on those...
|
||||
static lv_style_t tab_style, tab_background_style, indicator_style;
|
||||
|
||||
// This is the background style "behind" the tabs. This is what shows
|
||||
// through for "off" (inactive) tabs -- a vertical green gradient,
|
||||
// minimal padding around edges (zero at bottom).
|
||||
lv_style_init(&tab_background_style);
|
||||
lv_style_set_bg_color(&tab_background_style, LV_STATE_DEFAULT, lv_color_hex(0x408040));
|
||||
lv_style_set_bg_grad_color(&tab_background_style, LV_STATE_DEFAULT, lv_color_hex(0x304030));
|
||||
lv_style_set_bg_grad_dir(&tab_background_style, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
|
||||
lv_style_set_pad_top(&tab_background_style, LV_STATE_DEFAULT, 2);
|
||||
lv_style_set_pad_left(&tab_background_style, LV_STATE_DEFAULT, 2);
|
||||
lv_style_set_pad_right(&tab_background_style, LV_STATE_DEFAULT, 2);
|
||||
lv_style_set_pad_bottom(&tab_background_style, LV_STATE_DEFAULT, 0);
|
||||
lv_obj_add_style(tabview, LV_TABVIEW_PART_TAB_BG, &tab_background_style);
|
||||
|
||||
// Style for tabs. Active tab is white with opaque background, inactive
|
||||
// tabs are transparent so the background shows through (only the white
|
||||
// text is seen). A little top & bottom padding reduces scrunchyness.
|
||||
lv_style_init(&tab_style);
|
||||
lv_style_set_pad_top(&tab_style, LV_STATE_DEFAULT, 3);
|
||||
lv_style_set_pad_bottom(&tab_style, LV_STATE_DEFAULT, 10);
|
||||
lv_style_set_bg_color(&tab_style, LV_STATE_CHECKED, LV_COLOR_WHITE);
|
||||
lv_style_set_bg_opa(&tab_style, LV_STATE_CHECKED, LV_OPA_100);
|
||||
lv_style_set_text_color(&tab_style, LV_STATE_CHECKED, LV_COLOR_GRAY);
|
||||
lv_style_set_bg_opa(&tab_style, LV_STATE_DEFAULT, LV_OPA_TRANSP);
|
||||
lv_style_set_text_color(&tab_style, LV_STATE_DEFAULT, LV_COLOR_WHITE);
|
||||
lv_obj_add_style(tabview, LV_TABVIEW_PART_TAB_BTN, &tab_style);
|
||||
|
||||
// Style for the small indicator bar that appears below the active tab.
|
||||
lv_style_init(&indicator_style);
|
||||
lv_style_set_bg_color(&indicator_style, LV_STATE_DEFAULT, LV_COLOR_RED);
|
||||
lv_style_set_size(&indicator_style, LV_STATE_DEFAULT, 5);
|
||||
lv_obj_add_style(tabview, LV_TABVIEW_PART_INDIC, &indicator_style);
|
||||
|
||||
// Back to creating widgets...
|
||||
|
||||
// Add three tabs to the tabview
|
||||
lv_obj_t *tab1 = lv_tabview_add_tab(tabview, "Gauge");
|
||||
lv_obj_t *tab2 = lv_tabview_add_tab(tabview, "Chart");
|
||||
lv_obj_t *tab3 = lv_tabview_add_tab(tabview, "Canvas");
|
||||
|
||||
// And then add stuff in each tab...
|
||||
|
||||
// The first tab holds a gauge. To keep the demo simple, let's just use
|
||||
// the default style and range (0-100). See LittlevGL docs for options.
|
||||
gauge = lv_gauge_create(tab1, NULL);
|
||||
lv_obj_set_size(gauge, 186, 186);
|
||||
lv_obj_align(gauge, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
// Second tab, make a chart...
|
||||
chart = lv_chart_create(tab2, NULL);
|
||||
lv_obj_set_size(chart, 200, 180);
|
||||
lv_obj_align(chart, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_chart_set_type(chart, LV_CHART_TYPE_COLUMN);
|
||||
// For simplicity, we'll stick with the chart's default 10 data points:
|
||||
series = lv_chart_add_series(chart, LV_COLOR_RED);
|
||||
lv_chart_init_points(chart, series, 0);
|
||||
// Make each column shift left as new values enter on right:
|
||||
lv_chart_set_update_mode(chart, LV_CHART_UPDATE_MODE_SHIFT);
|
||||
|
||||
// Third tab is a canvas, which we'll fill with random colored lines.
|
||||
// LittlevGL draw functions only work on TRUE_COLOR canvas.
|
||||
canvas = lv_canvas_create(tab3, NULL);
|
||||
lv_canvas_set_buffer(canvas, canvas_buffer,
|
||||
CANVAS_WIDTH, CANVAS_HEIGHT, LV_IMG_CF_TRUE_COLOR);
|
||||
lv_obj_align(canvas, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_canvas_fill_bg(canvas, LV_COLOR_WHITE, LV_OPA_100);
|
||||
|
||||
// Set up canvas line-drawing style based on defaults.
|
||||
// Later we'll change color settings when drawing each line.
|
||||
lv_draw_line_dsc_init(&draw_dsc);
|
||||
}
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
||||
// Initialize display BEFORE glue setup
|
||||
tft.init(240, 240);
|
||||
tft.setRotation(TFT_ROTATION);
|
||||
pinMode(TFT_BACKLIGHT, OUTPUT);
|
||||
digitalWrite(TFT_BACKLIGHT, HIGH);
|
||||
|
||||
// Initialize glue, passing in address of display
|
||||
LvGLStatus status = glue.begin(&tft);
|
||||
if(status != LVGL_OK) {
|
||||
Serial.printf("Glue error %d\r\n", (int)status);
|
||||
for(;;);
|
||||
}
|
||||
|
||||
lvgl_setup(); // Call UI-building function above
|
||||
|
||||
// Enable "A" and "B" buttons as inputs
|
||||
pinMode(PIN_BUTTON1, INPUT_PULLUP);
|
||||
pinMode(PIN_BUTTON2, INPUT_PULLUP);
|
||||
}
|
||||
|
||||
uint32_t prev_time = -1;
|
||||
|
||||
void loop(void) {
|
||||
|
||||
// Read left/right button inputs. Debouncing could be done better,
|
||||
// but this'll do for a quick simple demo...
|
||||
if(digitalRead(PIN_BUTTON1) == LOW) {
|
||||
if(active_tab > 0) {
|
||||
active_tab--;
|
||||
}
|
||||
while(digitalRead(PIN_BUTTON1) == LOW); // Wait for button release
|
||||
} else if(digitalRead(PIN_BUTTON2) == LOW) {
|
||||
if(active_tab < 2) {
|
||||
active_tab++;
|
||||
}
|
||||
while(digitalRead(PIN_BUTTON2) == LOW); // Wait for button release
|
||||
}
|
||||
|
||||
// Change active tab if button pressings happened
|
||||
if(active_tab != prev_tab) {
|
||||
lv_tabview_set_tab_act(tabview, active_tab, true);
|
||||
prev_tab = active_tab;
|
||||
}
|
||||
|
||||
// Make the gauge sweep a full sine wave over time
|
||||
lv_gauge_set_value(gauge, 0, (int)(50.5 + sin(millis() / 1000.0) * 50.0));
|
||||
|
||||
// About 2X a second, things happen on the other two tabs...
|
||||
uint32_t new_time = millis() / 500; // Current half-second
|
||||
if(new_time != prev_time) { // freshly elapsed
|
||||
prev_time = new_time;
|
||||
|
||||
// Add a new random item to the bar chart (old value shift left)
|
||||
lv_chart_set_next(chart, series, random(100));
|
||||
lv_chart_refresh(chart);
|
||||
|
||||
// Add a random line to the canvas
|
||||
lv_point_t points[2];
|
||||
points[0].x = random(CANVAS_WIDTH);
|
||||
points[0].y = random(CANVAS_HEIGHT);
|
||||
points[1].x = random(CANVAS_WIDTH);
|
||||
points[1].y = random(CANVAS_HEIGHT);
|
||||
draw_dsc.color.ch.red = random();
|
||||
draw_dsc.color.ch.green = random();
|
||||
draw_dsc.color.ch.blue = random();
|
||||
lv_canvas_draw_line(canvas, points, 2, &draw_dsc);
|
||||
// This forces the canvas to update (otherwise changes aren't
|
||||
// seen unless leaving and returning to the canvas tab):
|
||||
lv_canvas_set_buffer(canvas, canvas_buffer,
|
||||
CANVAS_WIDTH, CANVAS_HEIGHT, LV_IMG_CF_TRUE_COLOR);
|
||||
}
|
||||
|
||||
lv_task_handler(); // Call LittleVGL task handler periodically
|
||||
delay(5);
|
||||
}
|
|
@ -0,0 +1,261 @@
|
|||
// A more interesting example for LittlevGL on Adafruit TFT FeatherWings,
|
||||
// showing use of the touchscreen. Code's a little more complex than the
|
||||
// hello_featherwing example, so best get that working before trying this.
|
||||
// By default, as written, on a 320x240 TFT FeatherWing the example is a
|
||||
// pretend calculator keypad, while 480x320 TFT has a whole keyboard
|
||||
// (though you'll probably need a stylus). These just seemed the right
|
||||
// level of detail for their respective screens, but feel free to override
|
||||
// and try either for yourself. If display is scrambled, check that
|
||||
// correct FeatherWing type is selected below (set BIG_FEATHERWING to 0
|
||||
// or 1 as needed).
|
||||
|
||||
// Prior Adafruit_LvGL_Glue users: see hello_changes example for updates!
|
||||
|
||||
// Feather M0 is no longer recommended for LittlevGL use. The calculator
|
||||
// almost works (hangs after a few button presses) and keyboard won't run
|
||||
// at all. A Feather M4 or other >32K RAM device is recommended.
|
||||
|
||||
#define BIG_FEATHERWING 0 // Set this to 1 for 3.5" (480x320) FeatherWing!
|
||||
|
||||
#include <Adafruit_LvGL_Glue.h> // Always include this BEFORE lvgl.h!
|
||||
#include <lvgl.h>
|
||||
#include <Adafruit_STMPE610.h>
|
||||
|
||||
#define DEMO_CALC 0
|
||||
#define DEMO_TEXT 1
|
||||
|
||||
#ifdef ESP32
|
||||
#define TFT_CS 15
|
||||
#define TFT_DC 33
|
||||
#define STMPE_CS 32
|
||||
#else
|
||||
#define TFT_CS 9
|
||||
#define TFT_DC 10
|
||||
#define STMPE_CS 6
|
||||
#endif
|
||||
#define TFT_RST -1
|
||||
|
||||
#if BIG_FEATHERWING
|
||||
#include <Adafruit_HX8357.h>
|
||||
Adafruit_HX8357 tft(TFT_CS, TFT_DC, TFT_RST);
|
||||
#define DEMO DEMO_TEXT // On big TFT, do text/keyboard example
|
||||
#else
|
||||
#include <Adafruit_ILI9341.h>
|
||||
Adafruit_ILI9341 tft(TFT_CS, TFT_DC);
|
||||
#define DEMO DEMO_CALC // Smaller TFT, do keypad example
|
||||
#endif
|
||||
|
||||
Adafruit_STMPE610 ts(STMPE_CS);
|
||||
Adafruit_LvGL_Glue glue;
|
||||
|
||||
#if DEMO == DEMO_CALC
|
||||
|
||||
// "Pretend" calculator example. Please, PLEASE...do NOT implement the whole
|
||||
// calculator and submit as a pull request, because it will NOT be merged!
|
||||
// This sketch is meant only to be illustrative and not functional, just
|
||||
// showing LittlevGL + Adafruit display/touch tied together with a modest
|
||||
// amount of code. Even a simple but working calc would require WAY more
|
||||
// code, distracting from that core idea (and is a waste of hardware).
|
||||
// Daiso has better calculators for $1.50.
|
||||
|
||||
#define TFT_ROTATION 0 // Portrait orientation
|
||||
|
||||
lv_obj_t *digits_label = NULL; // LittlevGL label object showing digits
|
||||
String digits = "0"; // Current digits string value
|
||||
bool hasDecimal = false; // Only allow one decimal point
|
||||
const char *buttons[] = { // Button matrix labels
|
||||
"7", "8", "9", "/", "\n",
|
||||
"4", "5", "6", "x", "\n",
|
||||
"1", "2", "3", "-", "\n",
|
||||
"0", ".", "=", "+", "" };
|
||||
|
||||
// This function processes events from the button matrix
|
||||
void button_event_handler(lv_obj_t *obj, lv_event_t event) {
|
||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||
const char *txt = lv_btnmatrix_get_active_btn_text(obj);
|
||||
if(txt) { // NULL if pressed in frame area outside buttons
|
||||
if(txt[0] == '.') {
|
||||
// Decimal button pressed. Add decimal point to "digits" string
|
||||
// if it's not too long and there's no decimal present yet...
|
||||
if((digits.length() < 15) && !hasDecimal) {
|
||||
digits += '.';
|
||||
hasDecimal = true;
|
||||
}
|
||||
} else if((txt[0] >= '0') && (txt[0] <= '9')) {
|
||||
// Number button (0-9) pressed. If there's nothing currently
|
||||
// being displayed, take the digit literally. Otherwise, append
|
||||
// the new digit if the "digits" string is not too long.
|
||||
if(digits.equals("0")) {
|
||||
digits = txt[0];
|
||||
} else if(digits.length() < 15) {
|
||||
digits += txt[0];
|
||||
}
|
||||
} else {
|
||||
// Any other button, just reset the calculator display.
|
||||
// It's all just pretend.
|
||||
digits = "0";
|
||||
hasDecimal = false;
|
||||
}
|
||||
if(digits_label != NULL) {
|
||||
lv_label_set_text(digits_label, digits.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void lvgl_setup(void) {
|
||||
|
||||
// Just using the default styles for everything here, keeping
|
||||
// it basic. See the official LittlevGL docs and examples for
|
||||
// insights on applying styles.
|
||||
|
||||
// The calculator digits are held inside a LvGL container object
|
||||
// as this gives us a little more control over positioning.
|
||||
lv_obj_t *container = lv_cont_create(lv_scr_act(), NULL);
|
||||
lv_cont_set_fit(container, LV_FIT_NONE); // Don't auto fit
|
||||
lv_obj_set_size(container, tft.width(), 50); // Full width x 50 px
|
||||
|
||||
// Calculator digits are just a text label inside the container,
|
||||
// refreshed whenever the global "digits" string changes.
|
||||
digits_label = lv_label_create(container, NULL);
|
||||
lv_label_set_text(digits_label, digits.c_str());
|
||||
lv_obj_align(digits_label, NULL, LV_ALIGN_IN_TOP_LEFT, 20, 10);
|
||||
lv_label_set_long_mode(digits_label, LV_LABEL_LONG_CROP);
|
||||
lv_obj_set_size(digits_label, tft.width() - 40, 30);
|
||||
lv_label_set_align(digits_label, LV_LABEL_ALIGN_RIGHT);
|
||||
|
||||
// Fill the remaining space with the button matrix.
|
||||
lv_obj_t *button_matrix = lv_btnmatrix_create(lv_scr_act(), NULL);
|
||||
lv_btnmatrix_set_map(button_matrix, buttons);
|
||||
lv_obj_align(button_matrix, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 50);
|
||||
lv_obj_set_size(button_matrix, tft.width(), tft.height() - 50);
|
||||
lv_obj_set_event_cb(button_matrix, button_event_handler);
|
||||
}
|
||||
|
||||
#else // Keyboard demo
|
||||
|
||||
// Keyboard example, lets you enter and edit text in a field. Even on a
|
||||
// 480x320 TFT it requires a stylus to be even half useful (fingertip
|
||||
// is possible if very patient), but having the option of a keyboard at
|
||||
// all on this device is pretty nifty!
|
||||
|
||||
#define TFT_ROTATION 1 // Landscape orientation
|
||||
|
||||
lv_obj_t *textarea,
|
||||
*keyboard = NULL; // Created/deleted as needed
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
// Called after keyboard slides closed - deletes keyboard object
|
||||
void delete_keyboard(lv_anim_t * a) {
|
||||
lv_obj_del((lv_obj_t *)a->var);
|
||||
keyboard = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Called when the close or ok button is pressed on the keyboard
|
||||
void keyboard_event_handler(lv_obj_t *obj, lv_event_t event) {
|
||||
lv_keyboard_def_event_cb(keyboard, event);
|
||||
|
||||
if(event == LV_EVENT_APPLY || event == LV_EVENT_CANCEL) {
|
||||
#if LV_USE_ANIMATION
|
||||
// If animation is enabled, make keyboard slide away
|
||||
lv_anim_path_t path;
|
||||
lv_anim_path_init(&path);
|
||||
lv_anim_path_set_cb(&path, lv_anim_path_ease_in_out);
|
||||
lv_anim_t a;
|
||||
lv_anim_init(&a);
|
||||
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_obj_set_y);
|
||||
lv_anim_set_var(&a, keyboard);
|
||||
lv_anim_set_time(&a, 300);
|
||||
lv_anim_set_values(&a, lv_obj_get_y(keyboard), LV_VER_RES); // start, end
|
||||
lv_anim_set_path(&a, &path);
|
||||
lv_anim_set_ready_cb(&a, delete_keyboard);
|
||||
lv_anim_start(&a);
|
||||
#else
|
||||
lv_obj_del(keyboard);
|
||||
keyboard = NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// Other clicks in the text area
|
||||
void text_area_event_handler(lv_obj_t *obj, lv_event_t event) {
|
||||
if(event == LV_EVENT_CLICKED) {
|
||||
|
||||
// Unsure why, but text area has an initial clicked event on
|
||||
// creation, causing the keyboard to appear. This is a hacky
|
||||
// workaround that just ignores the first click event, so
|
||||
// subsequent actual clicks bring up the keyboard.
|
||||
static bool first = true;
|
||||
if(first) {
|
||||
first = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if(keyboard == NULL) {
|
||||
// If not present, create keyboard object at bottom of screen
|
||||
keyboard = lv_keyboard_create(lv_scr_act(), NULL);
|
||||
lv_obj_set_size(keyboard, tft.width(), tft.height() * 7 / 16);
|
||||
lv_obj_align(keyboard, textarea, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
|
||||
lv_keyboard_set_textarea(keyboard, textarea);
|
||||
lv_keyboard_set_cursor_manage(keyboard, true);
|
||||
lv_obj_set_event_cb(keyboard, keyboard_event_handler);
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
// If animation is enabled, make keyboard slide into place
|
||||
lv_anim_path_t path;
|
||||
lv_anim_path_init(&path);
|
||||
lv_anim_path_set_cb(&path, lv_anim_path_ease_in_out);
|
||||
lv_anim_t a;
|
||||
lv_anim_init(&a);
|
||||
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_obj_set_y);
|
||||
lv_anim_set_var(&a, keyboard);
|
||||
lv_anim_set_time(&a, 300);
|
||||
lv_anim_set_values(&a, LV_VER_RES, lv_obj_get_y(keyboard)); // start, end
|
||||
lv_anim_set_path(&a, &path);
|
||||
lv_anim_start(&a);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void lvgl_setup(void) {
|
||||
textarea = lv_textarea_create(lv_scr_act(), NULL);
|
||||
lv_obj_set_size(textarea, LV_HOR_RES, LV_VER_RES); // Whole screen
|
||||
lv_obj_align(textarea, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_textarea_set_text(textarea, "This text is editable.");
|
||||
lv_obj_set_event_cb(textarea, text_area_event_handler);
|
||||
lv_textarea_set_cursor_pos(textarea, LV_TEXTAREA_CURSOR_LAST);
|
||||
}
|
||||
|
||||
#endif // end calculator / keyboard examples
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
||||
// Initialize display and touchscreen BEFORE glue setup
|
||||
tft.begin();
|
||||
tft.setRotation(TFT_ROTATION);
|
||||
if(!ts.begin()) {
|
||||
Serial.println("Couldn't start touchscreen controller");
|
||||
for(;;);
|
||||
}
|
||||
|
||||
// Initialize glue, passing in address of display & touchscreen
|
||||
LvGLStatus status = glue.begin(&tft, &ts);
|
||||
if(status != LVGL_OK) {
|
||||
Serial.printf("Glue error %d\r\n", (int)status);
|
||||
for(;;);
|
||||
}
|
||||
|
||||
lvgl_setup(); // Call UI-building function above
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
lv_task_handler(); // Call LittleVGL task handler periodically
|
||||
delay(5);
|
||||
}
|
||||
|
||||
// NOTE TO FUTURE SELF: this sketch is largely similar to the PyPortal
|
||||
// widgets example. If updating/bugfixing one sketch, make sure the other
|
||||
// is kept in sync.
|
|
@ -0,0 +1,225 @@
|
|||
// A more functional example for LittlevGL on Adafruit Circuit Playground
|
||||
// Bluefruit (NOT Express!) with TFT Gizmo display. Lacking touchscreen
|
||||
// input, interaction options are limited (but not impossible). In this
|
||||
// case we'll pretend like it's a status display for something -- the left
|
||||
// and right buttons (on the back if looking at the screen) switch between
|
||||
// three different tabs, each displaying different information. The code's
|
||||
// a bit more complex than the hello_gizmo example, so best get that
|
||||
// working before trying this. This example is a bit too much for the
|
||||
// Circuit Playground Express to handle now, but simpler LittlevGL
|
||||
// programs should be possible.
|
||||
|
||||
// Prior Adafruit_LvGL_Glue users: see hello_changes example for updates!
|
||||
|
||||
#if !defined(NRF52_SERIES) // Circuit Playground Bluefruit
|
||||
#error "This example is for Circuit Playground Bluefruit only."
|
||||
#endif
|
||||
|
||||
#include <Adafruit_LvGL_Glue.h> // Always include this BEFORE lvgl.h!
|
||||
#include <lvgl.h>
|
||||
#include <Adafruit_ST7789.h>
|
||||
|
||||
#define TFT_ROTATION 2
|
||||
#define TFT_CS A6
|
||||
#define TFT_DC A7
|
||||
#define TFT_RST -1
|
||||
#define TFT_BACKLIGHT A3
|
||||
#if defined(NRF52_SERIES) // Circuit Playground Bluefruit
|
||||
#define TFT_SPI SPI
|
||||
#else // Circuit Playground Express
|
||||
#define TFT_SPI SPI1
|
||||
// Though this example won't work on CP Express, including this
|
||||
// here anyway for reference, if copying over to a simpler sketch.
|
||||
#endif
|
||||
|
||||
Adafruit_ST7789 tft(&TFT_SPI, TFT_CS, TFT_DC, TFT_RST);
|
||||
Adafruit_LvGL_Glue glue;
|
||||
|
||||
lv_obj_t *tabview, // LittlevGL tabview object
|
||||
*gauge, // Gauge object (on first of three tabs)
|
||||
*chart, // Chart object (second tab)
|
||||
*canvas; // Canvas object (third tab)
|
||||
uint8_t active_tab = 0, // Index of currently-active tab (0-2)
|
||||
prev_tab = 0; // Index of previously-active tab
|
||||
lv_chart_series_t *series; // 'Series' data for the bar chart
|
||||
|
||||
// Canvas object is an image in memory. Although LittlevGL supports several
|
||||
// internal image formats, only the TRUE_COLOR variety allows drawing
|
||||
// operations. Fortunately nRF52840 has gobs of RAM for this. The canvas
|
||||
// buffer is global because it's referenced both in the setup and main loop.
|
||||
// Circuit Playground Express (M0) doesn't have enough RAM for this.
|
||||
#define CANVAS_WIDTH 200 // Dimensions in pixels
|
||||
#define CANVAS_HEIGHT 150
|
||||
lv_color_t canvas_buffer[
|
||||
LV_CANVAS_BUF_SIZE_TRUE_COLOR(CANVAS_WIDTH, CANVAS_HEIGHT)];
|
||||
lv_draw_line_dsc_t draw_dsc; // Drawing style (for canvas) is similarly global
|
||||
|
||||
void lvgl_setup(void) {
|
||||
// Create a tabview object, by default this covers the full display.
|
||||
tabview = lv_tabview_create(lv_disp_get_scr_act(NULL), NULL);
|
||||
// The Gizmo display has a lot of pixels and can't refresh very fast.
|
||||
// To show off the tabview animation, let's slow it down to 1 second.
|
||||
lv_tabview_set_anim_time(tabview, 1000);
|
||||
|
||||
// Because they're referenced any time an object is drawn, styles need
|
||||
// to be permanent in scope; either declared globally (outside all
|
||||
// functions), or static. The styles used on tabs are never modified after
|
||||
// they're used here, so let's use static on those...
|
||||
static lv_style_t tab_style, tab_background_style, indicator_style;
|
||||
|
||||
// This is the background style "behind" the tabs. This is what shows
|
||||
// through for "off" (inactive) tabs -- a vertical green gradient,
|
||||
// minimal padding around edges (zero at bottom).
|
||||
lv_style_init(&tab_background_style);
|
||||
lv_style_set_bg_color(&tab_background_style, LV_STATE_DEFAULT, lv_color_hex(0x408040));
|
||||
lv_style_set_bg_grad_color(&tab_background_style, LV_STATE_DEFAULT, lv_color_hex(0x304030));
|
||||
lv_style_set_bg_grad_dir(&tab_background_style, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
|
||||
lv_style_set_pad_top(&tab_background_style, LV_STATE_DEFAULT, 2);
|
||||
lv_style_set_pad_left(&tab_background_style, LV_STATE_DEFAULT, 2);
|
||||
lv_style_set_pad_right(&tab_background_style, LV_STATE_DEFAULT, 2);
|
||||
lv_style_set_pad_bottom(&tab_background_style, LV_STATE_DEFAULT, 0);
|
||||
lv_obj_add_style(tabview, LV_TABVIEW_PART_TAB_BG, &tab_background_style);
|
||||
|
||||
// Style for tabs. Active tab is white with opaque background, inactive
|
||||
// tabs are transparent so the background shows through (only the white
|
||||
// text is seen). A little top & bottom padding reduces scrunchyness.
|
||||
lv_style_init(&tab_style);
|
||||
lv_style_set_pad_top(&tab_style, LV_STATE_DEFAULT, 3);
|
||||
lv_style_set_pad_bottom(&tab_style, LV_STATE_DEFAULT, 10);
|
||||
lv_style_set_bg_color(&tab_style, LV_STATE_CHECKED, LV_COLOR_WHITE);
|
||||
lv_style_set_bg_opa(&tab_style, LV_STATE_CHECKED, LV_OPA_100);
|
||||
lv_style_set_text_color(&tab_style, LV_STATE_CHECKED, LV_COLOR_GRAY);
|
||||
lv_style_set_bg_opa(&tab_style, LV_STATE_DEFAULT, LV_OPA_TRANSP);
|
||||
lv_style_set_text_color(&tab_style, LV_STATE_DEFAULT, LV_COLOR_WHITE);
|
||||
lv_obj_add_style(tabview, LV_TABVIEW_PART_TAB_BTN, &tab_style);
|
||||
|
||||
// Style for the small indicator bar that appears below the active tab.
|
||||
lv_style_init(&indicator_style);
|
||||
lv_style_set_bg_color(&indicator_style, LV_STATE_DEFAULT, LV_COLOR_RED);
|
||||
lv_style_set_size(&indicator_style, LV_STATE_DEFAULT, 5);
|
||||
lv_obj_add_style(tabview, LV_TABVIEW_PART_INDIC, &indicator_style);
|
||||
|
||||
// Back to creating widgets...
|
||||
|
||||
// Add three tabs to the tabview
|
||||
lv_obj_t *tab1 = lv_tabview_add_tab(tabview, "Gauge");
|
||||
lv_obj_t *tab2 = lv_tabview_add_tab(tabview, "Chart");
|
||||
lv_obj_t *tab3 = lv_tabview_add_tab(tabview, "Canvas");
|
||||
|
||||
// And then add stuff in each tab...
|
||||
|
||||
// The first tab holds a gauge. To keep the demo simple, let's just use
|
||||
// the default style and range (0-100). See LittlevGL docs for options.
|
||||
gauge = lv_gauge_create(tab1, NULL);
|
||||
lv_obj_set_size(gauge, 186, 186);
|
||||
lv_obj_align(gauge, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
// Second tab, make a chart...
|
||||
chart = lv_chart_create(tab2, NULL);
|
||||
lv_obj_set_size(chart, 200, 180);
|
||||
lv_obj_align(chart, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_chart_set_type(chart, LV_CHART_TYPE_COLUMN);
|
||||
// For simplicity, we'll stick with the chart's default 10 data points:
|
||||
series = lv_chart_add_series(chart, LV_COLOR_RED);
|
||||
lv_chart_init_points(chart, series, 0);
|
||||
// Make each column shift left as new values enter on right:
|
||||
lv_chart_set_update_mode(chart, LV_CHART_UPDATE_MODE_SHIFT);
|
||||
|
||||
// Third tab is a canvas, which we'll fill with random colored lines.
|
||||
// LittlevGL draw functions only work on TRUE_COLOR canvas.
|
||||
canvas = lv_canvas_create(tab3, NULL);
|
||||
lv_canvas_set_buffer(canvas, canvas_buffer,
|
||||
CANVAS_WIDTH, CANVAS_HEIGHT, LV_IMG_CF_TRUE_COLOR);
|
||||
lv_obj_align(canvas, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_canvas_fill_bg(canvas, LV_COLOR_WHITE, LV_OPA_100);
|
||||
|
||||
// Set up canvas line-drawing style based on defaults.
|
||||
// Later we'll change color settings when drawing each line.
|
||||
lv_draw_line_dsc_init(&draw_dsc);
|
||||
}
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
||||
// Initialize display BEFORE glue setup
|
||||
tft.init(240, 240);
|
||||
tft.setRotation(TFT_ROTATION);
|
||||
analogWrite(TFT_BACKLIGHT, 255); // USE analogWrite() FOR GIZMO BACKLIGHT!
|
||||
|
||||
// Initialize glue, passing in address of display
|
||||
LvGLStatus status = glue.begin(&tft);
|
||||
if(status != LVGL_OK) {
|
||||
Serial.printf("Glue error %d\r\n", (int)status);
|
||||
for(;;);
|
||||
}
|
||||
|
||||
lvgl_setup(); // Call UI-building function above
|
||||
|
||||
// Enable "A" and "B" buttons as inputs
|
||||
pinMode(4, INPUT_PULLDOWN); // Left (A) button
|
||||
pinMode(5, INPUT_PULLDOWN); // Right (B) button
|
||||
}
|
||||
|
||||
uint32_t prev_time = -1;
|
||||
|
||||
void loop(void) {
|
||||
|
||||
// Read left/right button inputs. Debouncing could be done better,
|
||||
// but this'll do for a quick simple demo. The arrangements of the
|
||||
// buttons is intentionally flipped here (pin 5, the "right" button,
|
||||
// moves one tab left, pin 4 the opposite) so the button placements
|
||||
// make sense while looking at the screen on the reverse side.
|
||||
if(digitalRead(5) == HIGH) {
|
||||
if(active_tab > 0) {
|
||||
active_tab--;
|
||||
}
|
||||
while(digitalRead(5) == HIGH); // Wait for button release
|
||||
} else if(digitalRead(4) == HIGH) {
|
||||
if(active_tab < 2) {
|
||||
active_tab++;
|
||||
}
|
||||
while(digitalRead(4) == HIGH); // Wait for button release
|
||||
}
|
||||
|
||||
// Change active tab if button pressings happened
|
||||
if(active_tab != prev_tab) {
|
||||
lv_tabview_set_tab_act(tabview, active_tab, true);
|
||||
prev_tab = active_tab;
|
||||
}
|
||||
|
||||
// Make the gauge sweep a full sine wave over timeCLUE
|
||||
lv_gauge_set_value(gauge, 0, (int)(50.5 + sin(millis() / 1000.0) * 50.0));
|
||||
|
||||
// About 2X a second, things happen on the other two tabs...
|
||||
uint32_t new_time = millis() / 500; // Current half-second
|
||||
if(new_time != prev_time) { // freshly elapsed
|
||||
prev_time = new_time;
|
||||
|
||||
// Add a new random item to the bar chart (old value shift left)
|
||||
lv_chart_set_next(chart, series, random(100));
|
||||
lv_chart_refresh(chart);
|
||||
|
||||
// Add a random line to the canvas
|
||||
lv_point_t points[2];
|
||||
points[0].x = random(CANVAS_WIDTH);
|
||||
points[0].y = random(CANVAS_HEIGHT);
|
||||
points[1].x = random(CANVAS_WIDTH);
|
||||
points[1].y = random(CANVAS_HEIGHT);
|
||||
draw_dsc.color.ch.red = random();
|
||||
draw_dsc.color.ch.green = random();
|
||||
draw_dsc.color.ch.blue = random();
|
||||
lv_canvas_draw_line(canvas, points, 2, &draw_dsc);
|
||||
// This forces the canvas to update (otherwise changes aren't
|
||||
// seen unless leaving and returning to the canvas tab):
|
||||
lv_canvas_set_buffer(canvas, canvas_buffer,
|
||||
CANVAS_WIDTH, CANVAS_HEIGHT, LV_IMG_CF_TRUE_COLOR);
|
||||
}
|
||||
|
||||
lv_task_handler(); // Call LittleVGL task handler periodically
|
||||
delay(5);
|
||||
}
|
||||
|
||||
// NOTE TO FUTURE SELF: this sketch is essentially the same as the CLUE
|
||||
// widgets example. If updating one sketch, make sure the other is kept
|
||||
// in sync. Aside from screen setup, differences include backlight control
|
||||
// and A/B button setup & read (CPX is active high, CLUE is active low).
|
|
@ -0,0 +1,255 @@
|
|||
// A more interesting example for LittlevGL on Adafruit PyPortal, showing
|
||||
// use of the touchscreen. Code's a little more complex than the
|
||||
// hello_pyportal example, so best get that working before trying this.
|
||||
// By default, as written, on regular (320x240) PyPortal the example is a
|
||||
// pretend calculator keypad, while PyPortal Titano (480x320) has a whole
|
||||
// keyboard (though you'll probably need a stylus). These just seemed the
|
||||
// right level of detail for their respective screens, but feel free to
|
||||
// override and try either for yourself.
|
||||
|
||||
// Prior Adafruit_LvGL_Glue users: see hello_changes example for updates!
|
||||
|
||||
#include <Adafruit_LvGL_Glue.h> // Always include this BEFORE lvgl.h!
|
||||
#include <lvgl.h>
|
||||
#include <TouchScreen.h>
|
||||
|
||||
#define DEMO_CALC 0
|
||||
#define DEMO_TEXT 1
|
||||
|
||||
#define TFT_D0 34 // PyPortal TFT pins
|
||||
#define TFT_WR 26
|
||||
#define TFT_DC 10
|
||||
#define TFT_CS 11
|
||||
#define TFT_RST 24
|
||||
#define TFT_RD 9
|
||||
#define TFT_BACKLIGHT 25
|
||||
#define YP A4 // PyPortal touchscreen pins
|
||||
#define XP A5
|
||||
#define YM A6
|
||||
#define XM A7
|
||||
|
||||
#if defined(ADAFRUIT_PYPORTAL_M4_TITANO)
|
||||
#include <Adafruit_HX8357.h>
|
||||
Adafruit_HX8357 tft(tft8bitbus, TFT_D0, TFT_WR, TFT_DC, TFT_CS, TFT_RST,
|
||||
TFT_RD);
|
||||
#define DEMO DEMO_TEXT // On Titano, do text/keyboard example
|
||||
#else
|
||||
#include <Adafruit_ILI9341.h>
|
||||
Adafruit_ILI9341 tft(tft8bitbus, TFT_D0, TFT_WR, TFT_DC, TFT_CS, TFT_RST,
|
||||
TFT_RD);
|
||||
#define DEMO DEMO_CALC // Smaller PyPortal, do keypad example
|
||||
#endif
|
||||
TouchScreen ts(XP, YP, XM, YM, 300);
|
||||
Adafruit_LvGL_Glue glue;
|
||||
|
||||
#if DEMO == DEMO_CALC
|
||||
|
||||
// "Pretend" calculator example. Please, PLEASE...do NOT implement the whole
|
||||
// calculator and submit as a pull request, because it will NOT be merged!
|
||||
// This sketch is meant only to be illustrative and not functional, just
|
||||
// showing LittlevGL + Adafruit display/touch tied together with a modest
|
||||
// amount of code. Even a simple but working calc would require WAY more
|
||||
// code, distracting from that core idea (and is a waste of PyPortal).
|
||||
// Daiso has better calculators for $1.50.
|
||||
|
||||
#define TFT_ROTATION 0 // Portrait orientation on PyPortal (USB top)
|
||||
|
||||
lv_obj_t *digits_label = NULL; // LittlevGL label object showing digits
|
||||
String digits = "0"; // Current digits string value
|
||||
bool hasDecimal = false; // Only allow one decimal point
|
||||
const char *buttons[] = { // Button matrix labels
|
||||
"7", "8", "9", "/", "\n",
|
||||
"4", "5", "6", "x", "\n",
|
||||
"1", "2", "3", "-", "\n",
|
||||
"0", ".", "=", "+", "" };
|
||||
|
||||
// This function processes events from the button matrix
|
||||
void button_event_handler(lv_obj_t *obj, lv_event_t event) {
|
||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||
const char *txt = lv_btnmatrix_get_active_btn_text(obj);
|
||||
if(txt) { // NULL if pressed in frame area outside buttons
|
||||
if(txt[0] == '.') {
|
||||
// Decimal button pressed. Add decimal point to "digits" string
|
||||
// if it's not too long and there's no decimal present yet...
|
||||
if((digits.length() < 15) && !hasDecimal) {
|
||||
digits += '.';
|
||||
hasDecimal = true;
|
||||
}
|
||||
} else if((txt[0] >= '0') && (txt[0] <= '9')) {
|
||||
// Number button (0-9) pressed. If there's nothing currently
|
||||
// being displayed, take the digit literally. Otherwise, append
|
||||
// the new digit if the "digits" string is not too long.
|
||||
if(digits.equals("0")) {
|
||||
digits = txt[0];
|
||||
} else if(digits.length() < 15) {
|
||||
digits += txt[0];
|
||||
}
|
||||
} else {
|
||||
// Any other button, just reset the calculator display.
|
||||
// It's all just pretend.
|
||||
digits = "0";
|
||||
hasDecimal = false;
|
||||
}
|
||||
if(digits_label != NULL) {
|
||||
lv_label_set_text(digits_label, digits.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void lvgl_setup(void) {
|
||||
|
||||
// Just using the default styles for everything here, keeping
|
||||
// it basic. See the official LittlevGL docs and examples for
|
||||
// insights on applying styles.
|
||||
|
||||
// The calculator digits are held inside a LvGL container object
|
||||
// as this gives us a little more control over positioning.
|
||||
lv_obj_t *container = lv_cont_create(lv_scr_act(), NULL);
|
||||
lv_cont_set_fit(container, LV_FIT_NONE); // Don't auto fit
|
||||
lv_obj_set_size(container, tft.width(), 50); // Full width x 50 px
|
||||
|
||||
// Calculator digits are just a text label inside the container,
|
||||
// refreshed whenever the global "digits" string changes.
|
||||
digits_label = lv_label_create(container, NULL);
|
||||
lv_label_set_text(digits_label, digits.c_str());
|
||||
lv_obj_align(digits_label, NULL, LV_ALIGN_IN_TOP_LEFT, 20, 10);
|
||||
lv_label_set_long_mode(digits_label, LV_LABEL_LONG_CROP);
|
||||
lv_obj_set_size(digits_label, tft.width() - 40, 30);
|
||||
lv_label_set_align(digits_label, LV_LABEL_ALIGN_RIGHT);
|
||||
|
||||
// Fill the remaining space with the button matrix.
|
||||
lv_obj_t *button_matrix = lv_btnmatrix_create(lv_scr_act(), NULL);
|
||||
lv_btnmatrix_set_map(button_matrix, buttons);
|
||||
lv_obj_align(button_matrix, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 50);
|
||||
lv_obj_set_size(button_matrix, tft.width(), tft.height() - 50);
|
||||
lv_obj_set_event_cb(button_matrix, button_event_handler);
|
||||
}
|
||||
|
||||
#else // Keyboard demo
|
||||
|
||||
// Keyboard example, lets you enter and edit text in a field. Even on a
|
||||
// PyPortal Titano it requires a stylus to be even half useful (fingertip
|
||||
// is possible if very patient), but having the option of a keyboard at
|
||||
// all on this device is pretty nifty!
|
||||
|
||||
#define TFT_ROTATION 3 // Landscape orientation on PyPortal (USB right)
|
||||
|
||||
lv_obj_t *textarea,
|
||||
*keyboard = NULL; // Created/deleted as needed
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
// Called after keyboard slides closed - deletes keyboard object
|
||||
void delete_keyboard(lv_anim_t * a) {
|
||||
lv_obj_del((lv_obj_t *)a->var);
|
||||
keyboard = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Called when the close or ok button is pressed on the keyboard
|
||||
void keyboard_event_handler(lv_obj_t *obj, lv_event_t event) {
|
||||
lv_keyboard_def_event_cb(keyboard, event);
|
||||
|
||||
if(event == LV_EVENT_APPLY || event == LV_EVENT_CANCEL) {
|
||||
#if LV_USE_ANIMATION
|
||||
// If animation is enabled, make keyboard slide away
|
||||
lv_anim_path_t path;
|
||||
lv_anim_path_init(&path);
|
||||
lv_anim_path_set_cb(&path, lv_anim_path_ease_in_out);
|
||||
lv_anim_t a;
|
||||
lv_anim_init(&a);
|
||||
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_obj_set_y);
|
||||
lv_anim_set_var(&a, keyboard);
|
||||
lv_anim_set_time(&a, 300);
|
||||
lv_anim_set_values(&a, lv_obj_get_y(keyboard), LV_VER_RES); // start, end
|
||||
lv_anim_set_path(&a, &path);
|
||||
lv_anim_set_ready_cb(&a, delete_keyboard);
|
||||
lv_anim_start(&a);
|
||||
#else
|
||||
lv_obj_del(keyboard);
|
||||
keyboard = NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// Other clicks in the text area
|
||||
void text_area_event_handler(lv_obj_t *obj, lv_event_t event) {
|
||||
if(event == LV_EVENT_CLICKED) {
|
||||
|
||||
// Unsure why, but text area has an initial clicked event on
|
||||
// creation, causing the keyboard to appear. This is a hacky
|
||||
// workaround that just ignores the first click event, so
|
||||
// subsequent actual clicks bring up the keyboard.
|
||||
static bool first = true;
|
||||
if(first) {
|
||||
first = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if(keyboard == NULL) {
|
||||
// If not present, create keyboard object at bottom of screen
|
||||
keyboard = lv_keyboard_create(lv_scr_act(), NULL);
|
||||
lv_obj_set_size(keyboard, tft.width(), tft.height() * 7 / 16);
|
||||
lv_obj_align(keyboard, textarea, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
|
||||
lv_keyboard_set_textarea(keyboard, textarea);
|
||||
lv_keyboard_set_cursor_manage(keyboard, true);
|
||||
lv_obj_set_event_cb(keyboard, keyboard_event_handler);
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
// If animation is enabled, make keyboard slide into place
|
||||
lv_anim_path_t path;
|
||||
lv_anim_path_init(&path);
|
||||
lv_anim_path_set_cb(&path, lv_anim_path_ease_in_out);
|
||||
lv_anim_t a;
|
||||
lv_anim_init(&a);
|
||||
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_obj_set_y);
|
||||
lv_anim_set_var(&a, keyboard);
|
||||
lv_anim_set_time(&a, 300);
|
||||
lv_anim_set_values(&a, LV_VER_RES, lv_obj_get_y(keyboard)); // start, end
|
||||
lv_anim_set_path(&a, &path);
|
||||
lv_anim_start(&a);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void lvgl_setup(void) {
|
||||
textarea = lv_textarea_create(lv_scr_act(), NULL);
|
||||
lv_obj_set_size(textarea, LV_HOR_RES, LV_VER_RES); // Whole screen
|
||||
lv_obj_align(textarea, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_textarea_set_text(textarea, "This text is editable.");
|
||||
lv_obj_set_event_cb(textarea, text_area_event_handler);
|
||||
lv_textarea_set_cursor_pos(textarea, LV_TEXTAREA_CURSOR_LAST);
|
||||
}
|
||||
|
||||
#endif // end calculator / keyboard examples
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
||||
// Initialize display BEFORE glue setup
|
||||
tft.begin();
|
||||
tft.setRotation(TFT_ROTATION);
|
||||
pinMode(TFT_BACKLIGHT, OUTPUT);
|
||||
digitalWrite(TFT_BACKLIGHT, HIGH);
|
||||
|
||||
// PyPortal touchscreen needs no init
|
||||
|
||||
// Initialize glue, passing in address of display & touchscreen
|
||||
LvGLStatus status = glue.begin(&tft, &ts);
|
||||
if(status != LVGL_OK) {
|
||||
Serial.printf("Glue error %d\r\n", (int)status);
|
||||
for(;;);
|
||||
}
|
||||
|
||||
lvgl_setup(); // Call UI-building function above
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
lv_task_handler(); // Call LittleVGL task handler periodically
|
||||
delay(5);
|
||||
}
|
||||
|
||||
// NOTE TO FUTURE SELF: this sketch is largely similar to the FeatherWing
|
||||
// widgets example. If updating/bugfixing one sketch, make sure the other
|
||||
// is kept in sync.
|
|
@ -0,0 +1,10 @@
|
|||
name=Adafruit LittlevGL Glue Library
|
||||
version=2.0.0
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=Simplifies use of LittlevGL library with Adafruit displays.
|
||||
paragraph=This library works in conjunction with LittlevGL (an embedded system GUI library) and Adafruit display-specific libraries to provide nice user interfaces on PyPortal, TFT FeatherWings, and more.
|
||||
category=Display
|
||||
url=https://github.com/adafruit/Adafruit_LvGL_Glue
|
||||
architectures=samd, nrf52, esp32
|
||||
depends=Adafruit GFX Library, Adafruit TouchScreen, Adafruit STMPE610, Adafruit Zero DMA Library, Adafruit HX8357 Library, Adafruit ILI9341, Adafruit ZeroTimer Library, Adafruit ST7735 and ST7789 Library, lvgl
|
|
@ -0,0 +1,26 @@
|
|||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2020 Phil Burgess aka Paint Your Dragon for Adafruit Industries
|
||||
All rights reserved.
|
||||
|
||||
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 the copyright holders 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 ''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 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.
|
|
@ -0,0 +1,388 @@
|
|||
/*!
|
||||
*
|
||||
* @file Adafruit_STMPE610.cpp
|
||||
*
|
||||
* @mainpage Adafruit STMPE610 Resistive Touch Screen Controller
|
||||
*
|
||||
* @section intro_sec Introduction
|
||||
*
|
||||
* This is a library for the Adafruit STMPE610 Resistive
|
||||
* touch screen controller breakout
|
||||
* ----> http://www.adafruit.com/products/1571
|
||||
*
|
||||
* Check out the links above for our tutorials and wiring diagrams
|
||||
* These breakouts use SPI or I2C to communicate
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing
|
||||
* products from Adafruit!
|
||||
*
|
||||
* @section author Author
|
||||
*
|
||||
* Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
*
|
||||
* @section license License
|
||||
*
|
||||
* MIT license, all text above must be included in any redistribution
|
||||
*/
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
#include <SPI.h>
|
||||
#include <Wire.h>
|
||||
|
||||
#include "Adafruit_STMPE610.h"
|
||||
|
||||
static SPISettings mySPISettings;
|
||||
|
||||
/*!
|
||||
* @brief Instantiates a new STMPE610 class using bitbang SPI
|
||||
* @param cspin
|
||||
* CS pin
|
||||
* @param mosipin
|
||||
* MOSI pin
|
||||
* @param misopin
|
||||
* MISO pin
|
||||
* @param clkpin
|
||||
* CLK pin
|
||||
*/
|
||||
Adafruit_STMPE610::Adafruit_STMPE610(uint8_t cspin, uint8_t mosipin,
|
||||
uint8_t misopin, uint8_t clkpin) {
|
||||
_CS = cspin;
|
||||
_MOSI = mosipin;
|
||||
_MISO = misopin;
|
||||
_CLK = clkpin;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Instantiates a new STMPE610 using provided SPI
|
||||
* @param cspin
|
||||
* CS pin
|
||||
* @param *theSPI
|
||||
* spi object
|
||||
*/
|
||||
Adafruit_STMPE610::Adafruit_STMPE610(uint8_t cspin, SPIClass *theSPI) {
|
||||
_CS = cspin;
|
||||
_MOSI = _MISO = _CLK = -1;
|
||||
_spi = theSPI;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Instantiates a new STMPE610 using provided Wire
|
||||
* @param *theWire
|
||||
* wire object
|
||||
*/
|
||||
Adafruit_STMPE610::Adafruit_STMPE610(TwoWire *theWire) {
|
||||
_CS = _MISO = _MOSI = _CLK = -1;
|
||||
_wire = theWire;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Setups the HW
|
||||
* @param i2caddr
|
||||
* I2C address (defaults to STMPE_ADDR)
|
||||
* @return True if process is successful
|
||||
*/
|
||||
boolean Adafruit_STMPE610::begin(uint8_t i2caddr) {
|
||||
if (_CS != -1 && _CLK == -1) {
|
||||
// hardware SPI
|
||||
pinMode(_CS, OUTPUT);
|
||||
digitalWrite(_CS, HIGH);
|
||||
|
||||
_spi->begin();
|
||||
mySPISettings = SPISettings(1000000, MSBFIRST, SPI_MODE0);
|
||||
m_spiMode = SPI_MODE0;
|
||||
} else if (_CS != -1) {
|
||||
// software SPI
|
||||
pinMode(_CLK, OUTPUT);
|
||||
pinMode(_CS, OUTPUT);
|
||||
pinMode(_MOSI, OUTPUT);
|
||||
pinMode(_MISO, INPUT);
|
||||
} else {
|
||||
_wire->begin();
|
||||
_i2caddr = i2caddr;
|
||||
}
|
||||
|
||||
// try mode0
|
||||
if (getVersion() != 0x811) {
|
||||
if (_CS != -1 && _CLK == -1) {
|
||||
// Serial.println("try MODE1");
|
||||
mySPISettings = SPISettings(1000000, MSBFIRST, SPI_MODE1);
|
||||
m_spiMode = SPI_MODE1;
|
||||
|
||||
if (getVersion() != 0x811) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
writeRegister8(STMPE_SYS_CTRL1, STMPE_SYS_CTRL1_RESET);
|
||||
delay(10);
|
||||
|
||||
for (uint8_t i = 0; i < 65; i++) {
|
||||
readRegister8(i);
|
||||
}
|
||||
|
||||
writeRegister8(STMPE_SYS_CTRL2, 0x0); // turn on clocks!
|
||||
writeRegister8(STMPE_TSC_CTRL,
|
||||
STMPE_TSC_CTRL_XYZ | STMPE_TSC_CTRL_EN); // XYZ and enable!
|
||||
// Serial.println(readRegister8(STMPE_TSC_CTRL), HEX);
|
||||
writeRegister8(STMPE_INT_EN, STMPE_INT_EN_TOUCHDET);
|
||||
writeRegister8(STMPE_ADC_CTRL1, STMPE_ADC_CTRL1_10BIT |
|
||||
(0x6 << 4)); // 96 clocks per conversion
|
||||
writeRegister8(STMPE_ADC_CTRL2, STMPE_ADC_CTRL2_6_5MHZ);
|
||||
writeRegister8(STMPE_TSC_CFG, STMPE_TSC_CFG_4SAMPLE |
|
||||
STMPE_TSC_CFG_DELAY_1MS |
|
||||
STMPE_TSC_CFG_SETTLE_5MS);
|
||||
writeRegister8(STMPE_TSC_FRACTION_Z, 0x6);
|
||||
writeRegister8(STMPE_FIFO_TH, 1);
|
||||
writeRegister8(STMPE_FIFO_STA, STMPE_FIFO_STA_RESET);
|
||||
writeRegister8(STMPE_FIFO_STA, 0); // unreset
|
||||
writeRegister8(STMPE_TSC_I_DRIVE, STMPE_TSC_I_DRIVE_50MA);
|
||||
writeRegister8(STMPE_INT_STA, 0xFF); // reset all ints
|
||||
writeRegister8(STMPE_INT_CTRL,
|
||||
STMPE_INT_CTRL_POL_HIGH | STMPE_INT_CTRL_ENABLE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Returns true if touched, false otherwise
|
||||
* @return True if if touched, false otherwise
|
||||
*/
|
||||
boolean Adafruit_STMPE610::touched() {
|
||||
return (readRegister8(STMPE_TSC_CTRL) & 0x80);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Checks if buffer is empty
|
||||
* @return True if empty, false otherwise
|
||||
*/
|
||||
boolean Adafruit_STMPE610::bufferEmpty() {
|
||||
return (readRegister8(STMPE_FIFO_STA) & STMPE_FIFO_STA_EMPTY);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Returns the FIFO buffer size
|
||||
* @return The FIFO buffer size
|
||||
*/
|
||||
uint8_t Adafruit_STMPE610::bufferSize() {
|
||||
return readRegister8(STMPE_FIFO_SIZE);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Returns the STMPE610 version number
|
||||
* @return The STMPE610 version number
|
||||
*/
|
||||
uint16_t Adafruit_STMPE610::getVersion() {
|
||||
uint16_t v;
|
||||
// Serial.print("get version");
|
||||
v = readRegister8(0);
|
||||
v <<= 8;
|
||||
v |= readRegister8(1);
|
||||
// Serial.print("Version: 0x"); Serial.println(v, HEX);
|
||||
return v;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Reads touchscreen data
|
||||
* @param *x
|
||||
* The x coordinate
|
||||
* @param *y
|
||||
* The y coordinate
|
||||
* @param *z
|
||||
* The z coordinate
|
||||
*/
|
||||
void Adafruit_STMPE610::readData(uint16_t *x, uint16_t *y, uint8_t *z) {
|
||||
uint8_t data[4];
|
||||
|
||||
for (uint8_t i = 0; i < 4; i++) {
|
||||
data[i] = readRegister8(0xD7); // _spi->transfer(0x00);
|
||||
// Serial.print("0x"); Serial.print(data[i], HEX); Serial.print(" / ");
|
||||
}
|
||||
*x = data[0];
|
||||
*x <<= 4;
|
||||
*x |= (data[1] >> 4);
|
||||
*y = data[1] & 0x0F;
|
||||
*y <<= 8;
|
||||
*y |= data[2];
|
||||
*z = data[3];
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Returns point for touchscreen data
|
||||
* @return The touch point using TS_Point
|
||||
*/
|
||||
TS_Point Adafruit_STMPE610::getPoint() {
|
||||
uint16_t x, y;
|
||||
uint8_t z;
|
||||
|
||||
/* Making sure that we are reading all data before leaving */
|
||||
while (!bufferEmpty()) {
|
||||
readData(&x, &y, &z);
|
||||
}
|
||||
|
||||
if (bufferEmpty())
|
||||
writeRegister8(STMPE_INT_STA, 0xFF); // reset all ints
|
||||
|
||||
return TS_Point(x, y, z);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Reads SPI data
|
||||
*/
|
||||
uint8_t Adafruit_STMPE610::spiIn() {
|
||||
if (_CLK == -1) {
|
||||
uint8_t d = _spi->transfer(0);
|
||||
return d;
|
||||
} else
|
||||
return shiftIn(_MISO, _CLK, MSBFIRST);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Sends data through SPI
|
||||
* @param x
|
||||
* Data to send (one byte)
|
||||
*/
|
||||
void Adafruit_STMPE610::spiOut(uint8_t x) {
|
||||
if (_CLK == -1) {
|
||||
_spi->transfer(x);
|
||||
} else
|
||||
shiftOut(_MOSI, _CLK, MSBFIRST, x);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Reads 8bit of data from specified register
|
||||
* @param reg
|
||||
* The register
|
||||
* @return Data in the register
|
||||
*/
|
||||
uint8_t Adafruit_STMPE610::readRegister8(uint8_t reg) {
|
||||
uint8_t x;
|
||||
if (_CS == -1) {
|
||||
// use i2c
|
||||
_wire->beginTransmission(_i2caddr);
|
||||
_wire->write((byte)reg);
|
||||
_wire->endTransmission();
|
||||
_wire->requestFrom(_i2caddr, (byte)1);
|
||||
x = _wire->read();
|
||||
|
||||
// Serial.print("$"); Serial.print(reg, HEX);
|
||||
// Serial.print(": 0x"); Serial.println(x, HEX);
|
||||
} else {
|
||||
if (_CLK == -1)
|
||||
_spi->beginTransaction(mySPISettings);
|
||||
|
||||
digitalWrite(_CS, LOW);
|
||||
spiOut(0x80 | reg);
|
||||
spiOut(0x00);
|
||||
x = spiIn();
|
||||
digitalWrite(_CS, HIGH);
|
||||
|
||||
if (_CLK == -1)
|
||||
_spi->endTransaction();
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Reads 16 bits of data from specified register
|
||||
* @param reg
|
||||
* The register
|
||||
* @return Data in the register
|
||||
*/
|
||||
uint16_t Adafruit_STMPE610::readRegister16(uint8_t reg) {
|
||||
uint16_t x = 0;
|
||||
if (_CS == -1) {
|
||||
// use i2c
|
||||
_wire->beginTransmission(_i2caddr);
|
||||
_wire->write((byte)reg);
|
||||
_wire->endTransmission();
|
||||
_wire->requestFrom(_i2caddr, (byte)2);
|
||||
x = _wire->read();
|
||||
x <<= 8;
|
||||
x |= _wire->read();
|
||||
}
|
||||
if (_CLK == -1) {
|
||||
// hardware SPI
|
||||
if (_CLK == -1)
|
||||
_spi->beginTransaction(mySPISettings);
|
||||
digitalWrite(_CS, LOW);
|
||||
spiOut(0x80 | reg);
|
||||
spiOut(0x00);
|
||||
x = spiIn();
|
||||
x <<= 8;
|
||||
x |= spiIn();
|
||||
digitalWrite(_CS, HIGH);
|
||||
if (_CLK == -1)
|
||||
_spi->endTransaction();
|
||||
}
|
||||
|
||||
// Serial.print("$"); Serial.print(reg, HEX);
|
||||
// Serial.print(": 0x"); Serial.println(x, HEX);
|
||||
return x;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Writes 8 bit of data to specified register
|
||||
* @param reg
|
||||
* The register
|
||||
* @param val
|
||||
* Value to write
|
||||
*/
|
||||
void Adafruit_STMPE610::writeRegister8(uint8_t reg, uint8_t val) {
|
||||
if (_CS == -1) {
|
||||
// use i2c
|
||||
_wire->beginTransmission(_i2caddr);
|
||||
_wire->write((byte)reg);
|
||||
_wire->write(val);
|
||||
_wire->endTransmission();
|
||||
} else {
|
||||
if (_CLK == -1)
|
||||
_spi->beginTransaction(mySPISettings);
|
||||
digitalWrite(_CS, LOW);
|
||||
spiOut(reg);
|
||||
spiOut(val);
|
||||
digitalWrite(_CS, HIGH);
|
||||
if (_CLK == -1)
|
||||
_spi->endTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief TS_Point constructor
|
||||
*/
|
||||
TS_Point::TS_Point() { x = y = 0; }
|
||||
|
||||
/*!
|
||||
* @brief TS_Point constructor
|
||||
* @param x0
|
||||
* Initial x
|
||||
* @param y0
|
||||
* Initial y
|
||||
* @param z0
|
||||
* Initial z
|
||||
*/
|
||||
TS_Point::TS_Point(int16_t x0, int16_t y0, int16_t z0) {
|
||||
x = x0;
|
||||
y = y0;
|
||||
z = z0;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Equality operator for TS_Point
|
||||
* @return True if points are equal
|
||||
*/
|
||||
bool TS_Point::operator==(TS_Point p1) {
|
||||
return ((p1.x == x) && (p1.y == y) && (p1.z == z));
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Non-equality operator for TS_Point
|
||||
* @return True if points are not equal
|
||||
*/
|
||||
bool TS_Point::operator!=(TS_Point p1) {
|
||||
return ((p1.x != x) || (p1.y != y) || (p1.z != z));
|
||||
}
|
|
@ -0,0 +1,183 @@
|
|||
/*!
|
||||
*
|
||||
* @file Adafruit_STMPE610.cpp
|
||||
*
|
||||
* This is a library for the Adafruit STMPE610 Resistive
|
||||
* touch screen controller breakout
|
||||
* ----> http://www.adafruit.com/products/1571
|
||||
*
|
||||
* Check out the links above for our tutorials and wiring diagrams
|
||||
* These breakouts use SPI or I2C to communicate
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing
|
||||
* products from Adafruit!
|
||||
*
|
||||
* Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
*
|
||||
* MIT license, all text above must be included in any redistribution
|
||||
*/
|
||||
|
||||
#ifndef _ADAFRUIT_STMPE610H_
|
||||
#define _ADAFRUIT_STMPE610H_
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
#include <SPI.h>
|
||||
#include <Wire.h>
|
||||
|
||||
/** STMPE610 Address **/
|
||||
#define STMPE_ADDR 0x41
|
||||
|
||||
/** Reset Control **/
|
||||
#define STMPE_SYS_CTRL1 0x03
|
||||
#define STMPE_SYS_CTRL1_RESET 0x02
|
||||
|
||||
/** Clock Contrl **/
|
||||
#define STMPE_SYS_CTRL2 0x04
|
||||
|
||||
/** Touchscreen controller setup **/
|
||||
#define STMPE_TSC_CTRL 0x40
|
||||
#define STMPE_TSC_CTRL_EN 0x01
|
||||
#define STMPE_TSC_CTRL_XYZ 0x00
|
||||
#define STMPE_TSC_CTRL_XY 0x02
|
||||
|
||||
/** Interrupt control **/
|
||||
#define STMPE_INT_CTRL 0x09
|
||||
#define STMPE_INT_CTRL_POL_HIGH 0x04
|
||||
#define STMPE_INT_CTRL_POL_LOW 0x00
|
||||
#define STMPE_INT_CTRL_EDGE 0x02
|
||||
#define STMPE_INT_CTRL_LEVEL 0x00
|
||||
#define STMPE_INT_CTRL_ENABLE 0x01
|
||||
#define STMPE_INT_CTRL_DISABLE 0x00
|
||||
|
||||
/** Interrupt enable **/
|
||||
#define STMPE_INT_EN 0x0A
|
||||
#define STMPE_INT_EN_TOUCHDET 0x01
|
||||
#define STMPE_INT_EN_FIFOTH 0x02
|
||||
#define STMPE_INT_EN_FIFOOF 0x04
|
||||
#define STMPE_INT_EN_FIFOFULL 0x08
|
||||
#define STMPE_INT_EN_FIFOEMPTY 0x10
|
||||
#define STMPE_INT_EN_ADC 0x40
|
||||
#define STMPE_INT_EN_GPIO 0x80
|
||||
|
||||
/** Interrupt status **/
|
||||
#define STMPE_INT_STA 0x0B
|
||||
#define STMPE_INT_STA_TOUCHDET 0x01
|
||||
|
||||
/** ADC control **/
|
||||
#define STMPE_ADC_CTRL1 0x20
|
||||
#define STMPE_ADC_CTRL1_12BIT 0x08
|
||||
#define STMPE_ADC_CTRL1_10BIT 0x00
|
||||
|
||||
/** ADC control **/
|
||||
#define STMPE_ADC_CTRL2 0x21
|
||||
#define STMPE_ADC_CTRL2_1_625MHZ 0x00
|
||||
#define STMPE_ADC_CTRL2_3_25MHZ 0x01
|
||||
#define STMPE_ADC_CTRL2_6_5MHZ 0x02
|
||||
|
||||
/** Touchscreen controller configuration **/
|
||||
#define STMPE_TSC_CFG 0x41
|
||||
#define STMPE_TSC_CFG_1SAMPLE 0x00
|
||||
#define STMPE_TSC_CFG_2SAMPLE 0x40
|
||||
#define STMPE_TSC_CFG_4SAMPLE 0x80
|
||||
#define STMPE_TSC_CFG_8SAMPLE 0xC0
|
||||
#define STMPE_TSC_CFG_DELAY_10US 0x00
|
||||
#define STMPE_TSC_CFG_DELAY_50US 0x08
|
||||
#define STMPE_TSC_CFG_DELAY_100US 0x10
|
||||
#define STMPE_TSC_CFG_DELAY_500US 0x18
|
||||
#define STMPE_TSC_CFG_DELAY_1MS 0x20
|
||||
#define STMPE_TSC_CFG_DELAY_5MS 0x28
|
||||
#define STMPE_TSC_CFG_DELAY_10MS 0x30
|
||||
#define STMPE_TSC_CFG_DELAY_50MS 0x38
|
||||
#define STMPE_TSC_CFG_SETTLE_10US 0x00
|
||||
#define STMPE_TSC_CFG_SETTLE_100US 0x01
|
||||
#define STMPE_TSC_CFG_SETTLE_500US 0x02
|
||||
#define STMPE_TSC_CFG_SETTLE_1MS 0x03
|
||||
#define STMPE_TSC_CFG_SETTLE_5MS 0x04
|
||||
#define STMPE_TSC_CFG_SETTLE_10MS 0x05
|
||||
#define STMPE_TSC_CFG_SETTLE_50MS 0x06
|
||||
#define STMPE_TSC_CFG_SETTLE_100MS 0x07
|
||||
|
||||
/** FIFO level to generate interrupt **/
|
||||
#define STMPE_FIFO_TH 0x4A
|
||||
|
||||
/** Current filled level of FIFO **/
|
||||
#define STMPE_FIFO_SIZE 0x4C
|
||||
|
||||
/** Current status of FIFO **/
|
||||
#define STMPE_FIFO_STA 0x4B
|
||||
#define STMPE_FIFO_STA_RESET 0x01
|
||||
#define STMPE_FIFO_STA_OFLOW 0x80
|
||||
#define STMPE_FIFO_STA_FULL 0x40
|
||||
#define STMPE_FIFO_STA_EMPTY 0x20
|
||||
#define STMPE_FIFO_STA_THTRIG 0x10
|
||||
|
||||
/** Touchscreen controller drive I **/
|
||||
#define STMPE_TSC_I_DRIVE 0x58
|
||||
#define STMPE_TSC_I_DRIVE_20MA 0x00
|
||||
#define STMPE_TSC_I_DRIVE_50MA 0x01
|
||||
|
||||
/** Data port for TSC data address **/
|
||||
#define STMPE_TSC_DATA_X 0x4D
|
||||
#define STMPE_TSC_DATA_Y 0x4F
|
||||
#define STMPE_TSC_FRACTION_Z 0x56
|
||||
|
||||
/** GPIO **/
|
||||
#define STMPE_GPIO_SET_PIN 0x10
|
||||
#define STMPE_GPIO_CLR_PIN 0x11
|
||||
#define STMPE_GPIO_DIR 0x13
|
||||
#define STMPE_GPIO_ALT_FUNCT 0x17
|
||||
|
||||
/*!
|
||||
* @brief Class for working with points
|
||||
*/
|
||||
class TS_Point {
|
||||
public:
|
||||
TS_Point();
|
||||
TS_Point(int16_t x, int16_t y, int16_t z);
|
||||
|
||||
bool operator==(TS_Point);
|
||||
bool operator!=(TS_Point);
|
||||
|
||||
int16_t x; /**< x coordinate **/
|
||||
int16_t y; /**< y coordinate **/
|
||||
int16_t z; /**< z coordinate **/
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief Class that stores state and functions for interacting with
|
||||
* STMPE610
|
||||
*/
|
||||
class Adafruit_STMPE610 {
|
||||
public:
|
||||
Adafruit_STMPE610(uint8_t cspin, uint8_t mosipin, uint8_t misopin,
|
||||
uint8_t clkpin);
|
||||
Adafruit_STMPE610(uint8_t cspin, SPIClass *theSPI = &SPI);
|
||||
Adafruit_STMPE610(TwoWire *theWire = &Wire);
|
||||
|
||||
boolean begin(uint8_t i2caddr = STMPE_ADDR);
|
||||
|
||||
void writeRegister8(uint8_t reg, uint8_t val);
|
||||
uint16_t readRegister16(uint8_t reg);
|
||||
uint8_t readRegister8(uint8_t reg);
|
||||
void readData(uint16_t *x, uint16_t *y, uint8_t *z);
|
||||
uint16_t getVersion();
|
||||
boolean touched();
|
||||
boolean bufferEmpty();
|
||||
uint8_t bufferSize();
|
||||
TS_Point getPoint();
|
||||
|
||||
private:
|
||||
uint8_t spiIn();
|
||||
void spiOut(uint8_t x);
|
||||
|
||||
TwoWire *_wire;
|
||||
SPIClass *_spi;
|
||||
int8_t _CS, _MOSI, _MISO, _CLK;
|
||||
uint8_t _i2caddr;
|
||||
|
||||
int m_spiMode;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018 Adafruit Industries
|
||||
|
||||
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:
|
||||
|
||||
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 FOR 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.
|
|
@ -0,0 +1,20 @@
|
|||
# Adafruit STMPE610 Library [![Build Status](https://github.com/adafruit/Adafruit_STMPE610/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_STMPE610/actions)[![Documentation](https://github.com/adafruit/ci-arduino/blob/master/assets/doxygen_badge.svg)](http://adafruit.github.io/Adafruit_STMPE610/html/index.html)
|
||||
|
||||
<a href="http://www.adafruit.com/products/1571"><img src="assets/board.jpg?raw=true" width="500px"></a>
|
||||
|
||||
This is a library for the Adafruit STMPE610 Resistive
|
||||
touch screen controller breakout
|
||||
* http://www.adafruit.com/products/1571
|
||||
|
||||
Check out the links above for our tutorials and wiring diagrams
|
||||
These breakouts use SPI or I2C to communicate
|
||||
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
MIT license, all text above must be included in any redistribution
|
||||
|
||||
To install, use the Arduino Library Manager and search for "Adafruit STMPE610" and install the library.
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 277 KiB |
|
@ -0,0 +1,127 @@
|
|||
# Adafruit Community Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and leaders pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level or type of
|
||||
experience, education, socio-economic status, nationality, personal appearance,
|
||||
race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
We are committed to providing a friendly, safe and welcoming environment for
|
||||
all.
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Be kind and courteous to others
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Collaborating with other community members
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and sexual attention or advances
|
||||
* The use of inappropriate images, including in a community member's avatar
|
||||
* The use of inappropriate language, including in a community member's nickname
|
||||
* Any spamming, flaming, baiting or other attention-stealing behavior
|
||||
* Excessive or unwelcome helping; answering outside the scope of the question
|
||||
asked
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate
|
||||
|
||||
The goal of the standards and moderation guidelines outlined here is to build
|
||||
and maintain a respectful community. We ask that you don’t just aim to be
|
||||
"technically unimpeachable", but rather try to be your best self.
|
||||
|
||||
We value many things beyond technical expertise, including collaboration and
|
||||
supporting others within our community. Providing a positive experience for
|
||||
other community members can have a much more significant impact than simply
|
||||
providing the correct answer.
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project leaders are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project leaders have the right and responsibility to remove, edit, or
|
||||
reject messages, comments, commits, code, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any community member for other behaviors that they deem
|
||||
inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Moderation
|
||||
|
||||
Instances of behaviors that violate the Adafruit Community Code of Conduct
|
||||
may be reported by any member of the community. Community members are
|
||||
encouraged to report these situations, including situations they witness
|
||||
involving other community members.
|
||||
|
||||
You may report in the following ways:
|
||||
|
||||
In any situation, you may send an email to <support@adafruit.com>.
|
||||
|
||||
On the Adafruit Discord, you may send an open message from any channel
|
||||
to all Community Helpers by tagging @community helpers. You may also send an
|
||||
open message from any channel, or a direct message to @kattni#1507,
|
||||
@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or
|
||||
@Andon#8175.
|
||||
|
||||
Email and direct message reports will be kept confidential.
|
||||
|
||||
In situations on Discord where the issue is particularly egregious, possibly
|
||||
illegal, requires immediate action, or violates the Discord terms of service,
|
||||
you should also report the message directly to Discord.
|
||||
|
||||
These are the steps for upholding our community’s standards of conduct.
|
||||
|
||||
1. Any member of the community may report any situation that violates the
|
||||
Adafruit Community Code of Conduct. All reports will be reviewed and
|
||||
investigated.
|
||||
2. If the behavior is an egregious violation, the community member who
|
||||
committed the violation may be banned immediately, without warning.
|
||||
3. Otherwise, moderators will first respond to such behavior with a warning.
|
||||
4. Moderators follow a soft "three strikes" policy - the community member may
|
||||
be given another chance, if they are receptive to the warning and change their
|
||||
behavior.
|
||||
5. If the community member is unreceptive or unreasonable when warned by a
|
||||
moderator, or the warning goes unheeded, they may be banned for a first or
|
||||
second offense. Repeated offenses will result in the community member being
|
||||
banned.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct and the enforcement policies listed above apply to all
|
||||
Adafruit Community venues. This includes but is not limited to any community
|
||||
spaces (both public and private), the entire Adafruit Discord server, and
|
||||
Adafruit GitHub repositories. Examples of Adafruit Community spaces include
|
||||
but are not limited to meet-ups, audio chats on the Adafruit Discord, or
|
||||
interaction at a conference.
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. As a community
|
||||
member, you are representing our community, and are expected to behave
|
||||
accordingly.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 1.4, available at
|
||||
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
|
||||
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
|
||||
|
||||
For other projects adopting the Adafruit Community Code of
|
||||
Conduct, please contact the maintainers of those projects for enforcement.
|
||||
If you wish to use this code of conduct for your own project, consider
|
||||
explicitly mentioning your moderation policy or making a copy with your
|
||||
own moderation policy so as to avoid confusion.
|
|
@ -0,0 +1,81 @@
|
|||
/***************************************************
|
||||
This is an example for the Adafruit STMPE610 Resistive
|
||||
touch screen controller breakout
|
||||
----> http://www.adafruit.com/products/1571
|
||||
|
||||
Check out the links above for our tutorials and wiring diagrams
|
||||
These breakouts use SPI or I2C to communicate
|
||||
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
MIT license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
#include <SPI.h>
|
||||
#include <Wire.h>
|
||||
|
||||
#include "Adafruit_STMPE610.h"
|
||||
|
||||
// Pick one of three wiring options below!
|
||||
|
||||
// Option #1 - uses I2C, connect to hardware I2C port only!
|
||||
// SCL to I2C clock (#A5 on Uno) and SDA to I2C data (#A4 on Uno)
|
||||
// tie MODE to GND and POWER CYCLE (there is no reset pin)
|
||||
Adafruit_STMPE610 touch = Adafruit_STMPE610();
|
||||
|
||||
// Option #2 - use hardware SPI, connect to hardware SPI port only!
|
||||
// SDI to MOSI, SDO to MISO, and SCL to SPI CLOCK
|
||||
// on Arduino Uno, that's 11, 12 and 13 respectively
|
||||
// Then pick a CS pin, any pin is OK but we suggest #10 on an Uno
|
||||
// tie MODE to 3.3V and POWER CYCLE the STMPE610 (there is no reset pin)
|
||||
|
||||
//Adafruit_STMPE610 touch = Adafruit_STMPE610(STMPE_CS);
|
||||
|
||||
// Option #3 - use software SPI, connect to *any* 4 I/O pins!
|
||||
// define the following pins to whatever 4 you want and wire up!
|
||||
// Tie MODE to 3.3V and POWER CYCLE the STMPE610 (there is no reset pin)
|
||||
// Adafruit_STMPE610 touch = Adafruit_STMPE610(STMPE_CS, STMPE_SDI, STMPE_SDO, STMPE_SCK);
|
||||
|
||||
/******************/
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
Serial.println("Adafruit STMPE610 example");
|
||||
Serial.flush();
|
||||
|
||||
// if using hardware SPI on an Uno #10 must be an output, remove line
|
||||
// if using software SPI or I2C
|
||||
pinMode(10, OUTPUT);
|
||||
|
||||
// If using I2C you can select the I2C address (there are two options) by calling
|
||||
// touch.begin(0x41), the default, or touch.begin(0x44) if A0 is tied to 3.3V
|
||||
// If no address is passed, 0x41 is used
|
||||
if (! touch.begin()) {
|
||||
Serial.println("STMPE not found!");
|
||||
while(1);
|
||||
}
|
||||
Serial.println("Waiting for touch sense");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
uint16_t x, y;
|
||||
uint8_t z;
|
||||
if (touch.touched()) {
|
||||
// read x & y & z;
|
||||
while (! touch.bufferEmpty()) {
|
||||
Serial.print(touch.bufferSize());
|
||||
touch.readData(&x, &y, &z);
|
||||
Serial.print("->(");
|
||||
Serial.print(x); Serial.print(", ");
|
||||
Serial.print(y); Serial.print(", ");
|
||||
Serial.print(z);
|
||||
Serial.println(")");
|
||||
}
|
||||
touch.writeRegister8(STMPE_INT_STA, 0xFF); // reset all ints, in this example unneeded depending in use
|
||||
}
|
||||
delay(10);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
name=Adafruit STMPE610
|
||||
version=1.1.3
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=Arduino library for STMPE610/811 resistive touch screen controllers
|
||||
paragraph=Arduino library for STMPE610/811 resistive touch screen controllers
|
||||
category=Display
|
||||
url=https://github.com/adafruit/Adafruit_STMPE610
|
||||
architectures=*
|
|
@ -0,0 +1,26 @@
|
|||
# Adafruit TouchScreen Library [![Build Status](https://github.com/adafruit/Adafruit_TouchScreen/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_TouchScreen/actions)
|
||||
|
||||
This is the 4-wire resistive touch screen firmware for Arduino. Works with all Arduinos and Teensy
|
||||
|
||||
|
||||
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
|
||||
|
||||
# Contributing
|
||||
|
||||
Contributions are welcome! Please read our [Code of Conduct](https://github.com/adafruit/Adafruit_TouchScreen/blob/master/CODE_OF_CONDUCT.md>)
|
||||
before contributing to help this project stay welcoming.
|
||||
|
||||
## Documentation and doxygen
|
||||
Documentation is produced by doxygen. Contributions should include documentation for any new code added.
|
||||
|
||||
Some examples of how to use doxygen can be found in these guide pages:
|
||||
|
||||
https://learn.adafruit.com/the-well-automated-arduino-library/doxygen
|
||||
|
||||
https://learn.adafruit.com/the-well-automated-arduino-library/doxygen-tips
|
||||
|
||||
Written by Limor Fried for Adafruit Industries.
|
||||
BSD license, check license.txt for more information
|
||||
All text above must be included in any redistribution
|
||||
|
||||
To install, use the Arduino Library Manager and search for "Adafruit TouchScreen" and install the library.
|
|
@ -0,0 +1,291 @@
|
|||
// Touch screen library with X Y and Z (pressure) readings as well
|
||||
// as oversampling to avoid 'bouncing'
|
||||
// (c) ladyada / adafruit
|
||||
// Code under MIT License
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "pins_arduino.h"
|
||||
|
||||
#ifdef __AVR
|
||||
#include <avr/pgmspace.h>
|
||||
#elif defined(ESP8266)
|
||||
#include <pgmspace.h>
|
||||
#endif
|
||||
#include "TouchScreen.h"
|
||||
|
||||
// increase or decrease the touchscreen oversampling. This is a little different
|
||||
// than you make think: 1 is no oversampling, whatever data we get is
|
||||
// immediately returned 2 is double-sampling and we only return valid data if
|
||||
// both points are the same 3+ uses insert sort to get the median value. We
|
||||
// found 2 is precise yet not too slow so we suggest sticking with it!
|
||||
|
||||
#define NUMSAMPLES 2
|
||||
|
||||
TSPoint::TSPoint(void) { x = y = z = 0; }
|
||||
/**
|
||||
* @brief Construct a new TSPoint::TSPoint object
|
||||
*
|
||||
* @param x0 The point's X value
|
||||
* @param y0 The point's Y value
|
||||
* @param z0 The point's Z value
|
||||
*/
|
||||
TSPoint::TSPoint(int16_t x0, int16_t y0, int16_t z0) {
|
||||
x = x0;
|
||||
y = y0;
|
||||
z = z0;
|
||||
}
|
||||
/**
|
||||
* @brief Check if the current point is **not** equivalent to another point
|
||||
*
|
||||
* @param p1 The other point being checked for equivalence
|
||||
* @return `true` : the two points are equivalent
|
||||
* `false`: the two points are **not** equivalent
|
||||
*/
|
||||
bool TSPoint::operator==(TSPoint p1) {
|
||||
return ((p1.x == x) && (p1.y == y) && (p1.z == z));
|
||||
}
|
||||
/**
|
||||
* @brief Check if the current point is **not** equivalent to another point
|
||||
*
|
||||
* @param p1 The other point being checked for equivalence
|
||||
|
||||
* @return `true` :the two points are **not** equivalent
|
||||
* `false`: the two points are equivalent
|
||||
*/
|
||||
bool TSPoint::operator!=(TSPoint p1) {
|
||||
return ((p1.x != x) || (p1.y != y) || (p1.z != z));
|
||||
}
|
||||
|
||||
#if (NUMSAMPLES > 2)
|
||||
static void insert_sort(int array[], uint8_t size) {
|
||||
uint8_t j;
|
||||
int save;
|
||||
|
||||
for (int i = 1; i < size; i++) {
|
||||
save = array[i];
|
||||
for (j = i; j >= 1 && save < array[j - 1]; j--)
|
||||
array[j] = array[j - 1];
|
||||
array[j] = save;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* @brief Measure the X, Y, and pressure and return a TSPoint with the
|
||||
* measurements
|
||||
*
|
||||
* @return TSPoint The measured X, Y, and Z/pressure values
|
||||
*/
|
||||
TSPoint TouchScreen::getPoint(void) {
|
||||
int x, y, z;
|
||||
int samples[NUMSAMPLES];
|
||||
uint8_t i, valid;
|
||||
|
||||
valid = 1;
|
||||
|
||||
pinMode(_yp, INPUT);
|
||||
pinMode(_ym, INPUT);
|
||||
pinMode(_xp, OUTPUT);
|
||||
pinMode(_xm, OUTPUT);
|
||||
|
||||
#if defined(USE_FAST_PINIO)
|
||||
*xp_port |= xp_pin;
|
||||
*xm_port &= ~xm_pin;
|
||||
#else
|
||||
digitalWrite(_xp, HIGH);
|
||||
digitalWrite(_xm, LOW);
|
||||
#endif
|
||||
|
||||
#ifdef __arm__
|
||||
delayMicroseconds(20); // Fast ARM chips need to allow voltages to settle
|
||||
#endif
|
||||
|
||||
for (i = 0; i < NUMSAMPLES; i++) {
|
||||
samples[i] = analogRead(_yp);
|
||||
}
|
||||
|
||||
#if NUMSAMPLES > 2
|
||||
insert_sort(samples, NUMSAMPLES);
|
||||
#endif
|
||||
#if NUMSAMPLES == 2
|
||||
// Allow small amount of measurement noise, because capacitive
|
||||
// coupling to a TFT display's signals can induce some noise.
|
||||
if (samples[0] - samples[1] < -4 || samples[0] - samples[1] > 4) {
|
||||
valid = 0;
|
||||
} else {
|
||||
samples[1] = (samples[0] + samples[1]) >> 1; // average 2 samples
|
||||
}
|
||||
#endif
|
||||
|
||||
x = (1023 - samples[NUMSAMPLES / 2]);
|
||||
|
||||
pinMode(_xp, INPUT);
|
||||
pinMode(_xm, INPUT);
|
||||
pinMode(_yp, OUTPUT);
|
||||
pinMode(_ym, OUTPUT);
|
||||
|
||||
#if defined(USE_FAST_PINIO)
|
||||
*ym_port &= ~ym_pin;
|
||||
*yp_port |= yp_pin;
|
||||
#else
|
||||
digitalWrite(_ym, LOW);
|
||||
digitalWrite(_yp, HIGH);
|
||||
#endif
|
||||
|
||||
#ifdef __arm__
|
||||
delayMicroseconds(20); // Fast ARM chips need to allow voltages to settle
|
||||
#endif
|
||||
|
||||
for (i = 0; i < NUMSAMPLES; i++) {
|
||||
samples[i] = analogRead(_xm);
|
||||
}
|
||||
|
||||
#if NUMSAMPLES > 2
|
||||
insert_sort(samples, NUMSAMPLES);
|
||||
#endif
|
||||
#if NUMSAMPLES == 2
|
||||
// Allow small amount of measurement noise, because capacitive
|
||||
// coupling to a TFT display's signals can induce some noise.
|
||||
if (samples[0] - samples[1] < -4 || samples[0] - samples[1] > 4) {
|
||||
valid = 0;
|
||||
} else {
|
||||
samples[1] = (samples[0] + samples[1]) >> 1; // average 2 samples
|
||||
}
|
||||
#endif
|
||||
|
||||
y = (1023 - samples[NUMSAMPLES / 2]);
|
||||
|
||||
// Set X+ to ground
|
||||
// Set Y- to VCC
|
||||
// Hi-Z X- and Y+
|
||||
pinMode(_xp, OUTPUT);
|
||||
pinMode(_yp, INPUT);
|
||||
|
||||
#if defined(USE_FAST_PINIO)
|
||||
*xp_port &= ~xp_pin;
|
||||
*ym_port |= ym_pin;
|
||||
#else
|
||||
digitalWrite(_xp, LOW);
|
||||
digitalWrite(_ym, HIGH);
|
||||
#endif
|
||||
|
||||
int z1 = analogRead(_xm);
|
||||
int z2 = analogRead(_yp);
|
||||
|
||||
if (_rxplate != 0) {
|
||||
// now read the x
|
||||
float rtouch;
|
||||
rtouch = z2;
|
||||
rtouch /= z1;
|
||||
rtouch -= 1;
|
||||
rtouch *= x;
|
||||
rtouch *= _rxplate;
|
||||
rtouch /= 1024;
|
||||
|
||||
z = rtouch;
|
||||
} else {
|
||||
z = (1023 - (z2 - z1));
|
||||
}
|
||||
|
||||
if (!valid) {
|
||||
z = 0;
|
||||
}
|
||||
|
||||
return TSPoint(x, y, z);
|
||||
}
|
||||
|
||||
TouchScreen::TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym,
|
||||
uint16_t rxplate = 0) {
|
||||
_yp = yp;
|
||||
_xm = xm;
|
||||
_ym = ym;
|
||||
_xp = xp;
|
||||
_rxplate = rxplate;
|
||||
|
||||
#if defined(USE_FAST_PINIO)
|
||||
xp_port = portOutputRegister(digitalPinToPort(_xp));
|
||||
yp_port = portOutputRegister(digitalPinToPort(_yp));
|
||||
xm_port = portOutputRegister(digitalPinToPort(_xm));
|
||||
ym_port = portOutputRegister(digitalPinToPort(_ym));
|
||||
|
||||
xp_pin = digitalPinToBitMask(_xp);
|
||||
yp_pin = digitalPinToBitMask(_yp);
|
||||
xm_pin = digitalPinToBitMask(_xm);
|
||||
ym_pin = digitalPinToBitMask(_ym);
|
||||
#endif
|
||||
|
||||
pressureThreshhold = 10;
|
||||
}
|
||||
/**
|
||||
* @brief Read the touch event's X value
|
||||
*
|
||||
* @return int the X measurement
|
||||
*/
|
||||
int TouchScreen::readTouchX(void) {
|
||||
pinMode(_yp, INPUT);
|
||||
pinMode(_ym, INPUT);
|
||||
digitalWrite(_yp, LOW);
|
||||
digitalWrite(_ym, LOW);
|
||||
|
||||
pinMode(_xp, OUTPUT);
|
||||
digitalWrite(_xp, HIGH);
|
||||
pinMode(_xm, OUTPUT);
|
||||
digitalWrite(_xm, LOW);
|
||||
|
||||
return (1023 - analogRead(_yp));
|
||||
}
|
||||
/**
|
||||
* @brief Read the touch event's Y value
|
||||
*
|
||||
* @return int the Y measurement
|
||||
*/
|
||||
int TouchScreen::readTouchY(void) {
|
||||
pinMode(_xp, INPUT);
|
||||
pinMode(_xm, INPUT);
|
||||
digitalWrite(_xp, LOW);
|
||||
digitalWrite(_xm, LOW);
|
||||
|
||||
pinMode(_yp, OUTPUT);
|
||||
digitalWrite(_yp, HIGH);
|
||||
pinMode(_ym, OUTPUT);
|
||||
digitalWrite(_ym, LOW);
|
||||
|
||||
return (1023 - analogRead(_xm));
|
||||
}
|
||||
/**
|
||||
* @brief Read the touch event's Z/pressure value
|
||||
*
|
||||
* @return int the Z measurement
|
||||
*/
|
||||
uint16_t TouchScreen::pressure(void) {
|
||||
// Set X+ to ground
|
||||
pinMode(_xp, OUTPUT);
|
||||
digitalWrite(_xp, LOW);
|
||||
|
||||
// Set Y- to VCC
|
||||
pinMode(_ym, OUTPUT);
|
||||
digitalWrite(_ym, HIGH);
|
||||
|
||||
// Hi-Z X- and Y+
|
||||
digitalWrite(_xm, LOW);
|
||||
pinMode(_xm, INPUT);
|
||||
digitalWrite(_yp, LOW);
|
||||
pinMode(_yp, INPUT);
|
||||
|
||||
int z1 = analogRead(_xm);
|
||||
int z2 = analogRead(_yp);
|
||||
|
||||
if (_rxplate != 0) {
|
||||
// now read the x
|
||||
float rtouch;
|
||||
rtouch = z2;
|
||||
rtouch /= z1;
|
||||
rtouch -= 1;
|
||||
rtouch *= readTouchX();
|
||||
rtouch *= _rxplate;
|
||||
rtouch /= 1024;
|
||||
|
||||
return rtouch;
|
||||
} else {
|
||||
return (1023 - (z2 - z1));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
// Touch screen library with X Y and Z (pressure) readings as well
|
||||
// as oversampling to avoid 'bouncing'
|
||||
// (c) ladyada / adafruit
|
||||
// Code under MIT License
|
||||
|
||||
#ifndef _ADAFRUIT_TOUCHSCREEN_H_
|
||||
#define _ADAFRUIT_TOUCHSCREEN_H_
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega32U4__) || \
|
||||
defined(TEENSYDUINO) || defined(__AVR_ATmega2560__) || \
|
||||
defined(__AVR_ATmega4809__)
|
||||
typedef volatile uint8_t RwReg;
|
||||
#elif defined(ARDUINO_STM32_FEATHER)
|
||||
typedef volatile uint32 RwReg;
|
||||
#elif defined(NRF52_SERIES) || defined(ESP32) || defined(ESP8266) || \
|
||||
defined(ARDUINO_ARCH_STM32)
|
||||
typedef volatile uint32_t RwReg;
|
||||
#else
|
||||
typedef volatile uint32_t RwReg;
|
||||
#endif
|
||||
|
||||
#if defined(__AVR__) || defined(TEENSYDUINO) || defined(ARDUINO_ARCH_SAMD)
|
||||
#define USE_FAST_PINIO
|
||||
#endif
|
||||
|
||||
/** Object that encapsulates the X,Y, and Z/pressure measurements for a touch
|
||||
* event. */
|
||||
class TSPoint {
|
||||
public:
|
||||
TSPoint(void);
|
||||
TSPoint(int16_t x, int16_t y, int16_t z);
|
||||
|
||||
bool operator==(TSPoint);
|
||||
bool operator!=(TSPoint);
|
||||
|
||||
int16_t x, ///< state variable for the x value
|
||||
y, ///< state variable for the y value
|
||||
z; ///< state variable for the z value
|
||||
};
|
||||
/** Object that controls and keeps state for a touch screen. */
|
||||
|
||||
class TouchScreen {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Touch Screen object
|
||||
*
|
||||
* @param xp X+ pin. Must be an analog pin
|
||||
* @param yp Y+ pin. Must be an analog pin
|
||||
* @param xm X- pin. Can be a digital pin
|
||||
* @param ym Y- pin. Can be a digital pin
|
||||
* @param rx The resistance in ohms between X+ and X- to calibrate pressure
|
||||
* sensing
|
||||
*/
|
||||
TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, uint16_t rx);
|
||||
|
||||
/**
|
||||
* @brief **NOT IMPLEMENTED** Test if the screen has been touched
|
||||
*
|
||||
* @return true : touch detected false: no touch detected
|
||||
*/
|
||||
bool isTouching(void);
|
||||
uint16_t pressure(void);
|
||||
int readTouchY();
|
||||
int readTouchX();
|
||||
TSPoint getPoint();
|
||||
int16_t pressureThreshhold; ///< Pressure threshold for `isTouching`
|
||||
|
||||
private:
|
||||
uint8_t _yp, _ym, _xm, _xp;
|
||||
uint16_t _rxplate;
|
||||
|
||||
#if defined(USE_FAST_PINIO)
|
||||
volatile RwReg *xp_port, *yp_port, *xm_port, *ym_port;
|
||||
RwReg xp_pin, xm_pin, yp_pin, ym_pin;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,127 @@
|
|||
# Adafruit Community Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and leaders pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level or type of
|
||||
experience, education, socio-economic status, nationality, personal appearance,
|
||||
race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
We are committed to providing a friendly, safe and welcoming environment for
|
||||
all.
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Be kind and courteous to others
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Collaborating with other community members
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and sexual attention or advances
|
||||
* The use of inappropriate images, including in a community member's avatar
|
||||
* The use of inappropriate language, including in a community member's nickname
|
||||
* Any spamming, flaming, baiting or other attention-stealing behavior
|
||||
* Excessive or unwelcome helping; answering outside the scope of the question
|
||||
asked
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate
|
||||
|
||||
The goal of the standards and moderation guidelines outlined here is to build
|
||||
and maintain a respectful community. We ask that you don’t just aim to be
|
||||
"technically unimpeachable", but rather try to be your best self.
|
||||
|
||||
We value many things beyond technical expertise, including collaboration and
|
||||
supporting others within our community. Providing a positive experience for
|
||||
other community members can have a much more significant impact than simply
|
||||
providing the correct answer.
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project leaders are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project leaders have the right and responsibility to remove, edit, or
|
||||
reject messages, comments, commits, code, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any community member for other behaviors that they deem
|
||||
inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Moderation
|
||||
|
||||
Instances of behaviors that violate the Adafruit Community Code of Conduct
|
||||
may be reported by any member of the community. Community members are
|
||||
encouraged to report these situations, including situations they witness
|
||||
involving other community members.
|
||||
|
||||
You may report in the following ways:
|
||||
|
||||
In any situation, you may send an email to <support@adafruit.com>.
|
||||
|
||||
On the Adafruit Discord, you may send an open message from any channel
|
||||
to all Community Helpers by tagging @community helpers. You may also send an
|
||||
open message from any channel, or a direct message to @kattni#1507,
|
||||
@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or
|
||||
@Andon#8175.
|
||||
|
||||
Email and direct message reports will be kept confidential.
|
||||
|
||||
In situations on Discord where the issue is particularly egregious, possibly
|
||||
illegal, requires immediate action, or violates the Discord terms of service,
|
||||
you should also report the message directly to Discord.
|
||||
|
||||
These are the steps for upholding our community’s standards of conduct.
|
||||
|
||||
1. Any member of the community may report any situation that violates the
|
||||
Adafruit Community Code of Conduct. All reports will be reviewed and
|
||||
investigated.
|
||||
2. If the behavior is an egregious violation, the community member who
|
||||
committed the violation may be banned immediately, without warning.
|
||||
3. Otherwise, moderators will first respond to such behavior with a warning.
|
||||
4. Moderators follow a soft "three strikes" policy - the community member may
|
||||
be given another chance, if they are receptive to the warning and change their
|
||||
behavior.
|
||||
5. If the community member is unreceptive or unreasonable when warned by a
|
||||
moderator, or the warning goes unheeded, they may be banned for a first or
|
||||
second offense. Repeated offenses will result in the community member being
|
||||
banned.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct and the enforcement policies listed above apply to all
|
||||
Adafruit Community venues. This includes but is not limited to any community
|
||||
spaces (both public and private), the entire Adafruit Discord server, and
|
||||
Adafruit GitHub repositories. Examples of Adafruit Community spaces include
|
||||
but are not limited to meet-ups, audio chats on the Adafruit Discord, or
|
||||
interaction at a conference.
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. As a community
|
||||
member, you are representing our community, and are expected to behave
|
||||
accordingly.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 1.4, available at
|
||||
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
|
||||
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
|
||||
|
||||
For other projects adopting the Adafruit Community Code of
|
||||
Conduct, please contact the maintainers of those projects for enforcement.
|
||||
If you wish to use this code of conduct for your own project, consider
|
||||
explicitly mentioning your moderation policy or making a copy with your
|
||||
own moderation policy so as to avoid confusion.
|
|
@ -0,0 +1,35 @@
|
|||
// Touch screen library with X Y and Z (pressure) readings as well
|
||||
// as oversampling to avoid 'bouncing'
|
||||
// This demo code returns raw readings, public domain
|
||||
|
||||
#include <stdint.h>
|
||||
#include "TouchScreen.h"
|
||||
|
||||
#define YP A2 // must be an analog pin, use "An" notation!
|
||||
#define XM A3 // must be an analog pin, use "An" notation!
|
||||
#define YM 8 // can be a digital pin
|
||||
#define XP 9 // can be a digital pin
|
||||
|
||||
// For better pressure precision, we need to know the resistance
|
||||
// between X+ and X- Use any multimeter to read it
|
||||
// For the one we're using, its 300 ohms across the X plate
|
||||
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
// a point object holds x y and z coordinates
|
||||
TSPoint p = ts.getPoint();
|
||||
|
||||
// we have some minimum pressure we consider 'valid'
|
||||
// pressure of 0 means no pressing!
|
||||
if (p.z > ts.pressureThreshhold) {
|
||||
Serial.print("X = "); Serial.print(p.x);
|
||||
Serial.print("\tY = "); Serial.print(p.y);
|
||||
Serial.print("\tPressure = "); Serial.println(p.z);
|
||||
}
|
||||
|
||||
delay(100);
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// Touch screen library with X Y and Z (pressure) readings as well
|
||||
// as oversampling to avoid 'bouncing'
|
||||
// This demo code returns raw readings, public domain
|
||||
|
||||
#include <stdint.h>
|
||||
#include "TouchScreen.h"
|
||||
|
||||
// These are the pins for the shield!
|
||||
#define YP A1 // must be an analog pin, use "An" notation!
|
||||
#define XM A2 // must be an analog pin, use "An" notation!
|
||||
#define YM 7 // can be a digital pin
|
||||
#define XP 6 // can be a digital pin
|
||||
|
||||
#define MINPRESSURE 10
|
||||
#define MAXPRESSURE 1000
|
||||
|
||||
// For better pressure precision, we need to know the resistance
|
||||
// between X+ and X- Use any multimeter to read it
|
||||
// For the one we're using, its 300 ohms across the X plate
|
||||
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
// a point object holds x y and z coordinates
|
||||
TSPoint p = ts.getPoint();
|
||||
|
||||
// we have some minimum pressure we consider 'valid'
|
||||
// pressure of 0 means no pressing!
|
||||
if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {
|
||||
Serial.print("X = "); Serial.print(p.x);
|
||||
Serial.print("\tY = "); Serial.print(p.y);
|
||||
Serial.print("\tPressure = "); Serial.println(p.z);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
name=Adafruit TouchScreen
|
||||
version=1.1.1
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=Adafruit TouchScreen display library.
|
||||
paragraph=Adafruit TouchScreen display library.
|
||||
category=Display
|
||||
url=https://github.com/adafruit/Adafruit_TouchScreen
|
||||
architectures=*
|
|
@ -0,0 +1,26 @@
|
|||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2019 Limor Fried for Adafruit Industries
|
||||
All rights reserved.
|
||||
|
||||
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 the copyright holders 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 ''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 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.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue