📄 hardware_reg.h
字号:
/**************************************************************************************
*
* (c) 2004 ASIC,all rights reserved
*
*
* This source code and any compilation or derivative thereof
*is proprietary information and is confidential in nature.
* Under no circumstance is this software to be exposed or placed
*under an open source License of any type without expressed
*written permission of ASIC.
*
*filename: hardware_reg.h
*history:
*
* Version Date Author Comments
*------------------------------------------------------------------------------------
* 1.0 2004.9.24 lmq Initial Creation
*
**************************************************************************************/
#ifndef __HARWARE_REG_H__
#define __HARWARE_REG_H__
#include "HA_typedef.h"
/***************************************************
define INTC registers
***************************************************/
#define BASE_INTCR 0x10000000
#define INTC_IEN ( BASE_INTCR+0X0 )
#define INTC_IMSK ( BASE_INTCR+0X8 )
#define INTC_IFCE ( BASE_INTCR+0X10 )
#define INTC_IRSTAT ( BASE_INTCR+0X18 )
#define INTC_ISTAT ( BASE_INTCR+0X20 )
#define INTC_IMSTAT ( BASE_INTCR+0X28 )
#define INTC_IFSTAT ( BASE_INTCR+0X30 )
#define INTC_FEN ( BASE_INTCR+0XC0 )
#define INTC_FMSK ( BASE_INTCR+0XC4 )
#define INTC_FFCE ( BASE_INTCR+0XC8 )
#define INTC_FRSTAT ( BASE_INTCR+0XCC )
#define INTC_FSTAT ( BASE_INTCR+0XD0 )
#define INTC_FFSTAT ( BASE_INTCR+0XD4 )
#define INTC_IPLV ( BASE_INTCR+0XD8 )
/*************************************************
define GPT registers
*************************************************/
#ifdef FPGA
#define GPT_BASE 0x10003000
#else
#define GPT_BASE 0x00201000
#endif
#define GPT1_CNTL (GPT_BASE + 0x00)
#define GPT1_SCAL (GPT_BASE + 0x04)
#define GPT1_COMP (GPT_BASE + 0x08)
#define GPT1_CAPT (GPT_BASE + 0x0c)
#define GPT1_CNT (GPT_BASE + 0x10)
#define GPT1_STAT (GPT_BASE + 0x14)
#define GPT2_CNTL (GPT_BASE + 0x18)
#define GPT2_SCAL (GPT_BASE + 0x1c)
#define GPT2_COMP (GPT_BASE + 0x20)
#define GPT2_CAPT (GPT_BASE + 0x24)
#define GPT2_CNT (GPT_BASE + 0x28)
#define GPT2_STAT (GPT_BASE + 0x2c)
/************************************************
define PWM registers
************************************************/
#define PWM1_CNTL (GPT_BASE + 0X30)
#define PWM1_P (GPT_BASE + 0X34)
#define PWM1_S (GPT_BASE + 0X38)
#define PWM1_C (GPT_BASE + 0X3C)
#define PWM1_CNT (GPT_BASE + 0X40)
#define PWM1_STAT (GPT_BASE + 0X44)
#define PWM2_CNTL (GPT_BASE + 0X48)
#define PWM2_S (GPT_BASE + 0X4C)
#define PWM2_P (GPT_BASE + 0X50)
#define PWM2_C (GPT_BASE + 0X54)
#define PWM2_CNT (GPT_BASE + 0X58)
#define PWM2_STAT (GPT_BASE + 0X5C)
/*************************************************
defien RTC registers
*************************************************/
#ifdef FPGA
#define RTC_BASE 0x10002000
#else
#define RTC_BASE 0x00202000
#endif
#define RTC_YMD (RTC_BASE + 0X00) //year ,month ,day regment
#define RTC_HMS (RTC_BASE + 0X04) //hour ,minute ,second regment
#define RTC_ALRM (RTC_BASE + 0X08) //alarm time regment
#define RTC_CTRL (RTC_BASE + 0X0c) //rtc control regment
#define RTC_IEN (RTC_BASE + 0X10) //interrupt enable regment
#define RTC_ISTAT (RTC_BASE + 0X14) //interrupt status regment
#define RTC_SAMP (RTC_BASE + 0X18) //sample regment
#define RTC_WCNT (RTC_BASE + 0X1c) //watchdog count regment
#define RTC_WSVCE (RTC_BASE + 0X20) //Watchdog service regment
/*********************************************
define UART registers
*********************************************/
#ifdef FPGA
#define UART1_BASE 0X10004000
#else
#define UART1_BASE 0X00203000
#endif
#define UART1_THR (UART1_BASE+0X00)
#define UART1_RBR (UART1_BASE+0X00)
#define UART1_DLL (UART1_BASE+0X00)
#define UART1_DLH (UART1_BASE+0X04)
#define UART1_IER (UART1_BASE+0X04)
#define UART1_IIR (UART1_BASE+0X08)
#define UART1_FCR (UART1_BASE+0X08)
#define UART1_LCR (UART1_BASE+0X0c)
#define UART1_MCR (UART1_BASE+0X10)
#define UART1_LSR (UART1_BASE+0X14)
#define UART1_MSR (UART1_BASE+0X18)
#ifdef FPGA
#define UART2_BASE 0X10005000
#else
#define UART2_BASE 0X00204000
#endif
#define UART2_THR (UART2_BASE+0X00)
#define UART2_RBR (UART2_BASE+0X00)
#define UART2_DLL (UART2_BASE+0X00)
#define UART2_DLH (UART2_BASE+0X04)
#define UART2_IER (UART2_BASE+0X04)
#define UART2_IIR (UART2_BASE+0X08)
#define UART2_FCR (UART2_BASE+0X08)
#define UART2_LCR (UART2_BASE+0X0c)
#define UART2_MCR (UART2_BASE+0X10)
#define UART2_LSR (UART2_BASE+0X14)
#define UART2_MSR (UART2_BASE+0X18)
/*************************************
define LCDC registers
*************************************/
#define BASE_LCDC 0x11002000 //;BASE ADDRESS OF LCDC
#define VS_BASE 0x81000000 //;WHICH IS ASSUMED BECAUSE OF UN-ALLOCARTION
#define SSA (BASE_LCDC+0x00) //;Screen Start Address Register
#define SIZE (BASE_LCDC+0x04) //;Size Register
#define PCR (BASE_LCDC+0x08) //;Panel Configuration Register
#define HCR (BASE_LCDC+0x0c) //;Horizontal Configuration Register
#define VCR (BASE_LCDC+0x10) //;Vertical Configuration Register
#define PWMR (BASE_LCDC+0x14) //;PWM Contrast Control Register
#define LECR (BASE_LCDC+0x18) //;LCD Gray Palette Mapping Register
#define DMACR (BASE_LCDC+0x1c) //;DMA Control Register
#define LCDICR (BASE_LCDC+0x20) //;Interrupt Configuration Register
#define LCDISR (BASE_LCDC+0x24) //;Interrupt Status Register
#define LGPMR (BASE_LCDC+0x40) //;The begin of address of grey_reg
/**************************************
define SPI registers
****************************************/
#ifdef SIM
#define BASE_SPI_1 0X00205000
#define PORTF_DIR 0X0020b040
#define PORTF_DATA 0x0020b008
#define PORTF_SEL 0x0020b050
#define DMABASE 0x00221000
#endif
#ifdef FPGA
#define BASE_SPI_1 0X10006000
#define PORTF_DIR 0X1020b040
#define PORTF_DATA 0x1000b008
#define PORTF_SEL 0x1020b050
#endif
#define SPICR (BASE_SPI_1 + 0X00)
#define SPIBR (BASE_SPI_1 + 0X04)
#define SPISR (BASE_SPI_1 + 0X08)
#define SPITR (BASE_SPI_1 + 0X0C)
#define SPIRR (BASE_SPI_1 + 0x10)
#define x_location 0x94
#define y_location 0xD4
#define trigger 0x80
#define ctrlw 0x77
#define bt256 0x0007
#define spif 0x01
//
//dma
//
#define SA (DMABASE + 0X00)
#define DA (DMABASE + 0X04)
#define CTRL (DMABASE + 0X08)
#define DMAENABLE (DMABASE + 0X0C)
#define DMASTATUS (DMABASE + 0X10)
#define DACLW 0XA1040006
#define DACLR 0X91040006
/************************************** xiaoj 03.11.20
define DMA registers
****************************************/
#define DMACbase 0x11000000
#define DMACIntStatus (DMACbase+0x1020) //Read
#define DMACIntTCStatus (DMACbase+0x1050) //Read
#define DMACIntTCClear (DMACbase+0x1060) //Write
#define DMACRawIntTCStatus (DMACbase+0x1070) //Read
#define DMACIntErrorStatus (DMACbase+0x1080) //Read
#define DMACIntErrClr (DMACbase+0x1090) //Write
#define DMACRawIntErrorStatus (DMACbase+0x10a0) //Read
#define DMACEnbldChns (DMACbase+0x10B0) //Read; Indicate which channel can be used;
#define ADDRESS_CONFIGURATION (DMACbase+0x10C0)
#define DMACC0SrcAddr (DMACbase+0x1000) //DMA channel 0 registers;
#define DMACC0DestAddr (DMACbase+0x1004)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -