Code Monkey home page Code Monkey logo

lv_port_pc_vscode's Introduction

Simulator project for LVGL embedded GUI Library

The LVGL is written mainly for microcontrollers and embedded systems however you can run the library on your PC as well without any embedded hardware. The code written on PC can be simply copied when your are using an embedded system.

Using a PC simulator instead of an embedded hardware has several advantages:

  • Costs $0 because you you don't have to buy or design PCB
  • Fast because you don't have to design and manufacture PCB
  • Collaborative because any number of developers can work in the same environment
  • Developer friendly because much easier and faster to debug on PC

Requirements

This project is configured for VSCode and only tested on Linux, although this may work on OSx or WSL. It requires a working version of GCC, GDB and make in your path.

To allow debugging inside VSCode you will also require a GDB extension or other suitable debugger.

  • SDL a low level driver library to use graphics, handle mouse, keyboard etc.

Usage

Get the PC project

Clone the PC project and the related sub modules:

git clone --recursive https://github.com/lvgl/lv_sim_vscode_sdl

Install SDL

You can download SDL from https://www.libsdl.org/

On Linux you can install it via terminal:

sudo apt-get update && sudo apt-get install -y build-essential libsdl2-dev

On Windows copy "SDL2.dll" to your "Windows\System32" directory and the "ui\simulator\dlls" directory. Copy the SDL2 source code "include" directory to "ui\simulator\inc" name it "SDL2", the final paths look like this:

C:\Windows\System32\SDL2.dll
C:\(lv_sim_vscode_sdl source directory)\ui\simulator\dlls\SDL2.dll
C:\(lv_sim_vscode_sdl source directory)\ui\simulator\inc\SDL2\*.h

Build

On Linux use the default make target. Select "g++ build and debug active file" from the VS Code "RUN AND DEBUG" drop down, or via the command line:

make

On Windows install Cygwin from https://www.cygwin.com. Select the appropriate compiler and debugger during installation (x86_64-w64-mingw32-gcc, gdb). Add the Cygwin binaries directory path ( C:\cygwin64\bin for example ) to the "Path" "System Environment Variable" via Windows Settings. Use the win64 target to build. Select "win64 build and debug active file" from the VS Code "RUN AND DEBUG" drop down, or via the command line:

make win64

Setup

To allow custom UI code an lv_conf.h file placed at ui/simulator/inc will automatically override this projects lv_conf.h file. By default code under ui is ignored so you can reuse this repository for multiple projects. You will need to place a call from main.c to your UI's entry function.

To build and debug, press F5. You should now have your UI displayed in a new window and can access all the debug features of VSCode through GDB.

To allow temporary modification between simulator and device code, a SIMULATOR=1 define is added globally.

lv_port_pc_vscode's People

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.