Esempio n. 1
0
        protected override bool _CaptureStart(int num)
        {
            capnum  = num;
            captime = DateTime.Now;

            uint[] array = new uint[] { 1u, (uint)RX_BUF_SIZE, (uint)num };

            USBIFSTATUS sTATUS = USBIF.SendCommand(7u, array, array.Length);

            if (sTATUS != USBIFSTATUS.E_OK)
            {
                throw new IOException(sTATUS.ToString());
            }

            if (!USBIF.Reset())
            {
                throw new IOException("can't reset device");
            }

            USBIF.WriteReg(0x8000, 1u, 0u); //0x8000 = 32768u
            while ((array[0] & 1u) != 0u)
            {
                USBIF.ReadReg(0x8000, ref array[0], 0u); //0x8000 = 32768u
                Thread.Sleep(100);
            }

            return(true);
        }
Esempio n. 2
0
        protected override bool _Start()
        {
            USBIFSTATUS sTATUS = USBIF.SendCommand(0x07, new uint[] { 0u, (uint)RX_BUF_SIZE, 0 }, 3);

            if (sTATUS != USBIFSTATUS.E_OK)
            {
                throw new IOException(sTATUS.ToString());
            }
            if (!USBIF.Reset())
            {
                throw new IOException("can't reset device");
            }

            var result = btc_SetStartDMA();

            return(true);
        }
Esempio n. 3
0
        protected override bool _Capture()
        {
            if (capnum <= 0)
            {
                return(false);
            }
            capnum--;

            USBIFSTATUS sTATUS = btc_CapSet();

            if (sTATUS != USBIFSTATUS.E_OK)
            {
                throw new IOException($"Capture Err {sTATUS}");
            }

            if (!decflag)
            {
                //lock (lockobj) decodeIO();
                //imgbufflag = System.DateTime.Now.ToString("HHmmssfff");
            }

            return(true);
        }