S32K144: SDK LPUART idle line interrupt support

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K144: SDK LPUART idle line interrupt support

Jump to solution
2,683 Views
Joao_Roscoe
Contributor III

As far as I could understand, both S32SDK_S32K1xx_RTM_3.0.0 and S32SDK_S32K14x_RTM_2.0.0 won't support the idle line interrupt - LPUART_INT_IDLE_LINE.

Is that correct?

I need to deal with Rx frames with lengths I don't know in advance. So far, I'm doing that by passing a large Rx buffer and by pooling it's content until I find a complete, consistent frame. It works, but a pure interrupt solution would be cleaner and faster.

What would it take to add LPUART_INT_IDLE_LINE support? Any plans to add it?

Best regards,

Joao

1 Solution
2,349 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Joao Roscoe

No, unfortunately, this option is not available in SDK software yet, sorry for the inconveniences that this may cause you. Still, you could add the support of this interrupt in the LPUART_DRV_IRQHandler of the lpiart?driver.c file, here you can create your handler for the specific LPUART_INT_IDLE_LINE interruption.


Have a great day,
TIC

-------------------------------------------------------------------------------
Note: If this post answers your question, please click the "Mark Correct" button. Thank you!

-------------------------------------------------------------------------------

View solution in original post

2 Replies
2,350 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Joao Roscoe

No, unfortunately, this option is not available in SDK software yet, sorry for the inconveniences that this may cause you. Still, you could add the support of this interrupt in the LPUART_DRV_IRQHandler of the lpiart?driver.c file, here you can create your handler for the specific LPUART_INT_IDLE_LINE interruption.


Have a great day,
TIC

-------------------------------------------------------------------------------
Note: If this post answers your question, please click the "Mark Correct" button. Thank you!

-------------------------------------------------------------------------------

2,349 Views
dony
Contributor II

Hi TIC,

   I try to add the LPUART idle line interrupt - LPUART_INT_IDLE_LINE based on S32SDK_S32K1xx_RTM_3.0.0.

  • Firstly, set the CTRL[ILT] and CTRL[IDLECFG]:

LPUART_SetParityMode(base, lpuartUserConfig->parityMode);
LPUART_SetStopBitCount(base, lpuartUserConfig->stopBitCount);

/* Config: 8 idle character(s) must be received before the IDLE flag is set.*/
base->CTRL = (base->CTRL & ~LPUART_CTRL_IDLECFG_MASK) | (3 << LPUART_CTRL_IDLECFG_SHIFT);

/* Idle character bit count starts after stop bit. */
base->CTRL = (base->CTRL & ~LPUART_CTRL_ILT_MASK) | (1 << LPUART_CTRL_ILT_SHIFT);

  • Secondly, enable the CTRL[IDLE] in the function LPUART_DRV_StartReceiveDataUsingInt() or LPUART_DRV_StartReceiveDataUsingDma():

/* Enable LPUART Rx IDLE interrupt */
LPUART_SetIntMode(base, LPUART_INT_IDLE_LINE, true);

  • Lastly, add  handler for the LPUART_INT_IDLE_LINE interruption to the LPUART_DRV_IRQHandler():

/* Handle idle line interrupt */
if (LPUART_GetIntMode(base, LPUART_INT_IDLE_LINE))
{
   if (LPUART_GetStatusFlag(base, LPUART_IDLE_LINE_DETECT))
   {
      LPUART_IdleLineIrqHandler(instance);
   }
}

   After that, it still can not trigger the LPUART_INT_IDLE_LINE interruption when I send a string to the LPUART.

Is it configured correctly? Is there anything that I haven't done?

Have a great day,

Cyril

0 Kudos
Reply