Commit graph

11 commits

Author SHA1 Message Date
Earle F. Philhower, III
aeb41f3e70
Handle slave mode I2C restarts (#1104)
Fixes #1100
2023-01-06 12:23:53 -08:00
Earle F. Philhower, III
d94ca66e3e
Update Wire per @chrisckc debugging (#1011)
Merge in changes @chrisckc debugged while working at 400khz on his own project.
See https://github.com/earlephilhower/arduino-pico/issues/979#issuecomment-1328237128
2022-11-28 08:50:51 -08:00
Earle F. Philhower, III
0133ecc887
Avoid race conditions in I2C(Wire) callbacks (#995)
Fixes #979

Make sure to read the last byte of I2C data in the case where the IRQ happens
and the STOP signal is also asserted.

Also ensure all branches of the IRQ handler look at the same point in time
value for the IRQ status.
2022-11-22 17:14:44 -08:00
Earle F. Philhower, III
c4623f4297
Disable Wire slave interrupt on ::end (#621)
Fixes #620
2022-06-10 11:42:04 -07:00
Earle F. Philhower, III
10b869ef30
Fix XIAO RP2040, allow swapping HW units 0/1 (#606)
Add plumbing to allow `Wire`, `Serial1`, `SPI1` to map to the 2nd
hardware unit for devices where the PCB layout only brings out the
2nd port.

Fix the Seeedstudio XAIO pins

Fixes #594
2022-06-04 21:37:28 -07:00
Earle F. Philhower, III
24583494c6
Fix Wire::available() when ::requestFrom fails (#604)
Avoids returning 2^32 bytes in the case of a requestFrom read fails
due to timeout.
2022-06-01 17:58:54 -07:00
Earle F. Philhower, III
a3a5abac23
Fix Wire I2C restart handling (#586)
Fixes #585

On an I2C bus restart, call the onReceive callback and clear the buffer.

Thanks to @DWiskow for the debug and patch!
2022-05-19 16:00:52 -07:00
Earle F. Philhower, III
c4046602f0
Allow changing I2C clock speed while running (#459)
Fixes #458
2022-02-04 18:08:35 -08:00
Earle F. Philhower, III
25b9ca821e
Only call Wire.onReceive if data is available (#423)
The Pico HW seems to generate an interrupt on the end of every I2C
write cycle, even if the slave address wasn't actually targeted.
This would cause the onReceive method to be called with a 0-len
parameter for every write on the I2C bus.

Now, only call onReceive if there is 1 or more bytes of data available.
2022-01-19 16:16:39 -08:00
SirSydom
3585c58688
Reset the SDA and SCL pins to INPUT at Wire.end() to prevent multiple pins connected to I2C when changing pins (#302) 2021-09-03 08:40:18 -07:00
Earle F. Philhower, III
580970cd72
Use Stream::setTimeout to specify I2C TO (#263)
Use the existing Arduino Stream method of setTimeout to set the Wire
I2C timeout delay.

Fixes #260
2021-07-23 15:20:34 -07:00
Renamed from libraries/Wire/Wire.cpp (Browse further)