Example #1
0
File: Jrk.cs Project: lukazikus/mmc
        private UInt16 getRequest(jrkRequest requestId, UInt16 id, Byte length)
        {
            UInt16 value = 0;

            byte[] value_array;

            if (length == 2)
            {
                value_array = new byte[2];
                controlTransfer(0xC0, (Byte)requestId, 0, (ushort)id, value_array);
                value = (ushort)(value_array[0] + 256 * value_array[1]);
            }
            else if (length == 1)
            {
                value_array = new byte[1];
                controlTransfer(0xC0, (Byte)requestId, 0, (ushort)id, value_array);
                value = value_array[0];
            }
            else
            {
                throw new ArgumentException("length must be 1 or 2", "length");
            }

            return(value);
        }
Example #2
0
 private void setRequestU8(jrkRequest requestId, Byte id, Byte value)
 {
     controlTransfer(0x40, (byte)requestId, value, (UInt16)(id + (1 << 8)));
 }
Example #3
0
        private UInt16 getRequest(jrkRequest requestId, UInt16 id, Byte length)
        {
            UInt16 value = 0;

            byte[] value_array;

            if (length == 2)
            {
                value_array = new byte[2];
                controlTransfer(0xC0, (Byte)requestId, 0, (ushort)id, value_array);
                value = (ushort)(value_array[0] + 256 * value_array[1]);
            }
            else if (length == 1)
            {
                value_array = new byte[1];
                controlTransfer(0xC0, (Byte)requestId, 0, (ushort)id, value_array);
                value = value_array[0];
            }
            else
            {
                throw new ArgumentException("length must be 1 or 2", "length");
            }

            return value;
        }
Example #4
0
File: Jrk.cs Project: lukazikus/mmc
 private void setRequestU16(jrkRequest requestId, Byte id, UInt16 value)
 {
     controlTransfer(0x40, (byte)requestId, value, (UInt16)(id + (2 << 8)));
 }