#include<msp430x16x.h>
#include"12864.h"
#include"spi.h"
char addr1 = 0,addr2 = 0,addr3 = 0;
char map[10] = {'0','1','2','3','4','5','6','7','8','9'};
char value;
void test()
{
char a,b,c,d,e;
int_spi();
bulk_erase();
delaynms(2000);
addr1 = 0;addr2 = 0;addr3 = 0;
write_data(addr1,addr2,addr3,0xaa);
delaynms(50);
value = read_data(addr1,addr2,addr3);
a = value/10000;
b = value%10000/1000;
c = value%1000/100;
d = value%100/10;
e = value%10;
write(0,1);
write(0,0x80);
write(1,map[a]);
write(0,0x81);
write(1,map[b]);
write(0,0x82);
write(1,map[c]);
write(0,0x83);
write(1,map[d]);
write(0,0x84);
write(1,map[e]);
}
顺便加上读写的主函数部分,一并感谢大家持续的关注和建议 |