Luc 39e06975f2 Update from refactoring branch
### Maintenance page
* Add add tab color for mobile view
* Add spellcheck off / autocorect off in input
* Add disconnect button when authenticate enabled
* Add Invalid user or password message when authentication failed

### Board support
* Add ESP32 S2 support
* Add ESP32 S3 support
* Add ESP32 C3 support

### ESP commands
* Add command 701 to control GCODE streaming
* Remove command 901 as duplicate
* Update command 420 to add more details
* Use text as default output
* All json on all commands for formated output

### Core
* Add benchmak function to check transfer speed (for test only-not production)
* Merge code for ESP3DLib support
* Add better printer display support (M117 / Serial TFT)
* Use ESP32 analogWrite instead of emulated one

### Modules
* Display
	* Refactor code
	* Remove SPI ILI 9341 / 9488 support as not suitable
      * Add ST7789 support (135x240 / 240x240)
* Filesystem
	* Bug fixes due to esp core updates
	* Better SD sharing mecanism
      * Better global FS management
* FTP
	* Add SD sharing support
	* Better global FS management
* GCODE Host
	* Add basic support for macro files
      * Add ESP command support
      * Use not blocking method to stream commands / handle response
* Notifications
	* Add IFTTT notification service
	* Add WebUI notification
	* Add ESP3D display notification
* WebDav
	* Add SD sharing support
	* Add bug fix from https://github.com/d-a-v/ESPWebDAV
	* Better global FS management
* Websocket
	* Add function to handle zombies connections
* WiFi
	* Fix connection to AP sometime fail
	* Fix low signal not diplayed in ESP420 even connected
	* Add AP Setup mode

### Libraries
* Update SDFat-2.0.6 to 2.1.2
* Update ESP32SSDP 1.1.1 to 1.2.0
* Update TFT_eSPI-1.4.11 to 2.4.61
* Update arduinoWebSockets-2.3.5 to 2.3.6
* Update esp8266-oled-ssd1306-4.0.0 to 4.3.0
* Remove lvgl support

### Tools
* Add I2C scanner script
* Add python script to simulate/stress printer serial communication

### PlatformIO
 * Use latest 4.4.0 Espressif32 release (ESP32-arduino core 2.0.3)
 * Add fix for Flash more than 4MB
 * Add Esp32 S2/S3/C3 env
 * Add ESP32-ST7789 / esp32-TTGO_T_Display env
2022-06-01 14:56:57 +08:00

4.4 KiB

.. include:: /header.rst
:github_url: |github_link_base|/get-started/nxp.md

NXP

NXP has integrated LVGL into the MCUXpresso SDK packages for several of their general purpose and crossover microcontrollers, allowing easy evaluation and migration into your product design. Download an SDK for a supported board today and get started with your next GUI application.

Creating new project with LVGL

Downloading the MCU SDK example project is recommended as a starting point. It comes fully configured with LVGL (and with PXP support if module is present), no additional integration work is required.

Adding HW acceleration for NXP iMX RT platforms using PXP (PiXel Pipeline) engine for existing projects

Several drawing features in LVGL can be offloaded to the PXP engine. The CPU is available for other operations while the PXP is running. An RTOS is required to block the LVGL drawing thread and switch to another task or suspend the CPU for power savings.

Features supported:

  • RGB565 color format
  • Area fill + optional transparency
  • BLIT (BLock Image Transfer) + optional transparency
  • Color keying + optional transparency
  • Recoloring (color tint) + optional transparency
  • RTOS integration layer
  • Default FreeRTOS and bare metal code provided

Basic configuration:

  • Select NXP PXP engine in lv_conf.h: Set LV_USE_GPU_NXP_PXP to 1
  • Enable default implementation for interrupt handling, PXP start function and automatic initialization: Set LV_USE_GPU_NXP_PXP_AUTO_INIT to 1
  • If FSL_RTOS_FREE_RTOS symbol is defined, FreeRTOS implementation will be used, otherwise bare metal code will be included

Basic initialization:

  • If LV_USE_GPU_NXP_PXP_AUTO_INIT is enabled, no user code is required; PXP is initialized automatically in lv_init()
  • For manual PXP initialization, default configuration structure for callbacks can be used. Initialize PXP before calling lv_init()
      #if LV_USE_GPU_NXP_PXP
        #include "lv_gpu/lv_gpu_nxp_pxp.h"
        #include "lv_gpu/lv_gpu_nxp_pxp_osa.h"
      #endif
      . . .
      #if LV_USE_GPU_NXP_PXP
        if (lv_gpu_nxp_pxp_init(&pxp_default_cfg) != LV_RES_OK) {
            PRINTF("PXP init error. STOP.\n");
            for ( ; ; ) ;
        }
      #endif

Project setup:

  • Add PXP related files to project:
    • lv_gpu/lv_gpu_nxp.c, lv_gpu/lv_gpu_nxp.h: low level drawing calls for LVGL
    • lv_gpu/lv_gpu_nxp_osa.c, lv_gpu/lv_gpu_osa.h: default implementation of OS-specific functions (bare metal and FreeRTOS only)
      • optional, required only if LV_USE_GPU_NXP_PXP_AUTO_INIT is set to 1
  • PXP related code depends on two drivers provided by MCU SDK. These drivers need to be added to project:
    • fsl_pxp.c, fsl_pxp.h: PXP driver
    • fsl_cache.c, fsl_cache.h: CPU cache handling functions

Advanced configuration:

  • Implementation depends on multiple OS-specific functions. The struct lv_nxp_pxp_cfg_t with callback pointers is used as a parameter for the lv_gpu_nxp_pxp_init() function. Default implementation for FreeRTOS and baremetal is provided in lv_gpu_nxp_osa.c
    • pxp_interrupt_init(): Initialize PXP interrupt (HW setup, OS setup)
    • pxp_interrupt_deinit(): Deinitialize PXP interrupt (HW setup, OS setup)
    • pxp_run(): Start PXP job. Use OS-specific mechanism to block drawing thread. PXP must finish drawing before leaving this function.
  • There are configurable area thresholds which are used to decide whether the area will be processed by CPU, or by PXP. Areas smaller than a defined value will be processed by CPU and those bigger than the threshold will be processed by PXP. These thresholds may be defined as preprocessor variables. Default values are defined lv_gpu/lv_gpu_nxp_pxp.h
    • GPU_NXP_PXP_BLIT_SIZE_LIMIT: size threshold for image BLIT, BLIT with color keying, and BLIT with recolor (OPA > LV_OPA_MAX)
    • GPU_NXP_PXP_BLIT_OPA_SIZE_LIMIT: size threshold for image BLIT and BLIT with color keying with transparency (OPA < LV_OPA_MAX)
    • GPU_NXP_PXP_FILL_SIZE_LIMIT: size threshold for fill operation (OPA > LV_OPA_MAX)
    • GPU_NXP_PXP_FILL_OPA_SIZE_LIMIT: size threshold for fill operation with transparency (OPA < LV_OPA_MAX)