Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于ov2640基地址的问题 #169

Open
fortunerains opened this issue Jan 26, 2021 · 1 comment
Open

关于ov2640基地址的问题 #169

fortunerains opened this issue Jan 26, 2021 · 1 comment

Comments

@fortunerains
Copy link

手册上写的设备地址是60,为什么程序里面是0x30,求教谢谢

@liukangcc
Copy link
Contributor

0x60 = 0x30 << 1

static rt_err_t i2c_bit_send_address(struct rt_i2c_bus_device *bus,
                                     struct rt_i2c_msg        *msg)
{
   .
   .
   .  
    else
    {
        /* 7-bit addr */
        addr1 = msg->addr << 1;
        if (flags & RT_I2C_RD)
            addr1 |= 1;
        ret = i2c_send_address(bus, addr1, retries);
        if ((ret != 1) && !ignore_nack)
            return -RT_EIO;
    }

    return RT_EOK;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants