RT-Thread / RT-Thread/rt-thread
[Feature] I2C驱动框架的rt_i2c_control函数,V5.2.2版本看是没有获取设备锁,那是不是意味着要修改速率的时候,必须保证I2C是停止状态。
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 40
Description
Describe problem solved by the proposed feature
rt_err_t rt_i2c_control(struct rt_i2c_bus_device *bus,
int cmd,
void *args)
{
rt_err_t ret;
if(bus->ops->i2c_bus_control)
{
ret = bus->ops->i2c_bus_control(bus, cmd, args);
return ret;
}
else
{
LOG_E("I2C bus operation not supported");
return -RT_EINVAL;
}
Describe your preferred solution
No response
Describe possible alternatives
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at rt_i2c_control and trace the bus->ops->i2c_bus_control implementation in the I2C driver framework. Determine how device locking interacts with changing the I2C rate and define the expected behavior for an active bus; done should include a focused implementation or documented resolution with tests where the framework supports them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100