欢迎来到天天文库
浏览记录
ID:38687528
大小:34.00 KB
页数:9页
时间:2019-06-17
《软件模拟SPI源码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、typedef unsigned char boolean; /* 布尔变量 */typedef unsigned char uint8; /* 无符号8位整型变量 */typedef signed char int8; /* 有符号8位整型变量 */
2、typedef unsigned short uint16; /* 无符号16位整型变量 */typedef signed short int16; /* 有符号16位整型变量 */typedef unsigned int uint32; /* 无符号32位整型变量 */type
3、def signed int int32; /* 有符号32位整型变量 */typedef float fp32; /* 单精度浮点数(32位长度) */typedef double fp64; /* 双精度浮点数(64位长度) #define R0 0#define R1 1#defi
4、ne R1b 2#define R2 3#define R3 4uint32 loop_time;uint8 rep[5];#define nop() do{;}while(0);#define CS_PIN 6 //RS VD4#define DI_PIN 7 //RW VD6#define SD_CS_PORT rPDATE#define SD_CS_DDR_PORT rPCONE#define SD_CS_PUP_PORT rPUPE#define S
5、D_DI_PORT rPDATE#define SD_DI_DDR_PORT rPCONE#define SD_DI_PUP_PORT rPUPE#define DO_PIN 12 //EN VD5#define CLK_PIN 13 //RS VD4#define SD_DO_PORT rPDATC#define SD_DO_DDR_PORT rPCONC#define SD_DO_PUP_PORT rPUPC#define SD_CLK_PORT
6、 rPDATC#define SD_CLK_DDR_PORT rPCONC#define SD_CLK_PUP_PORT rPUPC#define CS_LOW() SD_CS_PORT &= ~(1<< CS_PIN)#define CS_HIGH() SD_CS_PORT
7、= (1<< CS_PIN)#define DI_LOW() SD_DI_PORT &= ~(1<< DI_PIN)#define DI_HIGH() SD_DI_PORT
8、= (1<< DI_PI
9、N)#define CLK_LOW() SD_CLK_PORT &= ~(1<< CLK_PIN)#define CLK_HIGH() SD_CLK_PORT
10、= (1<< CLK_PIN)#define DO() SD_DO_PORT & (0x01<11、oop(uint32 i)//-----------------------------------------------------------{while (i--){;//nop();}} //-----------------------------------------------------------//发送一
11、oop(uint32 i)//-----------------------------------------------------------{while (i--){;//nop();}} //-----------------------------------------------------------//发送一
此文档下载收益归作者所有