智能车制作

 找回密码
 注册

扫一扫,访问微社区

查看: 4633|回复: 3
打印 上一主题 下一主题

求大神解答野火库里面这些事什么意思?????

[复制链接]

2

主题

123

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1295
威望
658
贡献
353
兑换币
440
注册时间
2013-3-22
在线时间
142 小时
跳转到指定楼层
1#
发表于 2013-7-19 21:42:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
/** 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

16

主题

339

帖子

0

精华

跨届大侠

Rank: 10Rank: 10Rank: 10

积分
7310

论坛元老奖章资源大师奖章优秀会员奖章活跃会员奖章

QQ
威望
1537
贡献
5097
兑换币
330
注册时间
2010-11-4
在线时间
338 小时
2#
发表于 2013-7-19 22:46:55 | 只看该作者
这是对寄存器的一些宏定义
回复 支持 反对

使用道具 举报

2

主题

123

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1295
威望
658
贡献
353
兑换币
440
注册时间
2013-3-22
在线时间
142 小时
3#
 楼主| 发表于 2013-7-19 23:38:50 | 只看该作者
想问下那个结构体能给我解释下吗?、??????
回复 支持 反对

使用道具 举报

1

主题

23

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
417
威望
247
贡献
134
兑换币
90
注册时间
2012-8-22
在线时间
18 小时
毕业学校
4#
发表于 2013-7-23 13:40:04 | 只看该作者
你看飞思卡尔的头文件,有很多这样的定义。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关于我们|联系我们|小黑屋|亿加合和智能车制作 ( 黑ICP备2022002344号

GMT+8, 2024-5-7 01:14 , Processed in 0.087775 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表