Skip to content

Commit c507182

Browse files
committed
move from lv_project
1 parent 840a043 commit c507182

23 files changed

+2022
-2
lines changed

.cproject

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
3+
<storageModule moduleId="org.eclipse.cdt.core.settings">
4+
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.1013439379">
5+
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.1013439379" moduleId="org.eclipse.cdt.core.settings" name="Default">
6+
<externalSettings/>
7+
<extensions>
8+
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
9+
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
10+
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
11+
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
12+
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
13+
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
14+
</extensions>
15+
</storageModule>
16+
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
17+
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.cross.base.1013439379" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
18+
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.1013439379.683091649" name="/" resourcePath="">
19+
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.1504032888" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
20+
<option id="cdt.managedbuild.option.gnu.cross.prefix.1186604053" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
21+
<option id="cdt.managedbuild.option.gnu.cross.path.1047998753" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
22+
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.263972871" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
23+
<builder id="cdt.managedbuild.builder.gnu.cross.1982289326" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
24+
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.655921103" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
25+
<option id="gnu.c.compiler.option.include.paths.1842451458" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
26+
<listOptionValue builtIn="false" value="/home/kisvegabor/esp/esp-idf/components/esp32/include"/>
27+
<listOptionValue builtIn="false" value="/home/kisvegabor/esp/esp-idf/components/log/include"/>
28+
<listOptionValue builtIn="false" value="/home/kisvegabor/esp/esp-idf/components/freertos/include"/>
29+
<listOptionValue builtIn="false" value="/home/kisvegabor/esp/esp-idf/components/nvs_flash/include"/>
30+
<listOptionValue builtIn="false" value="/home/kisvegabor/esp/esp-idf/components/spi_flash/include"/>
31+
<listOptionValue builtIn="false" value="/home/kisvegabor/esp/esp-idf/components/driver/include"/>
32+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lvgl_esp32}&quot;"/>
33+
</option>
34+
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1618296825" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
35+
</tool>
36+
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1054223501" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
37+
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2045378480" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
38+
</tool>
39+
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.883455135" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
40+
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.7419403" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
41+
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.438230222" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
42+
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
43+
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
44+
</inputType>
45+
</tool>
46+
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.977235586" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
47+
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.12500289" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
48+
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.720759256" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
49+
</tool>
50+
</toolChain>
51+
</folderInfo>
52+
<sourceEntries>
53+
<entry excluding="main|lvgl|lv_examples|drv" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
54+
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="drv"/>
55+
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="lv_examples"/>
56+
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="lvgl"/>
57+
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="main"/>
58+
</sourceEntries>
59+
</configuration>
60+
</storageModule>
61+
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
62+
</cconfiguration>
63+
</storageModule>
64+
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
65+
<project id="hello_world.null.256928934" name="hello_world"/>
66+
</storageModule>
67+
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
68+
<storageModule moduleId="refreshScope"/>
69+
<storageModule moduleId="scannerConfiguration">
70+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
71+
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1013439379;cdt.managedbuild.toolchain.gnu.cross.base.1013439379.683091649;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1054223501;cdt.managedbuild.tool.gnu.cpp.compiler.input.2045378480">
72+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
73+
</scannerConfigBuildInfo>
74+
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1257239843;cdt.managedbuild.toolchain.gnu.cross.base.1257239843.573921054;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1833542076;cdt.managedbuild.tool.gnu.cpp.compiler.input.83736732">
75+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
76+
</scannerConfigBuildInfo>
77+
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1257239843;cdt.managedbuild.toolchain.gnu.cross.base.1257239843.573921054;cdt.managedbuild.tool.gnu.cross.c.compiler.76182435;cdt.managedbuild.tool.gnu.c.compiler.input.1474940075">
78+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
79+
</scannerConfigBuildInfo>
80+
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1013439379;cdt.managedbuild.toolchain.gnu.cross.base.1013439379.683091649;cdt.managedbuild.tool.gnu.cross.c.compiler.655921103;cdt.managedbuild.tool.gnu.c.compiler.input.1618296825">
81+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
82+
</scannerConfigBuildInfo>
83+
</storageModule>
84+
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
85+
<buildTargets>
86+
<target name="flash" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
87+
<buildCommand>make</buildCommand>
88+
<buildArguments/>
89+
<buildTarget>flash</buildTarget>
90+
<stopOnError>true</stopOnError>
91+
<useDefaultCommand>true</useDefaultCommand>
92+
<runAllBuilders>true</runAllBuilders>
93+
</target>
94+
</buildTargets>
95+
</storageModule>
96+
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
97+
</cproject>

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ modules.order
5050
Module.symvers
5151
Mkfile.old
5252
dkms.conf
53+
54+
build/

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "lvgl"]
2+
path = lvgl
3+
url = https://github.com/littlevgl/lvgl.git
4+
[submodule "lv_examples"]
5+
path = lv_examples
6+
url = https://github.com/littlevgl/lv_examples.git

.project

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>esp32_ili9341</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
10+
<triggers>clean,full,incremental,</triggers>
11+
<arguments>
12+
</arguments>
13+
</buildCommand>
14+
<buildCommand>
15+
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
16+
<triggers>full,incremental,</triggers>
17+
<arguments>
18+
</arguments>
19+
</buildCommand>
20+
</buildSpec>
21+
<natures>
22+
<nature>org.eclipse.cdt.core.cnature</nature>
23+
<nature>org.eclipse.cdt.core.ccnature</nature>
24+
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
25+
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
26+
</natures>
27+
</projectDescription>

.settings/language.settings.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<project>
3+
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.1013439379" name="Default">
4+
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
5+
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
6+
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
7+
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
8+
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="389348143683409677" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
9+
<language-scope id="org.eclipse.cdt.core.gcc"/>
10+
<language-scope id="org.eclipse.cdt.core.g++"/>
11+
</provider>
12+
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
13+
</extension>
14+
</configuration>
15+
</project>

.settings/org.eclipse.cdt.core.prefs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
eclipse.preferences.version=1
2+
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1257239843/V/delimiter=\:
3+
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1257239843/V/operation=append
4+
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1257239843/V/value=1
5+
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1257239843/append=true
6+
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1257239843/appendContributed=true

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
3+
# project subdirectory.
4+
#
5+
6+
PROJECT_NAME := hello-world
7+
8+
# Add new components (source folders)
9+
# Must be before include $(IDF_PATH)/make/project.mk
10+
# $(PROJECT_PATH)/xxx didn't work -> use $(abspath xxx) instead
11+
EXTRA_COMPONENT_DIRS := $(abspath drv) $(abspath lvgl) $(abspath lv_examples)
12+
13+
include $(IDF_PATH)/make/project.mk
14+

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
# esp32_ili9431
2-
LittlevGL ported to ESP32 using ILI9341 display controller
1+
1. Install ESP-IDF: http://esp-idf.readthedocs.io/en/latest/
2+
2. To link LittlevGL (lvgl) and lv_examples with ESP-IDF you need to add a **component.mk** file to each directory. Next to this REAMDE file you find two example component.mk files
3+
- lvgl_component.mk
4+
- lv_example_component.mk
5+
6+
Rename them to component.mk and copy to the lvgl and lv_examples directories.

drv/component.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# drv

drv/disp_spi.c

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/**
2+
* @file disp_spi.c
3+
*
4+
*/
5+
6+
/*********************
7+
* INCLUDES
8+
*********************/
9+
#include "disp_spi.h"
10+
#include "esp_system.h"
11+
#include "driver/gpio.h"
12+
#include "driver/spi_master.h"
13+
#include <string.h>
14+
15+
/*********************
16+
* DEFINES
17+
*********************/
18+
19+
/**********************
20+
* TYPEDEFS
21+
**********************/
22+
23+
24+
/**********************
25+
* STATIC PROTOTYPES
26+
**********************/
27+
static spi_device_handle_t spi;
28+
29+
/**********************
30+
* STATIC VARIABLES
31+
**********************/
32+
33+
/**********************
34+
* MACROS
35+
**********************/
36+
37+
/**********************
38+
* GLOBAL FUNCTIONS
39+
**********************/
40+
void disp_spi_init(void)
41+
{
42+
43+
esp_err_t ret;
44+
45+
spi_bus_config_t buscfg={
46+
.miso_io_num=-1,
47+
.mosi_io_num=DISP_SPI_MOSI,
48+
.sclk_io_num=DISP_SPI_CLK,
49+
.quadwp_io_num=-1,
50+
.quadhd_io_num=-1
51+
};
52+
53+
spi_device_interface_config_t devcfg={
54+
.clock_speed_hz=80*1000*1000, //Clock out at 80 MHz
55+
.mode=0, //SPI mode 0
56+
.spics_io_num=DISP_SPI_CS, //CS pin
57+
.queue_size=1,
58+
.pre_cb=NULL,
59+
.post_cb=NULL,
60+
};
61+
62+
//Initialize the SPI bus
63+
ret=spi_bus_initialize(VSPI_HOST, &buscfg, 1);
64+
assert(ret==ESP_OK);
65+
66+
//Attach the LCD to the SPI bus
67+
ret=spi_bus_add_device(VSPI_HOST, &devcfg, &spi);
68+
assert(ret==ESP_OK);
69+
}
70+
71+
void disp_spi_send(uint8_t * data, uint16_t length)
72+
{
73+
if (length == 0) return; //no need to send anything
74+
75+
spi_transaction_t t;
76+
memset(&t, 0, sizeof(t)); //Zero out the transaction
77+
t.length = length * 8; //Length is in bytes, transaction length is in bits.
78+
t.tx_buffer = data; //Data
79+
80+
esp_err_t ret;
81+
// ret=spi_device_transmit(spi, &t); //Transmit!
82+
// assert(ret==ESP_OK); //Should have had no issues.
83+
84+
spi_device_queue_trans(spi, &t, portMAX_DELAY);
85+
86+
spi_transaction_t * rt;
87+
spi_device_get_trans_result(spi, &rt, portMAX_DELAY);
88+
}
89+
90+
91+
/**********************
92+
* STATIC FUNCTIONS
93+
**********************/

drv/disp_spi.h

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* @file lv_templ.h
3+
*
4+
*/
5+
6+
#ifndef LV_TEMPL_H
7+
#define LV_TEMPL_H
8+
9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif
12+
13+
/*********************
14+
* INCLUDES
15+
*********************/
16+
#include <stdint.h>
17+
18+
/*********************
19+
* DEFINES
20+
*********************/
21+
22+
#define DISP_SPI_MOSI 23
23+
#define DISP_SPI_CLK 18
24+
#define DISP_SPI_CS 17
25+
26+
27+
/**********************
28+
* TYPEDEFS
29+
**********************/
30+
31+
/**********************
32+
* GLOBAL PROTOTYPES
33+
**********************/
34+
void disp_spi_init(void);
35+
void disp_spi_send(uint8_t * data, uint16_t length);
36+
37+
/**********************
38+
* MACROS
39+
**********************/
40+
41+
42+
#ifdef __cplusplus
43+
} /* extern "C" */
44+
#endif
45+
46+
#endif /*LV_TEMPL_H*/

0 commit comments

Comments
 (0)