📄 main.c
字号:
#include <iom8v.h>
#include "mytype.h"
#include "flash.h"
#include "uart.h"
#include "spi.h"
uint8 table[16]="0123456789abcdef";
extern uint8 read_string[];
void main(void)
{
uint8 i,j;
WP_1;
Spi_init();//SPI初始化。
Uart_init();//串口初始化。
Prints("System starting...",1);
Sector_Erase(0x000005);//擦除第一段。
Write_string("Hello,I'm a flash!",0x000001,19);//写入一段字符串。
Read_string(0x000001,18);//读取地址0x000001开始的18个字节。
Prints(read_string,1);//读取数据发送到串口。
while(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -