OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 9239|回复: 1

GPIO_EventOutputConfig 和 GPIO_EventOutputCmd

[复制链接]

37

主题

70

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
258
金钱
258
注册时间
2012-9-17
在线时间
4 小时
发表于 2013-3-13 16:08:14 | 显示全部楼层 |阅读模式
这两个如何使用啊,在什么情况下使用啊,能举个例子吗?在中文固件库中只是简单的说了一下使用形式,GPIO_EventOutputConfig(GPIO_PortSourceGPIOE, GPIO_PinSource5);这是固件库给的例子,求高手指点!
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

36

主题

1105

帖子

5

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
2201
金钱
2201
注册时间
2012-2-8
在线时间
35 小时
发表于 2013-3-13 16:43:37 | 显示全部楼层
直接去看源码干了些什么吧

void GPIO_EventOutputConfig(uint8_t GPIO_PortSource, uint8_t GPIO_PinSource)
{
  uint32_t tmpreg = 0x00;
  /* Check the parameters */
  assert_param(IS_GPIO_EVENTOUT_PORT_SOURCE(GPIO_PortSource));
  assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource));
    
  tmpreg = AFIO->EVCR;
  /* Clear the ORT[6:4] and IN[3:0] bits */
  tmpreg &= EVCR_PORTPINCONFIG_MASK;
  tmpreg |= (uint32_t)GPIO_PortSource << 0x04;
  tmpreg |= GPIO_PinSource;
  AFIO->EVCR = tmpreg;
}

再查参考手册

Event control register (AFIO_EVCR)

Bits 31:8 Reserved
Bit 7 EVOE:Event output enable
Set and cleared by software. When set the EVENTOUT Cortex output is connected to the 
I/O selected by the ORT[2:0] and IN[3:0] bits.
Bits 6:4PORT[2:0]: ort selection
Set and cleared by software. Select the port used to output the Cortex EVENTOUT signal.
Note: The EVENTOUT signal output capability is not extended to ports F and G.
000: A selected
001: B selected
010: C selected
011: PD selected
100: PE selected
Bits 3:0PIN[3:0]in selection (x = A .. E)
Set and cleared by software. Select the pin used to output the Cortex EVENTOUT signal.
0000: Px0 selected
0001: Px1 selected
0010: Px2 selected
0011: Px3 selected
...
1111: Px15 selected
https://github.com/roxma
回复 支持 反对

使用道具 举报

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

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-7-23 20:11

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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