智能车制作

标题: 求大神解答野火库里面这些事什么意思????? [打印本页]

作者: asdf123    时间: 2013-7-19 21:42
标题: 求大神解答野火库里面这些事什么意思?????
/** PORT - Peripheral register structure */
typedef struct PORT_MemMap
{
    uint32_t PCR[32];                                /**< Pin Control Register n, array offset: 0x0, array step: 0x4 */
    uint32_t GPCLR;                                  /**< Global Pin Control Low Register, offset: 0x80 */
    uint32_t GPCHR;                                  /**< Global Pin Control High Register, offset: 0x84 */
    uint8_t RESERVED_0[24];
    uint32_t ISFR;                                   /**< Interrupt Status Flag Register, offset: 0xA0 */
    uint8_t RESERVED_1[28];
    uint32_t DFER;                                   /**< Digital Filter Enable Register, offset: 0xC0 */
    uint32_t DFCR;                                   /**< Digital Filter Clock Register, offset: 0xC4 */
    uint32_t DFWR;                                   /**< Digital Filter Width Register, offset: 0xC8 */
} volatile *PORT_MemMapPtr;
/* ----------------------------------------------------------------------------
   -- PORT - Register accessor macros
   ---------------------------------------------------------------------------- */
/**
* @addtogroup PORT_Register_Accessor_Macros PORT - Register accessor macros
* @{
*/

/* PORT - Register accessors */
#define PORT_PCR_REG(base,index)                 ((base)->CR[index])//zhi zhen
#define PORT_GPCLR_REG(base)                     ((base)->GPCLR)
#define PORT_GPCHR_REG(base)                     ((base)->GPCHR)
#define PORT_ISFR_REG(base)                      ((base)->ISFR)
#define PORT_DFER_REG(base)                      ((base)->DFER)
#define PORT_DFCR_REG(base)                      ((base)->DFCR)
#define PORT_DFWR_REG(base)                      ((base)->DFWR)
/**
* @}
*/ /* end of group PORT_Register_Accessor_Macros */

/* ----------------------------------------------------------------------------
   -- PORT Register Masks
   ---------------------------------------------------------------------------- */
/**
* @addtogroup PORT_Register_Masks PORT Register Masks
* @{
*/
/* PCR Bit Fields */
#define PORT_PCR_PS_MASK                         0x1u
#define PORT_PCR_PS_SHIFT                        0
#define PORT_PCR_PE_MASK                         0x2u
#define PORT_PCR_PE_SHIFT                        1
#define PORT_PCR_SRE_MASK                        0x4u
#define PORT_PCR_SRE_SHIFT                       2
#define PORT_PCR_PFE_MASK                        0x10u
#define PORT_PCR_PFE_SHIFT                       4
#define PORT_PCR_ODE_MASK                        0x20u
#define PORT_PCR_ODE_SHIFT                       5
#define PORT_PCR_DSE_MASK                        0x40u
#define PORT_PCR_DSE_SHIFT                       6
#define PORT_PCR_MUX_MASK                        0x700u
#define PORT_PCR_MUX_SHIFT                       8
#define PORT_PCR_MUX(x)                          (((uint32_t)(((uint32_t)(x))<<;PORT_PCR_MUX_SHIFT))&PORT_PCR_MUX_MASK)
#define PORT_PCR_LK_MASK                         0x8000u
#define PORT_PCR_LK_SHIFT                        15
#define PORT_PCR_IRQC_MASK                       0xF0000u
#define PORT_PCR_IRQC_SHIFT                      16
#define PORT_PCR_IRQC(x)                         (((uint32_t)(((uint32_t)(x))<<;PORT_PCR_IRQC_SHIFT))&PORT_PCR_IRQC_MASK)
#define PORT_PCR_ISF_MASK                        0x1000000u
#define PORT_PCR_ISF_SHIFT                       24

作者: beandy    时间: 2013-7-19 22:46
这是对寄存器的一些宏定义
作者: asdf123    时间: 2013-7-19 23:38
想问下那个结构体能给我解释下吗?、??????
作者: BlackFire531    时间: 2013-7-23 13:40
你看飞思卡尔的头文件,有很多这样的定义。




欢迎光临 智能车制作 (http://dns.znczz.com/) Powered by Discuz! X3.2