Beispiel #1
0
        unsafe public static int WriteTRXEEPROMFloat(uint offset, float val)
        {
            byte[] temp = BitConverter.GetBytes(val);

            fixed(byte *ptr = &temp[0])
            return(USBHIDAPI.WriteEEPROM((ushort)offset, 4, ptr));
        }
Beispiel #2
0
        unsafe public static int ReadEEPROM(ushort addr, byte num_bytes, out byte[] buf)
        {
            buf = new byte[num_bytes];

            fixed(byte *ptr = &buf[0])
            return(USBHIDAPI.ReadEEPROM(addr, num_bytes, ptr));
        }
Beispiel #3
0
        public static int GetPASN(out uint sn)
        {
            int val = USBHIDAPI.ReadOp(Opcode.USB_OP_GET_PA_SN, 0, 0, out sn);

            sn = SwapBytes(sn);
            return(val);
        }
Beispiel #4
0
        public static int GetPARev(out uint rev)
        {
            int val = USBHIDAPI.ReadOp(Opcode.USB_OP_GET_PA_REV, 0, 0, out rev);

            rev = SwapBytes(rev);
            return(val);
        }
Beispiel #5
0
        public static int GetSerialNum(out uint sn)
        {
            int val = USBHIDAPI.ReadOp(Opcode.USB_OP_GET_SERIAL_NUM, 0, 0, out sn);

            sn = SwapBytes(sn);
            return(val);
        }
Beispiel #6
0
        public static bool GetStatus()
        {
            uint status;
            int  rtn = USBHIDAPI.ReadOp(Opcode.USB_OP_GET_STATUS, 0, 0, out status);

            return(status != 0);
        }
Beispiel #7
0
        unsafe public static int WriteTRXEEPROMUshort(uint offset, ushort buf)
        {
            byte[] temp = BitConverter.GetBytes(buf);

            fixed(byte *ptr = &temp[0])
            return(USBHIDAPI.WriteEEPROM((ushort)offset, 2, ptr));
        }
Beispiel #8
0
        public static int ReadGPIO(out byte data)
        {
            uint x;
            int  val = USBHIDAPI.ReadOp(Opcode.USB_OP_READ_GPIO, 0, 0, out x);

            data = (byte)x;
            return(val);
        }
Beispiel #9
0
        unsafe public static int ReadTRXEEPROMByte(uint offset, out byte buf)
        {
            int val;

            fixed(byte *ptr = &buf)
            val = USBHIDAPI.ReadEEPROM((ushort)offset, 1, ptr);

            return(val);
        }
Beispiel #10
0
        unsafe public static int ReadTRXEEPROMUshort(uint offset, out ushort buf)
        {
            int val;

            byte[] temp = new byte[2];

            fixed(byte *ptr = &temp[0])
            val = USBHIDAPI.ReadEEPROM((ushort)offset, 2, ptr);

            buf = BitConverter.ToUInt16(temp, 0);
            return(val);
        }
Beispiel #11
0
        unsafe public static int ReadTRXEEPROMFloat(uint offset, out float buf)
        {
            int val;

            byte[] temp = new byte[4];

            fixed(byte *ptr = &temp[0])
            val = USBHIDAPI.ReadEEPROM((ushort)offset, 4, ptr);

            buf = BitConverter.ToSingle(temp, 0);
            return(val);
        }
Beispiel #12
0
        public static int GetRegion(out FRSRegion region)
        {
            uint data;
            int  rtn = USBHIDAPI.ReadOp(Opcode.USB_OP_GET_REGION, 0, 0, out data);

            if ((FRSRegion)data >= FRSRegion.LAST)
            {
                region = 0;
                return(rtn);
            }

            region = (FRSRegion)data;
            return(rtn);
        }
Beispiel #13
0
 public static int SetPreamp(FLEX1500PreampMode mode)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_TRX_PREAMP, (uint)mode, 0));
 }
Beispiel #14
0
 public static int SetTXAnt(int n) // PA=0, XVRX=1, XVTX=2, BITE=3
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_TX_ANT, (uint)n, 0));
 }
Beispiel #15
0
 public static int FlexWire_Write2Value(byte addr, byte b1, byte b2)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_FLEXWIRE_WRITE_2_VALUE, addr, (uint)((b1 << 8) + b2)));
 }
Beispiel #16
0
 public static int SetTXOut(bool b)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_RCA_TX1, Convert.ToUInt32(b), 0));
 }
Beispiel #17
0
 public static int SetMOX(bool b)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_TR, Convert.ToUInt32(b), 0));
 }
Beispiel #18
0
 public static int WriteSPI(byte num_bytes, byte data)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_WRITE_SPI, (uint)num_bytes, (uint)data));
 }
Beispiel #19
0
 unsafe public static int WriteEEPROM(ushort addr, byte num_bytes, byte[] buf)
 {
     fixed(byte *ptr = &buf[0])
     return(USBHIDAPI.WriteEEPROM(addr, (byte)num_bytes, ptr));
 }
Beispiel #20
0
 public static int Initialize()
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_INITIALIZE, 0, 0));
 }
Beispiel #21
0
 public static int SetFreqTW(uint tw)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_RX1_FREQ_TW, tw, 0));
 }
Beispiel #22
0
 unsafe public static int WriteTRXEEPROMByte(uint offset, byte buf)
 {
     return(USBHIDAPI.WriteEEPROM((ushort)offset, 1, &buf));
 }
Beispiel #23
0
 unsafe public static int SetMicSel(bool b)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_MIC_SEL, Convert.ToUInt32(b), 0));
 }
Beispiel #24
0
 public static int WriteI2C2Value(byte addr, byte data1, byte data2)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_I2C_WRITE_2_VALUE, (uint)addr, (uint)((data1 << 8) + data2)));
 }
Beispiel #25
0
 unsafe public static int WriteEEPROM(ushort addr, byte[] buf) // up to 32 bytes
 {
     fixed(byte *ptr = &buf[0])
     return(USBHIDAPI.WriteEEPROM(addr, (byte)buf.Length, ptr));
 }
Beispiel #26
0
 public static int ReadPTT(out uint val)
 {
     return(USBHIDAPI.ReadOp(Opcode.USB_OP_READ_PTT, 0, 0, out val));
 }
Beispiel #27
0
 public static int WriteI2CValue(byte addr, byte data)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_I2C_WRITE_VALUE, (uint)addr, (uint)data));
 }
Beispiel #28
0
 public static int WriteGPIO(byte data)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_WRITE_GPIO, (uint)data, 0));
 }
Beispiel #29
0
 unsafe public static int SetTXGain(uint val)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_TX_GAIN, val, 0));
 }
Beispiel #30
0
 public static int SetPAFilter(int n)
 {
     return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_PA_FILTER, (uint)n, 0));
 }