import superfemto v1.0

This commit is contained in:
Harald Welte 2012-10-27 19:19:00 +02:00
parent 4d418840df
commit 1becfc0df9
7 changed files with 9 additions and 465 deletions

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

@ -1,101 +0,0 @@
#ifndef GSML1LINK_H__
#define GSML1LINK_H__
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
/****************************************************************************
* Includes *
****************************************************************************/
#include "gsml1serv.h"
#include "gsml1prim.h"
#include "gsml1const.h"
#include "gsml1types.h"
/****************************************************************************
* Types *
****************************************************************************/
/****************************************************************************
* Public Functions *
****************************************************************************/
/****************************************************************************
* Function : GsmL1Link_Init
************************************************************************//**
*
* Initialise the GSM layer 1 library.
*
* @return
* GsmL1_Status_Success or the error code
*
* @ingroup gsml1_api_services
*
****************************************************************************/
GsmL1_Status_t GsmL1Link_Init( void );
/****************************************************************************
* Function : GsmL1Link_SetExternalServices
************************************************************************//**
*
* Set every services provided to the layer 1 by external libraries
*
* @param [in] pL3ProvidedServices
* Points to a structure containing all Layer 3 external services
*
* @param [in] pL2ProvidedServices
* Points to a structure containing all Layer 3 external services
*
* @param [in] pPhyRfProvidedServices
* Points to a structure containing all PhyRf external services
*
* @return
* GsmL1_Status_Success or the error code
*
* @ingroup gsml1_api_services
*
****************************************************************************/
GsmL1_Status_t GsmL1Link_SetExternalServices( Gsm_L3ProvidedServices_t *pL3ProvidedServices,
Gsm_L2ProvidedServices_t *pL2ProvidedServices,
Gsm_PhyRfProvidedServices_t *pPhyRfProvidedServices );
/****************************************************************************
* Function : GsmL1Link_GetProvidedServices
************************************************************************//**
*
* Return a strucuture containing all service functions pointer provided
* by the physical link layer library to the external context.
*
* @param [out] pPhyLinkProvidedServices
* Points to a structure of all GSM layer 1 library services function pointer.
*
* @return
* GsmL1_Status_Success or the error code
*
* @ingroup gsml1_api_services
*
****************************************************************************/
GsmL1_Status_t GsmL1Link_GetProvidedServices( Gsm_PhyLinkProvidedServices_t *pPhyLinkProvidedServices );
/****************************************************************************
* Function : GsmL1Link_Close
************************************************************************//**
*
* Close the GSM layer 1 instance and free every allocated ressources.
*
* @return
* GsmL1_Status_Success or the error code
*
* @ingroup gsml1_api_services
*
****************************************************************************/
GsmL1_Status_t GsmL1Link_Close( void );
#ifdef __cplusplus
}
#endif // extern "C"
#endif // GSML1_H__

View File

@ -179,13 +179,15 @@ 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]
uint8_t u8AutoDummy; /**< Automatically transmit dummy burst
when there is nothing else to transmit. */
GsmL1_LogChComb_t logChComb; /**< Logical channel multiplexing
over the physical channel */
} GsmL1_MphConnectReq_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,121 +30,6 @@
***************************************************************************/
typedef uint32_t HANDLE;
/****************************************************************************
* typedef : GsmL1_RxBurst
************************************************************************//**
*
* Individual physical channel message received from the demodulator.
*
* @ingroup gsml1_api_types
*
***************************************************************************/
#ifdef QUAD_BAND__ // Quad-Band
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 u8DeviceId : 8; ///< Device Id ( Word 3 [0-7] )
uint32_t u8AgcScaleFactor : 8; ///< Agc Gain applied to the burst sample is 2^(AGC_SCALE_FACTOR) ( Word 3 [8 - 15] )
uint32_t u16RfAtten :16; ///< RF attenuator ( Word 3 [16 - 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;
#else // DCS-1800
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;
#endif
/****************************************************************************
* 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
************************************************************************//**

View File

@ -13,7 +13,7 @@
#include "gsml1const.h"
#define SUPERFEMTO_API(x,y,z) ((x << 16) | (y << 8) | z)
#define SUPERFEMTO_API_VERSION SUPERFEMTO_API(0,2,0)
#define SUPERFEMTO_API_VERSION SUPERFEMTO_API(1,0,0)
/****************************************************************************
* Const *