File tree 1 file changed +9
-4
lines changed
ports/raspberrypi/common-hal/busio
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,12 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
98
98
}
99
99
#endif
100
100
101
- // Create a bitbangio.I2C object to do short writes.
101
+ // Create a bitbangio.I2C object to do 0 byte writes.
102
+ //
103
+ // These are used to non-invasively detect I2C devices by sending
104
+ // the address and confirming an ACK.
105
+ // They are not supported by the RP2040 hardware.
106
+ //
102
107
// Must be done before setting up the I2C pins, since they will be
103
108
// set up as GPIO by the bitbangio.I2C object.
104
109
//
@@ -157,9 +162,9 @@ void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) {
157
162
}
158
163
159
164
uint8_t common_hal_busio_i2c_write (busio_i2c_obj_t * self , uint16_t addr ,
160
- const uint8_t * data , size_t len , bool transmit_stop_bit ) {
161
- if (len <= 2 ) {
162
- // The RP2040 I2C peripheral will not do writes 2 bytes or less long .
165
+ const uint8_t * data , size_t len , bool transmit_stop_bit ) {
166
+ if (len == 0 ) {
167
+ // The RP2040 I2C peripheral will not perform 0 byte writes .
163
168
// So use bitbangio.I2C to do the write.
164
169
165
170
gpio_set_function (self -> scl_pin , GPIO_FUNC_SIO );
You can’t perform that action at this time.
0 commit comments