Commit 05fae5d
committed
raspberrypi/I2CTarget: Fixed bug where I2C starts were seen as restarts.
The Rasperry Pi Pico, based on the RP2040, has a register that maintains
the status of I2C interrupt flags called IC_INTR_STAT. The bits of this
register are set by hardware and cleared by software. Before this commit,
the I2CTarget library did not clear the restart bit (R_RESTART_DET) in
this register after an I2C transaction ended, causing the is_restart
field of the i2ctarget_i2c_target_request_obj_t struct to always be true
after the first I2C transaction. This commit causes the restart and stop
bits to get cleared when the I2C transaction ends.
Signed-off-by: Amaar Ebrahim <[email protected]>1 parent 7809b8d commit 05fae5d
File tree
2 files changed
+17
-0
lines changed- ports/raspberrypi/common-hal/i2ctarget
2 files changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
126 | 141 | | |
127 | 142 | | |
128 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
0 commit comments