用计算机并口模拟SPI通讯的C源程序 #define LPT_PORT 0x378 #define CLR_WCK(X) {X=X&(~(1 #define SET_WCK(X) {X=X | (1 #define CLR_BCK(X) {X=X&(~(1 #define SET_BCK(X) {X=X | (1 #define CLR_DATA(X) {X=X&(~(1 #define SET_DATA(X) {X=X | (1 #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……