+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
"""Generic Linux I2C class using PureIO's smbus class"""
-import Adafruit_PureIO.smbus as smbus
+from Adafruit_PureIO import smbus
class I2C:
except FileNotFoundError:
raise RuntimeError(
"I2C Bus #%d not found, check if enabled in config!" % bus_num
- )
+ ) from RuntimeError
# pylint: enable=unused-argument
out_end=None,
in_start=0,
in_end=None,
- stop=False
+ stop=False,
):
"""Write data from buffer_out to an address and then
read data from an address and into buffer_in