⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zl5011xtdm.h

📁 Zalink50114----TDMoIP芯片驱动源码
💻 H
📖 第 1 页 / 共 2 页
字号:
/*******************************************************************************
*
*  File name:              zl5011xTdm.h
*
*  Version:                51
*
*  Author:                 MRC
*
*  Date created:           03/05/2002
*
*  Copyright 2002, 2003, 2004, 2005, Zarlink Semiconductor Limited.
*  All rights reserved.
*
*  Module Description:
*
*  This is the header file for the TDM interface functions.
*
*  The convention is that all directions are referenced relative to the
*  device. That is Rx is Wan Rx for the device and Tx is Wan Tx for the device.
*
*  Revision History:
*
*  Rev:  Date:       Author:  Comments:
*  1     03/05/2002  MRC      Creation
*  2     14/05/2002  MRC      Added more functions
*  3     15/05/2002  MRC      Added support for unframed mode
*  4     16/05/2002  MRC      Added more functions
*  5     17/05/2002  MRC      Added context delete functions
*  6     23/05/2002  MRC      Added PAC async functionality
*  7     28/05/2002  MRC      Mods following seminar
*  8     30/05/2002  MRC      Made function naming more consistent
*  9     31/05/2002  MRC      Added harness control to structures
*  10    11/06/2002  MRC      Added harness setups to create context fns
*  11    19/06/2002  MRC      PAC DPLL changed
*  12    09/07/2002  MRC      Added sample point to the clock structures
*  13    12/07/2002  MRC      Rationalised the 2 enums for CPU queues
*  14    18/07/2002  MRC      Added Wan to host fns
*  15    25/07/2002  MRC      Jitter buffer is now specified in time
*  16    01/08/2002  MRC      Tidied and added queue slip fn
*  17    12/09/2002  MRC      Updated following review
*  18    13/09/2002  MRC      Added extra funcs
*  19    19/09/2002  MRC      Added extra dpll settings to wan configure fn
*  20    02/10/2002  MRC      Fixed a couple of function names
*  21    24/10/2002  PJE      API tidy up
*  22    25/10/2002  MRC      Changed numFramesPerPacket to 32 bit
*  23    29/10/2002  MRC      Added osExclusion parameter
*  24    31/10/2002  MRC      Added variants + minor fixes
*  25    13/12/2002  MRC      Added control to allow Wan Tx clock to be sourced
*                             externally in unframed mode
*  26    07/02/2003  MRC      Added DPLL output enable and get inband PRS
*                             frequency function
*  27    17/02/2003  MRC      Added BER functions
*  28    25/03/2003  MRC      Added DPLL lock range parameter
*  29    11/06/2003  MRC      Added zl5011xWanRxGetPayloadLength fn and option
*                             to force the Wan Rx payload to be 64 bit aligned
*  30    26/06/2003  MRC      Added function to calculate the payload size for
*                             unframed contexts
*  31    02/07/2003  MRC      Removed unused param from structure.
*  32    21/07/2003  MRC      Added queue stats function
*  33    11/08/2003  MRC      Added channel combination checking
*  34    18/11/2003  AMS      Update
*  35    18/11/2003  AMS      Update
*  36    06/01/2004  MRC      Reverted to revision 33
*  37    20/04/2004  APL      Allow payload size to be specified in bytes
*  38    14/07/2004  MRC      Fixed problem deleting Wan Tx contexts that had
*                             not initialised.
*  39    21/07/2004  MRC      Added Wan Tx clock source functions
*  40    19/08/2004  MRC      Added limits checking to payload calculation
*  41    16/09/2004  APL      Corrected name of one function parameter
*  42    17/09/2004  MRC      Added min/max statistics to zl5011xWanTxGetQueueStats
*  43    27/09/2004  MRC      Added control for TDM_CLKiP freq to configureSync
*  44    20/10/2004  MRC      Added variable to async configure struct
*  45    16/11/2004  MRC      Added individual stream frequency control
*  46    16/12/2004  MRC      Added clock reference mux function
*  47    21/01/2005  MRC      zl5011xWanSetTxFreq can change nominal stream freq
*  48    28/01/2005  MRC      Added option to use a GPIO pin to force WanTx
*                             context deletion and current queue length to
*                             function zl5011xWanTxGetQueueStats
*  49    10/01/2005  APL      Previously static API function
*                             zl5011xUpdateRTPCurrentHeaderRecord is now available
*                             to other API files.
*  50    06/05/2005  APL      Added function zl5011xWanGetTxSeqNum
*  51    17/05/2005  MRC      Added function to return TDM queue counts
*
*******************************************************************************/

#ifndef _ZL5011X_TDM_H
#define _ZL5011X_TDM_H

#ifdef __cplusplus
extern "C" {
#endif

#define ZL5011X_TDM_QUEUE_CHECK_MS    50
/*****************   INCLUDE FILES   ******************************************/

/*****************   DATA STRUCTURES and FUNCTION DECLARATIONS   **************/

typedef struct
{
   zl5011xWanIfUnderrunModeE underrunMode;
   Uint8T underrunByte;
} zl5011xWanUnframedStreamS;

typedef struct
{
   Uint32T context;
   zl5011xFlowTypeE flow;
   zl5011xWanUnframedStreamS unframedStream;
   zl5011xBooleanE osExclusionEnable;
} zl5011xContextCreateS;

zlStatusE zl5011xContextCreateStructInit(zl5011xParamsS *zl5011xParams, zl5011xContextCreateS *par);
zlStatusE zl5011xContextCreateRx(zl5011xParamsS *zl5011xParams, zl5011xContextCreateS *par);
zlStatusE zl5011xContextCreateTx(zl5011xParamsS *zl5011xParams, zl5011xContextCreateS *par);

/********************************/

typedef struct
{
   Uint32T context;
   zl5011xBooleanE osExclusionEnable;
} zl5011xContextS;

zlStatusE zl5011xContextUpdateRxStructInit(zl5011xParamsS *zl5011xParams, zl5011xContextS *par);
zlStatusE zl5011xContextUpdateTxStructInit(zl5011xParamsS *zl5011xParams, zl5011xContextS *par);
zlStatusE zl5011xContextUpdateRx(zl5011xParamsS *zl5011xParams, zl5011xContextS *par);
zlStatusE zl5011xContextUpdateTx(zl5011xParamsS *zl5011xParams, zl5011xContextS *par);

zlStatusE zl5011xContextTakeStructInit(zl5011xParamsS *zl5011xParams, zl5011xContextS *par);
zlStatusE zl5011xContextTakeRx(zl5011xParamsS *zl5011xParams, zl5011xContextS *par);
zlStatusE zl5011xContextTakeTx(zl5011xParamsS *zl5011xParams, zl5011xContextS *par);

/********************************/

typedef struct
{
   Uint32T context;
   zl5011xWanChannelS tdm;
   zl5011xBooleanE checkChannelCombination;

   zl5011xBooleanE osExclusionEnable;
} zl5011xContextAddChannelRxS;

zlStatusE zl5011xContextAddChannelRxStructInit(zl5011xParamsS *zl5011xParams,
      zl5011xContextAddChannelRxS *par);
zlStatusE zl5011xContextAddChannelRx(zl5011xParamsS *zl5011xParams,
      zl5011xContextAddChannelRxS *par);

/********************************/

typedef struct
{
   Uint32T context;
   zl5011xWanChannelS tdm;
   zl5011xBooleanE checkChannelCombination;

   zl5011xWanIfUnderrunModeE underrunMode;
   Uint8T underrunByte;

   zl5011xBooleanE osExclusionEnable;
} zl5011xContextAddChannelTxS;

zlStatusE zl5011xContextAddChannelTxStructInit(zl5011xParamsS *zl5011xParams,
      zl5011xContextAddChannelTxS *par);
zlStatusE zl5011xContextAddChannelTx(zl5011xParamsS *zl5011xParams,
      zl5011xContextAddChannelTxS *par);

/********************************/

typedef struct
{
   Uint32T context;
   zl5011xWanChannelS tdm;
   zl5011xBooleanE osExclusionEnable;
} zl5011xContextRemoveChannelS;

zlStatusE zl5011xContextRemoveChannelRxStructInit(zl5011xParamsS *zl5011xParams,
      zl5011xContextRemoveChannelS *par);
zlStatusE zl5011xContextRemoveChannelRx(zl5011xParamsS *zl5011xParams,
      zl5011xContextRemoveChannelS *par);

zlStatusE zl5011xContextRemoveChannelTxStructInit(zl5011xParamsS *zl5011xParams,
      zl5011xContextRemoveChannelS *par);
zlStatusE zl5011xContextRemoveChannelTx(zl5011xParamsS *zl5011xParams,
      zl5011xContextRemoveChannelS *par);

/********************************/

typedef struct
{
   Uint32T context;
   Uint32T numberOfFrames;
   Uint32T numberOfBytes;

   /* For DS3 there are 699 bytes in a TDM frame (8kHz). This can be forced
      to be a multiple of 8 bytes if necessary by setting the following boolean
      to ZL5011X_TRUE.
      Clock recovery may require this to be set if the network PDV is high */
   zl5011xBooleanE unframedForceMultiple64Bits;

   zl5011xBooleanE osExclusionEnable;
} zl5011xWanRxPayloadConfigS;

zlStatusE zl5011xWanRxPayloadConfigStructInit(zl5011xParamsS *zl5011xParams,
      zl5011xWanRxPayloadConfigS *par);
zlStatusE zl5011xWanRxPayloadConfig(zl5011xParamsS *zl5011xParams,
      zl5011xWanRxPayloadConfigS *par);

/********************************/

typedef struct
{
   Uint32T context;
   Uint32T lengthBytes;
   Uint32T lengthBits;

   zl5011xBooleanE osExclusionEnable;
} zl5011xWanRxGetPayloadLengthS;

zlStatusE zl5011xWanRxGetPayloadLengthStructInit(zl5011xParamsS *zl5011xParams,
      zl5011xWanRxGetPayloadLengthS *par);
zlStatusE zl5011xWanRxGetPayloadLength(zl5011xParamsS *zl5011xParams,
      zl5011xWanRxGetPayloadLengthS *par);

/********************************/

typedef struct
{
   Uint32T context;
   zl5011xWanTxQueueSizeE queueSize;
   zl5011xWanTxQueueOperationE queueMode;
   /* the jitter buffer size is controlled in micro-seconds */
   Uint32T jitterBufferSizeUs;

   zl5011xBooleanE osExclusionEnable;
} zl5011xWanTxQueueConfigS;

zlStatusE zl5011xWanTxQueueConfigStructInit(zl5011xParamsS *zl5011xParams,
      zl5011xWanTxQueueConfigS *par);
zlStatusE zl5011xWanTxQueueConfig(zl5011xParamsS *zl5011xParams,
      zl5011xWanTxQueueConfigS *par);

/********************************/

typedef struct
{
   Uint32T streamFreqHz[ZL5011X_MAX_NUMBER_STREAMS];

   zl5011xDpllConnectionE dpllConnection;
   zl5011xBooleanE dpllMasterOutputEnable;
   zl5011xRefClkConfigS primaryRef;
   zl5011xRefClkConfigS secondaryRef;
   zl5011xDpllRefPriorityE refPriority;

   zl5011xPolarityE refPolarity;
   zl5011xPolarityE framePulsePolarity;
   zl5011xWanIfFramePulseTypeE framePulseWidth;

   zl5011xWanIfSamplePointE dataSamplePoint;

   Uint16T dpllRefCheckCycles;
   Uint16T dpllRefCheckSingle_x_10;
   Uint16T dpllRefCheckMulti_x_10;

   Uint16T dpllLockDetectThreshold;
   Uint32T dpllLockDetectTimeUs;

   Uint16T dpllMaxLockRangePpm;

   /* the following variable specifies the frequency of the
      clock applied to the TDM_CLKiP reference input */
   Uint32T extRefFreqHz;
   zl5011xBooleanE osExclusionEnable;
} zl5011xWanConfigureSyncS;

zlStatusE zl5011xWanConfigureSyncStructInit(zl5011xParamsS *zl5011xParams,
      zl5011xWanConfigureSyncS *par);
zlStatusE zl5011xWanConfigureSync(zl5011xParamsS *zl5011xParams,
      zl5011xWanConfigureSyncS *par);

/********************************/

typedef struct
{
   zl5011xWanAsyncIntFreqE interruptFreq;
   zl5011xBooleanE forceStdInterruptFreq;

   zl5011xRefClkConfigS refSource;
   zl5011xBooleanE wanTxExternalClockEnable;

   zl5011xPolarityE inputPolarity[ZL5011X_MAX_NUMBER_STREAMS];
   zl5011xPolarityE outputPolarity[ZL5011X_MAX_NUMBER_STREAMS];

   Uint32T streamFreqHz[ZL5011X_MAX_NUMBER_STREAMS];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -