/* Set PCNT operational mode. 
Notice that this function does not do any configuration. Setting operational mode is normally only required after initialization is done, and if not done as part of initialization. Or if requiring to disable/reenable pulse counter. */
void PCNT_Enable(PCNT_TypeDef *pcnt, PCNT_Mode_TypeDef mode)
/* Set PCNT operational mode. 
Notice that this function does not do any configuration. Setting operational mode is normally only required after initialization is done, and if not done as part of initialization. Or if requiring to disable/reenable pulse counter. */
void PCNT_Enable(PCNT_TypeDef *pcnt, PCNT_Mode_TypeDef mode)
{
  uint32_t tmp;
  EFM_ASSERT(PCNT_REF_VALID(pcnt));
  tmp  = pcnt->CTRL & ~_PCNT_CTRL_MODE_MASK;
  tmp |= (uint32_t)mode << _PCNT_CTRL_MODE_SHIFT;
  PCNT_Sync(pcnt, PCNT_SYNCBUSY_CTRL);
  pcnt->CTRL = tmp;
}