Auto-Generate Embedded GUI C Code with Flint

Flint UI Designer converts every screen, asset, and state machine into optimised, production-ready C code with a single click — no hand-coding of UI scaffolding required.

What Is Embedded GUI Code Generation?

Embedded GUI C code generation is the process by which a visual GUI design tool — Flint UI Designer in Sparklet's case — automatically converts screen layouts, widget configurations, font tables, image assets, and state machine logic into compilable, platform-agnostic C source files ready to integrate directly into any embedded project. Flint produces three distinct output categories on every export: screen initialisation code, compressed asset code, and hierarchical state machine implementations. Each output follows the same MISRA C coding standards as the Sparklet library itself.

This means the generated code meets the same quality bar expected in safety-critical and production embedded systems — automotive, medical, industrial — without any manual quality enforcement by the developer. Hand-coding embedded GUI requires writing widget initialisation, layout calculations, asset array declarations, and state machine logic manually — typically thousands of lines for a non-trivial UI. Flint generates all of this automatically, consistently, and with zero risk of typos or formula errors in coordinate calculations.

This page explains each output category in detail, describes how the export pipeline works, and shows how to integrate Flint-generated code into your build system — whether Make, CMake, IAR Embedded Workbench, Keil MDK, or GCC.

Three Categories of Generated C Code

Flint generates screen code, asset code, and state machine code — all in a single export operation.

Screen Initialisation and Event Handler Code

For each screen designed in Flint, the exporter produces a dedicated C source file containing a widget initialisation function, layout parameters, and event handler stubs. Every function is named after its screen and event — for example, screen_main_on_btn_ok_pressed() — so the relationship between the visual design and the generated function is immediately clear.

Screen code is intentionally human-readable and well-structured. Variables follow predictable naming conventions derived from widget names assigned in Flint. Any embedded C developer can read, trace, and extend the generated files without needing to understand Flint internals. Event handler stubs are preserved across re-exports, so application logic written inside them is never overwritten.

  • One C source file per screen — clean project organisation
  • Widget IDs derived from Flint widget names — predictable everywhere
  • Event handler stubs: screen_x_on_widget_y_event()
  • Layout parameters as readable named constants, not magic numbers

Platform-Agnostic by Design — Zero Hardware Calls in Generated Code

The most important characteristic of Flint-generated code is that it contains zero hardware calls. There are no direct register writes, no display controller commands, no DMA configuration, no RTOS-specific calls. All hardware interaction is routed through Sparklet's Hardware Abstraction Layer (HAL), which is written separately by the developer once per target board.

This means the identical Flint-generated C code compiles and runs on a Renesas RH850, an NXP i.MX RT1170, an STM32H7, an Infineon TRAVEO T2G, or the Windows x86 PC simulator — with only the HAL differing between targets. Platform portability is not a configuration option; it is a structural property of how the generated code is organised. The same Flint project can simultaneously target multiple hardware platforms with a single export. Visit the Supported Platforms page for the full list of toolchains verified with Sparklet.

Build System Integration

Flint exports a standard C source tree: one directory for screen code, one for asset code, one for state machine code. This directory tree is added to your existing Makefile, CMakeLists.txt, IAR project, or Keil MDK project as a source path — no special export format, no custom IDE plugin, no proprietary build tool required. The export integrates with version control cleanly: each export produces deterministic output for unchanged inputs, so diffs contain only lines that reflect real design changes.

Delta Exports and Fast Iteration

After the initial export, Flint tracks which screens and assets have changed since the last export. On subsequent exports, only modified screens and updated assets are regenerated. Unchanged files are left exactly as they were on disk — your compiler only recompiles what actually changed. Delta export also preserves manually written application logic: developers add application code inside event handler stubs, and Flint re-exports without touching those function bodies, provided developers follow the standard code organisation convention. The Animation Designer and State Machine Editor both contribute to the same export pipeline and support the same delta behaviour.

Flint Export Output Files — Reference

Output File / DirectoryContentConsumed By
screens/screen_<name>.c/.hWidget init function, layout constants, event handler stubsSparklet EXEC layer + application event handlers
assets/img_<name>.cColour-converted, compressed raster image array (const)Sparklet GDI layer via widget ImageHolder / background
assets/font_<name>.cPre-rendered glyph bitmaps, kerning table, glyph index (const)Sparklet font engine (GDI text rendering)
assets/mesh_<name>.c3D vertex/normal/UV data in Sparklet scene format (const)Sparklet 3DWidget / 3DView renderer
strings/strings_<locale>.cString tables per language — one array per localeSparklet runtime locale switch API
statemachine/sm_<name>.c/.hFull HSM implementation using RS_MIN: states, events, guards, actionsApplication event dispatch + Sparklet EXEC layer
animations/anim_<name>.cKeyframe descriptor tables and sequence chains (const)Sparklet animation execution engine

What Flint Code Generation Delivers

Four capabilities that distinguish Flint's code generation from hand-coded embedded UI workflows.
Single-Click Export

Single-Click Export

Design once in Flint, export the entire project — screens, assets, and state machines — with a single menu action. No manual code assembly needed.

Human-Readable Output

Human-Readable Output

Generated C files use predictable naming conventions and clean structure. Any embedded C developer can read, trace, and extend them without Flint training.

MISRA C Standards

MISRA C-Compliant Code

Generated code follows the same MISRA C coding standards as the Sparklet library, making it suitable for automotive, medical, and industrial projects with compliance requirements.

Any Build System

Any Build System

Exported source trees integrate with Make, CMake, IAR Embedded Workbench, Keil MDK, and GCC-based toolchains without modification or special tooling.

FAQs: Embedded GUI Code Generation

Yes. Flint generates human-readable C with consistent naming conventions. Screen initialisation functions, widget identifiers, and event handler stubs all follow a predictable pattern tied directly to the visual design. A developer who inherits a project can read the generated code and understand the screen structure without ever opening Flint.

Generate Your Embedded GUI Code Today

Download the free Sparklet evaluation — includes Flint UI Designer, platform binaries, and sample projects. Export your first screen in minutes.