|
弄了个简单的SPI程序:
#include "def.h"
#include "option.h"
#include "2440addr.h"
#include "2440lib.h"
#include "cc2420.h"
void spi_poll_done(void);
char RXdata[],TXdata[],test=0;
extern char RX[4];
/************SPI的初始化程序*************
GPG2-----nSS0 GPE11-----MISO
GPE12----MOSI GPE13-----SPICLK
GPG0-----VREG_EN GPG6------RSTn
GPG10-----SFD GPG7------CCA
GPG11----FIFO GPG5-----FIFO_P
GPG1-----CSn
*****************************************/
void Init_SPI(void)
………………
编译后出现如下错误
2440spi.c:1:17: error: def.h: No such file or directory
2440spi.c:2:20: error: option.h: No such file or directory
2440spi.c:3:22: error: 2440addr.h: No such file or directory
2440spi.c:4:21: error: 2440lib.h: No such file or directory
2440spi.c:5:20: error: cc2420.h: No such file or directory
2440spi.c:6:22: error: mach/spi.h: No such file or directory
2440spi.c:7:27: error: linux/spi/spi.h: No such file or directory
2440spi.c: In function 'Init_SPI':
2440spi.c:25: error: 'rGPECON' undeclared (first use in this function)
2440spi.c:25: error: (Each undeclared identifier is reported only once
2440spi.c:25: error: for each function it appears in.)
2440spi.c:27: error: 'rGPGCON' undeclared (first use in this function)
2440spi.c:30: error: 'rGPGUP' undeclared (first use in this function)
2440spi.c:31: error: 'rGPEUP' undeclared (first use in this function)
2440spi.c:34: error: 'rSPPRE0' undeclared (first use in this function)
2440spi.c:35: error: 'rCLKCON' undeclared (first use in this function)
2440spi.c:36: error: 'rSPCON0' undeclared (first use in this function)
2440spi.c:37: error: 'rSPPIN0' undeclared (first use in this function)
2440spi.c:39: error: 'rSPTDAT0' undeclared (first use in this function)
2440spi.c: In function 'WRITE_SPI':
2440spi.c:46: error: 'rSPTDAT0' undeclared (first use in this function)
2440spi.c: In function 'spi_poll_done':
2440spi.c:52: error: 'rSPSTA0' undeclared (first use in this function)
2440spi.c: In function 'Read_SPI':
2440spi.c:58: error: 'rSPRDAT0' undeclared (first use in this function)
make: *** [proexe] Error 1
朋友说是在工程文件夹下,除了应用程序2440spi和makefile以外,还需要一个定义各个头文件的文件,但是查了很多资料都没有说是怎么写的……求各位高人指点,要再加一个什么文件,名字是什么?内容是什么?多谢,多谢! |
|