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

📄 gp32.h

📁 the test file for GP32 gameboy hack
💻 H
📖 第 1 页 / 共 2 页
字号:
//////////////////////////////////////////////////////////////////////////////// GP32.h                                                                   /////////////////////////////////////////////////////////////////////////////////*
	yet another GP32.h :P
*/

#ifndef __GP32_H
#define __GP32_H

//////////////////////////////////////////////////////////////////////////////// Defines                                                                  /////////////////////////////////////////////////////////////////////////////////* Memory control */
#define rBWSCON		(*(volatile unsigned *)0x14000000)
#define rBANKCON0	(*(volatile unsigned *)0x14000004)
#define rBANKCON1	(*(volatile unsigned *)0x14000008)
#define rBANKCON2	(*(volatile unsigned *)0x1400000c)
#define rBANKCON3	(*(volatile unsigned *)0x14000010)
#define rBANKCON4	(*(volatile unsigned *)0x14000014)
#define rBANKCON5	(*(volatile unsigned *)0x14000018)
#define rBANKCON6	(*(volatile unsigned *)0x1400001c)
#define rBANKCON7	(*(volatile unsigned *)0x14000020)
#define rREFRESH	(*(volatile unsigned *)0x14000024)
#define rBANKSIZE	(*(volatile unsigned *)0x14000028)
#define rMRSRB6		(*(volatile unsigned *)0x1400002c)
#define rMRSRB7		(*(volatile unsigned *)0x14000030)

/* INTERRUPT */
#define rSRCPND		(*(volatile unsigned *)0x14400000)
#define rINTMOD		(*(volatile unsigned *)0x14400004)
#define rINTMSK		(*(volatile unsigned *)0x14400008)
#define rPRIORITY	(*(volatile unsigned *)0x1440000c)
#define rINTPND		(*(volatile unsigned *)0x14400010)
#define rINTOFFSET	(*(volatile unsigned *)0x14400014)

/* DMA */
#define rDISRC0		(*(volatile unsigned *)0x14600000)
#define rDIDST0		(*(volatile unsigned *)0x14600004)
#define rDCON0		(*(volatile unsigned *)0x14600008)
#define rDSTAT0		(*(volatile unsigned *)0x1460000c)
#define rDCSRC0		(*(volatile unsigned *)0x14600010)
#define rDCDST0		(*(volatile unsigned *)0x14600014)
#define rDMASKTRIG0	(*(volatile unsigned *)0x14600018)
#define rDISRC1		(*(volatile unsigned *)0x14600020)
#define rDIDST1		(*(volatile unsigned *)0x14600024)
#define rDCON1		(*(volatile unsigned *)0x14600028)
#define rDSTAT1		(*(volatile unsigned *)0x1460002c)
#define rDCSRC1		(*(volatile unsigned *)0x14600030)
#define rDCDST1		(*(volatile unsigned *)0x14600034)
#define rDMASKTRIG1	(*(volatile unsigned *)0x14600038)
#define rDISRC2		(*(volatile unsigned *)0x14600040)
#define rDIDST2		(*(volatile unsigned *)0x14600044)
#define rDCON2		(*(volatile unsigned *)0x14600048)
#define rDSTAT2		(*(volatile unsigned *)0x1460004c)
#define rDCSRC2		(*(volatile unsigned *)0x14600050)
#define rDCDST2		(*(volatile unsigned *)0x14600054)
#define rDMASKTRIG2	(*(volatile unsigned *)0x14600058)
#define rDISRC3		(*(volatile unsigned *)0x14600060)
#define rDIDST3		(*(volatile unsigned *)0x14600064)
#define rDCON3		(*(volatile unsigned *)0x14600068)
#define rDSTAT3		(*(volatile unsigned *)0x1460006c)
#define rDCSRC3		(*(volatile unsigned *)0x14600070)
#define rDCDST3		(*(volatile unsigned *)0x14600074)
#define rDMASKTRIG3	(*(volatile unsigned *)0x14600078)

/* CLOCK & POWER MANAGEMENT */
#define rLOCKTIME	(*(volatile unsigned *)0x14800000)
#define rMPLLCON	(*(volatile unsigned *)0x14800004)
#define rUPLLCON	(*(volatile unsigned *)0x14800008)
#define rCLKCON		(*(volatile unsigned *)0x1480000c)
#define rCLKSLOW	(*(volatile unsigned *)0x14800010)
#define rCLKDIVN	(*(volatile unsigned *)0x14800014)

/* LCD CONTROLLER */
#define rLCDCON1	(*(volatile unsigned *)0x14a00000)
#define rLCDCON2	(*(volatile unsigned *)0x14a00004)
#define rLCDCON3	(*(volatile unsigned *)0x14a00008)
#define rLCDCON4	(*(volatile unsigned *)0x14a0000c)
#define rLCDCON5	(*(volatile unsigned *)0x14a00010)
#define rLCDSADDR1	(*(volatile unsigned *)0x14a00014)
#define rLCDSADDR2	(*(volatile unsigned *)0x14a00018)
#define rLCDSADDR3	(*(volatile unsigned *)0x14a0001c)
#define rREDLUT		(*(volatile unsigned *)0x14a00020)
#define rGREENLUT	(*(volatile unsigned *)0x14a00024)
#define rBLUELUT	(*(volatile unsigned *)0x14a00028)
#define rDP1_2		(*(volatile unsigned *)0x14a0002c)
#define rDP4_7		(*(volatile unsigned *)0x14a00030)
#define rDP3_5		(*(volatile unsigned *)0x14a00034)
#define rDP2_3		(*(volatile unsigned *)0x14a00038)
#define rDP5_7		(*(volatile unsigned *)0x14a0003c)
#define rDP3_4		(*(volatile unsigned *)0x14a00040)
#define rDP4_5		(*(volatile unsigned *)0x14a00044)
#define rDP6_7		(*(volatile unsigned *)0x14a00048)
#define rDITHMODE	(*(volatile unsigned *)0x14a0004c)
#define rTPAL		(*(volatile unsigned *)0x14a00050)
#define PALETTE		(0x14a00400)//SJS

/* UART */
#define rULCON0		(*(volatile unsigned *)0x15000000)
#define rUCON0		(*(volatile unsigned *)0x15000004)
#define rUFCON0		(*(volatile unsigned *)0x15000008)
#define rUMCON0		(*(volatile unsigned *)0x1500000c)
#define rUTRSTAT0	(*(volatile unsigned *)0x15000010)
#define rUERSTAT0	(*(volatile unsigned *)0x15000014)
#define rUFSTAT0	(*(volatile unsigned *)0x15000018)
#define rUMSTAT0	(*(volatile unsigned *)0x1500001c)
#define rUBRDIV0	(*(volatile unsigned *)0x15000028)

#define rULCON1		(*(volatile unsigned *)0x15004000)
#define rUCON1		(*(volatile unsigned *)0x15004004)
#define rUFCON1		(*(volatile unsigned *)0x15004008)
#define rUMCON1		(*(volatile unsigned *)0x1500400c)
#define rUTRSTAT1	(*(volatile unsigned *)0x15004010)
#define rUERSTAT1	(*(volatile unsigned *)0x15004014)
#define rUFSTAT1	(*(volatile unsigned *)0x15004018)
#define rUMSTAT1	(*(volatile unsigned *)0x1500401c)
#define rUBRDIV1	(*(volatile unsigned *)0x15004028)

#define rUTXH0		(*(volatile unsigned char *)0x15000020)
#define rURXH0		(*(volatile unsigned char *)0x15000024)
#define rUTXH1		(*(volatile unsigned char *)0x15004020)
#define rURXH1		(*(volatile unsigned char *)0x15004024)

#define WrUTXH0(ch)	(*(volatile unsigned char *)0x15000020)=(unsigned char)(ch)
#define RdURXH0()	(*(volatile unsigned char *)0x15000024)
#define WrUTXH1(ch)	(*(volatile unsigned char *)0x15004020)=(unsigned char)(ch)
#define RdURXH1()	(*(volatile unsigned char *)0x15004024)

#define UTXH0		(0x15000020)    //byte_access address by DMA
#define URXH0		(0x15000024)
#define UTXH1		(0x15004020)
#define URXH1		(0x15004024)

/* PWM TIMER */
#define rTCFG0		(*(volatile unsigned *)0x15100000)
#define rTCFG1		(*(volatile unsigned *)0x15100004)
#define rTCON		(*(volatile unsigned *)0x15100008)
#define rTCNTB0		(*(volatile unsigned *)0x1510000c)
#define rTCMPB0		(*(volatile unsigned *)0x15100010)
#define rTCNTO0		(*(volatile unsigned *)0x15100014)
#define rTCNTB1		(*(volatile unsigned *)0x15100018)
#define rTCMPB1		(*(volatile unsigned *)0x1510001c)
#define rTCNTO1		(*(volatile unsigned *)0x15100020)
#define rTCNTB2		(*(volatile unsigned *)0x15100024)
#define rTCMPB2		(*(volatile unsigned *)0x15100028)
#define rTCNTO2		(*(volatile unsigned *)0x1510002c)
#define rTCNTB3		(*(volatile unsigned *)0x15100030)
#define rTCMPB3		(*(volatile unsigned *)0x15100034)
#define rTCNTO3		(*(volatile unsigned *)0x15100038)
#define rTCNTB4		(*(volatile unsigned *)0x1510003c)
#define rTCNTO4		(*(volatile unsigned *)0x15100040)

/* USB DEVICE */
#define rFUNC_ADDR_REG	(*(volatile unsigned *)0x15200140)
#define rPWR_REG	(*(volatile unsigned *)0x15200144)
#define rINT_REG	(*(volatile unsigned *)0x15200148)
#define rINT_MASK_REG	(*(volatile unsigned *)0x1520014c)
#define rFRAME_NUM_REG	(*(volatile unsigned *)0x15200150)
#define rRESUME_CON_REG	(*(volatile unsigned *)0x15200154)
#define rEP0_CSR	(*(volatile unsigned *)0x15200160)
#define rEP0_MAXP	(*(volatile unsigned *)0x15200164)
#define rEP0_OUT_CNT	(*(volatile unsigned *)0x15200168)
#define rEP0_FIFO	(*(volatile unsigned *)0x1520016c)
#define rEP1_IN_CSR	(*(volatile unsigned *)0x15200180)
#define rEP1_IN_MAXP	(*(volatile unsigned *)0x15200184)
#define rEP1_FIFO	(*(volatile unsigned *)0x15200188)
#define rEP2_IN_CSR	(*(volatile unsigned *)0x15200190)
#define rEP2_IN_MAXP	(*(volatile unsigned *)0x15200194)
#define rEP2_FIFO	(*(volatile unsigned *)0x15200198)
#define rEP3_OUT_CSR	(*(volatile unsigned *)0x152001a0)
#define rEP3_OUT_MAXP	(*(volatile unsigned *)0x152001a4)
#define rEP3_OUT_CNT	(*(volatile unsigned *)0x152001a8)
#define rEP3_FIFO	(*(volatile unsigned *)0x152001ac)
#define rEP4_OUT_CSR	(*(volatile unsigned *)0x152001b0)
#define rEP4_OUT_MAXP	(*(volatile unsigned *)0x152001b4)
#define rEP4_OUT_CNT	(*(volatile unsigned *)0x152001b8)
#define rEP4_FIFO	(*(volatile unsigned *)0x152001bc)
#define rDMA_CON	(*(volatile unsigned *)0x152001c0)
#define rDMA_UNIT	(*(volatile unsigned *)0x152001c4)
#define rDMA_FIFO	(*(volatile unsigned *)0x152001c8)
#define rDMA_TX		(*(volatile unsigned *)0x152001cc)
#define rTEST_MODE	(*(volatile unsigned *)0x152001f4)
#define rIN_CON_REG	(*(volatile unsigned *)0x152001f8)

/* WATCH DOG TIMER */
#define rWTCON		(*(volatile unsigned *)0x15300000)
#define rWTDAT		(*(volatile unsigned *)0x15300004)
#define rWTCNT		(*(volatile unsigned *)0x15300008)

/* IIC */
#define rIICCON		(*(volatile unsigned *)0x15400000)
#define rIICSTAT	(*(volatile unsigned *)0x15400004)
#define rIICADD		(*(volatile unsigned *)0x15400008)
#define rIICDS		(*(volatile unsigned *)0x1540000c)

/* IIS */
#define rIISCON		(*(volatile unsigned *)0x15508000)
#define rIISMOD		(*(volatile unsigned *)0x15508004)
#define rIISPSR		(*(volatile unsigned *)0x15508008)
#define rIISFIFCON	(*(volatile unsigned *)0x1550800c)
#define IISFIF		((volatile unsigned short *)0x15508010)

/* I/O PORT */
#define rPACON		(*(volatile unsigned *)0x15600000)
#define rPADAT		(*(volatile unsigned *)0x15600004)

#define rPBCON		(*(volatile unsigned *)0x15600008)
#define rPBDAT		(*(volatile unsigned *)0x1560000c)
#define rPBUP		(*(volatile unsigned *)0x15600010)

#define rPCCON		(*(volatile unsigned *)0x15600014)
#define rPCDAT		(*(volatile unsigned *)0x15600018)
#define rPCUP		(*(volatile unsigned *)0x1560001c)

#define rPDCON		(*(volatile unsigned *)0x15600020)
#define rPDDAT		(*(volatile unsigned *)0x15600024)
#define rPDUP		(*(volatile unsigned *)0x15600028)

#define rPECON		(*(volatile unsigned *)0x1560002c)
#define rPEDAT		(*(volatile unsigned *)0x15600030)
#define rPEUP		(*(volatile unsigned *)0x15600034)

#define rPFCON		(*(volatile unsigned *)0x15600038)
#define rPFDAT		(*(volatile unsigned *)0x1560003c)
#define rPFUP		(*(volatile unsigned *)0x15600040)

#define rPGCON		(*(volatile unsigned *)0x15600044)
#define rPGDAT		(*(volatile unsigned *)0x15600048)
#define rPGUP		(*(volatile unsigned *)0x1560004c)

#define rOPENCR		(*(volatile unsigned *)0x15600050)
#define rMISCCR		(*(volatile unsigned *)0x15600054)
#define rEXTINT		(*(volatile unsigned *)0x15600058)

⌨️ 快捷键说明

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