/* Set the T3CMP timer comparator. The 'timeout' value is an offset from now.  */
static void kw41z_tmr3_set_timeout(uint32_t timeout)
/* Set the T3CMP timer comparator. The 'timeout' value is an offset from now.  */
static void kw41z_tmr3_set_timeout(uint32_t timeout)
{
	uint32_t irqsts;
	timeout += ZLL->EVENT_TMR >> ZLL_EVENT_TMR_EVENT_TMR_SHIFT;
	ZLL->PHY_CTRL &= ~ZLL_PHY_CTRL_TMR3CMP_EN_MASK;
	ZLL->T3CMP = timeout & ZLL_T3CMP_T3CMP_MASK;
	irqsts  = ZLL->IRQSTS & BM_ZLL_IRQSTS_TMRxMSK;
	irqsts |= ZLL_IRQSTS_TMR3IRQ_MASK;
	ZLL->IRQSTS = irqsts;
	ZLL->PHY_CTRL |=
		(ZLL_PHY_CTRL_TMR3CMP_EN_MASK | ZLL_PHY_CTRL_TC3TMOUT_MASK);
}