SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
fcdhid.h
Go to the documentation of this file.
1 /***************************************************************************
2  * This file is part of Qthid.
3  *
4  * Copyright (C) 2010 Howard Long, G6LVB
5  * CopyRight (C) 2011 Alexandru Csete, OZ9AEC
6  * Mario Lorenz, DL5MLO
7  *
8  * Qthid is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * Qthid is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Qthid. If not, see <http://www.gnu.org/licenses/>.
20  *
21  ***************************************************************************/
22 
23 #ifndef _QTHID_H_
24 #define _QTHID_H_
25 
26 #include <string.h>
27 #include <stdlib.h>
28 #include <stdio.h>
29 #include <stdint.h>
30 #include "fcdhidcmd.h"
31 #include "hidapi.h"
32 
33 #include <inttypes.h>
34 
35 #define FALSE 0
36 #define TRUE 1
37 typedef int BOOL;
38 
40 typedef enum {
45 } FCD_MODE_ENUM; // The current mode of the FCD: none inserted, in bootloader mode or in normal application mode
46 
48 typedef struct {
49  unsigned char hasBiasT;
50  unsigned char hasCellBlock;
52 
53 
54 //#define FCDPP // FIXME: the Pro / Pro+ switch should be handled better than this!
55 //const unsigned short _usVID=0x04D8; /*!< USB vendor ID. */
56 //#ifdef FCDPP
57 //const unsigned short _usPID=0xFB31; /*!< USB product ID. */
58 //#else
59 //const unsigned short _usPID=0xFB56; /*!< USB product ID. */
60 //#endif
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
72 hid_device *fcdOpen(uint16_t usVID, uint16_t usPID, int whichdongle);
73 
75 void fcdClose(hid_device *phd);
76 
82 
88 FCD_MODE_ENUM fcdGetFwVerStr(hid_device *phd, char *str);
89 
107 
122 FCD_MODE_ENUM fcdGetCapsStr(hid_device *phd, char *caps_str);
123 
131 
141 FCD_MODE_ENUM fcdAppSetFreqkHz(hid_device *phd, int nFreq);
142 
152 FCD_MODE_ENUM fcdAppSetFreq(hid_device *phd, int nFreq);
153 
161 
171 
181 FCD_MODE_ENUM fcdBlWriteFirmware(hid_device *phd, char *pc, int64_t n64Size);
182 
192 FCD_MODE_ENUM fcdBlVerifyFirmware(hid_device *phd, char *pc, int64_t n64Size);
193 
210 FCD_MODE_ENUM fcdAppSetParam(hid_device *phd, uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len);
211 
228 FCD_MODE_ENUM fcdAppGetParam(hid_device *phd, uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len);
229 
230 #ifdef __cplusplus
231 }
232 #endif
233 
234 #endif // _QTHID_H_
FCD_MODE_ENUM fcdAppSetFreq(hid_device *phd, int nFreq)
Set FCD frequency with Hz resolution.
Definition: fcdhid.c:450
FCD_MODE_ENUM fcdBlReset(hid_device *phd)
Reset FCD to application mode.
Definition: fcdhid.c:499
void fcdClose(hid_device *phd)
Close FCD HID device.
Definition: fcdhid.c:78
unsigned char hasBiasT
Definition: fcdhid.h:49
FCD_MODE_ENUM fcdAppGetParam(hid_device *phd, uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len)
Read FCD parameter (e.g. gain or filter)
Definition: fcdhid.c:884
FCD_MODE_ENUM
FCD mode enumeration.
Definition: fcdhid.h:40
FCD_MODE_ENUM fcdBlWriteFirmware(hid_device *phd, char *pc, int64_t n64Size)
Write new firmware into the FCD.
Definition: fcdhid.c:606
__int64 int64_t
Definition: rtptypes_win.h:47
FCD_MODE_ENUM fcdGetCapsStr(hid_device *phd, char *caps_str)
Get hardware and firmware dependent FCD capabilities as string.
Definition: fcdhid.c:281
FCD_MODE_ENUM fcdGetFwVerStr(hid_device *phd, char *str)
Get FCD firmware version as string.
Definition: fcdhid.c:140
FCD_MODE_ENUM fcdGetCaps(hid_device *phd, FCD_CAPS_STRUCT *fcd_caps)
Get hardware and firmware dependent FCD capabilities.
Definition: fcdhid.c:205
unsigned char uint8_t
Definition: rtptypes_win.h:42
FCD_MODE_ENUM fcdAppSetFreqkHz(hid_device *phd, int nFreq)
Set FCD frequency with kHz resolution.
Definition: fcdhid.c:400
unsigned short uint16_t
Definition: rtptypes_win.h:44
FCD_MODE_ENUM fcdAppReset(hid_device *phd)
Reset FCD to bootloader mode.
Definition: fcdhid.c:339
hid_device * fcdOpen(uint16_t usVID, uint16_t usPID, int whichdongle)
Open FCD device.
Definition: fcdhid.c:31
int BOOL
Definition: fcdhid.h:37
FCD_MODE_ENUM fcdAppSetParam(hid_device *phd, uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len)
Write FCD parameter (e.g. gain or filter)
Definition: fcdhid.c:826
FCD_MODE_ENUM fcdGetMode(hid_device *phd)
Get FCD mode.
Definition: fcdhid.c:88
FCD_MODE_ENUM fcdBlErase(hid_device *phd)
Erase firmware from FCD.
Definition: fcdhid.c:559
FCD_MODE_ENUM fcdBlVerifyFirmware(hid_device *phd, char *pc, int64_t n64Size)
Verify firmware in FCd flash.
Definition: fcdhid.c:708
FCD capabilities that depend on both hardware and firmware.
Definition: fcdhid.h:48
unsigned char hasCellBlock
Definition: fcdhid.h:50