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.
tca6424a 3组port口设置为输出,发送主机写地址后,写命令0x05设置第二组port口为输出,接着写数据,输出电平不会变化。。。。但是设置为输入时,能采集到外部电平变化。从机地址是0x44
有了解的,能给点建议吗????
void tca6424_writeData(uint8_t slaveAddr, uint8_t sendData)
{
//开始信号
I2C_GenerateSTART(TCA6424_I2C_BASE_PTR);
//发送从机地址
I2C_Send7bitAddress(TCA6424_I2C_BASE_PTR, slaveAddr, I2C_MASTER_WRITE);
I2C_WaitAck(TCA6424_I2C_BASE_PTR);
I2C_SetMasterMode(TCA6424_I2C_BASE_PTR,I2C_MASTER_WRITE);
//发送功能码,设置输出
I2C_SendData(TCA6424_I2C_BASE_PTR,0x04);
I2C_WaitAck(TCA6424_I2C_BASE_PTR);
// //写数据
I2C_SendData(TCA6424_I2C_BASE_PTR,sendData);
I2C_WaitAck(TCA6424_I2C_BASE_PTR);
//停止I2C
I2C_GenerateSTOP(TCA6424_I2C_BASE_PTR);
}