I'm trying to get SMBus transactions made for EFM8. Im not sure why Im getting errors for Write function:
'I2C_MasterWrite': requires ANSI-style prototype
Prototype function
void I2C_MasterWrite();
I put unsigned char* into () of prototype then it shows issues with SMB_DATA_OUT in the ISR part.
I write I2C_MasterWrite(InaConf); in the program.
'I2C_MasterWrite': requires ANSI-style prototype
Code:
void I2C_MasterWrite(unsigned char* PtrtoCmdBuffer)
{
while(SMB_BUSY); // Wait for SMBus to be free.
SMB_BUSY = 1; // Claim SMBus (set to busy)
SMB_RW = 0; // Mark this transfer as a WRITE
TARGET = PtrtoCmdBuffer[0]; //copy the slave address from the transaction array to the global variable
SMB_DATA_OUT = PtrtoCmdBuffer + 2; //set the address of the first data byte in the transaction array
I2C_FinalWriteAddress = SMB_DATA_OUT + (PtrtoCmdBuffer[1] - 1); //set the final address based on the number of bytes to be transmitted
SFRPAGE = SMB0_PAGE;
SMB0CN0_STA = 1; //initiate the transaction by setting the start-condition bit
}
void I2C_MasterWrite();
I put unsigned char* into () of prototype then it shows issues with SMB_DATA_OUT in the ISR part.
I write I2C_MasterWrite(InaConf); in the program.