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

📄 pxa270.h

📁 博创PXA270-S开发箱的VxWorks BSP驱动(含注释)
💻 H
📖 第 1 页 / 共 2 页
字号:
/* pxa270.h - pxa270 board header *//* Copyright 2002 Wind River Systems, Inc. *//*TODO -  Remove the pxa270 modification history and begin a new history        starting with version 01a and growing the history upward with        each revision.modification history--------------------01a,21may02,scm  written*//*   TODO - Fill in this file with I/O addresses and related constants for the          pxa270 BSP. Anything with "pxa270" as a prefix needs to examined           and re-named to id the BSP (i.e. iq80321, iq80310, etc.), and this           file should be re-named from "pxa270.h" to iq80321.h, iq80310.h, etc.*//*DESCRIPTIONThis file contains I/O address and related constants for thepxa270 BSP.*/#ifndef INCpxa270h#define INCpxa270h#ifdef __cplusplusextern "C" {#endif/*------------------------------------------------------------- *  pxa270 Macro Defintions... * ------------------------------------------------------------*/#define BIT(bitNumber)                    (1 << (bitNumber))#define pxa270_REG_READ8 (reg,result)\               ((result) = *(volatile UINT8 *)(reg))#define pxa270_REG_WRITE8 (reg,data)\               (*((volatile UINT8 *)(reg)) = (data))#define pxa270_REG_READ16 (reg,result)\               ((result) = *(volatile UINT16 *)(reg))#define pxa270_REG_WRITE16 (reg,data)\               (*((volatile UINT16 *)(reg)) = (data))#define pxa270_REG_READ32 (reg,result)\               ((result) = *(volatile UINT32 *)(reg))#define pxa270_REG_WRITE32 (reg,data)\               (*((volatile UINT32 *)(reg)) = (data))#define SWAP16(x)                         ((((x) << 8) | ((x) >> 8)) & 0xFFFF)#define SWAP32(x)                         (((x) << 24) |              \                                          (((x) & 0x0000FF00) << 8) | \                                          (((x) & 0x00FF0000) >> 8) | \                                          (((unsigned int)(x)) >> 24))#if (_BYTE_ORDER == _BIG_ENDIAN)#define SWAP32PCIFUNC(x)                  (swap32(x))#define SWAP16PCIFUNC(x)                  (swap16(x))#define SWAP16PCI(x)                      (SWAP16(x))#define SWAP32PCI(x)                      (SWAP32(x))#else#define SWAP32PCIFUNC(x)                  (x)#define SWAP16PCIFUNC(x)                  (x)#define SWAP16PCI(x)                      (x)#define SWAP32PCI(x)                      (x)#endif#define PCI_IN_BYTE(x)                    *(volatile UINT8 *) (x)#define PCI_IN_WORD(x)                    *(volatile UINT16 *) (x)#define PCI_IN_LONG(x)                    *(volatile UINT32 *) (x)#define PCI_OUT_BYTE(x,y)                 *(volatile UINT8 *) (x) = (UINT8) (y)#define PCI_OUT_WORD(x,y)                 *(volatile UINT16 *) (x) = (UINT16) (y)#define PCI_OUT_LONG(x,y)                 *(volatile UINT32 *) (x) = (UINT32) (y)#define PCI_SET_OUT_BYTE(x,y)             PCI_OUT_BYTE((int)x, (PCI_IN_BYTE(x) | y))#define PCI_SET_OUT_WORD(x,y)             PCI_OUT_WORD((int)x, (PCI_IN_WORD(x) | y))#define PCI_SET_OUT_LONG(x,y)             PCI_OUT_LONG((int)x, (PCI_IN_LONG(x) | y))#define PCI_CLEAR_OUT_BYTE(x,y)           PCI_OUT_BYTE((int)x, (PCI_IN_BYTE(x) & ~y))#define PCI_CLEAR_OUT_WORD(x,y)           PCI_OUT_WORD((int)x, (PCI_IN_WORD(x) & ~y))#define PCI_CLEAR_OUT_LONG(x,y)           PCI_OUT_LONG((int)x, (PCI_IN_LONG(x) & ~y))/*------------------------------------------------------------- * pxa270 Generic Constants... * ------------------------------------------------------------*/#define    SZ_0                           0x00000000#define    SZ_1                           0x00000001#define    SZ_2                           0x00000002#define    SZ_4                           0x00000004#define    SZ_8                           0x00000008#define    SZ_16                          0x00000010#define    SZ_32                          0x00000020#define    SZ_48                          0x00000030#define    SZ_64                          0x00000040#define    SZ_128                         0x00000080#define    SZ_256                         0x00000100#define    SZ_512                         0x00000200#define    SZ_1K                          0x00000400#define    SZ_2K                          0x00000800#define    SZ_4K                          0x00001000#define    SZ_8K                          0x00002000#define    SZ_16K                         0x00004000#define    SZ_32K                         0x00008000#define    SZ_64K                         0x00010000#define    SZ_128K                        0x00020000#define    SZ_256K                        0x00040000#define    SZ_512K                        0x00080000#define    SZ_1M                          0x00100000#define    SZ_2M                          0x00200000#define    SZ_3M                          0x00300000#define    SZ_4M                          0x00400000#define    SZ_8M                          0x00800000#define    SZ_16M                         0x01000000#define    SZ_32M                         0x02000000#define    SZ_48M                         0x03000000#define    SZ_64M                         0x04000000#define    SZ_128M                        0x08000000#define    SZ_256M                        0x10000000#define    SZ_512M                        0x20000000#define    SZ_1G                          0x40000000#define    SZ_2G                          0x80000000/*TODO:  Fill in this file with I/O addresses and related constants for the  pxa270 BSP. Anything with "pxa270" as a prefix needs to examined   and re-named to id the BSP (i.e. iq80321, iq80310, etc.) *//*============================================================= * Processor Specific Register Constants... * ============================================================*/#define  pxa270_OSMR0     0x40a00000#define  pxa270_OSCR0     0x40a00010#define  pxa270_OIER      0x40a0001c#define  pxa270_OSSR      0x40a00014/*------------------------------------------------------------- * pxa270 Peripheral Registers... * ------------------------------------------------------------*//*------------------------------------------------------------- * pxa270 ATU Address Translation... * ------------------------------------------------------------*//*------------------------------------------------------------- * pxa270 Memory Controller Unit... * ------------------------------------------------------------*//* Refresh frequqnecy - depending on Memory Controller may not be needed *//* refresh set for 200 Mhz */#define pxa270_MCU_RFR_DEFAULT_VAL      0xFFF/*------------------------------------------------------------- * pxa270 Peripheral Bus Interface... * ------------------------------------------------------------*//*------------------------------------------------------------- * pxa270 I2C Bus Interface... * ------------------------------------------------------------*//*------------------------------------------------------------- * pxa270 Processor Arbitration Unit... * ------------------------------------------------------------*//*------------------------------------------------------------- * pxa270 Timers... * ------------------------------------------------------------*//* Timer Mode Registers Internal Bus Address */#define pxa270_TMR0_REG                 0xdeadbeef#define pxa270_TMR1_REG                 0xdeadbeef/* Timer Input Clock Selects -depending on Timers may not be supported */#define pxa270_TMR_CSEL_CORE            0x00#define pxa270_TMR_CSEL_CORE4           0x00#define pxa270_TMR_CSEL_CORE8           0x00#define pxa270_TMR_CSEL_CORE16          0x00/* Needed by BSP *//* Minimum rate at which the system clock can run */#define SYS_CLK_RATE_MIN                  0x0/* 1000 ticks, Maximum rate at which the system clock can run */#define SYS_CLK_RATE_MAX                  0xFFFFFFFF#ifdef INCLUDE_AUX_CLK/* Minimum rate at which the auxiliary clock can run */#define AUX_CLK_RATE_MIN                  0x0/* 1000 ticks, Maximum rate at which the auxiliary clock can run */#define AUX_CLK_RATE_MAX                  0xFFF#endif/* TODO - for inclusion, define in config.h */#define PXA270_ICIP   0x40d00000#define PXA270_ICIP2  0x40d000ac#define PXA270_ICFP   0x40d0000c#define PXA270_ICFP2  0x40d000a8#define PXA270_ICMR   0x40d00004#define PXA270_ICMR2  0x40d000a0#define PXA270_ICLR   0x40d00008#define PXA270_ICLR2   0x40d000a4#define PXA270_ICPR   0x40d00010#define PXA270_ICPR2  0x40d000ac#define PXA270_ICCR   0x40d00014#define PXA270_IPR0   0x40d0001c#define PXA270_IPR1   0x40d000b0#define PXA270_ICHP   0x40d00018/* show we're alive... */#ifdef INCLUDE_HEX_LED #define pxa270INT_HEART_BEAT#endif#ifdef pxa270INT_HEART_BEAT /* Watch Interrupts */LOCAL UINT32 IntMsb = L7SEG_Dot;LOCAL UINT32 IntLsb = L7SEG_ALL_OFF;LOCAL UINT32 IntCount = 0;#endif/* * This module implements the pxa270 interrupt controller driver.*/#define PXA_IRQ_SKIP	0#define PXA_IRQ(x)	((x) - PXA_IRQ_SKIP)

⌨️ 快捷键说明

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