Compare commits

...

No commits in common. "femtobts_v2.3" and "master" have entirely different histories.

8 changed files with 828 additions and 480 deletions

View File

@ -5,6 +5,8 @@
extern "C" {
#endif // __cplusplus
#define L1_HAS_EFR
#define L1_HAS_RTP_MODE
/****************************************************************************
* Public macro *
@ -139,8 +141,9 @@ typedef enum GsmL1_Status_t
GsmL1_Status_TxBurstFifoUndr = -21, ///< Fifo underrun
GsmL1_Status_NotSynchronized = -22, ///< Not synchronized
GsmL1_Status_Unsupported = -23, ///< Unsupported feature
GsmL1_Status_ClockError = -24, ///< System clock error
GSML1_STATUS_NUM = 24
GSML1_STATUS_NUM = 25
} GsmL1_Status_t;
@ -181,7 +184,8 @@ typedef enum GsmL1_DevType_t
GsmL1_DevType_Rxd = 0x01, ///< Monitor type (RX downlink only)
GsmL1_DevType_Rxu = 0x02, ///< Monitor type (RX uplink only)
GsmL1_DevType_Txd = 0x04, ///< Jammer type (TX downlink only)
GsmL1_DevType_Txu = 0x08 ///< Jammer type (TX uplink only)
GsmL1_DevType_Txu = 0x08, ///< Jammer type (TX uplink only)
GsmL1_DevType_TxuRxu = 0x0A ///< Loopback type (TX uplink with downlink frame format, Rx uplink)
} GsmL1_DevType_t;
@ -242,6 +246,22 @@ typedef enum GsmL1_FreqBand_t
} GsmL1_FreqBand_t;
/****************************************************************************
* Enum : GsmL1_TchFormat_t
************************************************************************//**
*
* TCH message packin format.
*
* @ingroup gsml1_api_const
*
****************************************************************************/
typedef enum GsmL1_TchFormat_t
{
GsmL1_TchFormat_Rtp = 0, ///< RTP format
GsmL1_TchFormat_If2 ///< IF2 format (AMR), custom (HR, FR, EFR)
} GsmL1_TchFormat_t;
/****************************************************************************
* Enum : GsmL1_PrimId_t
************************************************************************//**
@ -337,7 +357,7 @@ typedef enum GsmL1_If2FrTypeIdx_t
* typedef enum : GsmL1_TchPlType_t
************************************************************************//**
*
* List of every payload type supported on a Half-Rate physical channel
* List of every payload type supported on a TCH physical channel.
*
* @ingroup gsml1_api_const
*
@ -346,8 +366,9 @@ typedef enum GsmL1_TchPlType_t
{
GsmL1_TchPlType_NA = 0, ///< Not applicable, unknown, invalid
GsmL1_TchPlType_Fr, ///< Compacted ETSI hull-rate traffic speech frame
GsmL1_TchPlType_Fr, ///< Compacted ETSI full-rate traffic speech frame
GsmL1_TchPlType_Hr, ///< Compacted ETSI half-rate traffic speech frame
GsmL1_TchPlType_Efr, ///< Compacted ETSI enhanced full-rate traffic speech frame
GsmL1_TchPlType_Amr, ///< RTP/IF2 adaptive multi-rate traffic speech frame
// These cannot be formatted using IF2 format !!
@ -364,6 +385,41 @@ typedef enum GsmL1_TchPlType_t
} GsmL1_TchPlType_t;
/****************************************************************************
* Enum : GsmL1_TchPlFmt_t
************************************************************************//**
*
* List of every payload packing format supported on a TCH physical channel.
*
* @ingroup gsml1_api_const
*
****************************************************************************/
typedef enum GsmL1_TchPlFmt_t
{
GsmL1_TchPlFmt_Rtp = 0, ///< RFC XXXX - RTP format
GsmL1_TchPlFmt_If2 ///< Etsi IF2 format (AMR), custom (HR, FR, EFR)
} GsmL1_TchPlFmt_t;
/****************************************************************************
* typedef enum : GsmL1_PdtchPlType_t
************************************************************************//**
*
* List of every payload type supported on a PDTCH physical channel.
*
* @ingroup gsml1_api_const
*
***************************************************************************/
typedef enum GsmL1_PdtchPlType_t
{
GsmL1_PdtchPlType_NA = 0x00, ///< Not applicable, unknown, invalid
GsmL1_PdtchPlType_Hdr = 0x01, ///< Header only is present and valid
GsmL1_PdtchPlType_Hdr_Data1 = 0x03, ///< Header and 1st half of data (2nd half is present but invalid)
GsmL1_PdtchPlType_Hdr_Data2 = 0x05, ///< Header and 2nd half of data (1st half is present but invalid)
GsmL1_PdtchPlType_Full = 0x07 ///< Full data present and valid
} GsmL1_PdtchPlType_t;
/****************************************************************************
* typedef enum : GsmL1_AmrCodec_t
************************************************************************//**
@ -451,7 +507,7 @@ typedef enum GsmL1_ConfigParamId_t
****************************************************************************/
/// Maximum length of a layer 2 message unit.
#define MAX_L2MSGSIZE 157 // ( Based on a PDTCH block type 13 (MCS-9) [155 bytes] )
#define MAX_L2MSGSIZE 160 // ( Based on a PDTCH block type 13 (MCS-9) [155 bytes] )
/// Advance taken by the library (counted in frames where 1 frame = 8 timeslots )
#define GSML1_FN_ADVANCE 6

View File

@ -167,26 +167,6 @@ void GsmL1Dbg_DumpBuffer( uint32_t u32Level,
uint32_t u32Length,
uint8_t *pu8Buffer );
/****************************************************************************
* Function : GsmL1Dbg_DumpRxBurst
************************************************************************//**
*
* Dump a RxBurst
*
* @param [in] u32Level
* Verbosity level of the printed message.
*
* @param [in] prxBurst
* Pointer to the dumped RX burst
*
* @return
* None.
*
* @ingroup gsm_common_debug
*
***************************************************************************/
void GsmL1Dbg_DumpRxBurst( uint32_t u32Level, GsmL1_RxBurst_t *prxBurst );
#ifdef __cplusplus
}
#endif // extern "C"

View File

@ -68,17 +68,17 @@ typedef struct GsmL1_MeasParam_t
***************************************************************************/
typedef struct GsmL1_DeviceParam_t
{
GsmL1_DevType_t devType; ///< Device type
GsmL1_DevType_t devType; ///< Device type
GsmL1_FreqBand_t freqBand; ///< GSM Frequency band used by the TRX device
uint16_t u16Arfcn; ///< Radio frequency channel number
uint16_t u16BcchArfcn; ///< Associated beacon radio frequency channel number
uint8_t u8NbTsc; ///< Training sequence code to be used for normal bursts
uint8_t u8AutoTA; ///< Automatic timing advance (0:TA is handled by upper layers, 1:TA is handled by layer 1)
float fRxPowerLevel; ///< Nominal RX power level in dBm (use 0 if the control is handled by upper layers)
float fTxPowerLevel; /**< Transmission power level if applicable (in dBm).
@see Verify the values supported by the hardware. */
GsmL1_FreqBand_t freqBand; ///< GSM Frequency band used by the TRX device
uint16_t u16Arfcn; ///< Radio frequency channel number
uint16_t u16BcchArfcn; ///< Associated beacon radio frequency channel number
uint8_t u8NbTsc; ///< Training sequence code to be used for normal bursts
uint8_t u8AutoTA; ///< Automatic timing advance (0:TA is handled by upper layers, 1:TA is handled by layer 1)
float fRxPowerLevel; ///< Nominal RX power level in dBm (use 0 if the control is handled by upper layers)
float fTxPowerLevel; /**< Transmission power level if applicable (in dBm).
@see Verify the values supported by the hardware. */
} GsmL1_DeviceParam_t;
@ -179,13 +179,13 @@ typedef struct GsmL1_MphCloseCnf_t
****************************************************************************/
typedef struct GsmL1_MphConnectReq_t
{
HANDLE hLayer3; ///< Handle to a layer 3 entity
HANDLE hLayer1; /**< Handle to the layer1 on which the
physical channel is connected. */
HANDLE hLayer3; ///< Handle to a layer 3 entity
HANDLE hLayer1; /**< Handle to the layer1 on which the
physical channel is connected. */
uint8_t u8Tn; ///< Time-slot [0..7]
GsmL1_LogChComb_t logChComb; /**< Logical channel multiplexing
over the physical channel */
uint8_t u8Tn; ///< Time-slot [0..7]
GsmL1_LogChComb_t logChComb; /**< Logical channel multiplexing
over the physical channel */
} GsmL1_MphConnectReq_t;
@ -281,6 +281,8 @@ typedef struct GsmL1_MphActivateReq_t
GsmL1_Sapi_t sapi; ///< Service access point identifier
GsmL1_Dir_t dir; ///< Direction path to configure
float fBFILevel; /**< Bad Frame Indication RX power level in dBm
(use 0 do disable BFI) */
GsmL1_LogChParam_t logChPrm; ///< Additional configuration parameters
} GsmL1_MphActivateReq_t;

View File

@ -1,87 +0,0 @@
#ifndef GSML1RF_H__
#define GSML1RF_H__
/****************************************************************************
* Includes *
****************************************************************************/
#include <stdint.h>
#include "gsml1serv.h"
/****************************************************************************
* Defines *
****************************************************************************/
#define GSML1RF_NOCHANGE 2 ///< Do not modify RX or TX device in the FPGA side
#define GSML1RF_ENABLE 1 ///< Enable RX or TX device in the FPGA side
#define GSML1RF_DISABLE 0 ///< Disable RX or TX device in the FPGA side
/****************************************************************************
* Public functions *
****************************************************************************/
/****************************************************************************
* Function : GsmL1Rf_Init
************************************************************************//**
*
* Initialize the PhyRf library.
*
* @return
* GsmL1_Status_Success or an error code otherwise.
*
* @ingroup gsml1_api_phyrf
*
****************************************************************************/
GsmL1_Status_t GsmL1Rf_Init( void );
/****************************************************************************
* Function : GsmL1Rf_Close
************************************************************************//**
*
* Uninitialize the PhyRf library.
*
* @return
* GsmL1_Status_Success or an error code otherwise.
*
* @ingroup gsml1_api_phyrf
*
****************************************************************************/
void GsmL1Rf_Close( void );
/****************************************************************************
* Function : GsmL1Rf_GetProvidedServices
************************************************************************//**
*
* Used to retrieve a structure of every services provided by the PhyRf layer.
*
* @param [out] pPhyRfProvidedServices
* Points to a structure of every services provided by the PhyRf layer
*
* @return
* GsmL1_Status_Success or an error code otherwise.
*
* @ingroup gsml1_api_phyrf
*
****************************************************************************/
GsmL1_Status_t GsmL1Rf_GetProvidedServices( Gsm_PhyRfProvidedServices_t *pPhyRfProvidedServices );
/****************************************************************************
* Function : GsmL1Rf_IsInitialized
************************************************************************//**
*
* Used to determinate if the PhyRf library is initialized
*
* @return
* 1 if initialized, 0 otherwise
*
* @ingroup gsml1_api_phyrf
*
****************************************************************************/
uint8_t GsmL1Rf_IsInitialized( void );
#ifdef __cplusplus
}
#endif // extern "C"
#endif // GSML1PHYRF_H__

View File

@ -1,135 +0,0 @@
#ifndef GSML1SERV_H__
#define GSML1SERV_H__
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
/****************************************************************************
* Includes *
****************************************************************************/
#include "gsml1const.h"
#include "gsml1types.h"
#include "gsml1prim.h"
/****************************************************************************
* Struct : PhyRf_ExternalServices_t
************************************************************************//**
*
* All external services provided from the PhyLink Layer to the PhyRf layer.
*
* @ingroup gsml1_api_phyrf
*
****************************************************************************/
typedef struct PhyRf_ExternalServices_t
{
GsmL1_Status_t (*pfRecvBurst) ( HANDLE hPhyLink, GsmL1_RxBurst_t *pRxBurst );
GsmL1_Status_t (*pfUpdateTn) ( HANDLE hPhyLink, uint32_t u32Fn, uint8_t u8Tn );
} PhyRf_ExternalServices_t;
/****************************************************************************
* typedef : Gsm_L3ProvidedServices_t
************************************************************************//**
*
* Structure which contains a function pointer to every service provided
* by the Gsm Layer 3 library.
*
* @ingroup gsml1_api_services
*
***************************************************************************/
typedef struct Gsm_L3ProvidedServices
{
GsmL1_Status_t (*pfMphCnf)( GsmL1_Prim_t *pPrim );
GsmL1_Status_t (*pfMphInd)( GsmL1_Prim_t *pPrim );
} Gsm_L3ProvidedServices_t;
/****************************************************************************
* typedef : Gsm_L2ProvidedServices_t
************************************************************************//**
*
* Structure which contains a function pointer to every service provided
* by the Gsm Layer 2 library.
*
* @ingroup gsml1_api_services
*
***************************************************************************/
typedef struct Gsm_L2ProvidedServices_t
{
GsmL1_Status_t (*pfPhCnf)( GsmL1_Prim_t *pPrim );
GsmL1_Status_t (*pfPhInd)( GsmL1_Prim_t *pPrim );
} Gsm_L2ProvidedServices_t;
/****************************************************************************
* typedef : Gsm_PhyLinkProvidedServices_t
************************************************************************//**
*
* Structure which contains a function pointer to every service provided
* by the physical link layer library.
*
* @ingroup gsml1_api_services
*
***************************************************************************/
typedef struct Gsm_PhyLinkProvidedServices_t
{
// Services provided to the layer 3
GsmL1_Status_t (*pfMphReq)( GsmL1_Prim_t *pPrim );
// Services provided to the Layer 2
GsmL1_Status_t (*pfPhReq)( GsmL1_Prim_t *pPrim );
// Services provided to the physical radio frequency layer
GsmL1_Status_t (*pfRecvBurst) ( HANDLE hDevice, GsmL1_RxBurst_t *pRxBurst );
GsmL1_Status_t (*pfUpdateTn) ( HANDLE hDevice, uint32_t u32Fn, uint8_t u8Tn );
} Gsm_PhyLinkProvidedServices_t;
/****************************************************************************
* typedef : Gsm_PhyRfProvidedServices_t
************************************************************************//**
*
* Structure which contains a function pointer to every service provided
* by the PhyRf library.
*
* @ingroup gsml1_api_services
*
***************************************************************************/
typedef struct Gsm_PhyRfProvidedServices_t
{
// Services provided from the physical radio frequency layer
GsmL1_Status_t (*pfInitDevice) ( PhyRf_ExternalServices_t *pPhyRfExternalServices,
GsmL1_DevType_t devType,
GsmL1_FreqBand_t freqBand,
uint16_t u16Arfcn,
float fTxPowerLevel,
uint8_t u8NbTsc,
HANDLE hPhyLink,
HANDLE *hPhyRf );
void (*pfCloseDevice ) ( HANDLE hPhyRfDevice );
GsmL1_Status_t (*pfSendBurst ) ( HANDLE hPhyRfDevice, GsmL1_TxBurst_t *pTxBurst );
GsmL1_Status_t (*pfConfigTs ) ( HANDLE hPhyRfDevice,
uint8_t u8Tn,
uint8_t u8EnableRx,
uint8_t u8EnableTxAutoDummy );
GsmL1_Status_t (*pfSetTxPowerLevel) ( HANDLE hPhyRfDevice,
float fTxPowerLevel );
GsmL1_Status_t (*pfSetNbTsc) ( HANDLE hPhyRfDevice,
uint8_t u8NbTsc );
// Services provided by the physical RF layer to the FPGA layer
void (*pfNewTnIsr) ( void );
} Gsm_PhyRfProvidedServices_t;
#ifdef __cplusplus
}
#endif // extern "C"
#endif // GSMSERVICES_H__

View File

@ -30,85 +30,6 @@
***************************************************************************/
typedef uint32_t HANDLE;
/****************************************************************************
* typedef : GsmL1_RxBurst
************************************************************************//**
*
* Individual physical channel message received from the demodulator.
*
* @ingroup gsml1_api_types
*
***************************************************************************/
typedef struct GsmL1_RxBurst_t
{
uint32_t u32Sync; ///< Synchronization word (Word 1)
uint32_t u22Fn : 24; ///< Frame number (Word 2 [0-23])
uint32_t u8Tn : 8; ///< Time slot number (Word 2 [24-32])
uint32_t u16DeviceId :16; ///< Device Id ( Word 3 [0-15] )
uint32_t u8AgcScaleFactor : 8; ///< Agc Gain applied to the burst sample is 2^(AGC_SCALE_FACTOR) ( Word 3 [16 - 23] )
uint32_t u8RfAtten : 8; ///< RF attenuator ( Word 3 [24 - 31] )
uint32_t u8BurstType : 8; ///< Burst type ( Word 4 [0-7] )
uint32_t u8RfSync : 8; ///< RF synchronization flag ( Word 4 [8 - 15] )
int32_t i16Offset : 16; ///< Burst offset ( Word 4 [16-31] )
float fRssi; ///< Received signal strength indicator in femtowatt( Word 5 )
union
{
float fLQ; ///< Link quality ( Word 6 [0 - 31] )
float fTsRssi; ///< Received training sequence signal strength indicator in femtowatt( Word 6 )
} u;
uint32_t u16XCorr : 16; ///< Correlation result ( Word 7 [0 - 15] )
uint32_t u16Arfcn : 16; ///< Arfcn (Set by the PhyRf layer ( Word 8 [0 - 15] )
GsmL1_Dir_t dir; ///< Direction ( Word 8 [0 - 31] )
//uint32_t u16Arfcn : 16; ///< Arfcn (Set by the PhyRf layer ( Word 8 [0 - 15] )
//uint32_t : 16; ///< Reserved bits ( Word 8, [16 - 31] )
int8_t pi8Burst[148]; ///< Burst data (148 bytes)
} GsmL1_RxBurst_t;
/****************************************************************************
* typedef : GsmL1_TxBurst
************************************************************************//**
*
* Individual physical channel message transmitted to the demodulator.
*
* @ingroup gsml1_api_types
*
* @note The [LB] tag means that this field is set in Dsp/Fpga loopback only
***************************************************************************/
typedef struct GsmL1_TxBurst_t
{
uint32_t u32Sync; ///< Synchronization word (Word 1 [0 - 31] )
uint32_t u22Fn : 24; ///< Frame number (Word 2 [0-23])
uint32_t u8Tn : 8; ///< Time slot number (Word 2 [24-32])
uint32_t u16DeviceId : 16; ///< Fpga device Id (Word 3 [0 - 15] )
uint32_t : 16; ///< Reserved bits ( Word 3 [16 - 31] )
uint32_t u8BurstType : 8; ///< Burst type ( Word 4 [0-7] )
uint32_t : 24; ///< Reserved bits ( Word 4 [8-31] )
uint32_t u32SubCh : 32; ///< Reserved bits ( Word 5 )
uint32_t : 32; ///< Reserved bits ( Word 6 )
uint32_t u16Arfcn : 16; ///< [LB] Absolute radio frequency channel number ( Word 8 [ 16-31 ] )
uint32_t : 16; ///< Reserved word ( Word 8 [ 0-15 ] )
GsmL1_Dir_t dir; ///< Direction ( Word 8 [0 - 31] )
int8_t pi8Burst[148]; ///< Burst data (148 bytes)
} GsmL1_TxBurst_t;
/****************************************************************************
* typedef : GsmL1_LogChParam_t
************************************************************************//**
@ -143,6 +64,8 @@ typedef union
// TCH
struct
{
GsmL1_TchPlFmt_t tchPlFmt; ///< Payload format (RFC RTP, Etsi IF2)
GsmL1_TchPlType_t tchPlType; ///< Expected payload type (HR, FR, EFR or AMR)
GsmL1_AmrCmiPhase_t amrCmiPhase; ///< AMR Codec Mode Indication phase (downlink)
GsmL1_AmrCodecMode_t amrInitCodecMode; ///< AMR Initial Codec Mode
GsmL1_AmrCodec_t amrActiveCodecSet[4]; ///< AMR Active Codec Set

283
include/sbts2050_header.h Normal file
View File

@ -0,0 +1,283 @@
#ifndef PACKET_H__
#define PACKET_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define RQT_SUCCESS 0
enum sbts2050_ids_request {
SBTS2050_PWR_RQT = 0x00,
SBTS2050_PWR_STATUS = 0x01,
SBTS2050_TEMP_RQT = 0x10
};
typedef struct
{
uint16_t u16Magic; ///< Magic ID (0xCAFE)
uint8_t u8Id; ///< Command ID
uint8_t u8Len; ///< Command length in bytes (not including the parity)
union {
//
// Power Supply commands
//
// Activate/deactivate power supply
struct
{
uint8_t u1MasterEn :1; ///< Master SF enable (0:disable, 1:enable)
uint8_t u1SlaveEn :1; ///< Slave SF enable (0:disable, 1:enable)
uint8_t u1PwrAmpEn :1; ///< PA enable (0:disable, 1:enable)
} __attribute__((packed)) pwrSetState;
// Get the status of the power supplies
struct
{
} __attribute__((packed)) pwrGetStatus;
//
// Temperature commands
//
// Get temperature
struct
{
} __attribute__((packed)) tempGet;
//
// Ethernet Swicth commands
//
// Reset the ethernet switch
struct
{
} __attribute__((packed)) ethswtReset;
// Write to the ethernet switch EEPROM
struct
{
uint8_t u8Addr; ///< Write address
uint8_t u8Data; ///< Write value
} __attribute__((packed)) ethswtEepromWrite;
// Read from the ethernet switch EEPROM
struct
{
uint8_t u8Addr; ///< Write address
} __attribute__((packed)) ethswtEepromRead;
// Write to the MDIO port of the ethernet switch
struct
{
uint8_t u8Dev; ///< Device address
uint8_t u8Reg; ///< Register address
uint16_t u16Data; ///< Write data
} __attribute__((packed)) ethswtMdioWrite;
// Read from the MDIO port of the ethernet switch
struct
{
uint8_t u8Dev; ///< Device address
uint8_t u8Reg; ///< Write address
} __attribute__((packed)) ethswtMdioRead;
//
// Watchdog commands
//
// Set the timeout value of the watchdog timer
struct
{
uint8_t u8Timeout; ///< Timout value in seconds (0: disable)
} __attribute__((packed)) wdtSetTimeout;
// Trig the watchdog timer
struct
{
} __attribute__((packed)) wdtTrig;
//
// Firmware commands
//
// Get firmware version
struct
{
} __attribute__((packed)) fwGetVer;
// Update firmware (enter programming mode)
struct
{
} __attribute__((packed)) fwUpdate;
// Restart the application
struct
{
} __attribute__((packed)) fwReset;
// Erase a flash section
struct
{
uint32_t u32Addr; ///< Flash address
} __attribute__((packed)) fwFlErase;
// Program flash memory
struct
{
uint32_t u32Addr; ///< Flash address
uint8_t u8Len; ///< Number of bytes to be programmed
uint8_t u8Data[128]; ///< Data to be programmed
} __attribute__((packed)) fwFlProg;
//
// Raw payload
//
uint8_t raw[0]; ///< Raw command data
} cmd;
uint8_t u8Parity; ///< Command parity
} __attribute__((packed)) cmdpkt_t;
/****************************************************************************
* Struct : rsppkt_t
************************************************************************//**
*
* Response packet format (from control board).
*
****************************************************************************/
typedef struct
{
uint16_t u16Magic; ///< Magic ID (0xCAFE)
uint8_t u8Id; ///< Command ID
uint8_t u8Len; ///< Response length in bytes (not including the parity)
int8_t i8Error; ///< Error code (0:success, /0:error)
union {
//
// Power Supply commands
//
// Activate/deactivate power supply
struct
{
} __attribute__((packed)) pwrSetState;
// Get the status of the power supplies
struct
{
uint8_t u1MasterEn :1; ///< Master SF enable (0:disable, 1:enable)
uint8_t u1SlaveEn :1; ///< Slave SF enable (0:disable, 1:enable)
uint8_t u1PwrAmpEn :1; ///< PA enable (0:disable, 1:enable)
uint8_t u8MasterV; ///< Master SF voltage (Q3.5)
uint8_t u8MasterA; ///< Master SF current (Q2.6)
uint8_t u8SlaveV; ///< Slave SF voltage (Q3.5)
uint8_t u8SlaveA; ///< Slave SF current (Q2.6)
uint8_t u8PwrAmpV; ///< PA voltage (Q6.2)
uint8_t u8PwrAmpA; ///< PA current (Q2.6)
uint8_t u8PwrAmpBiasV; ///< PA Bias voltage (Q4.4)
uint8_t u8MainSupplyA; ///< Main supply (24V) current (Q2.6)
} __attribute__((packed)) pwrGetStatus;
//
// Temperature commands
//
// Get temperature
struct
{
int8_t i8BrdTemp; ///< Control board temperature
int8_t i8PaTemp; ///< PA temperature
} __attribute__((packed)) tempGet;
//
// Ethernet Swicth commands
//
// Reset the ethernet switch
struct
{
} __attribute__((packed)) ethswtReset;
// Write to the ethernet switch EEPROM
struct
{
} __attribute__((packed)) ethswtEepromWrite;
// Read from the ethernet switch EEPROM
struct
{
uint8_t u8Value; ///< Read value
} __attribute__((packed)) ethswtEepromRead;
// Write to the MDIO port of the ethernet switch
struct
{
} __attribute__((packed)) ethswtMdioWrite;
// Read from the MDIO port of the ethernet switch
struct
{
uint16_t u16Data; ///< Read value
} __attribute__((packed)) ethswtMdioRead;
//
// Watchdog commands
//
// Set the timeout value of the watchdog timer
struct
{
} __attribute__((packed)) wdtSetTimout;
// Trig the watchdog timer
struct
{
} __attribute__((packed)) wdtTrig;
//
// Firmware commands
//
// Get firmware version
struct
{
uint8_t u8Major; ///< Major version number
uint8_t u8Minor; ///< Minot version number
} __attribute__((packed)) fwGetVer;
// Update firmware
struct
{
} __attribute__((packed)) fwUpdate;
// Restart the application
struct
{
} __attribute__((packed)) fwReset;
// Erase a flash section
struct
{
} __attribute__((packed)) fwFlErase;
// Program flash memory
struct
{
} __attribute__((packed)) fwFlProg;
//
// Raw payload
//
uint8_t raw[0]; ///< Raw command data
} rsp;
uint8_t u8Parity; ///< Command parity
} __attribute__((packed)) rsppkt_t;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,8 +1,5 @@
#ifndef FemtoBts_H__
#define FemtoBts_H__
#define FEMTOBTS_API(x,y,z) ((x << 16) | (y << 8) | z)
#define FEMTOBTS_API_VERSION FEMTOBTS_API(2,3,0)
#ifndef SUPERFEMTO_H__
#define SUPERFEMTO_H__
#ifdef __cplusplus
extern "C" {
@ -15,69 +12,106 @@
#include "gsml1const.h"
#define SUPERFEMTO_API(x,y,z) ((x << 16) | (y << 8) | z)
#define SUPERFEMTO_API_VERSION SUPERFEMTO_API(5,1,0)
/****************************************************************************
* Const *
****************************************************************************/
/****************************************************************************
* Enum: FemtoBts_Status_t
* Enum: SuperFemto_Status_t
************************************************************************//**
*
* Status used by the FemtoBts.
* Status used by the SuperFemto.
*
* @ingroup femtobts_api
* @ingroup superfemto_api
*
****************************************************************************/
typedef GsmL1_Status_t FemtoBts_Status_t;
typedef GsmL1_Status_t SuperFemto_Status_t;
/****************************************************************************
* Enum : FemtoBts_PrimId_t
* Enum : SuperFemto_PrimId_t
************************************************************************//**
*
* System management primitives.
*
* @ingroup femtobts_api
* @ingroup superfemto_api
*
****************************************************************************/
typedef enum FemtoBts_PrimId_t
typedef enum SuperFemto_PrimId_t
{
FemtoBts_PrimId_SystemInfoReq, ///< Request system information
FemtoBts_PrimId_SystemInfoCnf, ///< Confirm system information
FemtoBts_PrimId_SystemFailureInd, ///< System failure indication
FemtoBts_PrimId_ActivateRfReq, ///< Request activation of the RF section
FemtoBts_PrimId_ActivateRfCnf, ///< Confirm activation of the RF section
FemtoBts_PrimId_DeactivateRfReq, ///< Request deactivation of the RF section
FemtoBts_PrimId_DeactivateRfCnf, ///< Confirm deactivation of the RF section
FemtoBts_PrimId_SetTraceFlagsReq, ///< Set the verbosity of the system
FemtoBts_PrimId_RfClockInfoReq, ///< Request information about the RF clock sub-system
FemtoBts_PrimId_RfClockInfoCnf, ///< Returns the RF clock sub-system information
FemtoBts_PrimId_RfClockSetupReq, ///< Configure the RF clock sub-system
FemtoBts_PrimId_RfClockSetupCnf, ///< Confirm the configuration of the RF clock sub-system
FemtoBts_PrimId_Layer1ResetReq, ///< Trigger a reset of the GSM layer 1 library
FemtoBts_PrimId_Layer1ResetCnf, ///< Confirm that the GSM layer 1 library was reset
FemtoBts_PrimId_NUM
SuperFemto_PrimId_SystemInfoReq, ///< REQ: System information
SuperFemto_PrimId_SystemInfoCnf, ///< CNF: System information
SuperFemto_PrimId_SystemFailureInd, ///< IND: System failure indication
SuperFemto_PrimId_ActivateRfReq, ///< REQ: Activation of the RF section
SuperFemto_PrimId_ActivateRfCnf, ///< CNF: Activation of the RF section
SuperFemto_PrimId_DeactivateRfReq, ///< REQ: Deactivation of the RF section
SuperFemto_PrimId_DeactivateRfCnf, ///< CNF: Deactivation of the RF section
SuperFemto_PrimId_SetTraceFlagsReq, ///< REQ: Set the verbosity of the system
SuperFemto_PrimId_RfClockInfoReq, ///< REQ: Information about the RF clock sub-system
SuperFemto_PrimId_RfClockInfoCnf, ///< CNF: Returns the RF clock sub-system information
SuperFemto_PrimId_RfClockSetupReq, ///< REQ: Configure the RF clock sub-system
SuperFemto_PrimId_RfClockSetupCnf, ///< CNF: Confirm the configuration of the RF clock sub-system
SuperFemto_PrimId_Layer1ResetReq, ///< REQ: Trigger a reset of the GSM layer 1 library
SuperFemto_PrimId_Layer1ResetCnf, ///< CNF: Confirm that the GSM layer 1 library was reset
SuperFemto_PrimId_GetTxCalibTblReq, ///< REQ: Get the TX gain calibration table
SuperFemto_PrimId_GetTxCalibTblCnf, ///< CNF: Returns TX gain calibration table
SuperFemto_PrimId_SetTxCalibTblReq, ///< REQ: Set the TX gain calibration table
SuperFemto_PrimId_SetTxCalibTblCnf, ///< CNF: Confirm the use of the new TX gain calibration table
SuperFemto_PrimId_GetRxCalibTblReq, ///< REQ: Get the RX level calibration table
SuperFemto_PrimId_GetRxCalibTblCnf, ///< CNF: Returns RX level calibration table
SuperFemto_PrimId_SetRxCalibTblReq, ///< REQ: Set the RX level calibration table
SuperFemto_PrimId_SetRxCalibTblCnf, ///< CNF: Confirm the use of the new RX level calibration table
SuperFemto_PrimId_MuteRfReq, ///< REQ: Mute/Unmute the RF section
SuperFemto_PrimId_MuteRfCnf, ///< CNF: Confirm the mutin/unmiting of the the RF section
SuperFemto_PrimId_SetRxAttenReq, ///< REQ: Set the RX attenuation
SuperFemto_PrimId_SetRxAttenCnf, ///< CNF: Confirm the configuration of the RX attenuation
SuperFemto_PrimId_NUM
} FemtoBts_PrimId_t;
} SuperFemto_PrimId_t;
/****************************************************************************
* Enum : SuperFemto_ClkSrcId_t
************************************************************************//**
*
* Clock source intifiers.
*
* @ingroup superfemto_api
*
****************************************************************************/
typedef enum SuperFemto_ClkSrcId_t
{
// RF Diagnostic Primitives
SuperFemto_ClkSrcId_None = 0, ///< None
SuperFemto_ClkSrcId_Ocxo, ///< Optional on-board OCXO
SuperFemto_ClkSrcId_Tcxo, ///< Optional on-board TCXO
SuperFemto_ClkSrcId_External, ///< Multi-Trx external clock
SuperFemto_ClkSrcId_GpsPps, ///< GPS PPS
SuperFemto_ClkSrcId_Trx, ///< TRX clock
SuperFemto_ClkSrcId_Rx, ///< RX clock
SuperFemto_ClkSrcId_Edge, ///< Debug edge connector clock
SuperFemto_ClkSrcId_NetList ///< Network listening
} SuperFemto_ClkSrcId_t;
/****************************************************************************
* Types *
****************************************************************************/
/****************************************************************************
* Struct : FemtoBts_SystemInfoCnf_t
* Struct : SuperFemto_SystemInfoCnf_t
************************************************************************//**
*
* Structure is used to confirm the information about the system.
*
* @ingroup femtobts_api_prim_sys
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct FemtoBts_SystemInfoCnf
typedef struct SuperFemto_SystemInfoCnf
{
FemtoBts_Status_t status; ///< Status
SuperFemto_Status_t status; ///< Status
struct
{
@ -92,232 +126,524 @@ typedef struct FemtoBts_SystemInfoCnf
uint8_t minor; ///< FPGA firmware minor version number
uint8_t build; ///< FPGA firmware build version number
} fpgaVersion;
struct
{
uint8_t gsm850; ///< Support GSM-850 band (0:unsupported, 1:supported)
uint8_t gsm900; ///< Support GSM-900 band (0:unsupported, 1:supported)
uint8_t dcs1800; ///< Support GSM-1800 band (0:unsupported, 1:supported)
uint8_t pcs1900; ///< Support GSM-1900 band (0:unsupported, 1:supported)
} rfBand;
struct
{
uint8_t txvcxo; ///< TCVCXO presence flag
uint8_t ocvcxo; ///< OCVCXO presence flag
uint16_t u12ClkVc; ///< Current voltage control value
} rfClock;
} FemtoBts_SystemInfoCnf_t;
struct
{
uint8_t rev; ///< Board reversion number
uint8_t option; ///< Board option number
} boardVersion;
} SuperFemto_SystemInfoCnf_t;
/****************************************************************************
* Struct : FemtoBts_SystemFailureInd_t
* Struct : SuperFemto_SystemFailureInd_t
************************************************************************//**
*
* Structure is used to indicate a system failure.
*
* @ingroup femtobts_api_prim_sys
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct FemtoBts_SystemFailureInd
typedef struct SuperFemto_SystemFailureInd
{
FemtoBts_Status_t status; ///< Status
SuperFemto_Status_t status; ///< Status
} SuperFemto_SysemFailureInd_t;
} FemtoBts_SysemFailureInd_t;
/****************************************************************************
* Struct : FemtoBts_ActivateRfReq_t
* Struct : SuperFemto_ActivateRfReq_t
************************************************************************//**
*
* This primitive is used to request the activation the RF section of the system.
*
* @ingroup femtobts_api
* @ingroup superfemto_api
*
***************************************************************************/
typedef struct FemtoBts_ActivateRfReq
typedef struct SuperFemto_ActivateRfReq
{
uint16_t u12ClkVc; /**< Initial clock voltage control value
or 0xFFFF to use the defaultvalue */
// Maximum cell Size
uint8_t u8MaxCellSize; ///< Maximum cell size in qbits (1 qbit = 138.4 meters, max 90 qbits)
// Timing source (FN/TN)
struct
{
uint8_t u8TimSrc; ///< Timing source (0:Slave/Get timing from remote master BTS, 1:Master/Generates its own timing)
} timing;
} FemtoBts_ActivateRfReq_t;
// Message queue options
struct {
uint8_t u8UseTchMsgq; ///< Set to '1' to use a separate MSGQUEUE for TCH primitives
uint8_t u8UsePdtchMsgq; ///< Set to '1' to use a separate MSGQUEUE for PDTCH primitives
} msgq;
// RF options
struct
{
int iClkCor; ///< Clock correction value in PPB.
SuperFemto_ClkSrcId_t clkSrc; ///< Clock source (0:None, 1:OCXO, 2:TCXO, 3:External, 4:GPS PPS, 5:reserved, 6:RX, 7:Edge)
float fMaxTxPower; ///< Nominal maximum TX power in dBm
uint8_t u8UseExtAtten; ///< Use the external attenuator to control TX power (0:No, 1:Yes)
} rfTrx;
} SuperFemto_ActivateRfReq_t;
/****************************************************************************
* Struct : FemtoBts_ActivateRfCnf_t
* Struct : SuperFemto_ActivateRfCnf_t
************************************************************************//**
*
* This primitive is used to confirm the activation the RF section of the system.
*
* @ingroup femtobts_api
* @ingroup superfemto_api
*
***************************************************************************/
typedef struct FemtoBts_ActivateRfCnf
typedef struct SuperFemto_ActivateRfCnf
{
FemtoBts_Status_t status; ///< Status
SuperFemto_Status_t status; ///< Status
} FemtoBts_ActivateRfCnf_t;
} SuperFemto_ActivateRfCnf_t;
/****************************************************************************
* Struct : FemtoBts_DeactivateRfCnf_t
* Struct : SuperFemto_DeactivateRfCnf_t
************************************************************************//**
*
* This primitive is used to confirm the deactivation the RF section of the system.
*
* @ingroup femtobts_api
* @ingroup superfemto_api
*
***************************************************************************/
typedef struct FemtoBts_DeactivateRfCnf
typedef struct SuperFemto_DeactivateRfCnf
{
FemtoBts_Status_t status; ///< Status
SuperFemto_Status_t status; ///< Status
} FemtoBts_DeactivateRfCnf_t;
} SuperFemto_DeactivateRfCnf_t;
/****************************************************************************
* Struct : FemtoBts_SetTraceFlagsReq_t
* Struct : SuperFemto_SetTraceFlagsReq_t
************************************************************************//**
*
* This primitive is used to setup the trace flag values.
*
* @ingroup femtobts_api_prim_dbg
* @ingroup superfemto_api_prim_dbg
*
***************************************************************************/
typedef struct FemtoBts_SetTraceFlagsReq
typedef struct SuperFemto_SetTraceFlagsReq
{
uint32_t u32Tf; ///< Trace flag level
} FemtoBts_SetTraceFlagsReq_t;
} SuperFemto_SetTraceFlagsReq_t;
/****************************************************************************
* Struct : FemtoBts_RfClockInfoReq
* Struct : SuperFemto_RfClockInfoReq
************************************************************************//**
*
* This primitive is used to retrive information about the RF clock
*
* @ingroup femtobts_api_prim_dbg
* @ingroup superfemto_api_prim_dbg
*
***************************************************************************/
typedef struct FemtoBts_RfClockInfoReq
typedef struct SuperFemto_RfClockInfoReq
{
uint8_t u8RstClkErrCnt; ///< When set, it resets the clk error counter module
uint8_t u8RstClkCal; ///< Set to '1' to reset the calibration module
} FemtoBts_RfClockInfoReq_t;
} SuperFemto_RfClockInfoReq_t;
/****************************************************************************
* Struct : FemtoBts_RfClockSetupReq
* Struct : SuperFemto_RfClockSetupReq
************************************************************************//**
*
* This primitive is used to configure the RF clock sub-system.
*
* @ingroup femtobts_api_prim_dbg
* @ingroup superfemto_api_prim_dbg
*
***************************************************************************/
typedef struct FemtoBts_RfClockSetupReq
{
uint16_t u12ClkVc; /**< Clock voltage control value (12 bits DAC). */
typedef struct SuperFemto_RfClockSetupReq
{
// RF clock options
struct
{
int iClkCor; ///< Clock correction value in PPB.
SuperFemto_ClkSrcId_t clkSrc; ///< Clock source (0:None, 1:OCXO, 2:TCXO, 3:External, 4:GPS PPS, 5:reserved, 6:RX, 7:Edge)
} rfTrx;
// RF clock calibration
struct {
SuperFemto_ClkSrcId_t clkSrc; ///< Reference clock source (0:Off, 1:OCXO, 2:TCXO, 3:External, 4:GPS PPS, 5:reserved, 6:reserved, 7:Edge, 8:NL)
} rfTrxClkCal;
} FemtoBts_RfClockSetupReq_t;
} SuperFemto_RfClockSetupReq_t;
/****************************************************************************
* Struct : FemtoBts_RfClockSetupCnf
* Struct : SuperFemto_RfClockSetupCnf
************************************************************************//**
*
* This primitive is sent back to confirm the configuration of the RF clock sub-system.
*
* @ingroup femtobts_api_prim_dbg
* @ingroup superfemto_api_prim_dbg
*
***************************************************************************/
typedef struct FemtoBts_RfClockSetupCnf
typedef struct SuperFemto_RfClockSetupCnf
{
FemtoBts_Status_t status; ///< Status of the RF-CLOCK-SETUP-REQ
SuperFemto_Status_t status; ///< Status of the RF-CLOCK-SETUP-REQ
} FemtoBts_RfClockSetupCnf_t;
} SuperFemto_RfClockSetupCnf_t;
/****************************************************************************
* Struct : FemtoBts_RfClockInfoCnf
* Struct : SuperFemto_RfClockInfoCnf
************************************************************************//**
*
* This primitive is used to send back information on the RF clock sub-system.
*
* @ingroup femtobts_api_prim_dbg
* @ingroup superfemto_api_prim_dbg
*
***************************************************************************/
typedef struct FemtoBts_RfClockInfoCnf
typedef struct SuperFemto_RfClockInfoCnf
{
uint8_t u8ClkErrValid; /**< Set when the parameter of this primitives are valid.
It won't be set if the system was unable to synchronize
to a surrounding basestation long enough */
// RF clock options
struct
{
int iClkCor; ///< Clock correction value in PPB.
SuperFemto_ClkSrcId_t clkSrc; ///< Clock source (0:None, 1:OCXO, 2:TCXO, 3:External, 4:GPS PPS, 5:reserved, 6:RX, 7:Edge)
} rfTrx;
float fClkErr; // Measured clock error (in ppm).
// RF clock calibration
struct {
SuperFemto_ClkSrcId_t clkSrc; ///< Reference clock source (0:Off, 1:OCXO, 2:TCXO, 3:External, 4:GPS PPS, 5:reserved, 6:reserved, 7:Edge, 8:NL)
int iClkErr; ///< RF clock error (PPB).
int iClkErrRes; ///< Clock error resolution (PPT).
} rfTrxClkCal;
float fClkErrRes; /**< Indicates the resolution of the fErrPpm parameter (in ppm).
The resolution of the error depends on the period
(in frame) of the measurement. The longer the period,
the better is the resolution. */
} FemtoBts_RfClockInfoCnf_t;
} SuperFemto_RfClockInfoCnf_t;
/****************************************************************************
* Struct : FemtoBts_Layer1ResetReq_t
* Struct : SuperFemto_Layer1ResetReq_t
************************************************************************//**
*
* Structure is used to request a reset of the layer 1 module.
*
* @ingroup femtobts_api_prim_sys
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct FemtoBts_Layer1ResetReq
****************************************************************************/
typedef struct SuperFemto_Layer1ResetReq
{
uint32_t u32Reserved;
} FemtoBts_Layer1ResetReq_t;
} SuperFemto_Layer1ResetReq_t;
/****************************************************************************
* Struct : FemtoBts_Layer1ResetCnf_t
* Struct : SuperFemto_Layer1ResetCnf_t
************************************************************************//**
*
* Structure is used to confirm the reset of the layer 1 module.
*
* @ingroup femtobts_api_prim_sys
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct FemtoBts_Layer1ResetCnf
****************************************************************************/
typedef struct SuperFemto_Layer1ResetCnf
{
GsmL1_Status_t status;
} FemtoBts_Layer1ResetCnf_t;
} SuperFemto_Layer1ResetCnf_t;
/****************************************************************************
* Struct : FemtoBts_Primt_t
* Struct : SuperFemto_GetTxCalibTblReq_t
************************************************************************//**
*
* Structure is used to get the TX gain calibration table.
*
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct SuperFemto_GetTxCalibTblReq
{
GsmL1_FreqBand_t freqBand; ///< GSM Frequency band
} SuperFemto_GetTxCalibTblReq_t;
/****************************************************************************
* Struct : SuperFemto_GetTxCalibTblCnf_t
************************************************************************//**
*
* Structure is used to returns the TX gain calibration table.
*
* TX_Gain = m[band] x (fTxPowerLevel + fGainCorrVsArfcn[band][arfcn]) + b[band]
*
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct SuperFemto_GetTxCalibTblCnf
{
GsmL1_Status_t status;
GsmL1_FreqBand_t freqBand; ///< GSM Frequency band
float fTxGainGmsk[80]; ///< Gain setting for GMSK output level from +50dBm to -29 dBm
float fTx8PskCorr; ///< Gain adjustment for 8 PSK (default to +3.25 dB)
float fTxExtAttCorr[31]; ///< Gain adjustment for external attenuator (0:@1dB, 1:@2dB, ..., 31:@32dB)
float fTxRollOffCorr[374]; /**< Gain correction for each ARFCN
for GSM-850 : 0=128, 1:129, ..., 123:251, [124-373]:unused
for GSM-900 : 0=955, 1:956, ..., 70:1, ..., 317:956, [318-373]:unused
for DCS-1800: 0=512, 1:513, ..., 373:885
for PCS-1900: 0=512, 1:513, ..., 298:810, [299-373]:unused */
uint8_t u8DspMajVer; ///< DSP firmware major version (0 if unkown)
uint8_t u8DspMinVer; ///< DSP firmware minor version (0 if unkown)
uint8_t u8FpgaMajVer; ///< FPGA firmware major version (0 if unkown)
uint8_t u8FpgaMinVer; ///< FPGA firmware minor version (0 if unkown)
} SuperFemto_GetTxCalibTblCnf_t;
/****************************************************************************
* Struct : SuperFemto_SetTxCalibTblReq_t
************************************************************************//**
*
* Structure is used to set the TX gain calibration table.
*
* TX_Gain = m[band] x (fTxPowerLevel + fGainCorrVsArfcn[band][arfcn]) + b[band]
*
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct SuperFemto_SetTxCalibTblReq
{
GsmL1_FreqBand_t freqBand; ///< GSM Frequency band
float fTxGainGmsk[80]; ///< Gain setting for GMSK output level from +50dBm to -29 dBm
float fTx8PskCorr; ///< Gain adjustment for 8 PSK (default to +3.25 dB)
float fTxExtAttCorr[31]; ///< Gain adjustment for external attenuator (0:@1dB, 1:@2dB, ..., 31:@32dB)
float fTxRollOffCorr[374]; /**< Gain correction for each ARFCN
for GSM-850 : 0=128, 1:129, ..., 123:251, [124-373]:unused
for GSM-900 : 0=955, 1:956, ..., 70:1, ..., 317:956, [318-373]:unused
for DCS-1800: 0=512, 1:513, ..., 373:885
for PCS-1900: 0=512, 1:513, ..., 298:810, [299-373]:unused */
uint8_t u8DspMajVer; ///< DSP firmware major version (0 if unkown)
uint8_t u8DspMinVer; ///< DSP firmware minor version (0 if unkown)
uint8_t u8FpgaMajVer; ///< FPGA firmware major version (0 if unkown)
uint8_t u8FpgaMinVer; ///< FPGA firmware minor version (0 if unkown)
} SuperFemto_SetTxCalibTblReq_t;
/****************************************************************************
* Struct : SuperFemto_SetTxCalibTblCnf_t
************************************************************************//**
*
* Structure is used to confirm the use of the new TX gain calibration table.
*
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct SuperFemto_SetTxCalibTblCnf
{
GsmL1_Status_t status;
GsmL1_FreqBand_t freqBand; ///< GSM Frequency band
} SuperFemto_SetTxCalibTblCnf_t;
/****************************************************************************
* Struct : SuperFemto_GetRxCalibTblReq_t
************************************************************************//**
*
* Structure is used to get the RX level calibration table.
*
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct SuperFemto_GetRxCalibTblReq
{
GsmL1_FreqBand_t freqBand; ///< GSM Frequency band
uint8_t bUplink; ///< Direction (0:Downlink, 1:Uplink)
} SuperFemto_GetRxCalibTblReq_t;
/****************************************************************************
* Struct : SuperFemto_GetRxCalibTblCnf_t
************************************************************************//**
*
* Structure is used to returns the RX level calibration table.
*
* RSSI = RxLevel + fRssiCorrVsArfcn[band][arfcn]
*
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct SuperFemto_GetRxCalibTblCnf
{
GsmL1_Status_t status;
GsmL1_FreqBand_t freqBand; ///< GSM Frequency band
uint8_t bUplink; ///< Direction (0:Downlink, 1:Uplink)
float fExtRxGain; ///< External RX gain
float fRxMixGainCorr; ///< Mixer gain error compensation
float fRxLnaGainCorr[3]; ///< LNA gain error compensation (1:@-12 dB, 2:@-24 dB, 3:@-36 dB)
float fRxRollOffCorr[374]; /***< Frequency roll-off compensation
for GSM-850 : 0=128, 1:129, ..., 123:251, [124-373]:unused
for GSM-900 : 0=955, 1:956, ..., 70:1, ..., 317:956, [318-373]:unused
for DCS-1800: 0=512, 1:513, ..., 373:885
for PCS-1900: 0=512, 1:513, ..., 298:810, [299-373]:unused */
uint8_t u8IqImbalMode; ///< IQ imbalance mode (0:off, 1:on, 2:auto)
uint16_t u16IqImbalCorr[4]; ///< IQ imbalance compensation
uint8_t u8DspMajVer; ///< DSP firmware major version (0 if unkown)
uint8_t u8DspMinVer; ///< DSP firmware minor version (0 if unkown)
uint8_t u8FpgaMajVer; ///< FPGA firmware major version (0 if unkown)
uint8_t u8FpgaMinVer; ///< FPGA firmware minor version (0 if unkown)
} SuperFemto_GetRxCalibTblCnf_t;
/****************************************************************************
* Struct : SuperFemto_SetRxCalibTblReq_t
************************************************************************//**
*
* Structure is used to set the RX level calibration table.
*
* RSSI = RxLevel + fRssiCorrVsArfcn[band][arfcn]
*
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct SuperFemto_SetRxCalibTblReq
{
GsmL1_FreqBand_t freqBand; ///< GSM Frequency band
uint8_t bUplink; ///< Direction (0:Downlink, 1:Uplink)
float fExtRxGain; ///< External RX gain
float fRxMixGainCorr; ///< Mixer gain error compensation
float fRxLnaGainCorr[3]; ///< LNA gain error compensation (1:@-12 dB, 2:@-24 dB, 3:@-36 dB)
float fRxRollOffCorr[374]; /***< Frequency roll-off compensation
for GSM-850 : 0=128, 1:129, ..., 123:251, [124-373]:unused
for GSM-900 : 0=955, 1:956, ..., 70:1, ..., 317:956, [318-373]:unused
for DCS-1800: 0=512, 1:513, ..., 373:885
for PCS-1900: 0=512, 1:513, ..., 298:810, [299-373]:unused */
uint8_t u8IqImbalMode; ///< IQ imbalance mode (0:off, 1:on, 2:auto)
uint16_t u16IqImbalCorr[4]; ///< IQ imbalance compensation
uint8_t u8DspMajVer; ///< DSP firmware major version (0 if unkown)
uint8_t u8DspMinVer; ///< DSP firmware minor version (0 if unkown)
uint8_t u8FpgaMajVer; ///< FPGA firmware major version (0 if unkown)
uint8_t u8FpgaMinVer; ///< FPGA firmware minor version (0 if unkown)
} SuperFemto_SetRxCalibTblReq_t;
/****************************************************************************
* Struct : SuperFemto_SetRxCalibTblCnf_t
************************************************************************//**
*
* Structure is used to confirm the use of the new RX level calibration table.
*
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct SuperFemto_SetRxCalibTblCnf
{
GsmL1_Status_t status;
GsmL1_FreqBand_t freqBand; ///< GSM Frequency band
uint8_t bUplink; ///< Direction (0:Downlink, 1:Uplink)
} SuperFemto_SetRxCalibTblCnf_t;
/****************************************************************************
* Struct : SuperFemto_MuteRfReq_t
************************************************************************//**
*
* This primitive is used to configure the RF clock sub-system.
*
* @ingroup superfemto_api_prim_dbg
*
***************************************************************************/
typedef struct SuperFemto_MuteRfReq
{
uint8_t u8Mute[8]; ///< Timeslot mute flag (0:unmute, 1:mute)
} SuperFemto_MuteRfReq_t;
/****************************************************************************
* Struct : SuperFemto_MuteRfCnf_t
************************************************************************//**
*
* This primitive is sent back to confirm the configuration of the RF clock sub-system.
*
* @ingroup superfemto_api_prim_dbg
*
***************************************************************************/
typedef struct SuperFemto_MuteRfCnf
{
SuperFemto_Status_t status; ///< Status of the MUTE-RF-REQ
} SuperFemto_MuteRfCnf_t;
/****************************************************************************
* Struct : SuperFemto_SetRxAttenReq_t
************************************************************************//**
*
* This primitive is used to configure the RF receive attenuation.
*
* @ingroup superfemto_api_prim_dbg
*
***************************************************************************/
typedef struct SuperFemto_SetRxAttenReq
{
uint8_t u8Atten; ///< RX Attenuation: 0(default), 12, 24, 36 dB
} SuperFemto_SetRxAttenReq_t;
/****************************************************************************
* Struct : SuperFemto_SetRxAttenCnf_t
************************************************************************//**
*
* This primitive is sent back to confirm the configuration of the RF receive
* attenuation.
*
* @ingroup superfemto_api_prim_dbg
*
***************************************************************************/
typedef struct SuperFemto_SetRxAttenCnf
{
SuperFemto_Status_t status; ///< Status of the SET-RX-ATTEN-REQ
} SuperFemto_SetRxAttenCnf_t;
/****************************************************************************
* Struct : SuperFemto_Primt_t
************************************************************************//**
*
* System level primitive definition.
*
* @ingroup femtobts_api_prim_sys
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
typedef struct FemtoBts_Prim
****************************************************************************/
typedef struct SuperFemto_Prim
{
FemtoBts_PrimId_t id; ///< Primitive ID
SuperFemto_PrimId_t id; ///< Primitive ID
union
{
FemtoBts_SystemInfoCnf_t systemInfoCnf; ///< Confirm system information
FemtoBts_SysemFailureInd_t sysemFailureInd; ///< System failure indication
FemtoBts_ActivateRfReq_t activateRfReq; ///< Request activation of the RF section
FemtoBts_ActivateRfCnf_t activateRfCnf; ///< Confirm activation of the RF section
FemtoBts_DeactivateRfCnf_t deactivateRfCnf; ///< Confirm deactivation of the RF section
FemtoBts_SetTraceFlagsReq_t setTraceFlagsReq; ///< Set the verbosity of the system
FemtoBts_RfClockInfoReq_t rfClockInfoReq; ///< Request information about the RF clock
FemtoBts_RfClockInfoCnf_t rfClockInfoCnf; ///< Returns information about the RF clock
FemtoBts_RfClockSetupReq_t rfClockSetupReq; ///< Setup the RF clock
FemtoBts_RfClockSetupCnf_t rfClockSetupCnf; ///< Confirm the setup of the RF clock
FemtoBts_Layer1ResetReq_t layer1ResetReq; ///< Request a reset of the layer 1 module
FemtoBts_Layer1ResetCnf_t layer1ResetCnf; ///< Conrifm that the layer 1 module was reset
SuperFemto_SystemInfoCnf_t systemInfoCnf; ///< CNF: System information
SuperFemto_SysemFailureInd_t sysemFailureInd; ///< IND: System failure indication
SuperFemto_ActivateRfReq_t activateRfReq; ///< REQ: Activation of the RF section
SuperFemto_ActivateRfCnf_t activateRfCnf; ///< CNF: Activation of the RF section
SuperFemto_DeactivateRfCnf_t deactivateRfCnf; ///< CNF: Deactivation of the RF section
SuperFemto_SetTraceFlagsReq_t setTraceFlagsReq; ///< REQ: Set the verbosity of the system
SuperFemto_RfClockInfoReq_t rfClockInfoReq; ///< REQ: Information about the RF clock sub-system
SuperFemto_RfClockInfoCnf_t rfClockInfoCnf; ///< CNF: Returns the RF clock sub-system information
SuperFemto_RfClockSetupReq_t rfClockSetupReq; ///< REQ: Configure the RF clock sub-system
SuperFemto_RfClockSetupCnf_t rfClockSetupCnf; ///< CNF: Confirm the configuration of the RF clock sub-system
SuperFemto_Layer1ResetReq_t layer1ResetReq; ///< REQ: Trigger a reset of the GSM layer 1 module
SuperFemto_Layer1ResetCnf_t layer1ResetCnf; ///< CNF: Confirm that the GSM layer 1 module was reset
SuperFemto_GetTxCalibTblReq_t getTxCalibTblReq; ///< REQ: Get the TX gain calibration table
SuperFemto_GetTxCalibTblCnf_t getTxCalibTblCnf; ///< CNF: Returns TX gain calibration table
SuperFemto_SetTxCalibTblReq_t setTxCalibTblReq; ///< REQ: Set the TX gain calibration table
SuperFemto_SetTxCalibTblCnf_t setTxCalibTblCnf; ///< CNF: Confirm the use of the new TX gain calibration table
SuperFemto_GetRxCalibTblReq_t getRxCalibTblReq; ///< REQ: Get the RX level calibration table
SuperFemto_GetRxCalibTblCnf_t getRxCalibTblCnf; ///< CNF: Returns RX level calibration table
SuperFemto_SetRxCalibTblReq_t setRxCalibTblReq; ///< REQ: Set the RX level calibration table
SuperFemto_SetRxCalibTblCnf_t setRxCalibTblCnf; ///< CNF: Confirm the use of the new RX level calibration table
SuperFemto_MuteRfReq_t muteRfReq; ///< REQ: Mute/Unmute the RF section
SuperFemto_MuteRfCnf_t muteRfCnf; ///< CNF: Confirm the mutin/unmiting of the the RF section
SuperFemto_SetRxAttenReq_t setRxAttenReq; ///< REQ: Set the RX attenuation
SuperFemto_SetRxAttenCnf_t setRxAttenCnf; ///< CNF: Confirm the configuration of the RX attenuation
} u;
} FemtoBts_Prim_t;
} SuperFemto_Prim_t;
#ifdef _TMS320C6400
/****************************************************************************
@ -325,10 +651,10 @@ typedef struct FemtoBts_Prim
****************************************************************************/
/****************************************************************************
* Function : FemtoBts_RxPrimCallback
* Function : SuperFemto_RxPrimCallback
************************************************************************//**
*
* FemtoBts primitive reception callback routine. Process primitives sent
* SuperFemto primitive reception callback routine. Process primitives sent
* by the ARM processor.
*
* @param [in] pPrim
@ -337,10 +663,10 @@ typedef struct FemtoBts_Prim
* @return
* GsmL1_Status_Success or the error code
*
* @ingroup femtobts_api_prim_sys
* @ingroup superfemto_api_prim_sys
*
****************************************************************************/
void FemtoBts_RxPrimCallback( FemtoBts_Prim_t *pPrim );
void SuperFemto_RxPrimCallback( SuperFemto_Prim_t *pPrim );
#endif // _TMS320C6400
@ -349,4 +675,4 @@ void FemtoBts_RxPrimCallback( FemtoBts_Prim_t *pPrim );
}
#endif // extern "C"
#endif // FemtoBts_H__
#endif // SUPERFEMTO_H__