Other Parts Discussed in Thread: CC1310
1.有两个iic设备,地址相同,要分开读。计划分时复用iic,iic管脚可以动态绑定吗
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
1.有两个iic设备,地址相同,要分开读。计划分时复用iic,iic管脚可以动态绑定吗
您好,
感谢您的提问。我们不是很确定您所说的iic管脚的动态绑定意思。
按照我们的理解,您是想使用两个地址相同的i2c设备并在不同的时间调用。
那可以将slave设备接在不同的引脚上,然后在需要使用的时候切换引脚。用完一个,关掉i2C,再重新初始化。
在CC1310的CC1310_LAUNCHXL.c中有如下:
const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC1310_LAUNCHXL_I2CCOUNT] = {
{
.baseAddr = I2C0_BASE,
.powerMngrId = PowerCC26XX_PERIPH_I2C0,
.intNum = INT_I2C_IRQ,
.intPriority = ~0,
.swiPriority = 0,
.sdaPin = CC1310_LAUNCHXL_I2C0_SDA0,
.sclPin = CC1310_LAUNCHXL_I2C0_SCL0,
}
};
改.sclPin和.sdaPin应该就可以,相应的board.h也需要修改。(操作类似于您在https://e2echina.ti.com/support/wireless-connectivity/sub-1-ghz/f/sub-1-ghz-forum/756952/launchxl-cc1310-cc1310-iic)
改完了之后要重新初始化I2C。
您好,
关于I2C的API您可以查看:I2C.h File Reference