首页 | 嵌入式系统 | 显示技术 | 模拟IC/电源 | 元件与制造 | 其他IC/制程 | 消费类电子 | 无线/通信 | 汽车电子 | 工业控制 | 医疗电子 | 测试测量
首页> 分享下载> 嵌入式系统> 用计算机并口模拟SPI通讯的C源程序

用计算机并口模拟SPI通讯的C源程序

资料介绍
用计算机并口模拟SPI通讯的C源程序

#define LPT_PORT 0x378
#define CLR_WCK(X) {X=X&(~(1<<0)); outportb(LPT_PORT,X); } // data.0
#define SET_WCK(X) {X=X | (1<<0) outportb(LPT_PORT,X); }
#define CLR_BCK(X) {X=X&(~(1<<2)); outportb(LPT_PORT,X); } // data.2
#define SET_BCK(X) {X=X | (1<<2) outportb(LPT_PORT,X); }
#define CLR_DATA(X) {X=X&(~(1<<3)); outportb(LPT_PORT,X); } // data.3
#define SET_DATA(X) {X=X | (1<<3) outportb(LPT_PORT,X); }
#define FALSE 0
#define TRUE 1
void test_comm()
{
unsigned char data
data = 0;
printf("Please press enter to begin send data\n");
getch();
printf("Pull down WCK data.0\n");
CLR_WCK(data);
getch();
printf("Pull up WCK data.0\n");
SET_WCK(data);
getch();
printf("Pull down BCK data.2\n");
CLR_BCK(data);
get
标签: 计算机并口模拟SPIC源程序
用计算机并口模拟SPI通讯的C源程序
本地下载

评论