/// <summary>
        /// If the module has an Eiger carrier then poll the status register bit field with a timeout
        /// Status Reg (0x4334)
        /// BlazeBusy (Bit 1) == 1 => busy
        /// BlazeBusy (Bit 1) == 0 => okay to write next data set
        /// </summary>
        /// <param name="statusRegister"></param>
        /// <returns></returns>
        private static bool Poll(IRegister statusRegister)
        {
            DateTime  startTime   = DateTime.Now;
            const int TIME_OUT_MS = 10;
            const int BLAZE_BUSY  = 0x1;

            while ((statusRegister.Read32() & BLAZE_BUSY) == BLAZE_BUSY)
            {
                TimeSpan timeSpan = DateTime.Now - startTime;
                if (timeSpan.TotalMilliseconds > TIME_OUT_MS)
                {
                    return(false);
                }
            }
            return(true);
        }
Exemple #2
0
 public override int Read()
 {
     mRegister.Read32();
     return((int)ReadBitField());
 }