volatile bool DataReceivedFlg = FALSE;
volatile bool DataTransmittedFlg = FALSE;
uint8_t OutData[4] = {0x00U, 0x01U, 0x02U, 0x03U};
uint8_t InpData[4];
LDD_TError Error;
LDD_TDeviceData *MyI2CPtr;
int main(void)
{
PE_low_level_init();
MyI2CPtr = I2C2_Init(NULL);
while(1)
{
Error = I2C2_SlaveReceiveBlock(MyI2CPtr, &InpData, 4U);
if(TRUE == DataReceivedFlg)
{
I2C2_SendAcknowledge(MyI2CPtr, LDD_I2C_ACK_BYTE);
DataReceivedFlg = FALSE;
}
}
}
no ack signal
I am sorry , I can't understand your problem clearly.
Can you describe the problem clearly?
Do you want find where you can enable "I2C2_SendAcknowledge" function in CodeWarrior with PE?
Do you want send NACK signal?
I2C2_SendAcknowledge(MyI2CPtr, LDD_I2C_NACK_BYTE);
I use mk10dx256vlq10 mcu, I use codewarrior 10.4 tool, I2C_LDD component Settings->Mode selection selected SLAVE.
volatile bool DataReceivedFlg = FALSE;
volatile bool DataTransmittedFlg = FALSE;
uint8_t OutData[4] = {0x00U, 0x01U, 0x02U, 0x03U};
uint8_t InpData[4];
LDD_TError Error;
LDD_TDeviceData *MyI2CPtr;
int main(void)
{
PE_low_level_init();
MyI2CPtr = I2C2_Init(NULL);
while(1)
{
Error = I2C2_SlaveReceiveBlock(MyI2CPtr, &InpData, 4U);
if(TRUE == DataReceivedFlg)
{
I2C2_SendAcknowledge(MyI2CPtr, LDD_I2C_ACK_BYTE);
DataReceivedFlg = FALSE;
}
}
}
no ack signal
Here you can find different Application notes for use I2C, could you be a bit specific about what are you trying to do? or at least could you mention an error or problem, I could search specific solutions, with more information.
Please tell me if this is useful. :smileygrin: