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)); }
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)); }
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); }
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); }
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); }
public static bool GetStatus() { uint status; int rtn = USBHIDAPI.ReadOp(Opcode.USB_OP_GET_STATUS, 0, 0, out status); return(status != 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)); }
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); }
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); }
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); }
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); }
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); }
public static int SetPreamp(FLEX1500PreampMode mode) { return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_TRX_PREAMP, (uint)mode, 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)); }
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))); }
public static int SetTXOut(bool b) { return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_RCA_TX1, Convert.ToUInt32(b), 0)); }
public static int SetMOX(bool b) { return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_TR, Convert.ToUInt32(b), 0)); }
public static int WriteSPI(byte num_bytes, byte data) { return(USBHIDAPI.WriteOp(Opcode.USB_OP_WRITE_SPI, (uint)num_bytes, (uint)data)); }
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)); }
public static int Initialize() { return(USBHIDAPI.WriteOp(Opcode.USB_OP_INITIALIZE, 0, 0)); }
public static int SetFreqTW(uint tw) { return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_RX1_FREQ_TW, tw, 0)); }
unsafe public static int WriteTRXEEPROMByte(uint offset, byte buf) { return(USBHIDAPI.WriteEEPROM((ushort)offset, 1, &buf)); }
unsafe public static int SetMicSel(bool b) { return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_MIC_SEL, Convert.ToUInt32(b), 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))); }
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)); }
public static int ReadPTT(out uint val) { return(USBHIDAPI.ReadOp(Opcode.USB_OP_READ_PTT, 0, 0, out val)); }
public static int WriteI2CValue(byte addr, byte data) { return(USBHIDAPI.WriteOp(Opcode.USB_OP_I2C_WRITE_VALUE, (uint)addr, (uint)data)); }
public static int WriteGPIO(byte data) { return(USBHIDAPI.WriteOp(Opcode.USB_OP_WRITE_GPIO, (uint)data, 0)); }
unsafe public static int SetTXGain(uint val) { return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_TX_GAIN, val, 0)); }
public static int SetPAFilter(int n) { return(USBHIDAPI.WriteOp(Opcode.USB_OP_SET_PA_FILTER, (uint)n, 0)); }