📄 hardware_reg.h
字号:
/********************************************************************************************
*filename: hardware_reg.h
*author: wangxuexiang
*create date: 2007-7-3
*description: This file defined registers of all the module
*modify history:
*misc:
********************************************************************************************/
#ifndef _HARWARE_REG_H
#define _HARWARE_REG_H
#include "HA_typedef.h"
//#define FPGA
/***************************************************
define INTC registers
***************************************************/
#ifdef FPGA
#define INTC_BASE 0x40000000
#else
#define INTC_BASE 0x10000000
#endif
#define INTC_IEN ( INTC_BASE+0x00 )
#define INTC_IMSK ( INTC_BASE+0x08 )
#define INTC_IFCE ( INTC_BASE+0x10 )
#define INTC_IRSTAT ( INTC_BASE+0x18 )
#define INTC_ISTAT ( INTC_BASE+0x20 )
#define INTC_IMSTAT ( INTC_BASE+0x28 )
#define INTC_IFSTAT ( INTC_BASE+0x30 )
#define INTC_FEN ( INTC_BASE+0xC0 )
#define INTC_FMSK ( INTC_BASE+0xC4 )
#define INTC_FFCE ( INTC_BASE+0xC8 )
#define INTC_FRSTAT ( INTC_BASE+0xCC )
#define INTC_FSTAT ( INTC_BASE+0xD0 )
#define INTC_FFSTAT ( INTC_BASE+0xD4 )
#define INTC_PLV ( INTC_BASE+0xD8 )
#define INTC_ICR1 ( INTC_BASE+0xDC )
#define INTC_ICR2 ( INTC_BASE+0xE0 )
#define INTC_ICR3 ( INTC_BASE+0xE4 )
#define INTC_ICR4 ( INTC_BASE+0xE8 )
/*********************************************
define GPIO registers
**********************************************/
#define GPIO_BASE 0x1000F000
#define GPIO_DBCLK_DIV ( GPIO_BASE+0x00 )
#define GPIO_PORTA_DIR ( GPIO_BASE+0x04 )
#define GPIO_PORTA_SEL ( GPIO_BASE+0x08 )
#define GPIO_PORTA_DATA ( GPIO_BASE+0x0C )
#define GPIO_PORTB_DIR ( GPIO_BASE+0x10 )
#define GPIO_PORTB_SEL ( GPIO_BASE+0x14 )
#define GPIO_PORTB_DATA ( GPIO_BASE+0x18 )
#define GPIO_PORTC_DIR ( GPIO_BASE+0x1C )
#define GPIO_PORTC_SEL ( GPIO_BASE+0x20 )
#define GPIO_PORTC_DATA ( GPIO_BASE+0x24 )
#define GPIO_PORTD_DIR ( GPIO_BASE+0x28 )
#define GPIO_PORTD_SEL ( GPIO_BASE+0x2C )
#define GPIO_PORTD_DATA ( GPIO_BASE+0x30 )
#define GPIO_PORTE_DIR ( GPIO_BASE+0x34 )
#define GPIO_PORTE_SEL ( GPIO_BASE+0x38 )
#define GPIO_PORTE_INCTL ( GPIO_BASE+0x3C )
#define GPIO_PORTE_INTRCTL ( GPIO_BASE+0x40 )
#define GPIO_PORTE_INTRCLR ( GPIO_BASE+0x44 )
#define GPIO_PORTE_DATA ( GPIO_BASE+0x48 )
#define GPIO_PORTF_DIR ( GPIO_BASE+0x4C )
#define GPIO_PORTF_SEL ( GPIO_BASE+0x50 )
#define GPIO_PORTF_INCTL ( GPIO_BASE+0x54 )
#define GPIO_PORTF_INTRCTL ( GPIO_BASE+0x58 )
#define GPIO_PORTF_INTRCLR ( GPIO_BASE+0x5C )
#define GPIO_PORTF_DATA ( GPIO_BASE+0x60 )
#define GPIO_PORTG_DIR ( GPIO_BASE+0x64 )
#define GPIO_PORTG_SEL ( GPIO_BASE+0x68 )
#define GPIO_PORTG_DATA ( GPIO_BASE+0x6C )
#define GPIO_PORTH_DIR ( GPIO_BASE+0x70 )
#define GPIO_PORTH_SEL ( GPIO_BASE+0x74 )
#define GPIO_PORTH_DATA ( GPIO_BASE+0x78 )
#define GPIO_PORTI_DIR ( GPIO_BASE+0x7C )
#define GPIO_PORTI_SEL ( GPIO_BASE+0x80 )
#define GPIO_PORTI_DATA ( GPIO_BASE+0x84 )
#define GPIO_PORTJ_DIR ( GPIO_BASE+0x88 )
#define GPIO_PORTJ_SEL ( GPIO_BASE+0x8C )
#define GPIO_PORTJ_DATA ( GPIO_BASE+0x90 )
#define GPIO_PORTK_DIR ( GPIO_BASE+0x94 )
#define GPIO_PORTK_SEL ( GPIO_BASE+0x98 )
#define GPIO_PORTK_DATA ( GPIO_BASE+0x9C )
#define GPIO_PORTL_DIR ( GPIO_BASE+0x100 )
#define GPIO_PORTL_SEL ( GPIO_BASE+0x104 )
#define GPIO_PORTL_DATA ( GPIO_BASE+0x108 )
/*************************************************
define GPT registers
*************************************************/
#ifdef FPGA
#define GPT_BASE 0x40006000
#else
#define GPT_BASE 0x10003000
#endif
#define T1LCR (GPT_BASE + 0x00)
#define T1CCR (GPT_BASE + 0x04)
#define T1CR (GPT_BASE + 0x08)
#define T1ISCR (GPT_BASE + 0x0C)
#define T1IMSR (GPT_BASE + 0x10)
#define T2LCR (GPT_BASE + 0x20)
#define T2CCR (GPT_BASE + 0x24)
#define T2CR (GPT_BASE + 0x28)
#define T2ISCR (GPT_BASE + 0x2C)
#define T2IMSR (GPT_BASE + 0x30)
#define T3LCR (GPT_BASE + 0x40)
#define T3CCR (GPT_BASE + 0x44)
#define T3CR (GPT_BASE + 0x48)
#define T3ISCR (GPT_BASE + 0x4C)
#define T3IMSR (GPT_BASE + 0x50)
#define T3CAPR (GPT_BASE + 0x54)
#define T4LCR (GPT_BASE + 0x60)
#define T4CCR (GPT_BASE + 0x64)
#define T4CR (GPT_BASE + 0x68)
#define T4ISCR (GPT_BASE + 0x6C)
#define T4IMSR (GPT_BASE + 0x70)
#define T4CAPR (GPT_BASE + 0x74)
#define T5LCR (GPT_BASE + 0x80)
#define T5CCR (GPT_BASE + 0x84)
#define T5CR (GPT_BASE + 0x88)
#define T5ISCR (GPT_BASE + 0x8C)
#define T5IMSR (GPT_BASE + 0x90)
#define T5CAPR (GPT_BASE + 0x94)
#define T6LCR (GPT_BASE + 0xA0)
#define T6CCR (GPT_BASE + 0xA4)
#define T6CR (GPT_BASE + 0xA8)
#define T6ISCR (GPT_BASE + 0xAC)
#define T6IMSR (GPT_BASE + 0xB0)
#define T6CAPR (GPT_BASE + 0xB4)
#define T7LCR (GPT_BASE + 0xC0)
#define T7CCR (GPT_BASE + 0xC4)
#define T7CR (GPT_BASE + 0xC8)
#define T7ISCR (GPT_BASE + 0xCC)
#define T7IMSR (GPT_BASE + 0xD0)
#define T8LCR (GPT_BASE + 0xE0)
#define T8CCR (GPT_BASE + 0xE4)
#define T8CR (GPT_BASE + 0xE8)
#define T8ISCR (GPT_BASE + 0xEC)
#define T8IMSR (GPT_BASE + 0xF0)
#define T9LCR (GPT_BASE + 0x100)
#define T9CCR (GPT_BASE + 0x104)
#define T9CR (GPT_BASE + 0x108)
#define T9ISCR (GPT_BASE + 0x10C)
#define T9IMSR (GPT_BASE + 0x110)
#define T10LCR (GPT_BASE + 0x120)
#define T10CCR (GPT_BASE + 0x124)
#define T10CR (GPT_BASE + 0x128)
#define T10ISCR (GPT_BASE + 0x12C)
#define T10IMSR (GPT_BASE + 0x130)
#define TIMSR (GPT_BASE + 0x140)
#define TISCR (GPT_BASE + 0x144)
#define TISR (GPT_BASE + 0x148)
#define WDCTR (GPT_BASE + 0x14c)
#define WDINTEN (GPT_BASE + 0x150)
#define WDINTSTS (GPT_BASE + 0x154)
#define WDCNT (GPT_BASE + 0x158)
#define WDSEV (GPT_BASE + 0x15c)
/*********************************************
define UART registers
*********************************************/
#ifdef FPGA
#define UART0_BASE 0X00203000
#else
#define UART0_BASE 0X10004000
#endif
#define UART0_DLBL (UART0_BASE+0X00)
#define UART0_R0FIFO (UART0_BASE+0X00)
#define UART0_T0FIFO (UART0_BASE+0X00)
#define UART0_DLBH (UART0_BASE+0X04)
#define UART0_IER (UART0_BASE+0X04)
#define UART0_IIR (UART0_BASE+0X08)
#define UART0_FCR (UART0_BASE+0X08)
#define UART0_LCR (UART0_BASE+0X0c)
#define UART0_MCR (UART0_BASE+0X10)
#define UART0_LSR (UART0_BASE+0X14)
#define UART0_MSR (UART0_BASE+0X18)
#ifdef FPGA
#define UART1_BASE 0X00204000
#else
#define UART1_BASE 0X10005000
#endif
#define UART1_DLBL (UART1_BASE+0X00)
#define UART1_R1FIFO (UART1_BASE+0X00)
#define UART1_T1FIFO (UART1_BASE+0X00)
#define UART1_DLBH (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 0X00205000
#else
#define UART2_BASE 0X10007000
#endif
#define UART2_DLBL (UART2_BASE+0X00)
#define UART2_R2FIFO (UART2_BASE+0X00)
#define UART2_T2FIFO (UART2_BASE+0X00)
#define UART2_DLBH (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)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -