主题 : 如何在源码中设置4412外部中断引脚 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 103361
精华: 0
发帖: 13
金钱: 65 两
威望: 13 点
综合积分: 26 分
注册时间: 2014-04-24
最后登录: 2014-06-25
楼主  发表于: 2014-04-29 14:12

 如何在源码中设置4412外部中断引脚

大家好,有一个问题咨询一下:
tiny4412 ADK板中,中断脚和GPIo脚是复用的,在哪里设置按键的所接的脚为外部中断脚功能呢?
自由,自强,共享,共创。
级别: 论坛版主
UID: 12573
精华: 27
发帖: 8838
金钱: 46490 两
威望: 9298 点
综合积分: 18216 分
注册时间: 2010-01-09
最后登录: 2019-07-16
1楼  发表于: 2014-04-29 14:21
可以参考按键驱动,搜索相关寄存器即可
新手如何向我们反馈有效的信息,以便解决问题,见此贴:
http://www.arm9home.net/read.php?tid-14431.html

[注]: 此处签名链接仅为指引方向,而非解答问题本身.
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2014-04-29 15:18
参考arch/arm/mach-exynos/mach-tiny4412.c里调用s3c_gpio_cfgpin()的地方。这是arch/arm/plat-samsung/include/plat/gpio-cfg.h里关于s3c_gpio_cfgpin()的说明:

/**
* s3c_gpio_cfgpin() - Change the GPIO function of a pin.
* @pin pin The pin number to configure.
* @to to The configuration for the pin's function.
*
* Configure which function is actually connected to the external
* pin, such as an gpio input, output or some form of special function
* connected to an internal peripheral block.
*
* The @to parameter can be one of the generic S3C_GPIO_INPUT, S3C_GPIO_OUTPUT
* or S3C_GPIO_SFN() to indicate one of the possible values that the helper
* will then generate the correct bit mask and shift for the configuration.
*
* If a bank of GPIOs all needs to be set to special-function 2, then
* the following code will work:
*
*      for (gpio = start; gpio < end; gpio++)
*              s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
*
* The @to parameter can also be a specific value already shifted to the
* correct position in the control register, although these are discouraged
* in newer kernels and are only being kept for compatibility.
*/
extern int s3c_gpio_cfgpin(unsigned int pin, unsigned int to);
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 103361
精华: 0
发帖: 13
金钱: 65 两
威望: 13 点
综合积分: 26 分
注册时间: 2014-04-24
最后登录: 2014-06-25
3楼  发表于: 2014-04-29 17:09
我在GPX0_7上焊接了一个电阻,并在按键源码中修改了:
static struct button_desc buttons[] = {
    { EXYNOS4_GPX3(2), 0, "KEY0" },
    { EXYNOS4_GPX3(3), 1, "KEY1" },
    { EXYNOS4_GPX3(4), 2, "KEY2" },
    //{ EXYNOS4_GPX0(7), 3, "KEY3" },
    { EXYNOS4_GPX0(7), 0, "KEY3" },
};

发现是可以相应中断的。但是我并没有发现关于GPX0(7)复用管脚的设置。 请问中断怎么做到的。
级别: 新手上路
UID: 103361
精华: 0
发帖: 13
金钱: 65 两
威望: 13 点
综合积分: 26 分
注册时间: 2014-04-24
最后登录: 2014-06-25
4楼  发表于: 2014-04-29 17:10
焊的上拉电阻和按键。
级别: 新手上路
UID: 102529
精华: 0
发帖: 13
金钱: 65 两
威望: 13 点
综合积分: 26 分
注册时间: 2014-04-03
最后登录: 2014-06-09
5楼  发表于: 2014-05-19 15:45
你好 我也是4412用户 方便加个qq 交流一下gpio问题吗?