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.

TMS570LS1227: N2HET Emulated I2C Stop Condition Interrupt

Part Number: TMS570LS1227

Hello,

I have been using N2HET Emulated I2C app code and I can see the transmit, receive and NACK interrupt. How can I get stop condition detect interrupt from het1HighLevelInterrupt() function ? 


#pragma CODE_STATE(het1HighLevelInterrupt, 32)
#pragma INTERRUPT(het1HighLevelInterrupt, IRQ)

void het1HighLevelInterrupt(void)
{
    uint32_t vect = hetREG1->OFF1;
	switch (vect)
    {
    case 11: /*--------------------------->      Transmit interrupt */
    	if(Data_Send_HET<3)
    	{
    		HetI2CPutData(*I2C1_txptr++, IntEna);
    		Data_Send_HET++;
    	}
    	if(Start_Repeat==1)
    	{
    		if(Data_Send_HET<5)
    		{
    			HetI2CPutData(*I2C1_txptr++, IntEna);
    			Data_Send_HET++;
    		}
    		else if(Data_Send_HET==5)
    		{
    			RW = 1; //Read
    			IntEna = 0;//no transmit interrupt
    			HetI2CPutAddr(I2C2_ADDR, RW, 2, IntEna, 1);//now, start to receive two data bytes and generate stop bit
    		}
    	}
    	break;
    case 15: /*--------------------------->      Receive interrupt */
    	*I2C1_rxptr++ = (hetRAM1->Instruction[0x2C].Data>>8) & 0xFF;  // read the data
    	Data_Rece_HET++;
        break;
   	case 18:  /*--------------------------->      No ACK interrupt */

   	case 29: /* timeout2*/
   	case 8: /* timeout6*/
   	case 2: /* timeout9*/

   	default:
        	/* timeout + phantom interrupt, clear flags and return */
       	while(1);
       	break;
    }
}

/* USER CODE BEGIN (6) */
/* USER CODE END */

Best Regards