X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka.git/blobdiff_plain/45c6059e81fcdc21409153ffa553700874ed7634..54a64285fbc416a587a0894e1495f891e5c6080a:/src/adafruit_blinka/microcontroller/fake_mcp2221/pin.py diff --git a/src/adafruit_blinka/microcontroller/fake_mcp2221/pin.py b/src/adafruit_blinka/microcontroller/fake_mcp2221/pin.py index 27a1c56..f3b6b1f 100644 --- a/src/adafruit_blinka/microcontroller/fake_mcp2221/pin.py +++ b/src/adafruit_blinka/microcontroller/fake_mcp2221/pin.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: MIT """fake_mcp2221 pin names""" import random -from .fake_mcp2221 import mcp2221 class Pin: @@ -28,21 +27,18 @@ class Pin: if self.id is None: raise RuntimeError("Can not init a None type pin.") if pull is not None: - raise NotImplementedError("Internal pullups and pulldowns not supported on the MCP2221") - if mode in (Pin.IN, Pin.OUT): - # All pins can do GPIO - pass - elif mode == Pin.ADC: + raise NotImplementedError( + "Internal pullups and pulldowns not supported on the MCP2221" + ) + if mode == Pin.ADC: # ADC only available on these pins if self.id not in (1, 2, 3): raise ValueError("Pin does not have ADC capabilities") - pass # Do nothing elif mode == Pin.DAC: # DAC only available on these pins if self.id not in (2, 3): raise ValueError("Pin does not have DAC capabilities") - pass else: raise ValueError("Incorrect pin mode: {}".format(mode)) self._mode = mode @@ -90,4 +86,4 @@ G2 = Pin(2) G3 = Pin(3) SCL = Pin() -SDA = Pin() \ No newline at end of file +SDA = Pin()