GNU Radio 3.6.5 C++ API

fcd.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *  This file is part of Qthid.
00003  *
00004  *  Copyright (C) 2010  Howard Long, G6LVB
00005  *  CopyRight (C) 2011  Alexandru Csete, OZ9AEC
00006  *                      Mario Lorenz, DL5MLO
00007  *
00008  *  Qthid is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  Qthid is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  *  GNU General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU General Public License
00019  *  along with Qthid.  If not, see <http://www.gnu.org/licenses/>.
00020  *
00021  ***************************************************************************/
00022 
00023 #ifndef FCD_H
00024 #define FCD_H 1
00025 
00026 #include <fcd_api.h>
00027 
00028 #ifdef FCD
00029 #define EXTERN
00030 #define ASSIGN (x) =x
00031 #else
00032 #define EXTERN extern
00033 #define ASSIGN(x)
00034 #endif
00035 
00036 #include <inttypes.h>
00037 
00038 /** \brief FCD mode enumeration. */
00039 typedef enum {
00040     FCD_MODE_NONE,  /*!< No FCD detected. */
00041     FCD_MODE_BL,    /*!< FCD present in bootloader mode. */
00042     FCD_MODE_APP    /*!< FCD present in aplpication mode. */
00043 } FCD_MODE_ENUM; // The current mode of the FCD: none inserted, in bootloader mode or in normal application mode
00044 
00045 /** \brief FCD capabilities that depend on both hardware and firmware. */
00046 typedef struct {
00047     unsigned char hasBiasT;     /*!< Whether FCD has hardware bias tee (1=yes, 0=no) */
00048     unsigned char hasCellBlock; /*!< Whether FCD has cellular blocking. */
00049 } FCD_CAPS_STRUCT;
00050 
00051 #ifdef __cplusplus
00052 extern "C" {
00053 #endif
00054 
00055 /* Application functions */
00056 EXTERN FCD_API FCD_MODE_ENUM fcdGetMode(void);
00057 EXTERN FCD_API FCD_MODE_ENUM fcdGetFwVerStr(char *str);
00058 EXTERN FCD_API FCD_MODE_ENUM fcdGetCaps(FCD_CAPS_STRUCT *fcd_caps);
00059 EXTERN FCD_API FCD_MODE_ENUM fcdGetCapsStr(char *caps_str);
00060 EXTERN FCD_API FCD_MODE_ENUM fcdAppReset(void);
00061 EXTERN FCD_API FCD_MODE_ENUM fcdAppSetFreqkHz(int nFreq);
00062 EXTERN FCD_API FCD_MODE_ENUM fcdAppSetFreq(int nFreq);
00063 
00064 EXTERN FCD_API FCD_MODE_ENUM fcdAppSetParam(uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len);
00065 EXTERN FCD_API FCD_MODE_ENUM fcdAppGetParam(uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len);
00066 
00067 
00068 /* Bootloader functions */
00069 EXTERN FCD_API FCD_MODE_ENUM fcdBlReset(void);
00070 EXTERN FCD_API FCD_MODE_ENUM fcdBlErase(void);
00071 EXTERN FCD_API FCD_MODE_ENUM fcdBlWriteFirmware(char *pc, int64_t n64Size);
00072 EXTERN FCD_API FCD_MODE_ENUM fcdBlVerifyFirmware(char *pc, int64_t n64Size);
00073 
00074 
00075 #ifdef __cplusplus
00076 }
00077 #endif
00078 
00079 #endif // FCD_H