init commit
This commit is contained in:
commit
ae325683f9
267 changed files with 44630 additions and 0 deletions
1
.clang-format
Normal file
1
.clang-format
Normal file
|
|
@ -0,0 +1 @@
|
|||
IndentWidth: 4
|
||||
45
Makefile
Normal file
45
Makefile
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
################################################################################
|
||||
######################### User configurable parameters #########################
|
||||
# filename extensions
|
||||
CEXTS:=c
|
||||
ASMEXTS:=s S
|
||||
CXXEXTS:=cpp c++ cc
|
||||
|
||||
# probably shouldn't modify these, but you may need them below
|
||||
ROOT=.
|
||||
FWDIR:=$(ROOT)/firmware
|
||||
BINDIR=$(ROOT)/bin
|
||||
SRCDIR=$(ROOT)/src
|
||||
INCDIR=$(ROOT)/include
|
||||
|
||||
WARNFLAGS+=
|
||||
EXTRA_CFLAGS=
|
||||
EXTRA_CXXFLAGS=
|
||||
|
||||
# Set to 1 to enable hot/cold linking
|
||||
USE_PACKAGE:=1
|
||||
|
||||
# Add libraries you do not wish to include in the cold image here
|
||||
# EXCLUDE_COLD_LIBRARIES:= $(FWDIR)/your_library.a
|
||||
EXCLUDE_COLD_LIBRARIES:=
|
||||
|
||||
# Set this to 1 to add additional rules to compile your project as a PROS library template
|
||||
IS_LIBRARY:=0
|
||||
# TODO: CHANGE THIS!
|
||||
LIBNAME:=libbest
|
||||
VERSION:=1.0.0
|
||||
# EXCLUDE_SRC_FROM_LIB= $(SRCDIR)/unpublishedfile.c
|
||||
# this line excludes opcontrol.c and similar files
|
||||
EXCLUDE_SRC_FROM_LIB+=$(foreach file, $(SRCDIR)/main,$(foreach cext,$(CEXTS),$(file).$(cext)) $(foreach cxxext,$(CXXEXTS),$(file).$(cxxext)))
|
||||
|
||||
# files that get distributed to every user (beyond your source archive) - add
|
||||
# whatever files you want here. This line is configured to add all header files
|
||||
# that are in the the include directory get exported
|
||||
TEMPLATE_FILES=$(INCDIR)/**/*.h $(INCDIR)/**/*.hpp
|
||||
|
||||
.DEFAULT_GOAL=quick
|
||||
|
||||
################################################################################
|
||||
################################################################################
|
||||
########## Nothing below this line should be edited by typical users ###########
|
||||
-include ./common.mk
|
||||
295
common.mk
Normal file
295
common.mk
Normal file
|
|
@ -0,0 +1,295 @@
|
|||
ARCHTUPLE=arm-none-eabi-
|
||||
DEVICE=VEX EDR V5
|
||||
|
||||
MFLAGS=-mcpu=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=softfp -Os -g
|
||||
CPPFLAGS=-D_POSIX_THREADS -D_UNIX98_THREAD_MUTEX_ATTRIBUTES -D_POSIX_TIMERS -D_POSIX_MONOTONIC_CLOCK
|
||||
GCCFLAGS=-ffunction-sections -fdata-sections -fdiagnostics-color -funwind-tables
|
||||
|
||||
WARNFLAGS+=-Wno-psabi
|
||||
|
||||
SPACE := $() $()
|
||||
COMMA := ,
|
||||
|
||||
DEPDIR := .d
|
||||
$(shell mkdir -p $(DEPDIR))
|
||||
DEPFLAGS = -MT $$@ -MMD -MP -MF $(DEPDIR)/$$*.Td
|
||||
MAKEDEPFOLDER = -$(VV)mkdir -p $(DEPDIR)/$$(dir $$(patsubst $(BINDIR)/%, %, $(ROOT)/$$@))
|
||||
RENAMEDEPENDENCYFILE = -$(VV)mv -f $(DEPDIR)/$$*.Td $$(patsubst $(SRCDIR)/%, $(DEPDIR)/%.d, $(ROOT)/$$<) && touch $$@
|
||||
|
||||
LIBRARIES+=$(wildcard $(FWDIR)/*.a)
|
||||
# Cannot include newlib and libc because not all of the req'd stubs are implemented
|
||||
EXCLUDE_COLD_LIBRARIES+=$(FWDIR)/libc.a $(FWDIR)/libm.a
|
||||
COLD_LIBRARIES=$(filter-out $(EXCLUDE_COLD_LIBRARIES), $(LIBRARIES))
|
||||
wlprefix=-Wl,$(subst $(SPACE),$(COMMA),$1)
|
||||
LNK_FLAGS=--gc-sections --start-group $(strip $(LIBRARIES)) -lgcc -lstdc++ --end-group -T$(FWDIR)/v5-common.ld
|
||||
|
||||
ASMFLAGS=$(MFLAGS) $(WARNFLAGS)
|
||||
CFLAGS=$(MFLAGS) $(CPPFLAGS) $(WARNFLAGS) $(GCCFLAGS) --std=gnu11
|
||||
CXXFLAGS=$(MFLAGS) $(CPPFLAGS) $(WARNFLAGS) $(GCCFLAGS) --std=gnu++17
|
||||
LDFLAGS=$(MFLAGS) $(WARNFLAGS) -nostdlib $(GCCFLAGS)
|
||||
SIZEFLAGS=-d --common
|
||||
NUMFMTFLAGS=--to=iec --format %.2f --suffix=B
|
||||
|
||||
AR:=$(ARCHTUPLE)ar
|
||||
# using arm-none-eabi-as generates a listing by default. This produces a super verbose output.
|
||||
# Using gcc accomplishes the same thing without the extra output
|
||||
AS:=$(ARCHTUPLE)gcc
|
||||
CC:=$(ARCHTUPLE)gcc
|
||||
CXX:=$(ARCHTUPLE)g++
|
||||
LD:=$(ARCHTUPLE)g++
|
||||
OBJCOPY:=$(ARCHTUPLE)objcopy
|
||||
SIZETOOL:=$(ARCHTUPLE)size
|
||||
READELF:=$(ARCHTUPLE)readelf
|
||||
STRIP:=$(ARCHTUPLE)strip
|
||||
|
||||
ifneq (, $(shell command -v gnumfmt 2> /dev/null))
|
||||
SIZES_NUMFMT:=| gnumfmt --field=-4 --header $(NUMFMTFLAGS)
|
||||
else
|
||||
ifneq (, $(shell command -v numfmt 2> /dev/null))
|
||||
SIZES_NUMFMT:=| numfmt --field=-4 --header $(NUMFMTFLAGS)
|
||||
else
|
||||
SIZES_NUMFMT:=
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (, $(shell command -v sed 2> /dev/null))
|
||||
SIZES_SED:=| sed -e 's/ dec/total/'
|
||||
else
|
||||
SIZES_SED:=
|
||||
endif
|
||||
|
||||
rwildcard=$(foreach d,$(filter-out $3,$(wildcard $1*)),$(call rwildcard,$d/,$2,$3)$(filter $(subst *,%,$2),$d))
|
||||
|
||||
# Colors
|
||||
NO_COLOR=$(shell printf "%b" "\033[0m")
|
||||
OK_COLOR=$(shell printf "%b" "\033[32;01m")
|
||||
ERROR_COLOR=$(shell printf "%b" "\033[31;01m")
|
||||
WARN_COLOR=$(shell printf "%b" "\033[33;01m")
|
||||
STEP_COLOR=$(shell printf "%b" "\033[37;01m")
|
||||
OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)
|
||||
DONE_STRING=$(OK_COLOR)[DONE]$(NO_COLOR)
|
||||
ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)
|
||||
WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)
|
||||
ECHO=/bin/printf "%s\n"
|
||||
echo=@$(ECHO) "$2$1$(NO_COLOR)"
|
||||
echon=@/bin/printf "%s" "$2$1$(NO_COLOR)"
|
||||
|
||||
define test_output_2
|
||||
@if test $(BUILD_VERBOSE) -eq $(or $4,1); then printf "%s\n" "$2"; fi;
|
||||
@output="$$($2 2>&1)"; exit=$$?; \
|
||||
if test 0 -ne $$exit; then \
|
||||
printf "%s%s\n" "$1" "$(ERROR_STRING)"; \
|
||||
printf "%s\n" "$$output"; \
|
||||
exit $$exit; \
|
||||
elif test -n "$$output"; then \
|
||||
printf "%s%s\n" "$1" "$(WARN_STRING)"; \
|
||||
printf "%s\n" "$$output"; \
|
||||
else \
|
||||
printf "%s%s\n" "$1" "$3"; \
|
||||
fi;
|
||||
endef
|
||||
|
||||
define test_output
|
||||
@output=$$($1 2>&1); exit=$$?; \
|
||||
if test 0 -ne $$exit; then \
|
||||
printf "%s\n" "$(ERROR_STRING)" $$?; \
|
||||
printf "%s\n" $$output; \
|
||||
exit $$exit; \
|
||||
elif test -n "$$output"; then \
|
||||
printf "%s\n" "$(WARN_STRING)"; \
|
||||
printf "%s" $$output; \
|
||||
else \
|
||||
printf "%s\n" "$2"; \
|
||||
fi;
|
||||
endef
|
||||
|
||||
# Makefile Verbosity
|
||||
ifeq ("$(origin VERBOSE)", "command line")
|
||||
BUILD_VERBOSE = $(VERBOSE)
|
||||
endif
|
||||
ifeq ("$(origin V)", "command line")
|
||||
BUILD_VERBOSE = $(V)
|
||||
endif
|
||||
|
||||
ifndef BUILD_VERBOSE
|
||||
BUILD_VERBOSE = 0
|
||||
endif
|
||||
|
||||
# R is reduced (default messages) - build verbose = 0
|
||||
# V is verbose messages - verbosity = 1
|
||||
# VV is super verbose - verbosity = 2
|
||||
ifeq ($(BUILD_VERBOSE), 0)
|
||||
R = @echo
|
||||
D = @
|
||||
VV = @
|
||||
endif
|
||||
ifeq ($(BUILD_VERBOSE), 1)
|
||||
R = @echo
|
||||
D =
|
||||
VV = @
|
||||
endif
|
||||
ifeq ($(BUILD_VERBOSE), 2)
|
||||
R =
|
||||
D =
|
||||
VV =
|
||||
endif
|
||||
|
||||
INCLUDE=$(foreach dir,$(INCDIR) $(EXTRA_INCDIR),-iquote"$(dir)")
|
||||
|
||||
ASMSRC=$(foreach asmext,$(ASMEXTS),$(call rwildcard, $(SRCDIR),*.$(asmext), $1))
|
||||
ASMOBJ=$(addprefix $(BINDIR)/,$(patsubst $(SRCDIR)/%,%.o,$(call ASMSRC,$1)))
|
||||
CSRC=$(foreach cext,$(CEXTS),$(call rwildcard, $(SRCDIR),*.$(cext), $1))
|
||||
COBJ=$(addprefix $(BINDIR)/,$(patsubst $(SRCDIR)/%,%.o,$(call CSRC, $1)))
|
||||
CXXSRC=$(foreach cxxext,$(CXXEXTS),$(call rwildcard, $(SRCDIR),*.$(cxxext), $1))
|
||||
CXXOBJ=$(addprefix $(BINDIR)/,$(patsubst $(SRCDIR)/%,%.o,$(call CXXSRC,$1)))
|
||||
|
||||
GETALLOBJ=$(sort $(call ASMOBJ,$1) $(call COBJ,$1) $(call CXXOBJ,$1))
|
||||
|
||||
ARCHIVE_TEXT_LIST=$(subst $(SPACE),$(COMMA),$(notdir $(basename $(LIBRARIES))))
|
||||
|
||||
LDTIMEOBJ:=$(BINDIR)/_pros_ld_timestamp.o
|
||||
|
||||
MONOLITH_BIN:=$(BINDIR)/monolith.bin
|
||||
MONOLITH_ELF:=$(basename $(MONOLITH_BIN)).elf
|
||||
|
||||
HOT_BIN:=$(BINDIR)/hot.package.bin
|
||||
HOT_ELF:=$(basename $(HOT_BIN)).elf
|
||||
COLD_BIN:=$(BINDIR)/cold.package.bin
|
||||
COLD_ELF:=$(basename $(COLD_BIN)).elf
|
||||
|
||||
# Check if USE_PACKAGE is defined to check for migration steps from purduesigbots/pros#87
|
||||
ifndef USE_PACKAGE
|
||||
$(error Your Makefile must be migrated! Visit https://pros.cs.purdue.edu/v5/releases/kernel3.1.6.html to learn how)
|
||||
endif
|
||||
|
||||
DEFAULT_BIN=$(MONOLITH_BIN)
|
||||
ifeq ($(USE_PACKAGE),1)
|
||||
DEFAULT_BIN=$(HOT_BIN)
|
||||
endif
|
||||
|
||||
-include $(wildcard $(FWDIR)/*.mk)
|
||||
|
||||
.PHONY: all clean quick
|
||||
|
||||
quick: $(DEFAULT_BIN)
|
||||
|
||||
all: clean $(DEFAULT_BIN)
|
||||
|
||||
clean:
|
||||
@echo Cleaning project
|
||||
-$Drm -rf $(BINDIR)
|
||||
-$Drm -rf $(DEPDIR)
|
||||
|
||||
ifeq ($(IS_LIBRARY),1)
|
||||
ifeq ($(LIBNAME),libbest)
|
||||
$(errror "You should rename your library! libbest is the default library name and should be changed")
|
||||
endif
|
||||
|
||||
LIBAR=$(BINDIR)/$(LIBNAME).a
|
||||
TEMPLATE_DIR=$(ROOT)/template
|
||||
|
||||
clean-template:
|
||||
@echo Cleaning $(TEMPLATE_DIR)
|
||||
-$Drm -rf $(TEMPLATE_DIR)
|
||||
|
||||
$(LIBAR): $(call GETALLOBJ,$(EXCLUDE_SRC_FROM_LIB)) $(EXTRA_LIB_DEPS)
|
||||
-$Drm -f $@
|
||||
$(call test_output_2,Creating $@ ,$(AR) rcs $@ $^, $(DONE_STRING))
|
||||
|
||||
.PHONY: library
|
||||
library: $(LIBAR)
|
||||
|
||||
.PHONY: template
|
||||
template: clean-template $(LIBAR)
|
||||
$Dpros c create-template . $(LIBNAME) $(VERSION) $(foreach file,$(TEMPLATE_FILES) $(LIBAR),--system "$(file)") --target v5 $(CREATE_TEMPLATE_FLAGS)
|
||||
endif
|
||||
|
||||
# if project is a library source, compile the archive and link output.elf against the archive rather than source objects
|
||||
ifeq ($(IS_LIBRARY),1)
|
||||
ELF_DEPS+=$(filter-out $(call GETALLOBJ,$(EXCLUDE_SRC_FROM_LIB)), $(call GETALLOBJ,$(EXCLUDE_SRCDIRS)))
|
||||
LIBRARIES+=$(LIBAR)
|
||||
else
|
||||
ELF_DEPS+=$(call GETALLOBJ,$(EXCLUDE_SRCDIRS))
|
||||
endif
|
||||
|
||||
$(MONOLITH_BIN): $(MONOLITH_ELF) $(BINDIR)
|
||||
$(call test_output_2,Creating $@ for $(DEVICE) ,$(OBJCOPY) $< -O binary -R .hot_init $@,$(DONE_STRING))
|
||||
|
||||
$(MONOLITH_ELF): $(ELF_DEPS) $(LIBRARIES)
|
||||
$(call _pros_ld_timestamp)
|
||||
$(call test_output_2,Linking project with $(ARCHIVE_TEXT_LIST) ,$(LD) $(LDFLAGS) $(ELF_DEPS) $(LDTIMEOBJ) $(call wlprefix,-T$(FWDIR)/v5.ld $(LNK_FLAGS)) -o $@,$(OK_STRING))
|
||||
@echo Section sizes:
|
||||
-$(VV)$(SIZETOOL) $(SIZEFLAGS) $@ $(SIZES_SED) $(SIZES_NUMFMT)
|
||||
|
||||
$(COLD_BIN): $(COLD_ELF)
|
||||
$(call test_output_2,Creating cold package binary for $(DEVICE) ,$(OBJCOPY) $< -O binary -R .hot_init $@,$(DONE_STRING))
|
||||
|
||||
$(COLD_ELF): $(COLD_LIBRARIES)
|
||||
$(VV)mkdir -p $(dir $@)
|
||||
$(call test_output_2,Creating cold package with $(ARCHIVE_TEXT_LIST) ,$(LD) $(LDFLAGS) $(call wlprefix,--gc-keep-exported --whole-archive $^ -lstdc++ --no-whole-archive) $(call wlprefix,-T$(FWDIR)/v5.ld $(LNK_FLAGS) -o $@),$(OK_STRING))
|
||||
$(call test_output_2,Stripping cold package ,$(OBJCOPY) --strip-symbol=install_hot_table --strip-symbol=__libc_init_array --strip-symbol=_PROS_COMPILE_DIRECTORY --strip-symbol=_PROS_COMPILE_TIMESTAMP --strip-symbol=_PROS_COMPILE_TIMESTAMP_INT $@ $@, $(DONE_STRING))
|
||||
@echo Section sizes:
|
||||
-$(VV)$(SIZETOOL) $(SIZEFLAGS) $@ $(SIZES_SED) $(SIZES_NUMFMT)
|
||||
|
||||
$(HOT_BIN): $(HOT_ELF) $(COLD_BIN)
|
||||
$(call test_output_2,Creating $@ for $(DEVICE) ,$(OBJCOPY) $< -O binary $@,$(DONE_STRING))
|
||||
|
||||
$(HOT_ELF): $(COLD_ELF) $(ELF_DEPS)
|
||||
$(call _pros_ld_timestamp)
|
||||
$(call test_output_2,Linking hot project with $(COLD_ELF) and $(ARCHIVE_TEXT_LIST) ,$(LD) -nostartfiles $(LDFLAGS) $(call wlprefix,-R $<) $(filter-out $<,$^) $(LDTIMEOBJ) $(LIBRARIES) $(call wlprefix,-T$(FWDIR)/v5-hot.ld $(LNK_FLAGS) -o $@),$(OK_STRING))
|
||||
@printf "%s\n" "Section sizes:"
|
||||
-$(VV)$(SIZETOOL) $(SIZEFLAGS) $@ $(SIZES_SED) $(SIZES_NUMFMT)
|
||||
|
||||
define asm_rule
|
||||
$(BINDIR)/%.$1.o: $(SRCDIR)/%.$1
|
||||
$(VV)mkdir -p $$(dir $$@)
|
||||
$$(call test_output_2,Compiled $$< ,$(AS) -c $(ASMFLAGS) -o $$@ $$<,$(OK_STRING))
|
||||
endef
|
||||
$(foreach asmext,$(ASMEXTS),$(eval $(call asm_rule,$(asmext))))
|
||||
|
||||
define c_rule
|
||||
$(BINDIR)/%.$1.o: $(SRCDIR)/%.$1
|
||||
$(BINDIR)/%.$1.o: $(SRCDIR)/%.$1 $(DEPDIR)/$(basename $1).d
|
||||
$(VV)mkdir -p $$(dir $$@)
|
||||
$(MAKEDEPFOLDER)
|
||||
$$(call test_output_2,Compiled $$< ,$(CC) -c $(INCLUDE) -iquote"$(INCDIR)/$$(dir $$*)" $(CFLAGS) $(EXTRA_CFLAGS) $(DEPFLAGS) -o $$@ $$<,$(OK_STRING))
|
||||
$(RENAMEDEPENDENCYFILE)
|
||||
endef
|
||||
$(foreach cext,$(CEXTS),$(eval $(call c_rule,$(cext))))
|
||||
|
||||
define cxx_rule
|
||||
$(BINDIR)/%.$1.o: $(SRCDIR)/%.$1
|
||||
$(BINDIR)/%.$1.o: $(SRCDIR)/%.$1 $(DEPDIR)/$(basename %).d
|
||||
$(VV)mkdir -p $$(dir $$@)
|
||||
$(MAKEDEPFOLDER)
|
||||
$$(call test_output_2,Compiled $$< ,$(CXX) -c $(INCLUDE) -iquote"$(INCDIR)/$$(dir $$*)" $(CXXFLAGS) $(EXTRA_CXXFLAGS) $(DEPFLAGS) -o $$@ $$<,$(OK_STRING))
|
||||
$(RENAMEDEPENDENCYFILE)
|
||||
endef
|
||||
$(foreach cxxext,$(CXXEXTS),$(eval $(call cxx_rule,$(cxxext))))
|
||||
|
||||
define _pros_ld_timestamp
|
||||
$(VV)mkdir -p $(dir $(LDTIMEOBJ))
|
||||
@# Pipe a line of code defining _PROS_COMPILE_TOOLSTAMP and _PROS_COMPILE_DIRECTORY into GCC,
|
||||
@# which allows compilation from stdin. We define _PROS_COMPILE_DIRECTORY using a command line-defined macro
|
||||
@# which is the pwd | tail bit, which will truncate the path to the last 23 characters
|
||||
@#
|
||||
@# const int _PROS_COMPILE_TIMESTAMP_INT = $(( $(date +%s) - $(date +%z) * 3600 ))
|
||||
@# char const * const _PROS_COMPILE_TIEMSTAMP = __DATE__ " " __TIME__
|
||||
@# char const * const _PROS_COMPILE_DIRECTORY = "$(shell pwd | tail -c 23)";
|
||||
@#
|
||||
@# The shell command $$(($$(date +%s)+($$(date +%-z)/100*3600))) fetches the current
|
||||
@# unix timestamp, and then adds the UTC timezone offset to account for time zones.
|
||||
|
||||
$(call test_output_2,Adding timestamp ,echo 'const int _PROS_COMPILE_TIMESTAMP_INT = $(shell echo $$(($$(date +%s)+($$(date +%-z)/100*3600)))); char const * const _PROS_COMPILE_TIMESTAMP = __DATE__ " " __TIME__; char const * const _PROS_COMPILE_DIRECTORY = "$(wildcard $(shell pwd | tail -c 23))";' | $(CC) -c -x c $(CFLAGS) $(EXTRA_CFLAGS) -o $(LDTIMEOBJ) -,$(OK_STRING))
|
||||
endef
|
||||
|
||||
# these rules are for build-compile-commands, which just print out sysroot information
|
||||
cc-sysroot:
|
||||
@echo | $(CC) -c -x c $(CFLAGS) $(EXTRA_CFLAGS) --verbose -o /dev/null -
|
||||
cxx-sysroot:
|
||||
@echo | $(CXX) -c -x c++ $(CXXFLAGS) $(EXTRA_CXXFLAGS) --verbose -o /dev/null -
|
||||
|
||||
$(DEPDIR)/%.d: ;
|
||||
.PRECIOUS: $(DEPDIR)/%.d
|
||||
|
||||
include $(wildcard $(patsubst $(SRCDIR)/%,$(DEPDIR)/%.d,$(CSRC) $(CXXSRC)))
|
||||
BIN
firmware/libc.a
Normal file
BIN
firmware/libc.a
Normal file
Binary file not shown.
BIN
firmware/libm.a
Normal file
BIN
firmware/libm.a
Normal file
Binary file not shown.
BIN
firmware/libpros.a
Normal file
BIN
firmware/libpros.a
Normal file
Binary file not shown.
BIN
firmware/okapilib.a
Normal file
BIN
firmware/okapilib.a
Normal file
Binary file not shown.
1
firmware/squiggles.mk
Normal file
1
firmware/squiggles.mk
Normal file
|
|
@ -0,0 +1 @@
|
|||
INCLUDE+=-iquote"$(ROOT)/include/okapi/squiggles"
|
||||
263
firmware/v5-common.ld
Normal file
263
firmware/v5-common.ld
Normal file
|
|
@ -0,0 +1,263 @@
|
|||
/* Define the sections, and where they are mapped in memory */
|
||||
SECTIONS
|
||||
{
|
||||
/* This will get stripped out before uploading, but we need to place code
|
||||
here so we can at least link to it (install_hot_table) */
|
||||
.hot_init : {
|
||||
KEEP (*(.hot_magic))
|
||||
KEEP (*(.hot_init))
|
||||
} > HOT_MEMORY
|
||||
|
||||
.text : {
|
||||
KEEP (*(.vectors))
|
||||
/* boot data should be exactly 32 bytes long */
|
||||
*(.boot_data)
|
||||
. = 0x20;
|
||||
*(.boot)
|
||||
. = ALIGN(64);
|
||||
*(.freertos_vectors)
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.plt)
|
||||
*(.gnu_warning)
|
||||
*(.gcc_except_table)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.vfp11_veneer)
|
||||
*(.ARM.extab)
|
||||
*(.gnu.linkonce.armextab.*)
|
||||
} > RAM
|
||||
|
||||
.init : {
|
||||
KEEP (*(.init))
|
||||
} > RAM
|
||||
|
||||
.fini : {
|
||||
KEEP (*(.fini))
|
||||
} > RAM
|
||||
|
||||
.rodata : {
|
||||
__rodata_start = .;
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
*(.gnu.linkonce.r.*)
|
||||
__rodata_end = .;
|
||||
} > RAM
|
||||
|
||||
.rodata1 : {
|
||||
__rodata1_start = .;
|
||||
*(.rodata1)
|
||||
*(.rodata1.*)
|
||||
__rodata1_end = .;
|
||||
} > RAM
|
||||
|
||||
.sdata2 : {
|
||||
__sdata2_start = .;
|
||||
*(.sdata2)
|
||||
*(.sdata2.*)
|
||||
*(.gnu.linkonce.s2.*)
|
||||
__sdata2_end = .;
|
||||
} > RAM
|
||||
|
||||
.sbss2 : {
|
||||
__sbss2_start = .;
|
||||
*(.sbss2)
|
||||
*(.sbss2.*)
|
||||
*(.gnu.linkonce.sb2.*)
|
||||
__sbss2_end = .;
|
||||
} > RAM
|
||||
|
||||
.data : {
|
||||
__data_start = .;
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
*(.jcr)
|
||||
*(.got)
|
||||
*(.got.plt)
|
||||
__data_end = .;
|
||||
} > RAM
|
||||
|
||||
.data1 : {
|
||||
__data1_start = .;
|
||||
*(.data1)
|
||||
*(.data1.*)
|
||||
__data1_end = .;
|
||||
} > RAM
|
||||
|
||||
.got : {
|
||||
*(.got)
|
||||
} > RAM
|
||||
|
||||
.ctors : {
|
||||
__CTOR_LIST__ = .;
|
||||
___CTORS_LIST___ = .;
|
||||
KEEP (*crtbegin.o(.ctors))
|
||||
KEEP (*(EXCLUDE_FILE(*crtend.o) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
__CTOR_END__ = .;
|
||||
___CTORS_END___ = .;
|
||||
} > RAM
|
||||
|
||||
.dtors : {
|
||||
__DTOR_LIST__ = .;
|
||||
___DTORS_LIST___ = .;
|
||||
KEEP (*crtbegin.o(.dtors))
|
||||
KEEP (*(EXCLUDE_FILE(*crtend.o) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
__DTOR_END__ = .;
|
||||
___DTORS_END___ = .;
|
||||
} > RAM
|
||||
|
||||
.fixup : {
|
||||
__fixup_start = .;
|
||||
*(.fixup)
|
||||
__fixup_end = .;
|
||||
} > RAM
|
||||
|
||||
.eh_frame : {
|
||||
*(.eh_frame)
|
||||
} > RAM
|
||||
|
||||
.eh_framehdr : {
|
||||
__eh_framehdr_start = .;
|
||||
*(.eh_framehdr)
|
||||
__eh_framehdr_end = .;
|
||||
} > RAM
|
||||
|
||||
.gcc_except_table : {
|
||||
*(.gcc_except_table)
|
||||
} > RAM
|
||||
|
||||
.mmu_tbl (ALIGN(16384)) : {
|
||||
__mmu_tbl_start = .;
|
||||
*(.mmu_tbl)
|
||||
__mmu_tbl_end = .;
|
||||
} > RAM
|
||||
|
||||
.ARM.exidx : {
|
||||
__exidx_start = .;
|
||||
*(.ARM.exidx*)
|
||||
*(.gnu.linkonce.armexidix.*.*)
|
||||
__exidx_end = .;
|
||||
} > RAM
|
||||
|
||||
.preinit_array : {
|
||||
__preinit_array_start = .;
|
||||
KEEP (*(SORT(.preinit_array.*)))
|
||||
KEEP (*(.preinit_array))
|
||||
__preinit_array_end = .;
|
||||
} > RAM
|
||||
|
||||
.init_array : {
|
||||
__init_array_start = .;
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
__init_array_end = .;
|
||||
} > RAM
|
||||
|
||||
.fini_array : {
|
||||
__fini_array_start = .;
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
KEEP (*(.fini_array))
|
||||
__fini_array_end = .;
|
||||
} > RAM
|
||||
|
||||
.ARM.attributes : {
|
||||
__ARM.attributes_start = .;
|
||||
*(.ARM.attributes)
|
||||
__ARM.attributes_end = .;
|
||||
} > RAM
|
||||
|
||||
.sdata : {
|
||||
__sdata_start = .;
|
||||
*(.sdata)
|
||||
*(.sdata.*)
|
||||
*(.gnu.linkonce.s.*)
|
||||
__sdata_end = .;
|
||||
} > RAM
|
||||
|
||||
.sbss (NOLOAD) : {
|
||||
__sbss_start = .;
|
||||
*(.sbss)
|
||||
*(.sbss.*)
|
||||
*(.gnu.linkonce.sb.*)
|
||||
__sbss_end = .;
|
||||
} > RAM
|
||||
|
||||
.tdata : {
|
||||
__tdata_start = .;
|
||||
*(.tdata)
|
||||
*(.tdata.*)
|
||||
*(.gnu.linkonce.td.*)
|
||||
__tdata_end = .;
|
||||
} > RAM
|
||||
|
||||
.tbss : {
|
||||
__tbss_start = .;
|
||||
*(.tbss)
|
||||
*(.tbss.*)
|
||||
*(.gnu.linkonce.tb.*)
|
||||
__tbss_end = .;
|
||||
} > RAM
|
||||
|
||||
.bss (NOLOAD) : {
|
||||
__bss_start = .;
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
__bss_end = .;
|
||||
} > RAM
|
||||
|
||||
_SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 );
|
||||
|
||||
_SDA2_BASE_ = __sdata2_start + ((__sbss2_end - __sdata2_start) / 2 );
|
||||
|
||||
/* Generate Stack and Heap definitions */
|
||||
|
||||
.heap (NOLOAD) : {
|
||||
. = ALIGN(16);
|
||||
_heap = .;
|
||||
HeapBase = .;
|
||||
_heap_start = .;
|
||||
. += _HEAP_SIZE;
|
||||
_heap_end = .;
|
||||
HeapLimit = .;
|
||||
} > HEAP
|
||||
|
||||
.stack (NOLOAD) : {
|
||||
. = ALIGN(16);
|
||||
_stack_end = .;
|
||||
. += _STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
_stack = .;
|
||||
__stack = _stack;
|
||||
. = ALIGN(16);
|
||||
_irq_stack_end = .;
|
||||
. += _IRQ_STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
__irq_stack = .;
|
||||
_supervisor_stack_end = .;
|
||||
. += _SUPERVISOR_STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
__supervisor_stack = .;
|
||||
_abort_stack_end = .;
|
||||
. += _ABORT_STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
__abort_stack = .;
|
||||
_fiq_stack_end = .;
|
||||
. += _FIQ_STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
__fiq_stack = .;
|
||||
_undef_stack_end = .;
|
||||
. += _UNDEF_STACK_SIZE;
|
||||
. = ALIGN(16);
|
||||
__undef_stack = .;
|
||||
} > COLD_MEMORY
|
||||
|
||||
_end = .;
|
||||
}
|
||||
33
firmware/v5-hot.ld
Normal file
33
firmware/v5-hot.ld
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/* This stack is used during initialization, but FreeRTOS tasks have their own
|
||||
stack allocated in BSS or Heap (kernel tasks in FreeRTOS .bss heap; user tasks
|
||||
in standard heap) */
|
||||
_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x2000;
|
||||
|
||||
_ABORT_STACK_SIZE = DEFINED(_ABORT_STACK_SIZE) ? _ABORT_STACK_SIZE : 1024;
|
||||
_SUPERVISOR_STACK_SIZE = DEFINED(_SUPERVISOR_STACK_SIZE) ? _SUPERVISOR_STACK_SIZE : 2048;
|
||||
_IRQ_STACK_SIZE = DEFINED(_IRQ_STACK_SIZE) ? _IRQ_STACK_SIZE : 1024;
|
||||
_FIQ_STACK_SIZE = DEFINED(_FIQ_STACK_SIZE) ? _FIQ_STACK_SIZE : 1024;
|
||||
_UNDEF_STACK_SIZE = DEFINED(_UNDEF_STACK_SIZE) ? _UNDEF_STACK_SIZE : 1024;
|
||||
|
||||
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x02E00000; /* ~48 MB */
|
||||
|
||||
/* Define Memories in the system */
|
||||
start_of_cold_mem = 0x03800000;
|
||||
_COLD_MEM_SIZE = 0x04800000;
|
||||
end_of_cold_mem = start_of_cold_mem + _COLD_MEM_SIZE;
|
||||
|
||||
start_of_hot_mem = 0x07800000;
|
||||
_HOT_MEM_SIZE = 0x00800000;
|
||||
end_of_hot_mem = start_of_hot_mem + _HOT_MEM_SIZE;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
/* user code 72M */
|
||||
COLD_MEMORY : ORIGIN = start_of_cold_mem, LENGTH = _COLD_MEM_SIZE /* Just under 19 MB */
|
||||
HEAP : ORIGIN = 0x04A00000, LENGTH = _HEAP_SIZE
|
||||
HOT_MEMORY : ORIGIN = start_of_hot_mem, LENGTH = _HOT_MEM_SIZE /* Just over 8 MB */
|
||||
}
|
||||
|
||||
REGION_ALIAS("RAM", HOT_MEMORY);
|
||||
|
||||
ENTRY(install_hot_table)
|
||||
33
firmware/v5.ld
Normal file
33
firmware/v5.ld
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/* This stack is used during initialization, but FreeRTOS tasks have their own
|
||||
stack allocated in BSS or Heap (kernel tasks in FreeRTOS .bss heap; user tasks
|
||||
in standard heap) */
|
||||
_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x2000;
|
||||
|
||||
_ABORT_STACK_SIZE = DEFINED(_ABORT_STACK_SIZE) ? _ABORT_STACK_SIZE : 1024;
|
||||
_SUPERVISOR_STACK_SIZE = DEFINED(_SUPERVISOR_STACK_SIZE) ? _SUPERVISOR_STACK_SIZE : 2048;
|
||||
_IRQ_STACK_SIZE = DEFINED(_IRQ_STACK_SIZE) ? _IRQ_STACK_SIZE : 1024;
|
||||
_FIQ_STACK_SIZE = DEFINED(_FIQ_STACK_SIZE) ? _FIQ_STACK_SIZE : 1024;
|
||||
_UNDEF_STACK_SIZE = DEFINED(_UNDEF_STACK_SIZE) ? _UNDEF_STACK_SIZE : 1024;
|
||||
|
||||
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x02E00000; /* ~48 MB */
|
||||
|
||||
/* Define Memories in the system */
|
||||
start_of_cold_mem = 0x03800000;
|
||||
_COLD_MEM_SIZE = 0x04800000;
|
||||
end_of_cold_mem = start_of_cold_mem + _COLD_MEM_SIZE;
|
||||
|
||||
start_of_hot_mem = 0x07800000;
|
||||
_HOT_MEM_SIZE = 0x00800000;
|
||||
end_of_hot_mem = start_of_hot_mem + _HOT_MEM_SIZE;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
/* user code 72M */
|
||||
COLD_MEMORY : ORIGIN = start_of_cold_mem, LENGTH = _COLD_MEM_SIZE /* Just under 19 MB */
|
||||
HEAP : ORIGIN = 0x04A00000, LENGTH = _HEAP_SIZE
|
||||
HOT_MEMORY : ORIGIN = start_of_hot_mem, LENGTH = _HOT_MEM_SIZE /* Just over 8 MB */
|
||||
}
|
||||
|
||||
REGION_ALIAS("RAM", COLD_MEMORY);
|
||||
|
||||
ENTRY(vexStartup)
|
||||
80
include/api.h
Normal file
80
include/api.h
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
/**
|
||||
* \file api.h
|
||||
*
|
||||
* PROS API header provides high-level user functionality
|
||||
*
|
||||
* Contains declarations for use by typical VEX programmers using PROS.
|
||||
*
|
||||
* This file should not be modified by users, since it gets replaced whenever
|
||||
* a kernel upgrade occurs.
|
||||
*
|
||||
* \copyright Copyright (c) 2017-2023, Purdue University ACM SIGBots.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef _PROS_API_H_
|
||||
#define _PROS_API_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <cerrno>
|
||||
#include <cmath>
|
||||
#include <cstdbool>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#else /* (not) __cplusplus */
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define PROS_VERSION_MAJOR 3
|
||||
#define PROS_VERSION_MINOR 8
|
||||
#define PROS_VERSION_PATCH 0
|
||||
#define PROS_VERSION_STRING "3.8.0"
|
||||
|
||||
#include "pros/adi.h"
|
||||
#include "pros/colors.h"
|
||||
#include "pros/distance.h"
|
||||
#include "pros/error.h"
|
||||
#include "pros/ext_adi.h"
|
||||
#include "pros/gps.h"
|
||||
#include "pros/imu.h"
|
||||
#include "pros/link.h"
|
||||
#include "pros/llemu.h"
|
||||
#include "pros/misc.h"
|
||||
#include "pros/motors.h"
|
||||
#include "pros/optical.h"
|
||||
#include "pros/rtos.h"
|
||||
#include "pros/rotation.h"
|
||||
#include "pros/screen.h"
|
||||
#include "pros/vision.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "pros/adi.hpp"
|
||||
#include "pros/distance.hpp"
|
||||
#include "pros/gps.hpp"
|
||||
#include "pros/imu.hpp"
|
||||
#include "pros/llemu.hpp"
|
||||
#include "pros/misc.hpp"
|
||||
#include "pros/motors.hpp"
|
||||
#include "pros/optical.hpp"
|
||||
#include "pros/rotation.hpp"
|
||||
#include "pros/rtos.hpp"
|
||||
#include "pros/screen.hpp"
|
||||
#include "pros/vision.hpp"
|
||||
#include "pros/link.hpp"
|
||||
#endif
|
||||
|
||||
#endif // _PROS_API_H_
|
||||
71
include/display/README.md
Normal file
71
include/display/README.md
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
# Littlev Graphics Libraray
|
||||
|
||||

|
||||
|
||||
LittlevGL provides everything you need to create a Graphical User Interface (GUI) on embedded systems with easy-to-use graphical elements, beautiful visual effects and low memory footprint.
|
||||
|
||||
Homepage: https://littlevgl.com
|
||||
|
||||
### Table Of Content
|
||||
* [Key features](#key-features)
|
||||
* [Porting](#porting)
|
||||
* [Project set-up](#project-set-up)
|
||||
* [PC simulator](#pc-simulator)
|
||||
* [Screenshots](#screenshots)
|
||||
* [Contributing](#contributing)
|
||||
* [Donate](#donate)
|
||||
|
||||
## Key features
|
||||
* Powerful building blocks buttons, charts, lists, sliders, images etc
|
||||
* Advanced graphics with animations, anti-aliasing, opacity, smooth scrolling
|
||||
* Various input devices touch pad, mouse, keyboard, encoder, buttons etc
|
||||
* Multi language support with UTF-8 decoding
|
||||
* Fully customizable graphical elements
|
||||
* Hardware independent to use with any microcontroller or display
|
||||
* Scalable to operate with few memory (50 kB Flash, 10 kB RAM)
|
||||
* OS, External memory and GPU supported but not required
|
||||
* Single frame buffer operation even with advances graphical effects
|
||||
* Written in C for maximal compatibility
|
||||
* Simulator to develop on PC without embedded hardware
|
||||
* Tutorials, examples, themes for rapid development
|
||||
* Documentation and API references online
|
||||
|
||||
## Porting
|
||||
In the most sime case you need 4 things:
|
||||
1. Call `lv_tick_inc(1)` in every millisecods in a Timer or Task
|
||||
2. Register a function which can **copy a pixel array** to an area of the screen
|
||||
3. Register a function which can **read an input device**. (E.g. touch pad)
|
||||
4. Call `lv_task_handler()` periodically in every few milliseconds
|
||||
For more information visit https://littlevgl.com/porting
|
||||
|
||||
## Project set-up
|
||||
1. **Clone** or [Download](https://littlevgl.com/download) the lvgl repository: `git clone https://github.com/littlevgl/lvgl.git`
|
||||
2. **Create project** with your preferred IDE and add the *lvgl* folder
|
||||
3. Copy **lvgl/lv_conf_templ.h** as **lv_conf.h** next to the *lvgl* folder
|
||||
4. In the lv_conf.h delete the first `#if 0` and its `#endif`. Let the default configurations at first.
|
||||
5. In your *main.c*: #include "lvgl/lvgl.h"
|
||||
6. In your *main function*:
|
||||
* lvgl_init();
|
||||
* tick, display and input device initialization (see above)
|
||||
7. To **test** create a label: `lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);`
|
||||
8. In the main *while(1)* call `lv_task_handler();` and make a few milliseconds delay (e.g. `my_delay_ms(5);`)
|
||||
9. Compile the code and load it to your embedded hardware
|
||||
|
||||
## PC Simulator
|
||||
If you don't have got an embedded hardware you can test the graphics library in a PC simulator. The simulator uses [SDL2](https://www.libsdl.org/) to emulate a display on your monitor and a touch pad with your mouse.
|
||||
|
||||
There is a pre-configured PC project for **Eclipse CDT** in this repository: https://github.com/littlevgl/pc_simulator
|
||||
|
||||
## Screenshots
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## Contributing
|
||||
See [CONTRIBUTING.md](https://github.com/littlevgl/lvgl/blob/master/docs/CONTRIBUTING.md)
|
||||
|
||||
## Donate
|
||||
If you are pleased with the graphics library, found it useful or be happy with the support you got, please help its further development:
|
||||
|
||||
[](https://littlevgl.com/donate)
|
||||
8
include/display/licence.txt
Normal file
8
include/display/licence.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
MIT licence
|
||||
Copyright (c) 2016 Gábor Kiss-Vámosi
|
||||
|
||||
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.
|
||||
341
include/display/lv_conf.h
Normal file
341
include/display/lv_conf.h
Normal file
|
|
@ -0,0 +1,341 @@
|
|||
/**
|
||||
* @file lv_conf.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_CONF_H
|
||||
#define LV_CONF_H
|
||||
|
||||
/*----------------
|
||||
* Dynamic memory
|
||||
*----------------*/
|
||||
|
||||
/* Memory size which will be used by the library
|
||||
* to store the graphical objects and other data */
|
||||
#define LV_MEM_CUSTOM \
|
||||
1 /*1: use custom malloc/free, 0: use the built-in \
|
||||
lv_mem_alloc/lv_mem_free*/
|
||||
#if LV_MEM_CUSTOM == 0
|
||||
#define LV_MEM_SIZE \
|
||||
(32U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
|
||||
#define LV_MEM_ATTR /*Complier prefix for big array declaration*/
|
||||
#define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/
|
||||
#else /*LV_MEM_CUSTOM*/
|
||||
#define LV_MEM_CUSTOM_INCLUDE \
|
||||
"kapi.h" /*Header for the dynamic memory function*/
|
||||
#define LV_MEM_CUSTOM_ALLOC kmalloc /*Wrapper to malloc*/
|
||||
#define LV_MEM_CUSTOM_FREE kfree /*Wrapper to free*/
|
||||
#endif /*LV_MEM_CUSTOM*/
|
||||
#define LV_ENABLE_GC 0
|
||||
|
||||
/*===================
|
||||
Graphical settings
|
||||
*===================*/
|
||||
|
||||
/* Horizontal and vertical resolution of the library.*/
|
||||
#define LV_HOR_RES (480)
|
||||
#define LV_VER_RES (240)
|
||||
#define LV_DPI 126
|
||||
|
||||
/* Size of VDB (Virtual Display Buffer: the internal graphics buffer).
|
||||
* Required for buffered drawing, opacity and anti-aliasing
|
||||
* VDB makes the double buffering, you don't need to deal with it!
|
||||
* Typical size: ~1/10 screen */
|
||||
#define LV_VDB_SIZE \
|
||||
(LV_VER_RES * \
|
||||
LV_HOR_RES) /*Size of VDB in pixel count (1/10 screen size is good for \
|
||||
first)*/
|
||||
#define LV_VDB_ADR \
|
||||
0 /*Place VDB to a specific address (e.g. in external RAM) (0: allocate \
|
||||
automatically into RAM)*/
|
||||
|
||||
/* Use two Virtual Display buffers (VDB) parallelize rendering and flushing
|
||||
* (optional)
|
||||
* The flushing should use DMA to write the frame buffer in the background*/
|
||||
#define LV_VDB_DOUBLE 0 /*1: Enable the use of 2 VDBs*/
|
||||
#define LV_VDB2_ADR \
|
||||
0 /*Place VDB2 to a specific address (e.g. in external RAM) (0: allocate \
|
||||
automatically into RAM)*/
|
||||
|
||||
/* Enable anti-aliasing (lines, and radiuses will be smoothed) */
|
||||
#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/
|
||||
|
||||
/*Screen refresh settings*/
|
||||
#define LV_REFR_PERIOD 40 /*Screen refresh period in milliseconds*/
|
||||
#define LV_INV_FIFO_SIZE 32 /*The average count of objects on a screen */
|
||||
|
||||
/*=================
|
||||
Misc. setting
|
||||
*=================*/
|
||||
|
||||
/*Input device settings*/
|
||||
#define LV_INDEV_READ_PERIOD 50 /*Input device read period in milliseconds*/
|
||||
#define LV_INDEV_POINT_MARKER \
|
||||
0 /*Mark the pressed points (required: USE_LV_REAL_DRAW = 1)*/
|
||||
#define LV_INDEV_DRAG_LIMIT 10 /*Drag threshold in pixels */
|
||||
#define LV_INDEV_DRAG_THROW \
|
||||
20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */
|
||||
#define LV_INDEV_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/
|
||||
#define LV_INDEV_LONG_PRESS_REP_TIME \
|
||||
100 /*Repeated trigger period in long press [ms] */
|
||||
|
||||
/*Color settings*/
|
||||
#define LV_COLOR_DEPTH 32 /*Color depth: 1/8/16/24*/
|
||||
#define LV_COLOR_TRANSP \
|
||||
LV_COLOR_LIME /*Images pixels with this color will not be drawn (with chroma \
|
||||
keying)*/
|
||||
|
||||
/*Text settings*/
|
||||
#define LV_TXT_UTF8 1 /*Enable UTF-8 coded Unicode character usage */
|
||||
#define LV_TXT_BREAK_CHARS " ,.;:-_" /*Can break texts on these chars*/
|
||||
#define LV_TXT_LINE_BREAK_LONG_LEN 12
|
||||
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3
|
||||
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 1
|
||||
|
||||
/*Graphics feature usage*/
|
||||
#define USE_LV_ANIMATION 1 /*1: Enable all animations*/
|
||||
#define USE_LV_SHADOW 1 /*1: Enable shadows*/
|
||||
#define USE_LV_GROUP 1 /*1: Enable object groups (for keyboards)*/
|
||||
#define USE_LV_GPU 0 /*1: Enable GPU interface*/
|
||||
#define USE_LV_REAL_DRAW \
|
||||
1 /*1: Enable function which draw directly to the frame buffer instead of \
|
||||
VDB (required if LV_VDB_SIZE = 0)*/
|
||||
#define USE_LV_FILESYSTEM 1 /*1: Enable file system (required by images*/
|
||||
#define USE_LV_MULTI_LANG 1
|
||||
|
||||
/*Compiler attributes*/
|
||||
#define LV_ATTRIBUTE_TICK_INC /* Define a custom attribute to tick increment \
|
||||
function */
|
||||
#define LV_ATTRIBUTE_TASK_HANDLER
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN
|
||||
#define LV_COMPILER_VLA_SUPPORTED 1
|
||||
#define LV_COMPILER_NON_CONST_INIT_SUPPORTED 1
|
||||
|
||||
#define USE_LV_LOG 0
|
||||
/*================
|
||||
* THEME USAGE
|
||||
*================*/
|
||||
#define LV_THEME_LIVE_UPDATE 1
|
||||
#define USE_LV_THEME_TEMPL 0 /*Just for test*/
|
||||
#define USE_LV_THEME_DEFAULT 0 /*Built mainly from the built-in styles. Consumes very few RAM*/
|
||||
#define USE_LV_THEME_ALIEN 1 /*Dark futuristic theme*/
|
||||
#define USE_LV_THEME_NIGHT 1 /*Dark elegant theme*/
|
||||
#define USE_LV_THEME_MONO 1 /*Mono color theme for monochrome displays*/
|
||||
#define USE_LV_THEME_MATERIAL 1 /*Flat theme with bold colors and light shadows*/
|
||||
#define USE_LV_THEME_ZEN 1 /*Peaceful, mainly light theme */
|
||||
|
||||
/*==================
|
||||
* FONT USAGE
|
||||
*===================*/
|
||||
|
||||
/* More info about fonts: https://littlevgl.com/basics#fonts
|
||||
* To enable a built-in font use 1,2,4 or 8 values
|
||||
* which will determine the bit-per-pixel */
|
||||
#define LV_FONT_DEFAULT \
|
||||
&lv_font_dejavu_20 /*Always set a default font from the built-in fonts*/
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_10 4
|
||||
#define USE_LV_FONT_DEJAVU_10_LATIN_SUP 4
|
||||
#define USE_LV_FONT_DEJAVU_10_CYRILLIC 4
|
||||
#define USE_LV_FONT_SYMBOL_10 4
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_20 4
|
||||
#define USE_LV_FONT_DEJAVU_20_LATIN_SUP 4
|
||||
#define USE_LV_FONT_DEJAVU_20_CYRILLIC 4
|
||||
#define USE_LV_FONT_SYMBOL_20 4
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_30 0
|
||||
#define USE_LV_FONT_DEJAVU_30_LATIN_SUP 0
|
||||
#define USE_LV_FONT_DEJAVU_30_CYRILLIC 0
|
||||
#define USE_LV_FONT_SYMBOL_30 0
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_40 0
|
||||
#define USE_LV_FONT_DEJAVU_40_LATIN_SUP 0
|
||||
#define USE_LV_FONT_DEJAVU_40_CYRILLIC 0
|
||||
#define USE_LV_FONT_SYMBOL_40 0
|
||||
|
||||
/* PROS adds the mono variant of DejaVu sans */
|
||||
#define USE_PROS_FONT_DEJAVU_MONO_10 4
|
||||
#define USE_PROS_FONT_DEJAVU_MONO_10_LATIN_SUP 4
|
||||
|
||||
#define USE_PROS_FONT_DEJAVU_MONO_20 4
|
||||
#define USE_PROS_FONT_DEJAVU_MONO_LATIN_SUP_20 4
|
||||
|
||||
#define USE_PROS_FONT_DEJAVU_MONO_30 0
|
||||
#define USE_PROS_FONT_DEJAVU_MONO_30_LATIN_SUP 0
|
||||
|
||||
#define USE_PROS_FONT_DEJAVU_MONO_40 0
|
||||
#define USE_PROS_FONT_DEJAVU_MONO_40_LATIN_SUP 0
|
||||
|
||||
/*===================
|
||||
* LV_OBJ SETTINGS
|
||||
*==================*/
|
||||
#define LV_OBJ_FREE_NUM_TYPE \
|
||||
uint32_t /*Type of free number attribute (comment out disable free number)*/
|
||||
#define LV_OBJ_FREE_PTR 1 /*Enable the free pointer attribute*/
|
||||
|
||||
/*==================
|
||||
* LV OBJ X USAGE
|
||||
*================*/
|
||||
/*
|
||||
* Documentation of the object types: https://littlevgl.com/object-types
|
||||
*/
|
||||
|
||||
/*****************
|
||||
* Simple object
|
||||
*****************/
|
||||
|
||||
/*Label (dependencies: -*/
|
||||
#define USE_LV_LABEL 1
|
||||
#if USE_LV_LABEL != 0
|
||||
#define LV_LABEL_SCROLL_SPEED \
|
||||
25 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_SCROLL/ROLL' \
|
||||
mode*/
|
||||
#endif
|
||||
|
||||
/*Image (dependencies: lv_label*/
|
||||
#define USE_LV_IMG 1
|
||||
#if USE_LV_IMG != 0
|
||||
# define LV_IMG_CF_INDEXED 1
|
||||
# define LV_IMG_CF_ALPHA 1
|
||||
#endif
|
||||
|
||||
/*Line (dependencies: -*/
|
||||
#define USE_LV_LINE 1
|
||||
#define USE_LV_ARC 1
|
||||
|
||||
/*******************
|
||||
* Container objects
|
||||
*******************/
|
||||
|
||||
/*Container (dependencies: -*/
|
||||
#define USE_LV_CONT 1
|
||||
|
||||
/*Page (dependencies: lv_cont)*/
|
||||
#define USE_LV_PAGE 1
|
||||
|
||||
/*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
|
||||
#define USE_LV_WIN 1
|
||||
|
||||
/*Tab (dependencies: lv_page, lv_btnm)*/
|
||||
#define USE_LV_TABVIEW 1
|
||||
#if USE_LV_TABVIEW != 0
|
||||
#define LV_TABVIEW_ANIM_TIME \
|
||||
300 /*Time of slide animation [ms] (0: no animation)*/
|
||||
#endif
|
||||
#define USE_LV_TILEVIEW 1
|
||||
#if USE_LV_TILEVIEW
|
||||
# define LV_TILEVIEW_ANIM_TIME 300
|
||||
#endif
|
||||
|
||||
|
||||
/*************************
|
||||
* Data visualizer objects
|
||||
*************************/
|
||||
|
||||
/*Bar (dependencies: -)*/
|
||||
#define USE_LV_BAR 1
|
||||
|
||||
/*Line meter (dependencies: *;)*/
|
||||
#define USE_LV_LMETER 1
|
||||
|
||||
/*Gauge (dependencies:bar, lmeter)*/
|
||||
#define USE_LV_GAUGE 1
|
||||
|
||||
/*Chart (dependencies: -)*/
|
||||
#define USE_LV_CHART 1
|
||||
|
||||
#define USE_LV_TABLE 1
|
||||
#if USE_LV_TABLE
|
||||
# define LV_TABLE_COL_MAX 12
|
||||
#endif
|
||||
|
||||
/*LED (dependencies: -)*/
|
||||
#define USE_LV_LED 1
|
||||
|
||||
/*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/
|
||||
#define USE_LV_MBOX 1
|
||||
|
||||
/*Text area (dependencies: lv_label, lv_page)*/
|
||||
#define USE_LV_TA 1
|
||||
#if USE_LV_TA != 0
|
||||
#define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
|
||||
#define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
|
||||
#endif
|
||||
|
||||
#define USE_LV_SPINBOX 1
|
||||
#define USE_LV_CALENDAR 1
|
||||
|
||||
#define USE_PRELOAD 1
|
||||
#if USE_LV_PRELOAD != 0
|
||||
# define LV_PRELOAD_DEF_ARC_LENGTH 60
|
||||
# define LV_PRELOAD_DEF_SPIN_TIME 1000
|
||||
# define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
|
||||
#endif
|
||||
|
||||
#define USE_LV_CANVAS 1
|
||||
/*************************
|
||||
* User input objects
|
||||
*************************/
|
||||
|
||||
/*Button (dependencies: lv_cont*/
|
||||
#define USE_LV_BTN 1
|
||||
#if USE_LV_BTN != 0
|
||||
# define LV_BTN_INK_EFFECT 1
|
||||
#endif
|
||||
|
||||
#define USE_LV_IMGBTN 1
|
||||
#if USE_LV_IMGBTN
|
||||
# define LV_IMGBTN_TILED 0
|
||||
#endif
|
||||
|
||||
/*Button matrix (dependencies: -)*/
|
||||
#define USE_LV_BTNM 1
|
||||
|
||||
/*Keyboard (dependencies: lv_btnm)*/
|
||||
#define USE_LV_KB 1
|
||||
|
||||
/*Check box (dependencies: lv_btn, lv_label)*/
|
||||
#define USE_LV_CB 1
|
||||
|
||||
/*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons
|
||||
* ))*/
|
||||
#define USE_LV_LIST 1
|
||||
#if USE_LV_LIST != 0
|
||||
#define LV_LIST_FOCUS_TIME \
|
||||
100 /*Default animation time of focusing to a list element [ms] (0: no \
|
||||
animation) */
|
||||
#endif
|
||||
|
||||
/*Drop down list (dependencies: lv_page, lv_label)*/
|
||||
#define USE_LV_DDLIST 1
|
||||
#if USE_LV_DDLIST != 0
|
||||
#define LV_DDLIST_ANIM_TIME \
|
||||
200 /*Open and close default animation time [ms] (0: no animation)*/
|
||||
#endif
|
||||
|
||||
/*Roller (dependencies: lv_ddlist)*/
|
||||
#define USE_LV_ROLLER 1
|
||||
#if USE_LV_ROLLER != 0
|
||||
#define LV_ROLLER_ANIM_TIME \
|
||||
200 /*Focus animation time [ms] (0: no \
|
||||
animation)*/
|
||||
#endif
|
||||
|
||||
/*Slider (dependencies: lv_bar)*/
|
||||
#define USE_LV_SLIDER 1
|
||||
|
||||
/*Switch (dependencies: lv_slider)*/
|
||||
#define USE_LV_SW 1
|
||||
|
||||
#if LV_INDEV_DRAG_THROW <= 0
|
||||
#warning "LV_INDEV_DRAG_THROW must be greater than 0"
|
||||
#undef LV_INDEV_DRAG_THROW
|
||||
#define LV_INDEV_DRAG_THROW 1
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
|
||||
# define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
#include "display/lv_conf_checker.h"
|
||||
#endif /*LV_CONF_H*/
|
||||
664
include/display/lv_conf_checker.h
Normal file
664
include/display/lv_conf_checker.h
Normal file
|
|
@ -0,0 +1,664 @@
|
|||
/**
|
||||
* GENERATED FILE, DO NOT EDIT IT!
|
||||
* @file lv_conf_checker.h
|
||||
* Make sure all the defines of lv_conf.h have a default value
|
||||
**/
|
||||
|
||||
#ifndef LV_CONF_CHECKER_H
|
||||
#define LV_CONF_CHECKER_H
|
||||
/*===================
|
||||
Dynamic memory
|
||||
*===================*/
|
||||
|
||||
/* Memory size which will be used by the library
|
||||
* to store the graphical objects and other data */
|
||||
#ifndef LV_MEM_CUSTOM
|
||||
#define LV_MEM_CUSTOM 0 /*1: use custom malloc/free, 0: use the built-in lv_mem_alloc/lv_mem_free*/
|
||||
#endif
|
||||
#if LV_MEM_CUSTOM == 0
|
||||
#ifndef LV_MEM_SIZE
|
||||
# define LV_MEM_SIZE (64U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
|
||||
#endif
|
||||
#ifndef LV_MEM_ATTR
|
||||
# define LV_MEM_ATTR /*Complier prefix for big array declaration*/
|
||||
#endif
|
||||
#ifndef LV_MEM_ADR
|
||||
# define LV_MEM_ADR 0 /*Set an address for memory pool instead of allocation it as an array. Can be in external SRAM too.*/
|
||||
#endif
|
||||
#ifndef LV_MEM_AUTO_DEFRAG
|
||||
# define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/
|
||||
#endif
|
||||
#else /*LV_MEM_CUSTOM*/
|
||||
#ifndef LV_MEM_CUSTOM_INCLUDE
|
||||
# define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
|
||||
#endif
|
||||
#ifndef LV_MEM_CUSTOM_ALLOC
|
||||
# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
|
||||
#endif
|
||||
#ifndef LV_MEM_CUSTOM_FREE
|
||||
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
|
||||
#endif
|
||||
#endif /*LV_MEM_CUSTOM*/
|
||||
|
||||
/* Garbage Collector settings
|
||||
* Used if lvgl is binded to higher language and the memory is managed by that language */
|
||||
#ifndef LV_ENABLE_GC
|
||||
#define LV_ENABLE_GC 0
|
||||
#endif
|
||||
#if LV_ENABLE_GC != 0
|
||||
#ifndef LV_MEM_CUSTOM_REALLOC
|
||||
# define LV_MEM_CUSTOM_REALLOC your_realloc /*Wrapper to realloc*/
|
||||
#endif
|
||||
#ifndef LV_MEM_CUSTOM_GET_SIZE
|
||||
# define LV_MEM_CUSTOM_GET_SIZE your_mem_get_size /*Wrapper to lv_mem_get_size*/
|
||||
#endif
|
||||
#ifndef LV_GC_INCLUDE
|
||||
# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
|
||||
#endif
|
||||
#endif /* LV_ENABLE_GC */
|
||||
|
||||
/*===================
|
||||
Graphical settings
|
||||
*===================*/
|
||||
|
||||
/* Horizontal and vertical resolution of the library.*/
|
||||
#ifndef LV_HOR_RES
|
||||
#define LV_HOR_RES (480)
|
||||
#endif
|
||||
#ifndef LV_VER_RES
|
||||
#define LV_VER_RES (320)
|
||||
#endif
|
||||
|
||||
/* Dot Per Inch: used to initialize default sizes. E.g. a button with width = LV_DPI / 2 -> half inch wide
|
||||
* (Not so important, you can adjust it to modify default sizes and spaces)*/
|
||||
#ifndef LV_DPI
|
||||
#define LV_DPI 100
|
||||
#endif
|
||||
|
||||
/* Enable anti-aliasing (lines, and radiuses will be smoothed) */
|
||||
#ifndef LV_ANTIALIAS
|
||||
#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/
|
||||
#endif
|
||||
|
||||
/*Screen refresh period in milliseconds*/
|
||||
#ifndef LV_REFR_PERIOD
|
||||
#define LV_REFR_PERIOD 30
|
||||
#endif
|
||||
|
||||
/*-----------------
|
||||
* VDB settings
|
||||
*----------------*/
|
||||
|
||||
/* VDB (Virtual Display Buffer) is an internal graphics buffer.
|
||||
* The GUI will be drawn into this buffer first and then
|
||||
* the buffer will be passed to your `disp_drv.disp_flush` function to
|
||||
* copy it to your frame buffer.
|
||||
* VDB is required for: buffered drawing, opacity, anti-aliasing and shadows
|
||||
* Learn more: https://docs.littlevgl.com/#Drawing*/
|
||||
|
||||
/* Size of the VDB in pixels. Typical size: ~1/10 screen. Must be >= LV_HOR_RES
|
||||
* Setting it to 0 will disable VDB and `disp_drv.disp_fill` and `disp_drv.disp_map` functions
|
||||
* will be called to draw to the frame buffer directly*/
|
||||
#ifndef LV_VDB_SIZE
|
||||
#define LV_VDB_SIZE ((LV_VER_RES * LV_HOR_RES) / 10)
|
||||
#endif
|
||||
|
||||
/* Bit-per-pixel of VDB. Useful for monochrome or non-standard color format displays.
|
||||
* Special formats are handled with `disp_drv.vdb_wr`)*/
|
||||
#ifndef LV_VDB_PX_BPP
|
||||
#define LV_VDB_PX_BPP LV_COLOR_SIZE /*LV_COLOR_SIZE comes from LV_COLOR_DEPTH below to set 8, 16 or 32 bit pixel size automatically */
|
||||
#endif
|
||||
|
||||
/* Place VDB to a specific address (e.g. in external RAM)
|
||||
* 0: allocate automatically into RAM
|
||||
* LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`*/
|
||||
#ifndef LV_VDB_ADR
|
||||
#define LV_VDB_ADR 0
|
||||
#endif
|
||||
|
||||
/* Use two Virtual Display buffers (VDB) to parallelize rendering and flushing
|
||||
* The flushing should use DMA to write the frame buffer in the background */
|
||||
#ifndef LV_VDB_DOUBLE
|
||||
#define LV_VDB_DOUBLE 0
|
||||
#endif
|
||||
|
||||
/* Place VDB2 to a specific address (e.g. in external RAM)
|
||||
* 0: allocate automatically into RAM
|
||||
* LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`*/
|
||||
#ifndef LV_VDB2_ADR
|
||||
#define LV_VDB2_ADR 0
|
||||
#endif
|
||||
|
||||
/* Using true double buffering in `disp_drv.disp_flush` you will always get the image of the whole screen.
|
||||
* Your only task is to set the rendered image (`color_p` parameter) as frame buffer address or send it to your display.
|
||||
* The best if you do in the blank period of you display to avoid tearing effect.
|
||||
* Requires:
|
||||
* - LV_VDB_SIZE = LV_HOR_RES * LV_VER_RES
|
||||
* - LV_VDB_DOUBLE = 1
|
||||
*/
|
||||
#ifndef LV_VDB_TRUE_DOUBLE_BUFFERED
|
||||
#define LV_VDB_TRUE_DOUBLE_BUFFERED 0
|
||||
#endif
|
||||
|
||||
/*=================
|
||||
Misc. setting
|
||||
*=================*/
|
||||
|
||||
/*Input device settings*/
|
||||
#ifndef LV_INDEV_READ_PERIOD
|
||||
#define LV_INDEV_READ_PERIOD 50 /*Input device read period in milliseconds*/
|
||||
#endif
|
||||
#ifndef LV_INDEV_POINT_MARKER
|
||||
#define LV_INDEV_POINT_MARKER 0 /*Mark the pressed points (required: USE_LV_REAL_DRAW = 1)*/
|
||||
#endif
|
||||
#ifndef LV_INDEV_DRAG_LIMIT
|
||||
#define LV_INDEV_DRAG_LIMIT 10 /*Drag threshold in pixels */
|
||||
#endif
|
||||
#ifndef LV_INDEV_DRAG_THROW
|
||||
#define LV_INDEV_DRAG_THROW 20 /*Drag throw slow-down in [%] (must be > 0). Greater value means faster slow-down */
|
||||
#endif
|
||||
#ifndef LV_INDEV_LONG_PRESS_TIME
|
||||
#define LV_INDEV_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/
|
||||
#endif
|
||||
#ifndef LV_INDEV_LONG_PRESS_REP_TIME
|
||||
#define LV_INDEV_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */
|
||||
#endif
|
||||
|
||||
/*Color settings*/
|
||||
#ifndef LV_COLOR_DEPTH
|
||||
#define LV_COLOR_DEPTH 16 /*Color depth: 1/8/16/32*/
|
||||
#endif
|
||||
#ifndef LV_COLOR_16_SWAP
|
||||
#define LV_COLOR_16_SWAP 0 /*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/
|
||||
#endif
|
||||
#ifndef LV_COLOR_SCREEN_TRANSP
|
||||
#define LV_COLOR_SCREEN_TRANSP 0 /*1: Enable screen transparency. Useful for OSD or other overlapping GUIs. Requires ARGB8888 colors*/
|
||||
#endif
|
||||
#ifndef LV_COLOR_TRANSP
|
||||
#define LV_COLOR_TRANSP LV_COLOR_LIME /*Images pixels with this color will not be drawn (with chroma keying)*/
|
||||
#endif
|
||||
|
||||
/*Text settings*/
|
||||
#ifndef LV_TXT_UTF8
|
||||
#define LV_TXT_UTF8 1 /*Enable UTF-8 coded Unicode character usage */
|
||||
#endif
|
||||
#ifndef LV_TXT_BREAK_CHARS
|
||||
#define LV_TXT_BREAK_CHARS " ,.;:-_" /*Can break texts on these chars*/
|
||||
#endif
|
||||
#ifndef LV_TXT_LINE_BREAK_LONG_LEN
|
||||
#define LV_TXT_LINE_BREAK_LONG_LEN 12 /* If a character is at least this long, will break wherever "prettiest" */
|
||||
#endif
|
||||
#ifndef LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN
|
||||
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 /* Minimum number of characters of a word to put on a line before a break */
|
||||
#endif
|
||||
#ifndef LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN
|
||||
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 1 /* Minimum number of characters of a word to put on a line after a break */
|
||||
#endif
|
||||
|
||||
/*Feature usage*/
|
||||
#ifndef USE_LV_ANIMATION
|
||||
#define USE_LV_ANIMATION 1 /*1: Enable all animations*/
|
||||
#endif
|
||||
#ifndef USE_LV_SHADOW
|
||||
#define USE_LV_SHADOW 1 /*1: Enable shadows*/
|
||||
#endif
|
||||
#ifndef USE_LV_GROUP
|
||||
#define USE_LV_GROUP 1 /*1: Enable object groups (for keyboards)*/
|
||||
#endif
|
||||
#ifndef USE_LV_GPU
|
||||
#define USE_LV_GPU 1 /*1: Enable GPU interface*/
|
||||
#endif
|
||||
#ifndef USE_LV_REAL_DRAW
|
||||
#define USE_LV_REAL_DRAW 1 /*1: Enable function which draw directly to the frame buffer instead of VDB (required if LV_VDB_SIZE = 0)*/
|
||||
#endif
|
||||
#ifndef USE_LV_FILESYSTEM
|
||||
#define USE_LV_FILESYSTEM 1 /*1: Enable file system (might be required for images*/
|
||||
#endif
|
||||
#ifndef USE_LV_MULTI_LANG
|
||||
#define USE_LV_MULTI_LANG 0 /* Number of languages for labels to store (0: to disable this feature)*/
|
||||
#endif
|
||||
|
||||
/*Compiler settings*/
|
||||
#ifndef LV_ATTRIBUTE_TICK_INC
|
||||
#define LV_ATTRIBUTE_TICK_INC /* Define a custom attribute to `lv_tick_inc` function */
|
||||
#endif
|
||||
#ifndef LV_ATTRIBUTE_TASK_HANDLER
|
||||
#define LV_ATTRIBUTE_TASK_HANDLER /* Define a custom attribute to `lv_task_handler` function */
|
||||
#endif
|
||||
#ifndef LV_ATTRIBUTE_MEM_ALIGN
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN /* With size optimization (-Os) the compiler might not align data to 4 or 8 byte boundary. This alignment will be explicitly applied where needed.*/
|
||||
#endif
|
||||
#ifndef LV_COMPILER_VLA_SUPPORTED
|
||||
#define LV_COMPILER_VLA_SUPPORTED 1 /* 1: Variable length array is supported*/
|
||||
#endif
|
||||
#ifndef LV_COMPILER_NON_CONST_INIT_SUPPORTED
|
||||
#define LV_COMPILER_NON_CONST_INIT_SUPPORTED 1 /* 1: Initialization with non constant values are supported */
|
||||
#endif
|
||||
|
||||
/*HAL settings*/
|
||||
#ifndef LV_TICK_CUSTOM
|
||||
#define LV_TICK_CUSTOM 0 /*1: use a custom tick source (removing the need to manually update the tick with `lv_tick_inc`) */
|
||||
#endif
|
||||
#if LV_TICK_CUSTOM == 1
|
||||
#ifndef LV_TICK_CUSTOM_INCLUDE
|
||||
#define LV_TICK_CUSTOM_INCLUDE "something.h" /*Header for the sys time function*/
|
||||
#endif
|
||||
#ifndef LV_TICK_CUSTOM_SYS_TIME_EXPR
|
||||
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current systime in ms*/
|
||||
#endif
|
||||
#endif /*LV_TICK_CUSTOM*/
|
||||
|
||||
|
||||
/*Log settings*/
|
||||
#ifndef USE_LV_LOG
|
||||
#define USE_LV_LOG 1 /*Enable/disable the log module*/
|
||||
#endif
|
||||
#if USE_LV_LOG
|
||||
/* How important log should be added:
|
||||
* LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
|
||||
* LV_LOG_LEVEL_INFO Log important events
|
||||
* LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't caused problem
|
||||
* LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
|
||||
*/
|
||||
#ifndef LV_LOG_LEVEL
|
||||
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
|
||||
#endif
|
||||
/* 1: Print the log with 'printf'; 0: user need to register a callback*/
|
||||
|
||||
#ifndef LV_LOG_PRINTF
|
||||
# define LV_LOG_PRINTF 0
|
||||
#endif
|
||||
#endif /*USE_LV_LOG*/
|
||||
|
||||
/*================
|
||||
* THEME USAGE
|
||||
*================*/
|
||||
#ifndef LV_THEME_LIVE_UPDATE
|
||||
#define LV_THEME_LIVE_UPDATE 1 /*1: Allow theme switching at run time. Uses 8..10 kB of RAM*/
|
||||
#endif
|
||||
|
||||
#ifndef USE_LV_THEME_TEMPL
|
||||
#define USE_LV_THEME_TEMPL 0 /*Just for test*/
|
||||
#endif
|
||||
#ifndef USE_LV_THEME_DEFAULT
|
||||
#define USE_LV_THEME_DEFAULT 1 /*Built mainly from the built-in styles. Consumes very few RAM*/
|
||||
#endif
|
||||
#ifndef USE_LV_THEME_ALIEN
|
||||
#define USE_LV_THEME_ALIEN 1 /*Dark futuristic theme*/
|
||||
#endif
|
||||
#ifndef USE_LV_THEME_NIGHT
|
||||
#define USE_LV_THEME_NIGHT 1 /*Dark elegant theme*/
|
||||
#endif
|
||||
#ifndef USE_LV_THEME_MONO
|
||||
#define USE_LV_THEME_MONO 1 /*Mono color theme for monochrome displays*/
|
||||
#endif
|
||||
#ifndef USE_LV_THEME_MATERIAL
|
||||
#define USE_LV_THEME_MATERIAL 1 /*Flat theme with bold colors and light shadows*/
|
||||
#endif
|
||||
#ifndef USE_LV_THEME_ZEN
|
||||
#define USE_LV_THEME_ZEN 1 /*Peaceful, mainly light theme */
|
||||
#endif
|
||||
#ifndef USE_LV_THEME_NEMO
|
||||
#define USE_LV_THEME_NEMO 1 /*Water-like theme based on the movie "Finding Nemo"*/
|
||||
#endif
|
||||
|
||||
/*==================
|
||||
* FONT USAGE
|
||||
*===================*/
|
||||
|
||||
/* More info about fonts: https://docs.littlevgl.com/#Fonts
|
||||
* To enable a built-in font use 1,2,4 or 8 values
|
||||
* which will determine the bit-per-pixel. Higher value means smoother fonts */
|
||||
#ifndef USE_LV_FONT_DEJAVU_10
|
||||
#define USE_LV_FONT_DEJAVU_10 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_DEJAVU_10_LATIN_SUP
|
||||
#define USE_LV_FONT_DEJAVU_10_LATIN_SUP 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_DEJAVU_10_CYRILLIC
|
||||
#define USE_LV_FONT_DEJAVU_10_CYRILLIC 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_SYMBOL_10
|
||||
#define USE_LV_FONT_SYMBOL_10 4
|
||||
#endif
|
||||
|
||||
#ifndef USE_LV_FONT_DEJAVU_20
|
||||
#define USE_LV_FONT_DEJAVU_20 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_DEJAVU_20_LATIN_SUP
|
||||
#define USE_LV_FONT_DEJAVU_20_LATIN_SUP 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_DEJAVU_20_CYRILLIC
|
||||
#define USE_LV_FONT_DEJAVU_20_CYRILLIC 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_SYMBOL_20
|
||||
#define USE_LV_FONT_SYMBOL_20 4
|
||||
#endif
|
||||
|
||||
#ifndef USE_LV_FONT_DEJAVU_30
|
||||
#define USE_LV_FONT_DEJAVU_30 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_DEJAVU_30_LATIN_SUP
|
||||
#define USE_LV_FONT_DEJAVU_30_LATIN_SUP 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_DEJAVU_30_CYRILLIC
|
||||
#define USE_LV_FONT_DEJAVU_30_CYRILLIC 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_SYMBOL_30
|
||||
#define USE_LV_FONT_SYMBOL_30 4
|
||||
#endif
|
||||
|
||||
#ifndef USE_LV_FONT_DEJAVU_40
|
||||
#define USE_LV_FONT_DEJAVU_40 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_DEJAVU_40_LATIN_SUP
|
||||
#define USE_LV_FONT_DEJAVU_40_LATIN_SUP 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_DEJAVU_40_CYRILLIC
|
||||
#define USE_LV_FONT_DEJAVU_40_CYRILLIC 4
|
||||
#endif
|
||||
#ifndef USE_LV_FONT_SYMBOL_40
|
||||
#define USE_LV_FONT_SYMBOL_40 4
|
||||
#endif
|
||||
|
||||
#ifndef USE_LV_FONT_MONOSPACE_8
|
||||
#define USE_LV_FONT_MONOSPACE_8 1
|
||||
#endif
|
||||
|
||||
/* Optionally declare your custom fonts here.
|
||||
* You can use these fonts as default font too
|
||||
* and they will be available globally. E.g.
|
||||
* #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) \
|
||||
* LV_FONT_DECLARE(my_font_2) \
|
||||
*/
|
||||
#ifndef LV_FONT_CUSTOM_DECLARE
|
||||
#define LV_FONT_CUSTOM_DECLARE
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef LV_FONT_DEFAULT
|
||||
#define LV_FONT_DEFAULT &lv_font_dejavu_20 /*Always set a default font from the built-in fonts*/
|
||||
#endif
|
||||
|
||||
/*===================
|
||||
* LV_OBJ SETTINGS
|
||||
*==================*/
|
||||
#ifndef LV_OBJ_FREE_NUM_TYPE
|
||||
#define LV_OBJ_FREE_NUM_TYPE uint32_t /*Type of free number attribute (comment out disable free number)*/
|
||||
#endif
|
||||
#ifndef LV_OBJ_FREE_PTR
|
||||
#define LV_OBJ_FREE_PTR 1 /*Enable the free pointer attribute*/
|
||||
#endif
|
||||
#ifndef LV_OBJ_REALIGN
|
||||
#define LV_OBJ_REALIGN 1 /*Enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/
|
||||
#endif
|
||||
|
||||
/*==================
|
||||
* LV OBJ X USAGE
|
||||
*================*/
|
||||
/*
|
||||
* Documentation of the object types: https://docs.littlevgl.com/#Object-types
|
||||
*/
|
||||
|
||||
/*****************
|
||||
* Simple object
|
||||
*****************/
|
||||
|
||||
/*Label (dependencies: -*/
|
||||
#ifndef USE_LV_LABEL
|
||||
#define USE_LV_LABEL 1
|
||||
#endif
|
||||
#if USE_LV_LABEL != 0
|
||||
#ifndef LV_LABEL_SCROLL_SPEED
|
||||
# define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Image (dependencies: lv_label*/
|
||||
#ifndef USE_LV_IMG
|
||||
#define USE_LV_IMG 1
|
||||
#endif
|
||||
#if USE_LV_IMG != 0
|
||||
#ifndef LV_IMG_CF_INDEXED
|
||||
# define LV_IMG_CF_INDEXED 1 /*Enable indexed (palette) images*/
|
||||
#endif
|
||||
#ifndef LV_IMG_CF_ALPHA
|
||||
# define LV_IMG_CF_ALPHA 1 /*Enable alpha indexed images*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Line (dependencies: -*/
|
||||
#ifndef USE_LV_LINE
|
||||
#define USE_LV_LINE 1
|
||||
#endif
|
||||
|
||||
/*Arc (dependencies: -)*/
|
||||
#ifndef USE_LV_ARC
|
||||
#define USE_LV_ARC 1
|
||||
#endif
|
||||
|
||||
/*******************
|
||||
* Container objects
|
||||
*******************/
|
||||
|
||||
/*Container (dependencies: -*/
|
||||
#ifndef USE_LV_CONT
|
||||
#define USE_LV_CONT 1
|
||||
#endif
|
||||
|
||||
/*Page (dependencies: lv_cont)*/
|
||||
#ifndef USE_LV_PAGE
|
||||
#define USE_LV_PAGE 1
|
||||
#endif
|
||||
|
||||
/*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
|
||||
#ifndef USE_LV_WIN
|
||||
#define USE_LV_WIN 1
|
||||
#endif
|
||||
|
||||
/*Tab (dependencies: lv_page, lv_btnm)*/
|
||||
#ifndef USE_LV_TABVIEW
|
||||
#define USE_LV_TABVIEW 1
|
||||
#endif
|
||||
# if USE_LV_TABVIEW != 0
|
||||
#ifndef LV_TABVIEW_ANIM_TIME
|
||||
# define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Tileview (dependencies: lv_page) */
|
||||
#ifndef USE_LV_TILEVIEW
|
||||
#define USE_LV_TILEVIEW 1
|
||||
#endif
|
||||
#if USE_LV_TILEVIEW
|
||||
#ifndef LV_TILEVIEW_ANIM_TIME
|
||||
# define LV_TILEVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*************************
|
||||
* Data visualizer objects
|
||||
*************************/
|
||||
|
||||
/*Bar (dependencies: -)*/
|
||||
#ifndef USE_LV_BAR
|
||||
#define USE_LV_BAR 1
|
||||
#endif
|
||||
|
||||
/*Line meter (dependencies: *;)*/
|
||||
#ifndef USE_LV_LMETER
|
||||
#define USE_LV_LMETER 1
|
||||
#endif
|
||||
|
||||
/*Gauge (dependencies:lv_bar, lv_lmeter)*/
|
||||
#ifndef USE_LV_GAUGE
|
||||
#define USE_LV_GAUGE 1
|
||||
#endif
|
||||
|
||||
/*Chart (dependencies: -)*/
|
||||
#ifndef USE_LV_CHART
|
||||
#define USE_LV_CHART 1
|
||||
#endif
|
||||
|
||||
/*Table (dependencies: lv_label)*/
|
||||
#ifndef USE_LV_TABLE
|
||||
#define USE_LV_TABLE 1
|
||||
#endif
|
||||
#if USE_LV_TABLE
|
||||
#ifndef LV_TABLE_COL_MAX
|
||||
# define LV_TABLE_COL_MAX 12
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*LED (dependencies: -)*/
|
||||
#ifndef USE_LV_LED
|
||||
#define USE_LV_LED 1
|
||||
#endif
|
||||
|
||||
/*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/
|
||||
#ifndef USE_LV_MBOX
|
||||
#define USE_LV_MBOX 1
|
||||
#endif
|
||||
|
||||
/*Text area (dependencies: lv_label, lv_page)*/
|
||||
#ifndef USE_LV_TA
|
||||
#define USE_LV_TA 1
|
||||
#endif
|
||||
#if USE_LV_TA != 0
|
||||
#ifndef LV_TA_CURSOR_BLINK_TIME
|
||||
# define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
|
||||
#endif
|
||||
#ifndef LV_TA_PWD_SHOW_TIME
|
||||
# define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Spinbox (dependencies: lv_ta)*/
|
||||
#ifndef USE_LV_SPINBOX
|
||||
#define USE_LV_SPINBOX 1
|
||||
#endif
|
||||
|
||||
/*Calendar (dependencies: -)*/
|
||||
#ifndef USE_LV_CALENDAR
|
||||
#define USE_LV_CALENDAR 1
|
||||
#endif
|
||||
|
||||
/*Preload (dependencies: lv_arc)*/
|
||||
#ifndef USE_LV_PRELOAD
|
||||
#define USE_LV_PRELOAD 1
|
||||
#endif
|
||||
#if USE_LV_PRELOAD != 0
|
||||
#ifndef LV_PRELOAD_DEF_ARC_LENGTH
|
||||
# define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/
|
||||
#endif
|
||||
#ifndef LV_PRELOAD_DEF_SPIN_TIME
|
||||
# define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/
|
||||
#endif
|
||||
#ifndef LV_PRELOAD_DEF_ANIM
|
||||
# define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Canvas (dependencies: lv_img)*/
|
||||
#ifndef USE_LV_CANVAS
|
||||
#define USE_LV_CANVAS 1
|
||||
#endif
|
||||
/*************************
|
||||
* User input objects
|
||||
*************************/
|
||||
|
||||
/*Button (dependencies: lv_cont*/
|
||||
#ifndef USE_LV_BTN
|
||||
#define USE_LV_BTN 1
|
||||
#endif
|
||||
#if USE_LV_BTN != 0
|
||||
#ifndef LV_BTN_INK_EFFECT
|
||||
# define LV_BTN_INK_EFFECT 1 /*Enable button-state animations - draw a circle on click (dependencies: USE_LV_ANIMATION)*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Image Button (dependencies: lv_btn*/
|
||||
#ifndef USE_LV_IMGBTN
|
||||
#define USE_LV_IMGBTN 1
|
||||
#endif
|
||||
#if USE_LV_IMGBTN
|
||||
#ifndef LV_IMGBTN_TILED
|
||||
# define LV_IMGBTN_TILED 0 /*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Button matrix (dependencies: -)*/
|
||||
#ifndef USE_LV_BTNM
|
||||
#define USE_LV_BTNM 1
|
||||
#endif
|
||||
|
||||
/*Keyboard (dependencies: lv_btnm)*/
|
||||
#ifndef USE_LV_KB
|
||||
#define USE_LV_KB 1
|
||||
#endif
|
||||
|
||||
/*Check box (dependencies: lv_btn, lv_label)*/
|
||||
#ifndef USE_LV_CB
|
||||
#define USE_LV_CB 1
|
||||
#endif
|
||||
|
||||
/*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
|
||||
#ifndef USE_LV_LIST
|
||||
#define USE_LV_LIST 1
|
||||
#endif
|
||||
#if USE_LV_LIST != 0
|
||||
#ifndef LV_LIST_FOCUS_TIME
|
||||
# define LV_LIST_FOCUS_TIME 100 /*Default animation time of focusing to a list element [ms] (0: no animation) */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/
|
||||
#ifndef USE_LV_DDLIST
|
||||
#define USE_LV_DDLIST 1
|
||||
#endif
|
||||
#if USE_LV_DDLIST != 0
|
||||
#ifndef LV_DDLIST_ANIM_TIME
|
||||
# define LV_DDLIST_ANIM_TIME 200 /*Open and close default animation time [ms] (0: no animation)*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Roller (dependencies: lv_ddlist)*/
|
||||
#ifndef USE_LV_ROLLER
|
||||
#define USE_LV_ROLLER 1
|
||||
#endif
|
||||
#if USE_LV_ROLLER != 0
|
||||
#ifndef LV_ROLLER_ANIM_TIME
|
||||
# define LV_ROLLER_ANIM_TIME 200 /*Focus animation time [ms] (0: no animation)*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Slider (dependencies: lv_bar)*/
|
||||
#ifndef USE_LV_SLIDER
|
||||
#define USE_LV_SLIDER 1
|
||||
#endif
|
||||
|
||||
/*Switch (dependencies: lv_slider)*/
|
||||
#ifndef USE_LV_SW
|
||||
#define USE_LV_SW 1
|
||||
#endif
|
||||
|
||||
/*************************
|
||||
* Non-user section
|
||||
*************************/
|
||||
|
||||
#if LV_INDEV_DRAG_THROW <= 0
|
||||
#warning "LV_INDEV_DRAG_THROW must be greater than 0"
|
||||
#undef LV_INDEV_DRAG_THROW
|
||||
#ifndef LV_INDEV_DRAG_THROW
|
||||
#define LV_INDEV_DRAG_THROW 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
# define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif /*LV_CONF_CHECKER_H*/
|
||||
12
include/display/lv_core/lv_core.mk
Normal file
12
include/display/lv_core/lv_core.mk
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
CSRCS += lv_group.c
|
||||
CSRCS += lv_indev.c
|
||||
CSRCS += lv_obj.c
|
||||
CSRCS += lv_refr.c
|
||||
CSRCS += lv_style.c
|
||||
CSRCS += lv_vdb.c
|
||||
CSRCS += lv_lang.c
|
||||
|
||||
DEPPATH += --dep-path $(LVGL_DIR)/lvgl/lv_core
|
||||
VPATH += :$(LVGL_DIR)/lvgl/lv_core
|
||||
|
||||
CFLAGS += "-I$(LVGL_DIR)/lvgl/lv_core"
|
||||
247
include/display/lv_core/lv_group.h
Normal file
247
include/display/lv_core/lv_group.h
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
/**
|
||||
* @file lv_group.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_GROUP_H
|
||||
#define LV_GROUP_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#ifdef LV_CONF_INCLUDE_SIMPLE
|
||||
#include "lv_conf.h"
|
||||
#else
|
||||
#include "display/lv_conf.h"
|
||||
#endif
|
||||
|
||||
#include "lv_obj.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
/*Predefined keys to control the focused object via lv_group_send(group, c)*/
|
||||
/*For compatibility in signal function define the keys regardless to LV_GROUP*/
|
||||
#define LV_GROUP_KEY_UP 17 /*0x11*/
|
||||
#define LV_GROUP_KEY_DOWN 18 /*0x12*/
|
||||
#define LV_GROUP_KEY_RIGHT 19 /*0x13*/
|
||||
#define LV_GROUP_KEY_LEFT 20 /*0x14*/
|
||||
#define LV_GROUP_KEY_ESC 27 /*0x1B*/
|
||||
#define LV_GROUP_KEY_DEL 127 /*0x7F*/
|
||||
#define LV_GROUP_KEY_BACKSPACE 8 /*0x08*/
|
||||
#define LV_GROUP_KEY_ENTER 10 /*0x0A, '\n'*/
|
||||
#define LV_GROUP_KEY_NEXT 9 /*0x09, '\t'*/
|
||||
#define LV_GROUP_KEY_PREV 11 /*0x0B, '*/
|
||||
|
||||
#if USE_LV_GROUP != 0
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
struct _lv_group_t;
|
||||
|
||||
typedef void (*lv_group_style_mod_func_t)(lv_style_t *);
|
||||
typedef void (*lv_group_focus_cb_t)(struct _lv_group_t *);
|
||||
|
||||
typedef struct _lv_group_t
|
||||
{
|
||||
lv_ll_t obj_ll; /*Linked list to store the objects in the group */
|
||||
lv_obj_t ** obj_focus; /*The object in focus*/
|
||||
lv_group_style_mod_func_t style_mod; /*A function which modifies the style of the focused object*/
|
||||
lv_group_style_mod_func_t style_mod_edit;/*A function which modifies the style of the focused object*/
|
||||
lv_group_focus_cb_t focus_cb; /*A function to call when a new object is focused (optional)*/
|
||||
lv_style_t style_tmp; /*Stores the modified style of the focused object */
|
||||
uint8_t frozen :1; /*1: can't focus to new object*/
|
||||
uint8_t editing :1; /*1: Edit mode, 0: Navigate mode*/
|
||||
uint8_t click_focus :1; /*1: If an object in a group is clicked by an indev then it will be focused */
|
||||
uint8_t refocus_policy :1; /*1: Focus prev if focused on deletion. 0: Focus prev if focused on deletion.*/
|
||||
uint8_t wrap :1; /*1: Focus next/prev can wrap at end of list. 0: Focus next/prev stops at end of list.*/
|
||||
} lv_group_t;
|
||||
|
||||
typedef enum _lv_group_refocus_policy_t {
|
||||
LV_GROUP_REFOCUS_POLICY_NEXT = 0,
|
||||
LV_GROUP_REFOCUS_POLICY_PREV = 1
|
||||
} lv_group_refocus_policy_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Create a new object group
|
||||
* @return pointer to the new object group
|
||||
*/
|
||||
lv_group_t * lv_group_create(void);
|
||||
|
||||
/**
|
||||
* Delete a group object
|
||||
* @param group pointer to a group
|
||||
*/
|
||||
void lv_group_del(lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Add an object to a group
|
||||
* @param group pointer to a group
|
||||
* @param obj pointer to an object to add
|
||||
*/
|
||||
void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Remove an object from its group
|
||||
* @param obj pointer to an object to remove
|
||||
*/
|
||||
void lv_group_remove_obj(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Focus on an object (defocus the current)
|
||||
* @param obj pointer to an object to focus on
|
||||
*/
|
||||
void lv_group_focus_obj(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Focus the next object in a group (defocus the current)
|
||||
* @param group pointer to a group
|
||||
*/
|
||||
void lv_group_focus_next(lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Focus the previous object in a group (defocus the current)
|
||||
* @param group pointer to a group
|
||||
*/
|
||||
void lv_group_focus_prev(lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Do not let to change the focus from the current object
|
||||
* @param group pointer to a group
|
||||
* @param en true: freeze, false: release freezing (normal mode)
|
||||
*/
|
||||
void lv_group_focus_freeze(lv_group_t * group, bool en);
|
||||
|
||||
/**
|
||||
* Send a control character to the focuses object of a group
|
||||
* @param group pointer to a group
|
||||
* @param c a character (use LV_GROUP_KEY_.. to navigate)
|
||||
* @return result of focused object in group.
|
||||
*/
|
||||
lv_res_t lv_group_send_data(lv_group_t * group, uint32_t c);
|
||||
|
||||
/**
|
||||
* Set a function for a group which will modify the object's style if it is in focus
|
||||
* @param group pointer to a group
|
||||
* @param style_mod_func the style modifier function pointer
|
||||
*/
|
||||
void lv_group_set_style_mod_cb(lv_group_t * group, lv_group_style_mod_func_t style_mod_func);
|
||||
|
||||
/**
|
||||
* Set a function for a group which will modify the object's style if it is in focus in edit mode
|
||||
* @param group pointer to a group
|
||||
* @param style_mod_func the style modifier function pointer
|
||||
*/
|
||||
void lv_group_set_style_mod_edit_cb(lv_group_t * group, lv_group_style_mod_func_t style_mod_func);
|
||||
|
||||
/**
|
||||
* Set a function for a group which will be called when a new object is focused
|
||||
* @param group pointer to a group
|
||||
* @param focus_cb the call back function or NULL if unused
|
||||
*/
|
||||
void lv_group_set_focus_cb(lv_group_t * group, lv_group_focus_cb_t focus_cb);
|
||||
|
||||
/**
|
||||
* Set whether the next or previous item in a group is focused if the currently focussed obj is deleted.
|
||||
* @param group pointer to a group
|
||||
* @param new refocus policy enum
|
||||
*/
|
||||
void lv_group_set_refocus_policy(lv_group_t * group, lv_group_refocus_policy_t policy);
|
||||
|
||||
/**
|
||||
* Manually set the current mode (edit or navigate).
|
||||
* @param group pointer to group
|
||||
* @param edit: true: edit mode; false: navigate mode
|
||||
*/
|
||||
void lv_group_set_editing(lv_group_t * group, bool edit);
|
||||
|
||||
/**
|
||||
* Set the `click_focus` attribute. If enabled then the object will be focused then it is clicked.
|
||||
* @param group pointer to group
|
||||
* @param en: true: enable `click_focus`
|
||||
*/
|
||||
void lv_group_set_click_focus(lv_group_t * group, bool en);
|
||||
|
||||
/**
|
||||
* Set whether focus next/prev will allow wrapping from first->last or last->first object.
|
||||
* @param group pointer to group
|
||||
* @param en: true: wrapping enabled; false: wrapping disabled
|
||||
*/
|
||||
void lv_group_set_wrap(lv_group_t * group, bool en);
|
||||
|
||||
/**
|
||||
* Modify a style with the set 'style_mod' function. The input style remains unchanged.
|
||||
* @param group pointer to group
|
||||
* @param style pointer to a style to modify
|
||||
* @return a copy of the input style but modified with the 'style_mod' function
|
||||
*/
|
||||
lv_style_t * lv_group_mod_style(lv_group_t * group, const lv_style_t * style);
|
||||
|
||||
/**
|
||||
* Get the focused object or NULL if there isn't one
|
||||
* @param group pointer to a group
|
||||
* @return pointer to the focused object
|
||||
*/
|
||||
lv_obj_t * lv_group_get_focused(const lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Get a the style modifier function of a group
|
||||
* @param group pointer to a group
|
||||
* @return pointer to the style modifier function
|
||||
*/
|
||||
lv_group_style_mod_func_t lv_group_get_style_mod_cb(const lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Get a the style modifier function of a group in edit mode
|
||||
* @param group pointer to a group
|
||||
* @return pointer to the style modifier function
|
||||
*/
|
||||
lv_group_style_mod_func_t lv_group_get_style_mod_edit_cb(const lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Get the focus callback function of a group
|
||||
* @param group pointer to a group
|
||||
* @return the call back function or NULL if not set
|
||||
*/
|
||||
lv_group_focus_cb_t lv_group_get_focus_cb(const lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Get the current mode (edit or navigate).
|
||||
* @param group pointer to group
|
||||
* @return true: edit mode; false: navigate mode
|
||||
*/
|
||||
bool lv_group_get_editing(const lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Get the `click_focus` attribute.
|
||||
* @param group pointer to group
|
||||
* @return true: `click_focus` is enabled; false: disabled
|
||||
*/
|
||||
bool lv_group_get_click_focus(const lv_group_t * group);
|
||||
|
||||
/**
|
||||
* Get whether focus next/prev will allow wrapping from first->last or last->first object.
|
||||
* @param group pointer to group
|
||||
* @param en: true: wrapping enabled; false: wrapping disabled
|
||||
*/
|
||||
bool lv_group_get_wrap(lv_group_t * group);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*USE_LV_GROUP != 0*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_GROUP_H*/
|
||||
157
include/display/lv_core/lv_indev.h
Normal file
157
include/display/lv_core/lv_indev.h
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
/**
|
||||
* @file lv_indev_proc.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_INDEV_H
|
||||
#define LV_INDEV_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_obj.h"
|
||||
#include "display/lv_hal/lv_hal_indev.h"
|
||||
#include "display/lv_core/lv_group.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize the display input device subsystem
|
||||
*/
|
||||
void lv_indev_init(void);
|
||||
|
||||
/**
|
||||
* Get the currently processed input device. Can be used in action functions too.
|
||||
* @return pointer to the currently processed input device or NULL if no input device processing right now
|
||||
*/
|
||||
lv_indev_t * lv_indev_get_act(void);
|
||||
|
||||
|
||||
/**
|
||||
* Get the type of an input device
|
||||
* @param indev pointer to an input device
|
||||
* @return the type of the input device from `lv_hal_indev_type_t` (`LV_INDEV_TYPE_...`)
|
||||
*/
|
||||
lv_hal_indev_type_t lv_indev_get_type(const lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Reset one or all input devices
|
||||
* @param indev pointer to an input device to reset or NULL to reset all of them
|
||||
*/
|
||||
void lv_indev_reset(lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Reset the long press state of an input device
|
||||
* @param indev_proc pointer to an input device
|
||||
*/
|
||||
void lv_indev_reset_lpr(lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Enable input devices device by type
|
||||
* @param type Input device type
|
||||
* @param enable true: enable this type; false: disable this type
|
||||
*/
|
||||
void lv_indev_enable(lv_hal_indev_type_t type, bool enable);
|
||||
|
||||
/**
|
||||
* Set a cursor for a pointer input device (for LV_INPUT_TYPE_POINTER and LV_INPUT_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @param cur_obj pointer to an object to be used as cursor
|
||||
*/
|
||||
void lv_indev_set_cursor(lv_indev_t *indev, lv_obj_t *cur_obj);
|
||||
|
||||
#if USE_LV_GROUP
|
||||
/**
|
||||
* Set a destination group for a keypad input device (for LV_INDEV_TYPE_KEYPAD)
|
||||
* @param indev pointer to an input device
|
||||
* @param group point to a group
|
||||
*/
|
||||
void lv_indev_set_group(lv_indev_t *indev, lv_group_t *group);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set the an array of points for LV_INDEV_TYPE_BUTTON.
|
||||
* These points will be assigned to the buttons to press a specific point on the screen
|
||||
* @param indev pointer to an input device
|
||||
* @param group point to a group
|
||||
*/
|
||||
void lv_indev_set_button_points(lv_indev_t *indev, const lv_point_t *points);
|
||||
|
||||
/**
|
||||
* Set feedback callback for indev.
|
||||
* @param indev pointer to an input device
|
||||
* @param feedback feedback callback
|
||||
*/
|
||||
void lv_indev_set_feedback(lv_indev_t *indev, lv_indev_feedback_t feedback);
|
||||
|
||||
/**
|
||||
* Get the last point of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @param point pointer to a point to store the result
|
||||
*/
|
||||
void lv_indev_get_point(const lv_indev_t * indev, lv_point_t * point);
|
||||
|
||||
/**
|
||||
* Get the last key of an input device (for LV_INDEV_TYPE_KEYPAD)
|
||||
* @param indev pointer to an input device
|
||||
* @return the last pressed key (0 on error)
|
||||
*/
|
||||
uint32_t lv_indev_get_key(const lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Check if there is dragging with an input device or not (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @return true: drag is in progress
|
||||
*/
|
||||
bool lv_indev_is_dragging(const lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Get the vector of dragging of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
|
||||
* @param indev pointer to an input device
|
||||
* @param point pointer to a point to store the vector
|
||||
*/
|
||||
void lv_indev_get_vect(const lv_indev_t * indev, lv_point_t * point);
|
||||
/**
|
||||
* Get elapsed time since last press
|
||||
* @param indev pointer to an input device (NULL to get the overall smallest inactivity)
|
||||
* @return Elapsed ticks (milliseconds) since last press
|
||||
*/
|
||||
uint32_t lv_indev_get_inactive_time(const lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Get feedback callback for indev.
|
||||
* @param indev pointer to an input device
|
||||
* @return feedback callback
|
||||
*/
|
||||
lv_indev_feedback_t lv_indev_get_feedback(const lv_indev_t *indev);
|
||||
|
||||
/**
|
||||
* Do nothing until the next release
|
||||
* @param indev pointer to an input device
|
||||
*/
|
||||
void lv_indev_wait_release(lv_indev_t * indev);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_INDEV_H*/
|
||||
74
include/display/lv_core/lv_lang.h
Normal file
74
include/display/lv_core/lv_lang.h
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
* @file lv_lang.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_LANG_H
|
||||
#define LV_LANG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#ifdef LV_CONF_INCLUDE_SIMPLE
|
||||
#include "lv_conf.h"
|
||||
#else
|
||||
#include "display/lv_conf.h"
|
||||
#endif
|
||||
|
||||
#if USE_LV_MULTI_LANG
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_LANG_TXT_ID_NONE 0xFFFF /*Used to not assign any text IDs for a multi-language object.*/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Change the language
|
||||
* @param lang_id the id of the
|
||||
*/
|
||||
void lv_lang_set(uint8_t lang_id);
|
||||
|
||||
/**
|
||||
* Set a function to get the texts of the set languages from a `txt_id`
|
||||
* @param fp a function pointer to get the texts
|
||||
*/
|
||||
void lv_lang_set_text_func(const void * (*fp)(uint16_t));
|
||||
|
||||
/**
|
||||
* Use the function set by `lv_lang_set_text_func` to get the `txt_id` text in the set language
|
||||
* @param txt_id an ID of the text to get
|
||||
* @return the `txt_id` txt on the set language
|
||||
*/
|
||||
const void * lv_lang_get_text(uint16_t txt_id);
|
||||
|
||||
/**
|
||||
* Return with ID of the currently selected language
|
||||
* @return pointer to the active screen object (loaded by 'lv_scr_load()')
|
||||
*/
|
||||
uint8_t lv_lang_act(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*USE_LV_MULTI_LANG*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_LANG_H*/
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue