/* Reset PCNT to same state as after a HW reset. 
Notice the LFACLK must be enabled, since some basic reset is done with this clock. The pulse counter clock for the selected instance must also be enabled prior to init. */
void PCNT_Reset(PCNT_TypeDef *pcnt)
/* Reset PCNT to same state as after a HW reset. 
Notice the LFACLK must be enabled, since some basic reset is done with this clock. The pulse counter clock for the selected instance must also be enabled prior to init. */
void PCNT_Reset(PCNT_TypeDef *pcnt)
{
  unsigned int inst;
  EFM_ASSERT(PCNT_REF_VALID(pcnt));
  inst = PCNT_Map(pcnt);
  pcnt->IEN = _PCNT_IEN_RESETVALUE;
  BITBAND_Peripheral(&(pcnt->CTRL), _PCNT_CTRL_RSTEN_SHIFT, 1);
  CMU_PCNTClockExternalSet(inst, false);
  PCNT_TopBufferSet(pcnt, _PCNT_TOPB_RESETVALUE);
  pcnt->CTRL = _PCNT_CTRL_RESETVALUE | PCNT_CTRL_RSTEN;
  PCNT_Sync(pcnt, PCNT_SYNCBUSY_CTRL);
  BITBAND_Peripheral(&(pcnt->CTRL), _PCNT_CTRL_RSTEN_SHIFT, 0);
  pcnt->IFC = _PCNT_IFC_MASK;
}