|
|
|
@ -76,6 +76,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
|
|
|
|
|
mp_raise_ValueError(translate("Invalid pins"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if CIRCUITPY_REQUIRE_I2C_PULLUPS
|
|
|
|
|
// Test that the pins are in a high state. (Hopefully indicating they are pulled up.)
|
|
|
|
|
gpio_set_pin_function(sda->number, GPIO_PIN_FUNCTION_OFF);
|
|
|
|
|
gpio_set_pin_function(scl->number, GPIO_PIN_FUNCTION_OFF);
|
|
|
|
@ -98,6 +99,8 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
|
|
|
|
|
reset_pin_number(scl->number);
|
|
|
|
|
mp_raise_RuntimeError(translate("SDA or SCL needs a pull up"));
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
gpio_set_pin_function(sda->number, sda_pinmux);
|
|
|
|
|
gpio_set_pin_function(scl->number, scl_pinmux);
|
|
|
|
|
|
|
|
|
|