#include "cpswhalstddef.h"
#include "cpswhalutlsupport.h"

void cpswHalUtlUnReset(bit32u ResetBase,bit32u ResetBit)
  {
  bit32u *base=(bit32u*)ResetBase;
  cpswHalUtlReset(ResetBase,ResetBit);
  *base|=(1<<ResetBit);
  cpswHalUtlClockWait(ResetBase,64);
  }

void cpswHalUtlReset(bit32u ResetBase,bit32u ResetBit)
  {
  bit32u *base=(bit32u*)ResetBase;
  *base&=~(1<<ResetBit);
  cpswHalUtlClockWait(ResetBase,64);
  }

void cpswHalUtlClockWait(bit32u resetbase,unsigned int et)
  {
  volatile unsigned *rb=(volatile unsigned *)resetbase;
  unsigned int i;

  et/=4;
  while(et--)
    i=*rb;
  }
