#ifndef _MYLIB_H #define _MYLIB_H #include "main.h" typedef struct ASCIIFont { uint8_t h; uint8_t w; uint8_t *chars; } ASCIIFont; extern const ASCIIFont afont8x6; extern const ASCIIFont afont12x6; extern const ASCIIFont afont16x8; extern const ASCIIFont afont24x12; /** * @brief 字体结构体 * @note 字库前4字节存储utf8编码 剩余字节存储字模数据 * @note 字库数据可以使用波特律动LED取模助手生成(https://led.baud-dance.com) */ typedef struct Font { uint8_t h; // 字高度 uint8_t w; // 字宽度 const uint8_t *chars; // 字库 字库前4字节存储utf8编码 剩余字节存储字模数据 uint8_t len; // 字库长度 超过256则请改为uint16_t const ASCIIFont *ascii; // 缺省ASCII字体 当字库中没有对应字符且需要显示ASCII字符时使用 } Font; extern const Font font16x16;//声明你的想要显示数据的结构体 /** * @brief 图片结构体 * @note 图片数据可以使用波特律动LED取模助手生成(https://led.baud-dance.com) */ typedef struct Image { uint8_t w; // 图片宽度 uint8_t h; // 图片高度 const uint8_t *data; // 图片数据 } Image; extern const Image bilibiliImg; #endif