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 !
