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

📄 ds26528.h

📁 Sample driver code for Dallas DS26528 T1/E1 framer chip.
💻 H
📖 第 1 页 / 共 4 页
字号:
	VUC glimr;	/* 00fe */

	VUC hole103;	/* 00ff */


/*************************************************************************
 * End Global Register Map Section
 *************************************************************************
*/


/*************************************************************************
 * Framer Transmit Side
 *************************************************************************
*/
	VUC hole200[16];/* 100 - 10F */

	VUC thc1;	/* 110 */
#define THC1_NOFS	(1 << 7)
#define THC1_TEOML	(1 << 6)
#define THC1_THR	(1 << 5)
#define THC1_THMS	(1 << 4)
#define THC1_TFS	(1 << 3)
#define THC1_TEOM	(1 << 2)
#define THC1_TZSD	(1 << 1)
#define THC1_TCRCD	(1 << 0)

	VUC thbse;	/* 111 */
#define THBSE_TBSE(x)	VUC_FIELD(x, 0, 8)

	VUC hole201;	/* 112 */

	VUC thc2;	/* 113 */
#define THC2_TABT	(1 << 7)
#define THC2_SBOC	(1 << 6)
#define THC2_THCEN	(1 << 5)
#define THC2_THCS(x)	VUC_FIELD(x, 0, 5)

	VUC tsacr;	/* 114 */
#define TSACR_SIAF	(1 << 7)
#define TSACR_SINAF	(1 << 6)
#define TSACR_RA	(1 << 5)
#define TSACR_SA4	(1 << 4)
#define TSACR_SA5	(1 << 3)
#define TSACR_SA6	(1 << 2)
#define TSACR_SA7	(1 << 1)
#define TSACR_SA8	(1 << 0)
	
	VUC hole202[3];	/* 115 - 117 */

	VUC ssie[4];	/* 118 - 11B */

	VUC ttest[4];	/* 11C - 11F */

	VUC tidr[32];	/* 120 - 13F */
#define TIDR_C(x)	VUC_FIELD(x, 0, 8)

	VUC ts[16];	/* 140 - 14F */

	VUC tcice[4];	/* 150 - 153 */

	VUC hole206[14];/* 154 - 161 */

	VUC tfdl;	/* 162 */
#define TFDL_TFDL(x)	VUC_FIELD(x, 0, 8)

	VUC tboc;	/* 163 */
#define TBOC_TBOC(x)	VUC_FIELD(x, 0, 6)

	VUC tslc1_taf;	/* 164 */
#define TAF_SI		(1 << 7)
	
	VUC tslc2_tnaf;	/* 165 */
#define TNAF_SI		(1 << 7)
#define TNAF_A		(1 << 5)
#define TNAF_SA4	(1 << 4)
#define TNAF_SA5	(1 << 3)
#define TNAF_SA6	(1 << 2)
#define TNAF_SA7	(1 << 1)
#define TNAF_SA8	(1 << 0)

	VUC tslc3_tsiaf;/* 166 */
	
	VUC tsinaf;	/* 167 */
	
	VUC tra;	/* 168 */

	VUC tsa4;	/* 169 */

	VUC tsa5;	/* 16A */

	VUC tsa6;	/* 16B */

	VUC tsa7;	/* 16C */

	VUC tsa8;	/* 16D */

	VUC hole207[18];/* 16E - 17F */

	VUC tmmr;	/* 180 */
#define TMMR_FRM_EN 	(1 << 7)
#define TMMR_INIT_DONE	(1 << 6)
#define TMMR_SFTRST	(1 << 1)
#define TMMR_T1E1	(1 << 0)

	VUC tcr1;	/* 181 */	
#define TCR1_TJC	(1 << 7)
#define TCR1_TFPT	(1 << 6)
#define TCR1_TCPT	(1 << 5)
#define TCR1_TSSE	(1 << 4)
#define TCR1_GB7S	(1 << 3)
#define TCR1_TB8ZS	(1 << 2)
#define TCR1_TAIS	(1 << 1)
#define TCR1_TRAI	(1 << 0)

#define TCR1_TTPT	(1 << 7)
#define TCR1_T16S	(1 << 6)
#define TCR1_TG802	(1 << 5)
#define TCR1_TSIS	(1 << 4)
#define TCR1_TSA1	(1 << 3)
#define TCR1_THDB3	(1 << 2)
#define TCR1_TAIS	(1 << 1)
#define TCR1_TCRC4	(1 << 0)
	
	VUC tcr2;	/* 182 */
#define TCR2_TFDLS	(1 << 7)
#define TCR2_TSLC96	(1 << 6)
#define TCR2_FBCT(x)	VUC_FIELD(x, 3, 2)
#define TCR2_TD4RM	(1 << 2)
#define TCR2_PDE	(1 << 1)
#define TCR2_TB7ZS	(1 << 0)

#define TCR2_AEBE	(1 << 7)
#define TCR2_AAIS	(1 << 6)
#define TCR2_ARA	(1 << 5)
#define TCR2_SA4S	(1 << 4)
#define TCR2_SA5S	(1 << 3)
#define TCR2_SA6S	(1 << 2)
#define TCR2_SA7S	(1 << 1)
#define TCR2_SA8S	(1 << 0)

	VUC tcr3;	/* 183 */
#define TCR3_ODF	(1 << 7)
#define TCR3_ODM	(1 << 6)
#define TCR3_TCSS(x)	VUC_FIELD(x, 4, 2)
#define TCR3_MFRS	(1 << 3)
#define TCR3_TFM	(1 << 2)
#define TCR3_IBVD	(1 << 1)
#define TCR3_TLOOP	(1 << 0)

#define TCR3_CRC4R	(1 << 0)

	VUC tiocr;	/* 184 */
#define TIOCR_TCLKINV	(1 << 7)
#define TIOCR_TSYNCINV	(1 << 6)
#define TIOCR_TSSYNCINV	(1 << 5)
#define TIOCR_TSCLKM	(1 << 4)
#define TIOCR_TSSM	(1 << 3)
#define TIOCR_TSIO	(1 << 2)
#define TIOCR_TSDW	(1 << 1)
#define TIOCR_TSM	(1 << 0)

	VUC tescr;	/* 185 */
#define TESCR_TDATFMT	(1 << 7)
#define TESCR_TGCLKEN	(1 << 6)
#define TESCR_TDATAEN	(1 << 5)
#define TESCR_TSZS	(1 << 4)
#define TESCR_TESALGN	(1 << 3)
#define TESCR_TESR	(1 << 2)
#define TESCR_TESMDM	(1 << 1)
#define TESCR_TESE	(1 << 0)

	VUC tcr4;	/* 186 */
#define TCR4_TRAIM	(1 << 3)
#define TCR4_TAISM	(1 << 2)
#define TCR4_TC(x)	VUC_FIELD(x, 0, 2)

	VUC thfc;	/* 187 */
#define THFC_TFLWM(x)	VUC_FIELD(x, 0, 2)

	VUC tiboc;	/* 188 */
#define TIBOC_IBS(x)	VUC_FIELD(x, 5, 2)
#define TIBOC_IBOSEL	(1 << 4)
#define TIBOC_IBOEN	(1 << 3)
#define TIBOC_DA(x)	VUC_FIELD(x, 0, 3)

	VUC tds0sel;	/* 189 */
#define TDS0SEL_TCM(x)	VUC_FIELD(x, 0, 5)

	VUC txpc;	/* 18A */
#define TXPC_THPBMS	(1 << 7)
#define TXPC_THPBEN	(1 << 6)
#define TXPC_THPAMS	(1 << 5)
#define TXPC_THPAEN	(1 << 4)
#define TXPC_TBPDIR	(1 << 2)
#define TXPC_TBPFUS	(1 << 1)
#define TXPC_TBPEN	(1 << 0)

	VUC tbbs;	/* 18B */
#define TBBS_BPBSE(x)	VUC_FIELD(x, 0, 8)

	VUC hole208[2];	/* 18D */

	VUC tsyncc;	/* 18E */
#define TSYNCC_TSEN	(1 << 2)
#define TSYNCC_SYNCE	(1 << 1)
#define TSYNCC_RESYNC	(1 << 0)

#define TSYNCC_CRC4	(1 << 3)

	VUC ttest5;	/* 18F */
#define TTEST5_TLRTE	(1 << 6)
#define TTEST5_FLBAISD	(1 << 1)
#define TTEST5_AISCIP	(1 << 0)

	VUC tls1;	/* 190 */
#define TLS1_TESF	(1 << 7)
#define TLS1_TESEM	(1 << 6)
#define TLS1_TSLIP	(1 << 5)
#define TLS1_TSLC96	(1 << 4)
#define TLS1_TPDV	(1 << 3)
#define TLS1_TMF	(1 << 2)
#define TLS1_LOTCC	(1 << 1)
#define TLS1_LOTC	(1 << 0)

#define TLS1_TAF	(1 << 3)

	VUC tls2;	/* 191 */
#define TLS2_TFDLE	(1 << 4)
#define TLS2_TUDR	(1 << 3)
#define TLS2_TMEND	(1 << 2)
#define TLS2_TLWMS	(1 << 1)
#define TLS2_TNFS	(1 << 0)

	VUC tls3;	/* 192 */
#define TLS3_LOF	(1 << 1)
#define TLS3_LOFD	(1 << 0)

	VUC hole209[12];/* 193 - 19E */

	VUC tiir;	/* 19F */
#define TIIR_TLS1	(1 << 0)
#define TIIR_TLS2	(1 << 1)
#define TIIR_TLS3	(1 << 2)

	VUC tim1;	/* 1A0 */
#define TIM1_TESF	(1 << 7)
#define TIM1_TESEM	(1 << 6)
#define TIM1_TSLIP	(1 << 5)
#define TIM1_TSLC96	(1 << 4)
#define TIM1_TPDV	(1 << 3)
#define TIM1_TMF	(1 << 2)
#define TIM1_LOTCC	(1 << 1)
#define TIM1_LOTC	(1 << 0)

#define TIM1_TAF	(1 << 3)

	VUC tim2;	/* 1A1 */
#define TIM2_TFDLE	(1 << 4)
#define TIM2_TUDR	(1 << 3)
#define TIM2_TMEND	(1 << 2)
#define TIM2_TLWMS	(1 << 1)
#define TIM2_TNFS	(1 << 0)

	VUC tim3;	/* 1A2 */
#define TIM3_LOFD	(1 << 0)

	VUC hole210[9];	/* 1A3 - 1AB */

	VUC tcd1;	/* 1AC */
#define TCD1_C(x)	VUC_FIELD(x, 0, 8)

	VUC tcd2;	/* 1AD */
#define TCD2_C(x)	VUC_FIELD(x, 0, 8)

	VUC hole211[3];	/* 1AE - 1B0 */

	VUC trts2;	/* 1B1 */
#define TRTS_TEMPTY	(1 << 3)
#define TRTS_TFULL	(1 << 2)
#define TRTS_TLWMM	(1 << 1)
#define TRTS_TNF	(1 << 0)

	VUC hole212;	/* 1B2 */

	VUC tfba;	/* 1B3 */
#define TFBA_TFBA(x)	VUC_FIELD(x, 0, 7)

	VUC thf;	/* 1B4 */
#define THF_THD(x)	VUC_FIELD(x, 0, 8)

	VUC hole213[6];	/* 1B5 - 1BA */

	VUC tdsom;	/* 1BB */
#define TDSOM_B(x)	VUC_FIELD(x, 0, 8)

	VUC hole214[4];	/* 1BC - 1BF */

	VUC tbcs[4];	/* 1C0 - 1C3 */

	VUC tcbr[4];	/* 1C4 - 1C7 */

	VUC thscs[4];	/* 1C8 - 1CB */

	VUC tgccs[4];	/* 1CC - 1CF */

	VUC pcl[4];	/* 1D0 - 1D3 */

	VUC tbpcs[4];	/* 1D4 - 1D7*/

	VUC hole217[40];/* 1D8 - 1FF */
	
	
	
/*************************************************************************
 * End Framer Transmit Side
 *************************************************************************
*/



/*************************************************************************
 * End Per Port Section
 *************************************************************************
*/

} te1[8];

	struct _bertliu{
/*************************************************************************
 * LIU Section
 *************************************************************************
*/
	struct _liu {
		
	VUC ltrcr;	/* 1000 */
#define LTRCR_JADS	(1 << 4)
#define LTRCR_JAPS(x)	VUC_FIELD(x, 2, 2)
#define LTRCR_T1J1E1	(1 << 1)
#define LTRCR_LSC	(1 << 0)

	VUC ltitsr;	/* 1001 */
#define LTITSR_TIMPTOFF	(1 << 6)
#define LTITSR_TIMPL(x)	VUC_FIELD(x, 4, 2)
#define LTITSR_TS(x)	VUC_FIELD(x, 0, 3)

	VUC lmcr;	/* 1002 */
#define LMCR_TAIS	(1 << 7)
#define LMCR_ATAIS	(1 << 6)
#define LMCR_LLB	(1 << 5)
#define LMCR_ALB	(1 << 4)
#define LMCR_RLB	(1 << 3)
#define LMCR_TPDE	(1 << 2)
#define LMCR_RPDE	(1 << 1)
#define LMCR_TE		(1 << 0)

	VUC lrsr;	/* 1003 */
#define LRSR_OEQ	(1 << 5)
#define LRSR_UEQ	(1 << 4)
#define LRSR_JALTS	(1 << 3)
#define LRSR_SCS	(1 << 2)
#define LRSR_OCS	(1 << 1)
#define LRSR_LOSS	(1 << 0)

	VUC lsimr;	/* 1004 */
#define LSIMR_JALTRSIM	(1 << 7)
#define LSIMR_OCSRIM	(1 << 6)
#define LSIMR_SCSRIM	(1 << 5)
#define LSIMR_LOSRIM	(1 << 4)
#define LSIMR_JALTSSIM	(1 << 3)
#define LSIMR_OCSSIM	(1 << 2)
#define LSIMR_SCSSIM	(1 << 1)
#define LSIMR_LOSSIM	(1 << 0)

	VUC llsr;	/* 1005 */
#define LLSR_JFLTRLS	(1 << 7)
#define LLSR_OCRLS	(1 << 6)
#define LLSR_SCRLS	(1 << 5)
#define LLSR_LOSRLS	(1 << 4)
#define LLSR_JALTSLS	(1 << 3)
#define LLSR_OCSLS	(1 << 2)
#define LLSR_SCSLS	(1 << 1)
#define LLSR_LOSSLS	(1 << 0)

	VUC lrsl;	/* 1006 */
#define LRSL_RSL(x)	VUC_FIELD(x, 6, 2)

	VUC lrismr;	/* 1007 */
#define LRISMR_RG703	(1 << 7)
#define LRISMR_RIMPOFF	(1 << 6)
#define LRISMR_RIMPM(x)	VUC_FIELD(x, 4, 2)
#define LRISMR_RTR	(1 << 3)
#define LRISMR_RMONEN	(1 << 2)
#define LRISMR_RSMS(x)	VUC_FIELD(x, 0, 2)

	VUC hole[24];	/* 1008 - 101f */
	} liu[8];

/*************************************************************************
 * End LIU Section
 *************************************************************************
*/
/*************************************************************************
 * Bert Section
 *************************************************************************
*/
	struct _bert {

	VUC bawc;	/* 1100 */
#define BAWC_ACNT(x)	VUC_FIELD(x, 0, 8)

	VUC brp[4];	/* 1101 - 1104 */

	VUC bcr1;	/* 1105 */
#define BCR1_TC		(1 << 7)
#define BCR1_TINV	(1 << 6)
#define BCR1_RINV	(1 << 5)
#define BCR1_PS(x)	VUC_FIELD(x, 2, 3)
#define BCR1_LC		(1 << 1)
#define BCR1_RESYNC	(1 << 0)

	VUC bcr2;	/* 1106 */
#define BCR2_EIB(x)	VUC_FIELD(x, 5, 3)
#define BCR2_SBE	(1 << 4)
#define BCR2_RPL(x)	VUC_FIELD(x, 4, 0)

	VUC bbc[4];	/* 1107 - 110A */

	VUC bec[3];	/* 110B - 110D */

	VUC b0SR0;	/* 110E */
#define BOSRO_BBED	(1 << 6)
#define BOSRO_BBCO	(1 << 5)
#define BOSRO_BEC0	(1 << 4)
#define BOSRO_BRA(x)	VUC_FIELD(x, 2, 2)
#define BOSRO_BRLOS	(1 << 1)
#define BOSRO_BSYNC	(1 << 0)

	VUC simr;	/* 110F */

	} bert[8];

/*************************************************************************
 * End Bert Section
 *************************************************************************
*/
	} bertliu;


} DEVICE;

typedef struct _te1span FRAMER;
typedef struct _liu LIU;

/*
 *	Copyright 1997-2005 NComm, Inc.  All rights reserved.
 *	For technical support:
 *	Email: techsupport@ncomm.com
 *	603-893-6186 x67
 *	www.ncomm.com
 *
 *	The Device version is the chip revision that is supported by this
 *	driver.
 *
 *	Device Version:
 *		Rev 0
 *
 *	Revision:
 *		xx/xx/xx - Initial Release
 *
 *	See CUSTOMIZE HERE for areas that may need to be customized for your
 *	platform.
 */

/* -------------------------------------------------------------------------- */
/*
 * Driver for the DALLAS DS26528 chip, global section
 */

/* -------------------------------------------------------------------------- */
/* 
 * The following sections consists of defines for your platform as well
 * as how the DS26528 works in your system.
 * You need to review each of these sections.  All of the defines shown
 * here are what is required to operate this chip on one of NComms
 * evaluation platforms.  Your platform may require different settings.
 * The places that will be different are dependant upon the hardware
 * design of your platform.  The design team responsible for your
 * hardware platform will likely have the answers to any customizations that
 * are required.
 *
 * NComm recommends that you add a pound include line at the end of these
 * sections which contains an #undef of the items that need to be changed and
 * a subsequent #define that provides a different value.  This pound include 
 * file would then become a record of what changed between the standard NComm
 * driver distribution and your platform.  
 * See the line pound include "customizations_for_NCI_CHIP_NAME.h"
 * below for where this should be done.
 *
 */

/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* Platform Customizations Section
 * This section defines how the chip and driver interact with other parts
 * of your hardware.
 */

#define EDGE_TRIG_INTRPT	0	/* 0 = level triggered interrupts */
					/* level triggered is recommended */
					/* 1 = edge triggered */

#define USER_DEFINED_HOOKINT_VALUE 0	/* User defined value */
					/* A value that will be passed to the */
					/* application when a HOOKINTERRUPT is*/
					/* made.  This value is not used by */

⌨️ 快捷键说明

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