anyuianyui
anyui
anyui-LIVE
Feedback
  • English
  • 简体中文
anyui
anyui-LIVE
Feedback
  • English
  • 简体中文
  • Introduction

    • Introduction
  • Get Started

    • Get Started
  • Workspace

    • Workspace
  • Editor

    • Overview
    • Toolbar
    • Navigator
    • Inspector
    • Statusbar
    • Settings
    • Canvas
    • Preview
  • Subjects

    • Image
    • Font
    • Layout
    • Dynamic LVGL version
    • Override screen size
    • Codegen
    • Transplant

Codegen converts the workspace design into C source code that runs on the target device. This guide covers code generation features, configuration options, and integration points.

Overview

After designing screens in the editor, anyui-LIVE generates the screen implementations and converts assets into the generated/ directory of the workspace. The generated code is self-contained and independent of the hardware and development tools used to build the final firmware.

The pipeline is described here; the assets it consumes are defined in the image guide and the font guide.

Generated output

Codegen produces the following in {root}/generated:

OutputDescription
Screen source filesC files implementing each screen and the setupUI() entry point.
Asset sourcesConverted images, fonts, and Lottie data.
Header filesDeclarations for screens, components, and generated variables.

This output is automatically generated and should not be modified by hand.

Configuration options

Codegen behavior is controlled through project configuration:

OptionDescription
ResolutionTarget resolution used when generating screen layout.
Color depthColor depth used for generated assets.

See the workspace guide for where these options are configured.

Integration points

The generated code integrates with the rest of the system through well-defined entry points:

  • setupUI() - call this to initialize the UI from your application.
  • generated/ - copy these files into your project build.

These integration points are the basis of the transplant guide, which explains moving generated code to a target device.

Related guides

  • Image - how image assets are converted.
  • Font - how font libraries are converted.
  • Workspace - the generated output directory.
  • Overview - the screens that codegen compiles.
  • Preview - the simulated code produced by codegen.
  • Transplant - integrate generated code into a target project.
Prev
Override screen size
Next
Transplant