嵌入式linux之IIC驱动

来源:互联网 发布:2017淘宝村发布会 编辑:程序博客网 时间:2024/05/20 08:22

IIC介绍:

SDA信号线和SCL时钟线

http://blog.sina.com.cn/s/blog_9815359e01012c6k.html

http://www.cnblogs.com/jason-lu/archive/2012/11/24/2786406.html

http://blog.sina.com.cn/s/blog_7cae47280101mne2.html

实例解析IIC驱动程序的两种实现方式

http://blog.chinaunix.net/uid-27041925-id-3630192.html

log.chinaunix.net/uid-27041925-id-3630234.html

http://blog.chinaunix.net/uid-27041925-id-3629918.html

下面两个函数就完成了I2C总线层驱动模块的注册和注销。static int __init i2c_adap_s3c_init(void){ //注册平台设备return platform_driver_register(&s3c24xx_i2c_driver);}static void __exit i2c_adap_s3c_exit(void){ //注销平台设备platform_driver_unregister(&s3c24xx_i2c_driver);}那我们来看看这个平台设备吧。static struct platform_driver s3c24xx_i2c_driver = {.probe            = s3c24xx_i2c_probe,  //探测函数.remove          = s3c24xx_i2c_remove,.id_table  = s3c24xx_driver_ids,.driver            = {        .owner    = THIS_MODULE,        .name      = "s3c-i2c",        .pm  = S3C24XX_DEV_PM_OPS,},};

这个平台设备总线驱动模型连接了实际的物理适配器(即IIC控制器)和对应的IIC控制器的驱动.

0 0
原创粉丝点击