标题: 关于驱动中调用内核函数实现gpio寄存器的设置 [打印本页]

作者: lianyiqun    时间: 2015-7-8 22:06
标题: 关于驱动中调用内核函数实现gpio寄存器的设置
系列函数
系列函数的定义在arch/arm/mach-s3c2410/gpio.c,相关的宏定义在include/asm-arm/arch-s3c2410/regs-gpio.h
(1)void s3c2410_gpio_setpin(unsigned int pin, unsigned intto);
设置相应GPIO口的输出值,例如:
pin=S3C2410_GPG2,to=0,则设置S3C2410_GPG2的输出值为0;
pin=S3C2410_GPG2,to=1,则设置S3C2410_GPG2的输出值为1。
函数定义:
viewplain



(2)unsigned int s3c2410_gpio_getpin(unsigned intpin);
获取相应GPIO口的值。
函数定义:
viewplain



(3)void s3c2410_gpio_cfgpin(unsigned int pin, unsigned intfunction);
设置相应GPIO口的工作模式,输入、输出、中断等。
函数定义:
viewplain



(4)unsigned int s3c2410_gpio_getcfg(unsigned intpin);
获取相应GPIO口的工作模式,输入、输出、中断等。
函数定义:
viewplain



(5)voids3c2410_gpio_pullup(unsigned int pin, unsigned intto);
设置相应的GPIO口的电平,例如:
pin=S3C2410_GPG2,to=0,则拉低S3C2410_GPG2,也就是设置S3C2410_GPG2的值为0;
pin=S3C2410_GPG2,to=1,则拉高S3C2410_GPG2,也就是设置S3C2410_GPG2的值为1。
函数定义:
viewplain



(6)unsigned int s3c2410_modify_misccr(unsigned int clear,unsigned int change);
杂项设置,设置寄存器MISCCR,具体看函数定义。
函数定义:
viewplain



(7)int s3c2410_gpio_getirq(unsigned intpin);
获取相应的GPIO口所对应的中断号。
函数定义:
viewplain



(8)int s3c2410_gpio_irqfilter(unsigned int pin, unsignedint on, unsigned int config);
中断过滤配置,具体看函数定义。
函数定义:
viewplain








欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1