IIC适配器级别分析-基于s3c2410



也就是说函数s3c_i2c0_set_platdata 的功能就是对s3c2410_platform_i2c结构体 进行初始化

初始化的结果是:

     struct s3c2410_platform_i2c default_i2c_data __initdata = {
            .bus_num = 0;
            .flags = 0;
            .slave_addr = 0x10;
            .frequency = 100*1000;
            .sda_delay = 100;
            .cfg_gpio =s3c_i2c0_cfg_gpio,

        };


结构体原型如下:

/**
 *    struct s3c2410_platform_i2c - Platform data for s3c I2C.
 *    @bus_num: The bus number to use (if possible).
 *    @flags: Any flags for the I2C bus (E.g. S3C_IICFLK_FILTER).
 *    @slave_addr: The I2C address for the slave device (if enabled).
 *    @frequency: The desired frequency in Hz of the bus.  This is
 *                  guaranteed to not be exceeded.  If the caller does
 *                  not care, use zero and the driver will select a
 *                  useful default.
 *    @sda_delay: The delay (in ns) applied to SDA edges.
 *    @cfg_gpio: A callback to configure the pins for I2C operation.
 */
struct s3c2410_platform_i2c {
    int        bus_num;
    unsigned int    flags;
    unsigned int    slave_addr;
    unsigned long    frequency;
    unsigned int    sda_delay;

    void    (*cfg_gpio)(struct platform_device *dev);
};

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值