New MCC i2c code no write CMD, why?

New MCC i2c code no write CMD, why?

Postby jlian168 » Thu Oct 08, 2020 7:09 am

Dear All :

void I2C2_Write1ByteRegister(i2c2_address_t address, uint8_t reg, uint8_t data)
{
while(!I2C2_Open(address)); // sit here until we get the bus..
I2C2_SetDataCompleteCallback(wr1RegCompleteHandler,&data);
I2C2_SetBuffer(&reg,1);
I2C2_SetAddressNackCallback(NULL,NULL); //NACK polling?
I2C2_MasterWrite();
while(I2C2_BUSY == I2C2_Close()); // sit here until finished.
}

How can I to change to can write CMD? like below...
void I2C2_Write1ByteRegister(i2c2_address_t address, uint8_t reg);

Thank u.
jlian168
 
Posts: 5
Joined: Mon Jun 16, 2014 8:49 am

Return to SSP (IIC, SPI)

Who is online

Users browsing this forum: No registered users and 9 guests