跳转至

lib/graphic/fast_test/demo_support/demo_manager.h

Generic demo manager for CFBD-based embedded GUI demonstrations. More...

Classes

Name
struct CFBD_DemoDescriptor
Demo descriptor structure.

Types

Name
enum CFBD_DemoRunMode { CFBD_DEMO_RUN_SINGLE, CFBD_DEMO_RUN_QUEUE, CFBD_DEMO_RUN_LOOP}
Demo run mode.
typedef void(*)(CFBD_GraphicDevice *dev) CFBD_DemoEntry

Functions

Name
void CFBD_DemoManager_Run(CFBD_GraphicDevice * dev, const CFBD_DemoDescriptor * demos, uint32_t demo_count, CFBD_DemoRunMode mode, uint32_t index)
Run demos according to selected mode.

Detailed Description

Generic demo manager for CFBD-based embedded GUI demonstrations.

Author: CharlieChen

This module provides a unified mechanism to:

  • Register independent demo modules
  • Run a single specified demo
  • Run demos sequentially (queue mode)
  • Run demos in circular rotation (loop mode)

Design goals:

  • No dynamic memory allocation
  • Pure C, OOP-style abstraction
  • Easy extensibility (add a demo = add one file)

Types Documentation

enum CFBD_DemoRunMode

Enumerator Value Description
CFBD_DEMO_RUN_SINGLE Run only one demo
CFBD_DEMO_RUN_QUEUE Run demos sequentially once
CFBD_DEMO_RUN_LOOP Run demos continuously in loop

Demo run mode.

typedef CFBD_DemoEntry

typedef void(* CFBD_DemoEntry) (CFBD_GraphicDevice *dev);

Functions Documentation

function CFBD_DemoManager_Run

void CFBD_DemoManager_Run(
    CFBD_GraphicDevice * dev,
    const CFBD_DemoDescriptor * demos,
    uint32_t demo_count,
    CFBD_DemoRunMode mode,
    uint32_t index
)

Run demos according to selected mode.

Parameters:

  • dev Graphic device
  • demos Demo descriptor array
  • demo_count Number of demos
  • mode Run mode
  • index Index used only in SINGLE mode

Run demos according to selected mode.

Source code

#pragma once
#include <stdint.h>

#include "cfbd_graphic_define.h"


typedef void (*CFBD_DemoEntry)(CFBD_GraphicDevice* dev);

typedef struct
{
    const char* name;     
    CFBD_DemoEntry entry; 
    uint32_t duration;    
} CFBD_DemoDescriptor;

typedef enum
{
    CFBD_DEMO_RUN_SINGLE, 
    CFBD_DEMO_RUN_QUEUE,  
    CFBD_DEMO_RUN_LOOP    
} CFBD_DemoRunMode;

void CFBD_DemoManager_Run(CFBD_GraphicDevice* dev,
                          const CFBD_DemoDescriptor* demos,
                          uint32_t demo_count,
                          CFBD_DemoRunMode mode,
                          uint32_t index);

Updated on 2026-02-03 at 13:21:55 +0000