Exemple #1
0
        private int sr_load(byte reg, byte data)
        {
            int rc = JanusAudio.WriteControlMsg(usbDevHandle,
                                                VRT_VENDOR_OUT,
                                                VRQ_SDR1K_CTL,
                                                SDR1KCTRL_SR_LOAD,
                                                (reg << 8) | data,
                                                null,
                                                0,
                                                1000);

            // Thread.Sleep(10);
            // System.Console.WriteLine("sr_load: reg:" + reg + " data: " + data + " rc: " + rc);
            return(rc);
        }
Exemple #2
0
        private int dds_write(byte addr, byte data)
        {
            int rc = JanusAudio.WriteControlMsg(usbDevHandle,
                                                VRT_VENDOR_OUT,
                                                VRQ_SDR1K_CTL,
                                                SDR1KCTRL_DDS_WRITE,
                                                (addr << 8) | data,
                                                null,
                                                0,
                                                1000);

            // Thread.Sleep(10);
            // System.Console.WriteLine("dds_write: addr:" + addr + " data: " + data + " rc: " + rc);
            return(rc);
        }
Exemple #3
0
        private int latch(byte latchid, byte data)
        {
            int rc = 0; JanusAudio.WriteControlMsg(usbDevHandle,
                                                   VRT_VENDOR_OUT,
                                                   VRQ_SDR1K_CTL,
                                                   SDR1KCTRL_LATCH,
                                                   (latchid << 8) | data,
                                                   null,
                                                   0,
                                                   1000);

            // Thread.Sleep(10);
            // System.Console.WriteLine("latch: latchid: " + latchid + " data: " + data + " rc: " + rc);
            return(rc);
        }
Exemple #4
0
        private int dds_reset()
        {
            int rc = JanusAudio.WriteControlMsg(usbDevHandle,
                                                VRT_VENDOR_OUT,
                                                VRQ_SDR1K_CTL,
                                                SDR1KCTRL_DDS_RESET,
                                                0,
                                                null,
                                                0,
                                                1000);

            // Thread.Sleep(10);
            // System.Console.WriteLine("dds_reset: rc: " + rc);
            return(rc);
        }
Exemple #5
0
        private int get_status_port()
        {
            byte[] buf = new byte[1];

            int rc = JanusAudio.WriteControlMsg(usbDevHandle,
                                                VRT_VENDOR_IN,
                                                VRQ_SDR1K_CTL,
                                                SDR1KCTRL_READ_STATUS,
                                                0,
                                                buf,
                                                buf.Length,
                                                1000);

            if (rc == buf.Length)
            {
                rc = (int)((uint)(buf[0]));
                rc = swizzleStatusBits(rc);
#if false
                ++read_ok_count;
#endif
            }
            else
            {
                rc = -1;
#if false
                ++read_notok_count;
#endif
            }
            // Thread.Sleep(10);
#if false
            if (dbgGate == 100)
            {
                System.Console.WriteLine("get_status: data: 0x" + rc.ToString("X") + " read_ok: " + read_ok_count + " read_not_ok: " + read_notok_count);
            }
            ++dbgGate;
            if (dbgGate >= 101)
            {
                dbgGate          = 0;
                read_ok_count    = 0;
                read_notok_count = 0;
            }
#endif
            return(rc);
        }