private void RC_MASK(ref RATIO_CNTR rc) { rc.val &= (((ulong)1 << 20) - 1); }
private uint RC_GET_VAL(ref RATIO_CNTR rc) { return((uint)(rc.val >> 20)); }
private void RC_RESET_PRESTEP(ref RATIO_CNTR rc) { rc.val = ((ulong)1 << 20) - rc.inc; }
private void RC_RESET(ref RATIO_CNTR rc) { rc.val = 0; }
private void RC_STEP(ref RATIO_CNTR rc) { rc.val += rc.inc; }
//RATIO_CNTR; private void RC_SET_RATIO(ref RATIO_CNTR rc, uint mul, uint div) { rc.inc = (ulong)((((ulong)mul << 20) + div / 2) / div); //RC_SHIFT=20 }