static void Main(string[] args)
        {
            int data_count = 10;

            int [] dataRead   = new int [data_count];
            int [] dataRead_1 = new int[data_count];
            DM280e dm         = new DM280e("PXI2::0::INSTR", 0x0, "Simulate=1,DriverSetup=Model:DM280e");
            int    count      = 0;
            double vio;

            int [] parity = new int [data_count];
            int [] data   = new int [data_count];
            data[0]      = 0x12; //Address [15:8]
            data[1]      = 0x31; //Byte 1 data
            data[2]      = 0x31; //Byte 2 data
            data[3]      = 0x31; //Byte 3 data
            dataRead [0] = 0x12;
            dm.MIPI_ConfigureVoltageSupply(1.9, out vio);
            dm.MIPI_ConfigureClock(26000000);
            dm.MIPI_ConfigureLoopback(1, 1);
            dm.MIPI_ConfigureDelay(1, 0);
            dm.MIPI_Write(1, (0xF << 8) | (0x0 << 4) | (0x2), data);       //reg write
            dm.MIPI_Read(1, 1, (0xF << 8) | (0x2 << 4) | (0x2), dataRead); //reg read
            dm.MIPI_Retrieve(1, out count, dataRead_1, parity);
            dm.Reset();
            dm.Close();
            Console.ReadLine();
        }
예제 #2
0
        public void MIPI_Reg_Write(int channel, int slaveAdd, int dataAdd, int data)
        {
            int wrCommand = 0;

            int[] dataFrame = new int[16];
            if (dataAdd == 0)
            {
                wrCommand = (slaveAdd << 8) | (0x1 << 7) | (data);
            }
            else if (dataAdd > 0 && dataAdd < 32)
            {
                wrCommand    = (slaveAdd << 8) | (0x2 << 5) | (dataAdd);
                dataFrame[0] = data;
            }

            _aemDm280.MIPI_Write(channel, wrCommand, dataFrame);
        }