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.

MSPM0G3507: DL_UART_setRXInterruptTimeout details confirmation

Part Number: MSPM0G3507


Hi team:

 My customer want to evaluate our M0`s Idle interrupt, it is an interrupt that occurs when no more data is received on the bus within a byte period.

And I found the function may be suitable for this :

/**
* @brief Set the RX interrupt timeout
*
* When an additional character has not been received within the set
* timeout, a RX interrupt will still trigger even if the FIFO level has not
* been reached. A value of 0 disables this function.
*
* @param[in] uart Pointer to the register overlay for the peripheral
* @param[in] timeout Timeout to set the RX interrupt to.
* Value between 0 - 15
*/
__STATIC_INLINE void DL_UART_setRXInterruptTimeout(
UART_Regs *uart, uint32_t timeout)
{
DL_Common_updateReg(
&uart->IFLS, timeout << UART_IFLS_RXTOSEL_OFS, UART_IFLS_RXTOSEL_MASK);
}

/**
* @brief Writes value to specified register - retaining bits unaffected by mask.
*
* @param[in] reg Pointer to the register overlay for the peripheral.
* @param[in] val Value to be written to the register.
* @param[in] mask Mask defines which bits will be altered.
*/
__STATIC_INLINE void DL_Common_updateReg(
volatile uint32_t *reg, uint32_t val, uint32_t mask)
{
uint32_t tmp;

tmp = *reg;
tmp = tmp & ~mask;
*reg = tmp | (val & mask);
}

But when i look into it, i still can not get whats the meaning of the timeout Value between 0 - 15 , can you help to explain? tks !

  • Hi Allen,

    The timeout value 0-15 should be how many bits time the MCU waits for another start edge. Please find more information in the TRM.

    If the customer wants to generate an interrupt when their is no data received within the time of one byte, then they can configure the timeout value as 8 to meet their requirement. 

    Best regards,

    Cash Hao