Boen_Shi 8be2866433 feat(base): 初始化 MSPM0 开发环境
- 添加头文件和配置文件支持
- 更新.gitignore忽略编译和IDE相关文件
- 添加基础的bsp代码
2026-07-16 14:45:26 +08:00

44 lines
1.0 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef HOST_H
#define HOST_H
#include "ti_msp_dl_config.h"
#include <stdint.h>
#include <cstdio>
#include "../../include/user/Print.h"
#include <stdlib.h>
#define MAX_KEYS 10
#define MAX_KEY_LENGTH 32
typedef struct {
char key[MAX_KEY_LENGTH];
double value;
} KeyValuePair;
class Host {
public:
static double posX;
static double posY;
static int x_count;
static int y_count;
static void init(); // 模块初始化
static void inject(char ch); // 数据注入串口、I2C回调函数注入数据
static double get(const char* key, double defaultValue = 0.0);
static double getWithoutClean(const char *key, double defaultValue = 0.0);
static void info(const char* format, ...);
static void warn(const char* format, ...);
static void error(const char* format, ...);
static void plot(const char* key, double value);
private:
static KeyValuePair data[MAX_KEYS];
static int count;
static void log(const char* level, const char* format, ...);
};
#endif //HOST_H