This commit is contained in:
qiyongshuang
2026-08-10 10:47:09 +08:00
parent 804daf39a2
commit dfe5ceea43
150 changed files with 20271 additions and 58 deletions
@@ -0,0 +1,170 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : wui_asset.c
* Author : WCH
* Version : V1.2.0
* Date : 2026/07/30
* Description : This file is auto-generated by WUI Designer Tool.
* : Contains WUI asset resources (strings, images, fonts).
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#include "wui_asset.h"
#include <stddef.h>
#include "LCD_Font.h"
const wui_bitfont_t wui_font_6x12 = { 6, 12, 0x20, 95, (const uint8_t*)asc2_1206 };
const wui_bitfont_t wui_font_8x16 = { 8, 16, 0x20, 95, (const uint8_t*)asc2_1608 };
/*******************************************************************************
* STRING RESOURCES
******************************************************************************/
/* Maps string IDs to string pointers */
static const char* wui_string_table[WUI_STR_COUNT] = {
[WUI_STR_NONE] = NULL,
[WUI_STR_MAIN_MAIN_TIME] = "12:34",
};
/**
* @brief Get string by ID
* @param id - String ID
* @return String pointer, or NULL if not found
*/
const char* wui_get_string(wui_str_id_t id)
{
if (id > 0 && id < WUI_STR_COUNT)
{
return wui_string_table[id];
}
return NULL;
}
/*******************************************************************************
* IMAGE TABLE RESOURCES
******************************************************************************/
static const uint16_t wui_imgtable_main_main_battery[] = {
IMAGE_RES_IMG_TPL_MAIN_BAT00,
IMAGE_RES_IMG_TPL_MAIN_BAT01,
IMAGE_RES_IMG_TPL_MAIN_BAT02,
IMAGE_RES_IMG_TPL_MAIN_BAT03,
IMAGE_RES_IMG_TPL_MAIN_BAT04,
IMAGE_RES_IMG_TPL_MAIN_BAT05,
IMAGE_RES_IMG_TPL_MAIN_BAT06,
IMAGE_RES_IMG_TPL_MAIN_BAT07,
IMAGE_RES_IMG_TPL_MAIN_BAT08,
IMAGE_RES_IMG_TPL_MAIN_BAT09,
IMAGE_RES_IMG_TPL_MAIN_BAT10,
IMAGE_RES_IMG_TPL_MAIN_BAT11,
IMAGE_RES_IMG_TPL_MAIN_BAT12,
IMAGE_RES_IMG_TPL_MAIN_BAT13,
IMAGE_RES_IMG_TPL_MAIN_BAT14,
IMAGE_RES_IMG_TPL_MAIN_BAT15,
IMAGE_RES_IMG_TPL_MAIN_BAT16,
IMAGE_RES_IMG_TPL_MAIN_BAT17,
IMAGE_RES_IMG_TPL_MAIN_BAT18,
IMAGE_RES_IMG_TPL_MAIN_BAT19,
IMAGE_RES_IMG_TPL_MAIN_BAT20,
IMAGE_RES_IMG_TPL_MAIN_BAT21,
};
static const uint16_t wui_imgtable_main_main_connection[] = {
IMAGE_RES_IMG_TPL_MAIN_CON1,
IMAGE_RES_IMG_TPL_MAIN_CON2,
IMAGE_RES_IMG_TPL_MAIN_CON3,
};
/* Maps image table IDs to image ID arrays */
static const uint16_t* wui_imgtable_list[WUI_IMGTABLE_COUNT] = {
[WUI_IMGTABLE_NONE] = NULL,
[WUI_IMGTABLE_MAIN_MAIN_BATTERY] = wui_imgtable_main_main_battery,
[WUI_IMGTABLE_MAIN_MAIN_CONNECTION] = wui_imgtable_main_main_connection,
};
/**
* @brief Get image table by ID
* @param id - Image table ID
* @return Image table pointer, or NULL if not found
*/
const uint16_t* wui_get_imgtable(wui_imgtable_id_t id)
{
if (id > 0 && id < WUI_IMGTABLE_COUNT)
{
return wui_imgtable_list[id];
}
return NULL;
}
/*******************************************************************************
* FONT RESOURCES
******************************************************************************/
/**
* @brief Font table for WUI
* @details Maps font IDs to font structures
*/
static const wui_font_t wui_font_table[WUI_FONT_COUNT] = {
[WUI_FONT_NONE] = {0},
[WUI_FONT_WUI_PAGE_MAIN_MAIN_TIME] = {
.cnt = 10,
.start_char = '0',
.width = 10,
.height = 26,
.first_img_id = IMAGE_ART_WUI_PAGE_MAIN_MAIN_TIME_0030,
},
};
const wui_font_t* wui_get_font(wui_font_id_t id)
{
if (id > 0 && id < WUI_FONT_COUNT)
{
return &wui_font_table[id];
}
return NULL;
}
/*******************************************************************************
* BITMAP FONT RESOURCES
******************************************************************************/
/* Maps bitmap font IDs to font structures */
static const wui_bitfont_t* wui_bitmap_font_table[WUI_BITMAP_FONT_COUNT] = {
[WUI_BITMAP_FONT_DEFAULT] = &wui_font_8x16,
[WUI_BITMAP_FONT_6X12] = &wui_font_6x12,
[WUI_BITMAP_FONT_8X16] = &wui_font_8x16,
};
/**
* @brief Get bitmap font by ID
* @param id - Bitmap font ID
* @return Bitmap font structure pointer, or default font if not found
*/
const wui_bitfont_t* wui_get_bitmap_font(wui_bitmap_font_id_t id)
{
if (id > 0 && id < WUI_BITMAP_FONT_COUNT) {
return wui_bitmap_font_table[id];
}
return wui_bitmap_font_table[WUI_BITMAP_FONT_DEFAULT];
}
/*********************************************************************
* @fn wui_get_image
*
* @brief Get image information by index.
*
* @param index - Image index.
*
* @return Pointer to image information structure.
*/
const image_info_t* wui_get_image(uint32_t index)
{
// return get_image(index);
uint16_t idx = IMAGE_GET_INDEX(index);
if (idx >= IMAGE_COUNT) return NULL;
return &image_table[idx];
}