⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bootpara.h

📁 移植好的UCOS2.86版
💻 H
字号:
#ifndef BOOTPARAMS_H
#define	BOOTPARAMS_H

typedef struct {            //定义一个参数项的结构体类型(每项有12个字符和32bit空间)
	char flags[12];
	unsigned int val;
} ParamItem;

typedef struct {            // 定义一个
	ParamItem start;        // 启动代码标志
	ParamItem cpu_clk;      // CPU 时钟
	ParamItem boot_delay;   // boot自动启动的时间
	ParamItem serial_sel;   // 串口号
	ParamItem serial_baud;  // 波特率
	ParamItem machine;      //
	ParamItem run_addr;     // 应用程序启动地址
	ParamItem root_sel;
	ParamItem tty_sel;
	ParamItem initrd_addr;
	ParamItem initrd_len;
	ParamItem mem_cfg;
	ParamItem devfs_sel;
	ParamItem osstor;
	ParamItem user_params;
	char string[128];
} BootParams;

typedef struct {
	ParamItem vid;
	ParamItem pid;
	ParamItem ser_l;
	ParamItem ser_h;
	ParamItem user_params;
	char string[128];
} VenderParams;

int search_params(void);
int save_params(void);
int set_params(void);

#define	DEFAULT_USER_PARAMS	""//"display=shp240"

#ifdef GLOBAL_PARAMS

//小于等于512个字节,最多保存24个ITEM和128字节用户定义的字符串
BootParams boot_params = {
	{"bootpara", 3},	//0=boot without parameters,1=boot with parameters
	{"cpuclk",   0},	//0=296M, 1=399M, 2=400M, 3=440M
	{"rundelay", 5},	//0 seconds
	{"serial",   1},	//0=serial port 0, 1=serial port 1
	{"baudrate", 115200},
	{"machine",  193},
	{"runAddr",  0x30400000}, 
	{"rootfs",   0},
	{"tty",      1},
	{"initrdA",  0},
	{"initrdL",  0},
	{"memsize",  0x04000000},
	{"devfs",    1},
	{"ostore",   0},	//0=nand, 1=nor
	{"userpara", sizeof(DEFAULT_USER_PARAMS)},
	DEFAULT_USER_PARAMS
};

//小于等于256字节
VenderParams vend_params = {
	{"VendID",   0x76543210},
	{"ProdID",   0xfedcba98},
	{"Serial_L", 0x01234567},
	{"Serial_H", 0x89abcdef},
	{"userpara", 1},	//0=data, 1=string
	"www.ramar.com.cn"
};

#else

extern BootParams boot_params;
extern VenderParams vend_params;

#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -