This repository has been archived on 2024-12-31. You can view files and clone it, but cannot push or open issues or pull requests.
mfps/App/Inc/myLib.h

52 lines
1.3 KiB
C

#ifndef _MYLIB_H
#define _MYLIB_H
#include "main.h"
extern const unsigned char F6x8[][6];
extern const unsigned char F8X16[];
extern const char Hzk[][32];
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