Comments (4)
@WBosonic, thanks for the report. I agree this looks wrong. However, are you sure it's an SP (stop) you see between the write operations? I'd expect a SR (repeated start), triggered by https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/src/i2c/controller.rs#L294:
if first_byte {
if !first_transaction {
w.restart().enable();
}
first_byte = false;
}
@ithinuel, if I read the git history correctly, that was added in #764. Do you remember why?
from rp-hal.
Ah yes it is an SR (I encountered this bug a while ago and misremembered).
From what I see the user facing I2C transaction does not actually check if the transaction type is the same as the one before.
from rp-hal.
Ah yes it is an SR (I encountered this bug a while ago and misremembered).
From what I see the user facing I2C transaction does not actually check if the transaction type is the same as the one before.
If I understand the datasheet correctly, it doesn't need to:
1 - If IC_RESTART_EN is 1, a RESTART is issued before the
data is sent/received (according to the value of CMD),
regardless of whether or not the transfer direction is
changing from the previous command; if IC_RESTART_EN
is 0, a STOP followed by a START is issued instead.
0 - If IC_RESTART_EN is 1, a RESTART is issued only if the
transfer direction is changing from the previous
command; if IC_RESTART_EN is 0, a STOP followed by a
START is issued instead.
So the fix could be as easy as removing w.restart().enable();
entirely?
from rp-hal.
Yes, provided that ic_restart_en
is set (which it is).
from rp-hal.
Related Issues (20)
- ADC read blocks HOT 3
- embedded_io::serial::Reader implementations drop data on error
- rp2040_hal::halt() makes rp2040 un-debuggable even though comment in function says debugging will stay possible
- Does rp2040_hal::spi::Spi implement the embedded-hal 1.0 SpiDevice trait? HOT 3
- Cycling a buffer with DMA HOT 5
- Support for #[thread_local]? HOT 3
- Multicore Lockout HOT 11
- Readme seems to use wrong cargo run command HOT 1
- I2C example produces weird non-working results HOT 3
- Embassy-RP and RP2040-hal Compatibility??? - Embedded_Hal::PWM:SetDutyCycle Assistance HOT 4
- Faulty UART baudrate divisor formula HOT 2
- Support the ReadReady and WriteReady traits on UART HOT 1
- Strange on-target-test results on rust beta HOT 4
- Add new RP2350 microcontroller support HOT 2
- `embedded_io::ReadReady/WriteReady` not implemented for uart peripheral HOT 1
- rp235x-hal: Add nice wrapper for `get_sys_info`
- Our implementation of embedded_io::Write is wrong HOT 1
- Using sram4/5 HOT 11
- Be consistent with I2S and SPI terminology
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rp-hal.