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

📄 jz4740.h

📁 mips cpu 君正4730 4740的 ucosii 源码 包括系统 摄像头 网络 文件系统等等测试
💻 H
📖 第 1 页 / 共 5 页
字号:
 */#define UART_IER_RIE	(1 << 0)	/* 0: receive fifo "full" interrupt disable */#define UART_IER_TIE	(1 << 1)	/* 0: transmit fifo "empty" interrupt disable */#define UART_IER_RLIE	(1 << 2)	/* 0: receive line status interrupt disable */#define UART_IER_MIE	(1 << 3)	/* 0: modem status interrupt disable */#define UART_IER_RTIE	(1 << 4)	/* 0: receive timeout interrupt disable *//* * Define macros for UART_ISR * UART Interrupt Status Register */#define UART_ISR_IP	(1 << 0)	/* 0: interrupt is pending  1: no interrupt */#define UART_ISR_IID	(7 << 1)	/* Source of Interrupt */#define UART_ISR_IID_MSI		(0 << 1)	/* Modem status interrupt */#define UART_ISR_IID_THRI	(1 << 1)	/* Transmitter holding register empty */#define UART_ISR_IID_RDI		(2 << 1)	/* Receiver data interrupt */#define UART_ISR_IID_RLSI	(3 << 1)	/* Receiver line status interrupt */#define UART_ISR_FFMS	(3 << 6)	/* FIFO mode select, set when UART_FCR.FE is set to 1 */#define UART_ISR_FFMS_NO_FIFO	(0 << 6)#define UART_ISR_FFMS_FIFO_MODE	(3 << 6)/* * Define macros for UART_FCR * UART FIFO Control Register */#define UART_FCR_FE	(1 << 0)	/* 0: non-FIFO mode  1: FIFO mode */#define UART_FCR_RFLS	(1 << 1)	/* write 1 to flush receive FIFO */#define UART_FCR_TFLS	(1 << 2)	/* write 1 to flush transmit FIFO */#define UART_FCR_DMS	(1 << 3)	/* 0: disable DMA mode */#define UART_FCR_UUE	(1 << 4)	/* 0: disable UART */#define UART_FCR_RTRG	(3 << 6)	/* Receive FIFO Data Trigger */#define UART_FCR_RTRG_1	(0 << 6)#define UART_FCR_RTRG_4	(1 << 6)#define UART_FCR_RTRG_8	(2 << 6)#define UART_FCR_RTRG_15	(3 << 6)/* * Define macros for UART_LCR * UART Line Control Register */#define UART_LCR_WLEN	(3 << 0)	/* word length */#define UART_LCR_WLEN_5	(0 << 0)#define UART_LCR_WLEN_6	(1 << 0)#define UART_LCR_WLEN_7	(2 << 0)#define UART_LCR_WLEN_8	(3 << 0)#define UART_LCR_STOP	(1 << 2)	/* 0: 1 stop bit when word length is 5,6,7,8					   1: 1.5 stop bits when 5; 2 stop bits when 6,7,8 */#define UART_LCR_STOP_1	(0 << 2)	/* 0: 1 stop bit when word length is 5,6,7,8					   1: 1.5 stop bits when 5; 2 stop bits when 6,7,8 */#define UART_LCR_STOP_2	(1 << 2)	/* 0: 1 stop bit when word length is 5,6,7,8					   1: 1.5 stop bits when 5; 2 stop bits when 6,7,8 */#define UART_LCR_PE	(1 << 3)	/* 0: parity disable */#define UART_LCR_PROE	(1 << 4)	/* 0: even parity  1: odd parity */#define UART_LCR_SPAR	(1 << 5)	/* 0: sticky parity disable */#define UART_LCR_SBRK	(1 << 6)	/* write 0 normal, write 1 send break */#define UART_LCR_DLAB	(1 << 7)	/* 0: access UART_RDR/TDR/IER  1: access UART_DLLR/DLHR *//* * Define macros for UART_LSR * UART Line Status Register */#define UART_LSR_DR	(1 << 0)	/* 0: receive FIFO is empty  1: receive data is ready */#define UART_LSR_ORER	(1 << 1)	/* 0: no overrun error */#define UART_LSR_PER	(1 << 2)	/* 0: no parity error */#define UART_LSR_FER	(1 << 3)	/* 0; no framing error */#define UART_LSR_BRK	(1 << 4)	/* 0: no break detected  1: receive a break signal */#define UART_LSR_TDRQ	(1 << 5)	/* 1: transmit FIFO half "empty" */#define UART_LSR_TEMT	(1 << 6)	/* 1: transmit FIFO and shift registers empty */#define UART_LSR_RFER	(1 << 7)	/* 0: no receive error  1: receive error in FIFO mode *//* * Define macros for UART_MCR * UART Modem Control Register */#define UART_MCR_DTR	(1 << 0)	/* 0: DTR_ ouput high */#define UART_MCR_RTS	(1 << 1)	/* 0: RTS_ output high */#define UART_MCR_OUT1	(1 << 2)	/* 0: UART_MSR.RI is set to 0 and RI_ input high */#define UART_MCR_OUT2	(1 << 3)	/* 0: UART_MSR.DCD is set to 0 and DCD_ input high */#define UART_MCR_LOOP	(1 << 4)	/* 0: normal  1: loopback mode */#define UART_MCR_MCE	(1 << 7)	/* 0: modem function is disable *//* * Define macros for UART_MSR * UART Modem Status Register */#define UART_MSR_DCTS	(1 << 0)	/* 0: no change on CTS_ pin since last read of UART_MSR */#define UART_MSR_DDSR	(1 << 1)	/* 0: no change on DSR_ pin since last read of UART_MSR */#define UART_MSR_DRI	(1 << 2)	/* 0: no change on RI_ pin since last read of UART_MSR */#define UART_MSR_DDCD	(1 << 3)	/* 0: no change on DCD_ pin since last read of UART_MSR */#define UART_MSR_CTS	(1 << 4)	/* 0: CTS_ pin is high */#define UART_MSR_DSR	(1 << 5)	/* 0: DSR_ pin is high */#define UART_MSR_RI	(1 << 6)	/* 0: RI_ pin is high */#define UART_MSR_DCD	(1 << 7)	/* 0: DCD_ pin is high *//* * Define macros for SIRCR * Slow IrDA Control Register */#define SIRCR_TSIRE	(1 << 0)	/* 0: transmitter is in UART mode  1: IrDA mode */#define SIRCR_RSIRE	(1 << 1)	/* 0: receiver is in UART mode  1: IrDA mode */#define SIRCR_TPWS	(1 << 2)	/* 0: transmit 0 pulse width is 3/16 of bit length					   1: 0 pulse width is 1.6us for 115.2Kbps */#define SIRCR_TXPL	(1 << 3)	/* 0: encoder generates a positive pulse for 0 */#define SIRCR_RXPL	(1 << 4)	/* 0: decoder interprets positive pulse as 0 *//************************************************************************* * AIC (AC97/I2S Controller) *************************************************************************/#define	AIC_FR			(AIC_BASE + 0x000)#define	AIC_CR			(AIC_BASE + 0x004)#define	AIC_ACCR1		(AIC_BASE + 0x008)#define	AIC_ACCR2		(AIC_BASE + 0x00C)#define	AIC_I2SCR		(AIC_BASE + 0x010)#define	AIC_SR			(AIC_BASE + 0x014)#define	AIC_ACSR		(AIC_BASE + 0x018)#define	AIC_I2SSR		(AIC_BASE + 0x01C)#define	AIC_ACCAR		(AIC_BASE + 0x020)#define	AIC_ACCDR		(AIC_BASE + 0x024)#define	AIC_ACSAR		(AIC_BASE + 0x028)#define	AIC_ACSDR		(AIC_BASE + 0x02C)#define	AIC_I2SDIV		(AIC_BASE + 0x030)#define	AIC_DR			(AIC_BASE + 0x034)#define	REG_AIC_FR		REG32(AIC_FR)#define	REG_AIC_CR		REG32(AIC_CR)#define	REG_AIC_ACCR1		REG32(AIC_ACCR1)#define	REG_AIC_ACCR2		REG32(AIC_ACCR2)#define	REG_AIC_I2SCR		REG32(AIC_I2SCR)#define	REG_AIC_SR		REG32(AIC_SR)#define	REG_AIC_ACSR		REG32(AIC_ACSR)#define	REG_AIC_I2SSR		REG32(AIC_I2SSR)#define	REG_AIC_ACCAR		REG32(AIC_ACCAR)#define	REG_AIC_ACCDR		REG32(AIC_ACCDR)#define	REG_AIC_ACSAR		REG32(AIC_ACSAR)#define	REG_AIC_ACSDR		REG32(AIC_ACSDR)#define	REG_AIC_I2SDIV		REG32(AIC_I2SDIV)#define	REG_AIC_DR		REG32(AIC_DR)/* AIC Controller Configuration Register (AIC_FR) */#define	AIC_FR_RFTH_BIT		12        /* Receive FIFO Threshold */#define	AIC_FR_RFTH_MASK	(0xf << AIC_FR_RFTH_BIT)#define	AIC_FR_TFTH_BIT		8         /* Transmit FIFO Threshold */#define	AIC_FR_TFTH_MASK	(0xf << AIC_FR_TFTH_BIT)#define	AIC_FR_ICDC		(1 << 5)  /* External(0) or Internal CODEC(1) */#define	AIC_FR_AUSEL		(1 << 4)  /* AC97(0) or I2S/MSB-justified(1) */#define	AIC_FR_RST		(1 << 3)  /* AIC registers reset */#define	AIC_FR_BCKD		(1 << 2)  /* I2S BIT_CLK direction, 0:input,1:output */#define	AIC_FR_SYNCD		(1 << 1)  /* I2S SYNC direction, 0:input,1:output */#define	AIC_FR_ENB		(1 << 0)  /* AIC enable bit *//* AIC Controller Common Control Register (AIC_CR) */#define	AIC_CR_OSS_BIT		19  /* Output Sample Size from memory (AIC V2 only) */#define	AIC_CR_OSS_MASK		(0x7 << AIC_CR_OSS_BIT)  #define AIC_CR_OSS_8BIT	(0x0 << AIC_CR_OSS_BIT)  #define AIC_CR_OSS_16BIT	(0x1 << AIC_CR_OSS_BIT)  #define AIC_CR_OSS_18BIT	(0x2 << AIC_CR_OSS_BIT)  #define AIC_CR_OSS_20BIT	(0x3 << AIC_CR_OSS_BIT)  #define AIC_CR_OSS_24BIT	(0x4 << AIC_CR_OSS_BIT)#define	AIC_CR_ISS_BIT		16  /* Input Sample Size from memory (AIC V2 only) */#define	AIC_CR_ISS_MASK		(0x7 << AIC_CR_ISS_BIT)  #define AIC_CR_ISS_8BIT	(0x0 << AIC_CR_ISS_BIT)  #define AIC_CR_ISS_16BIT	(0x1 << AIC_CR_ISS_BIT)  #define AIC_CR_ISS_18BIT	(0x2 << AIC_CR_ISS_BIT)  #define AIC_CR_ISS_20BIT	(0x3 << AIC_CR_ISS_BIT)  #define AIC_CR_ISS_24BIT	(0x4 << AIC_CR_ISS_BIT)#define	AIC_CR_RDMS		(1 << 15)  /* Receive DMA enable */#define	AIC_CR_TDMS		(1 << 14)  /* Transmit DMA enable */#define	AIC_CR_M2S		(1 << 11)  /* Mono to Stereo enable */#define	AIC_CR_ENDSW		(1 << 10)  /* Endian switch enable */#define	AIC_CR_AVSTSU		(1 << 9)   /* Signed <-> Unsigned toggle enable */#define	AIC_CR_FLUSH		(1 << 8)   /* Flush FIFO */#define	AIC_CR_EROR		(1 << 6)   /* Enable ROR interrupt */#define	AIC_CR_ETUR		(1 << 5)   /* Enable TUR interrupt */#define	AIC_CR_ERFS		(1 << 4)   /* Enable RFS interrupt */#define	AIC_CR_ETFS		(1 << 3)   /* Enable TFS interrupt */#define	AIC_CR_ENLBF		(1 << 2)   /* Enable Loopback Function */#define	AIC_CR_ERPL		(1 << 1)   /* Enable Playback Function */#define	AIC_CR_EREC		(1 << 0)   /* Enable Record Function *//* AIC Controller AC-link Control Register 1 (AIC_ACCR1) */#define	AIC_ACCR1_RS_BIT	16          /* Receive Valid Slots */#define	AIC_ACCR1_RS_MASK	(0x3ff << AIC_ACCR1_RS_BIT)  #define AIC_ACCR1_RS_SLOT12	  (1 << 25) /* Slot 12 valid bit */  #define AIC_ACCR1_RS_SLOT11	  (1 << 24) /* Slot 11 valid bit */  #define AIC_ACCR1_RS_SLOT10	  (1 << 23) /* Slot 10 valid bit */  #define AIC_ACCR1_RS_SLOT9	  (1 << 22) /* Slot 9 valid bit, LFE */  #define AIC_ACCR1_RS_SLOT8	  (1 << 21) /* Slot 8 valid bit, Surround Right */  #define AIC_ACCR1_RS_SLOT7	  (1 << 20) /* Slot 7 valid bit, Surround Left */  #define AIC_ACCR1_RS_SLOT6	  (1 << 19) /* Slot 6 valid bit, PCM Center */  #define AIC_ACCR1_RS_SLOT5	  (1 << 18) /* Slot 5 valid bit */  #define AIC_ACCR1_RS_SLOT4	  (1 << 17) /* Slot 4 valid bit, PCM Right */  #define AIC_ACCR1_RS_SLOT3	  (1 << 16) /* Slot 3 valid bit, PCM Left */#define	AIC_ACCR1_XS_BIT	0          /* Transmit Valid Slots */#define	AIC_ACCR1_XS_MASK	(0x3ff << AIC_ACCR1_XS_BIT)  #define AIC_ACCR1_XS_SLOT12	  (1 << 9) /* Slot 12 valid bit */  #define AIC_ACCR1_XS_SLOT11	  (1 << 8) /* Slot 11 valid bit */  #define AIC_ACCR1_XS_SLOT10	  (1 << 7) /* Slot 10 valid bit */  #define AIC_ACCR1_XS_SLOT9	  (1 << 6) /* Slot 9 valid bit, LFE */  #define AIC_ACCR1_XS_SLOT8	  (1 << 5) /* Slot 8 valid bit, Surround Right */  #define AIC_ACCR1_XS_SLOT7	  (1 << 4) /* Slot 7 valid bit, Surround Left */  #define AIC_ACCR1_XS_SLOT6	  (1 << 3) /* Slot 6 valid bit, PCM Center */  #define AIC_ACCR1_XS_SLOT5	  (1 << 2) /* Slot 5 valid bit */  #define AIC_ACCR1_XS_SLOT4	  (1 << 1) /* Slot 4 valid bit, PCM Right */  #define AIC_ACCR1_XS_SLOT3	  (1 << 0) /* Slot 3 valid bit, PCM Left *//* AIC Controller AC-link Control Register 2 (AIC_ACCR2) */#define	AIC_ACCR2_ERSTO		(1 << 18) /* Enable RSTO interrupt */#define	AIC_ACCR2_ESADR		(1 << 17) /* Enable SADR interrupt */#define	AIC_ACCR2_ECADT		(1 << 16) /* Enable CADT interrupt */#define	AIC_ACCR2_OASS_BIT	8  /* Output Sample Size for AC-link */#define	AIC_ACCR2_OASS_MASK	(0x3 << AIC_ACCR2_OASS_BIT)  #define AIC_ACCR2_OASS_20BIT	  (0 << AIC_ACCR2_OASS_BIT) /* Output Audio Sample Size is 20-bit */  #define AIC_ACCR2_OASS_18BIT	  (1 << AIC_ACCR2_OASS_BIT) /* Output Audio Sample Size is 18-bit */  #define AIC_ACCR2_OASS_16BIT	  (2 << AIC_ACCR2_OASS_BIT) /* Output Audio Sample Size is 16-bit */  #define AIC_ACCR2_OASS_8BIT	  (3 << AIC_ACCR2_OASS_BIT) /* Output Audio Sample Size is 8-bit */#define	AIC_ACCR2_IASS_BIT	6  /* Output Sample Size for AC-link */#define	AIC_ACCR2_IASS_MASK	(0x3 << AIC_ACCR2_IASS_BIT)  #define AIC_ACCR2_IASS_20BIT	  (0 << AIC_ACCR2_IASS_BIT) /* Input Audio Sample Size is 20-bit */  #define AIC_ACCR2_IASS_18BIT	  (1 << AIC_ACCR2_IASS_BIT) /* Input Audio Sample Size is 18-bit */  #define AIC_ACCR2_IASS_16BIT	  (2 << AIC_ACCR2_IASS_BIT) /* Input Audio Sample Size is 16-bit */  #define AIC_ACCR2_IASS_8BIT	  (3 << AIC_ACCR2_IASS_BIT) /* Input Audio Sample Size is 8-bit */#define	AIC_ACCR2_SO		(1 << 3)  /* SDATA_OUT output value */#define	AIC_ACCR2_SR		(1 << 2)  /* RESET# pin level */#define	AIC_ACCR2_SS		(1 << 1)  /* SYNC pin level */#define	AIC_ACCR2_SA		(1 << 0)  /* SYNC and SDATA_OUT alternation *//* AIC Controller I2S/MSB-justified Control Register (AIC_I2SCR) */#define	AIC_I2SCR_STPBK		(1 << 12) /* Stop BIT_CLK for I2S/MSB-justified */#define	AIC_I2SCR_WL_BIT	1  /* Input/Output Sample Size for I2S/MSB-justified */#define	AIC_I2SCR_WL_MASK	(0x7 << AIC_I2SCR_WL_BIT)  #define AIC_I2SCR_WL_24BIT	  (0 << AIC_I2SCR_WL_BIT) /* Word Length is 24 bit */  #define AIC_I2SCR_WL_20BIT	  (1 << AIC_I2SCR_WL_BIT) /* Word Length is 20 bit */  #define AIC_I2SCR_WL_18BIT	  (2 << AIC_I2SCR_WL_BIT) /* Word Length is 18 bit */  #define AIC_I2SCR_WL_16BIT	  (3 << AIC_I2SCR_WL_BIT) /* Word Length is 16 bit */  #define AIC_I2SCR_WL_8BIT	  (4 << AIC_I2SCR_WL_BIT) /* Word Length is 8 bit */#define	AIC_I2SCR_AMSL		(1 << 0) /* 0:I2S, 1:MSB-justified *//* AIC Controller FIFO Status Register (AIC_SR) */#define	AIC_SR_RFL_BIT		24  /* Receive FIFO Level */#define	AIC_SR_RFL_MASK		(0x3f << AIC_SR_RFL_BIT)#define	AIC_SR_TFL_BIT		8   /* Transmit FIFO level */#define	AIC_SR_TFL_MASK		(0x3f << AIC_SR_TFL_BIT)#define	AIC_SR_ROR		(1 << 6) /* Receive FIFO Overrun */#define	AIC_SR_TUR		(1 << 5) /* Transmit FIFO Underrun */#define	AIC_SR_RFS		(1 << 4) /* Receive FIFO Service Request */#define	AIC_SR_TFS		(1 << 3) /* Transmit FIFO Service Request *//* AIC Controller AC-link Status Register (AIC_ACSR) */#define	AIC_ACSR_SLTERR		(1 << 21) /* Slot Error Flag */#define	AIC_ACSR_CRDY		(1 << 20) /* External CODEC Ready Flag */#define	AIC_ACSR_CLPM		(1 << 19) /* External CODEC low power mode flag */#define	AIC_ACSR_RSTO		(1 << 18) /* External CODEC regs read status timeout */#define	AIC_ACSR_SADR		(1 << 17) /* External CODEC regs status addr and data received */#define	AIC_ACSR_CADT		(1 << 16) /* Command Address and Data Transmitted *//* AIC Controller I2S/MSB-justified Status Register (AIC_I2SSR) */#define	AIC_I2SSR_BSY		(1 << 2)  /* AIC Busy in I2S/MSB-justified format *//* AIC Controller AC97 codec Command Address Register (AIC_ACCAR) */#define	AIC_ACCAR_CAR_BIT	0#define	AIC_ACCAR_CAR_MASK	(0xfffff << AIC_ACCAR_CAR_BIT)/* AIC Controller AC97 codec Command Data Register (AIC_ACCDR) */#define	AIC_ACCDR_CDR_BIT	0#define	AIC_ACCDR_CDR_MASK	(0xfffff << AIC_ACCDR_CDR_BIT)/* AIC Controller AC97 codec Status Address Register (AIC_ACSAR) */#define	AIC_ACSAR_SAR_BIT	0#define	AIC_ACSAR_SAR_MASK	(0xfffff << AIC_ACSAR_SAR_BIT)/* AIC Controller AC97 codec Status Data Register (AIC_ACSDR) */#define	AIC_ACSDR_SDR_BIT	0#define	AIC_ACSDR_SDR_MASK	(0xfffff << AIC_ACSDR_SDR_BIT)/* AIC Controller I2S/MSB-justified Clock Divider Register (AIC_I2SDIV) */#define	AIC_I2SDIV_DIV_BIT	0#define	AIC_I2SDIV_DIV_MASK	(0x7f << AIC_I2SDIV_DIV_BIT)  #define AIC_I2SDIV_BITCLK_3072KHZ	(0x0C << AIC_I2SDIV_DIV_BIT) /* BIT_CLK of 3.072MHz */  #define AIC_I2SDIV_BITCLK_2836KHZ	(0x0D << AIC_I2SDIV_DIV_BIT) /* BIT_CLK of 2.836MHz */  #define AIC_I2SDIV_BITCLK_1418KHZ	(0x1A << AIC_I2SDIV_DIV_BIT) /* BIT_CLK of 1.418MHz */  #define AIC_I2SDIV_BITCLK_1024KHZ	(0x24 << AIC_I2SDIV_DIV_BIT) /* BIT_CLK of 1.024MHz */  #define AIC_I2SDIV_BITCLK_7089KHZ	(0x34 << AIC_I2SDIV_DIV_BIT) /* BIT_CLK of 708.92KHz */  #define AIC_I2SDIV_BITCLK_512KHZ	(0x48 << AIC_I2SDIV_DIV_BIT) /* BIT_CLK of 512.00KHz *//************************************************************************* * ICDC (Internal CODEC) *************************************************************************/#define	ICDC_CR			(ICDC_BASE + 0x0400)  /* ICDC Control Register */#define	ICDC_APWAIT		(ICDC_BASE + 0x0404)  /* Anti-Pop WAIT Stage Timing Control Register */#define	ICDC_APPRE		(ICDC_BASE + 0x0408)  /* Anti-Pop HPEN-PRE Stage Timing Control Register */#define	ICDC_APHPEN		(ICDC_BASE + 0x040C)  /* Anti-Pop HPEN Stage Timing Control Register */#define	ICDC_APSR		(ICDC_BASE + 0x0410)  /* Anti-Pop Status Register */#define ICDC_CDCCR1             (ICDC_BASE + 0x0080)#define ICDC_CDCCR2             (ICDC_BASE + 0x0084)#define	REG_ICDC_CR		REG32(ICDC_CR)#define	REG_ICDC_APWAIT		REG32(ICDC_APWAIT)#define	REG_ICDC_APPRE		REG32(ICDC_APPRE)#define	REG_ICDC_APHPEN		REG32(ICDC_APHPEN)

⌨️ 快捷键说明

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