在编译 "I2C" 程序的时候,总是通不过。提示错误信息为:
warning: #223-D: function "I2CMasterSlaveAddrSet" declared implicitly
warning: #223-D: function "I2CMasterDataPut" declared implicitly
warning: #223-D: function "I2CMasterControl" declared implicitly
error: #20: identifier "I2C_MASTER_CMD_BURST_SEND_START" is undefined
warning: #223-D: function "I2CMasterBusy" declared implicitly
error: #20: identifier "I2C_MASTER_CMD_BURST_SEND_CONT" is undefined
error: #20: identifier "I2C_MASTER_CMD_BURST_SEND_FINISH" is undefined
PCA9535.c - 3 Error(s), 4 Warning(s).
当时的头文件为:
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_gpio.h"
#include "inc/hw_i2c.h"
#include "driverlib/sysctl.h"
最后加上“#include "driverlib/i2c.h”之后编译通过,我一直以为"inc/hw_i2c.h"和 "driverlib/i2c.h"这种头文件的作用是一样的。请大家帮忙解释下它们的区别呢?谢谢了!!! |