From 4df8144a91b98082db25bfb7b18b9379d7add6fc Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 6 Jun 2019 11:53:59 -0400 Subject: [PATCH 1/7] add first mock api, blinks! --- adafruit_esp32spi/digitalio.py | 146 +++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100755 adafruit_esp32spi/digitalio.py diff --git a/adafruit_esp32spi/digitalio.py b/adafruit_esp32spi/digitalio.py new file mode 100755 index 0000000..b03da8c --- /dev/null +++ b/adafruit_esp32spi/digitalio.py @@ -0,0 +1,146 @@ +# The MIT License (MIT) +# +# Copyright (c) 2019 Brent Rubell for Adafruit +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +""" +`digitalio` +============================== +DigitalIO for ESP32 over SPI. + +* Author(s): Brent Rubell +""" +from micropython import const + +class DriveMode(): + PUSH_PULL = None + OPEN_DRAIN = None + +DriveMode.PUSH_PULL = DriveMode() +DriveMode.OPEN_DRAIN = DriveMode() + +class Direction: + INPUT = None + OUTPUT = None + +Direction.INPUT = Direction() +Direction.OUTPUT = Direction() + +class Pull: + UP = None + DOWN = None + +Pull.UP = Pull() +Pull.DOWN = Pull() + +class Pin: + IN = const(0x00) + OUT = const(0x01) + LOW = const(0x00) + HIGH = const(0x01) + id = None + _value = LOW + _mode = IN + + def __init__(self, esp_pin_number, esp): + self.id = esp_pin_number + self._esp = esp + + def init(self, mode=IN, pull=None): + """Initalizes a pre-defined pin. + :param mode: Pin mode (IN, OUT, LOW, HIGH) + :param pull: Pull value (PULL_NONE, PULL_UP, PULL_DOWN) + """ + print('pin init') + if mode != None: + if mode == self.IN: + self._mode = self.IN + self._esp.set_pin_mode(self.id, 0) + elif mode == self.OUT: + self._mode = self.OUT + self._esp.set_pin_mode(self.id, 1) + else: + raise RuntimeError("Invalid mode defined") + if pull != None: + raise RuntimeError("ESP32 does not have pull-up resistors defined.") + + def value(self, val=None): + """Sets ESP32 Pin GPIO output mode. + :param val: Output level (LOW, HIGH) + """ + if val != None: + if val == self.LOW: + self._value = val + self._esp.set_digital_write(self.id, 0) + elif val == self.HIGH: + self._value = val + self._esp.set_digital_write(self.id, 1) + else: + raise RuntimeError("Invalid value for pin") + else: + raise AttributeError("ESP32SPI does not allow for a digital input.") + + def __repr__(self): + return str(self.id) + + +class DigitalInOut(): + """Mock DigitalIO CircuitPython API Implementation for ESP32SPI. + Provides access to ESP_SPIcontrol methods. + """ + _pin = None + def __init__(self, esp, pin): + self._esp = esp + self._pin = Pin(pin, self._esp) + print('id:', self._pin.id) + self._direction = Direction.INPUT + + def deinit(self): + self._pin = None + + def __exit__(self): + self.deinit() + + @property + def direction(self): + return self.__direction + + @direction.setter + def direction(self, dir): + self.__direction = dir + if dir is Direction.OUTPUT: + self._pin.init(mode=Pin.OUT) + self.value = False + self.drive_mode = DriveMode.PUSH_PULL + elif dir is Direction.INPUT: + self._pin.init(mode=Pin.IN) + self.pull = None + else: + raise AttributeError("Not a Direction") + + @property + def value(self): + return self._pin.value() is 1 + + @value.setter + def value(self, val): + if self.direction is Direction.OUTPUT: + self._pin.value(1 if val else 0) + else: + raise AttributeError("Not an output") \ No newline at end of file From 777289474f963711b53d46d9199ad6c42e17d138 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 6 Jun 2019 12:44:53 -0400 Subject: [PATCH 2/7] add valid pin tupleset check before initialization, raise error --- adafruit_esp32spi/digitalio.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/adafruit_esp32spi/digitalio.py b/adafruit_esp32spi/digitalio.py index b03da8c..8e01b19 100755 --- a/adafruit_esp32spi/digitalio.py +++ b/adafruit_esp32spi/digitalio.py @@ -49,19 +49,32 @@ class Pull: Pull.UP = Pull() Pull.DOWN = Pull() +# ESP32-WROOM GPIO Pins + + class Pin: IN = const(0x00) OUT = const(0x01) LOW = const(0x00) HIGH = const(0x01) id = None - _value = LOW + _value = LOW _mode = IN - def __init__(self, esp_pin_number, esp): - self.id = esp_pin_number + ESP32_GPIO_PINS = set([0, 1, 2, 4, 5, + 12, 13, 14, 15, + 16, 17, 18, 19, + 21, 22, 23, 25, + 26, 27, 32, 33]) + + + def __init__(self, esp_pin, esp): + if esp_pin in self.ESP32_GPIO_PINS: + self.id = esp_pin + else: + raise AttributeError("Pin %d is not a valid ESP32 GPIO Pin."%esp_pin) self._esp = esp - + def init(self, mode=IN, pull=None): """Initalizes a pre-defined pin. :param mode: Pin mode (IN, OUT, LOW, HIGH) @@ -79,7 +92,7 @@ def init(self, mode=IN, pull=None): raise RuntimeError("Invalid mode defined") if pull != None: raise RuntimeError("ESP32 does not have pull-up resistors defined.") - + def value(self, val=None): """Sets ESP32 Pin GPIO output mode. :param val: Output level (LOW, HIGH) From 00e7f97453a4cd257cb6739f69132e5d79d087d1 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 6 Jun 2019 13:01:43 -0400 Subject: [PATCH 3/7] drop all pull functionality since we dont have it defined in adafruit_esp32spi.py --- adafruit_esp32spi/digitalio.py | 41 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/adafruit_esp32spi/digitalio.py b/adafruit_esp32spi/digitalio.py index 8e01b19..b9f28bf 100755 --- a/adafruit_esp32spi/digitalio.py +++ b/adafruit_esp32spi/digitalio.py @@ -28,6 +28,7 @@ """ from micropython import const +# Enums class DriveMode(): PUSH_PULL = None OPEN_DRAIN = None @@ -42,16 +43,6 @@ class Direction: Direction.INPUT = Direction() Direction.OUTPUT = Direction() -class Pull: - UP = None - DOWN = None - -Pull.UP = Pull() -Pull.DOWN = Pull() - -# ESP32-WROOM GPIO Pins - - class Pin: IN = const(0x00) OUT = const(0x01) @@ -67,7 +58,6 @@ class Pin: 21, 22, 23, 25, 26, 27, 32, 33]) - def __init__(self, esp_pin, esp): if esp_pin in self.ESP32_GPIO_PINS: self.id = esp_pin @@ -75,10 +65,9 @@ def __init__(self, esp_pin, esp): raise AttributeError("Pin %d is not a valid ESP32 GPIO Pin."%esp_pin) self._esp = esp - def init(self, mode=IN, pull=None): + def init(self, mode=IN): """Initalizes a pre-defined pin. - :param mode: Pin mode (IN, OUT, LOW, HIGH) - :param pull: Pull value (PULL_NONE, PULL_UP, PULL_DOWN) + :param mode: Pin mode (IN, OUT, LOW, HIGH). """ print('pin init') if mode != None: @@ -90,8 +79,6 @@ def init(self, mode=IN, pull=None): self._esp.set_pin_mode(self.id, 1) else: raise RuntimeError("Invalid mode defined") - if pull != None: - raise RuntimeError("ESP32 does not have pull-up resistors defined.") def value(self, val=None): """Sets ESP32 Pin GPIO output mode. @@ -107,13 +94,13 @@ def value(self, val=None): else: raise RuntimeError("Invalid value for pin") else: - raise AttributeError("ESP32SPI does not allow for a digital input.") + raise NotImplementedError("digitalRead not currently implemented in esp32spi") def __repr__(self): return str(self.id) - class DigitalInOut(): + """Mock DigitalIO CircuitPython API Implementation for ESP32SPI. Provides access to ESP_SPIcontrol methods. """ @@ -143,7 +130,6 @@ def direction(self, dir): self.drive_mode = DriveMode.PUSH_PULL elif dir is Direction.INPUT: self._pin.init(mode=Pin.IN) - self.pull = None else: raise AttributeError("Not a Direction") @@ -156,4 +142,19 @@ def value(self, val): if self.direction is Direction.OUTPUT: self._pin.value(1 if val else 0) else: - raise AttributeError("Not an output") \ No newline at end of file + raise AttributeError("Not an output") + + @property + def drive_mode(self): + if self.direction is Direction.OUTPUT: + return self.__drive_mode + else: + raise AttributeError("Not an output") + + @drive_mode.setter + def drive_mode(self, mode): + self.__drive_mode = mode + if mode is DriveMode.OPEN_DRAIN: + self._pin.init(mode=Pin.OPEN_DRAIN) + elif mode is DriveMode.PUSH_PULL: + self._pin.init(mode=Pin.OUT) \ No newline at end of file From 5e97cb1fcd152bcf22055e53eeb376e336f820eb Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 6 Jun 2019 15:01:22 -0400 Subject: [PATCH 4/7] add switch_to_x methods, docstrings --- adafruit_esp32spi/digitalio.py | 90 ++++++++++++++++++++++++---------- 1 file changed, 64 insertions(+), 26 deletions(-) diff --git a/adafruit_esp32spi/digitalio.py b/adafruit_esp32spi/digitalio.py index b9f28bf..2c4fb57 100755 --- a/adafruit_esp32spi/digitalio.py +++ b/adafruit_esp32spi/digitalio.py @@ -28,36 +28,30 @@ """ from micropython import const -# Enums -class DriveMode(): - PUSH_PULL = None - OPEN_DRAIN = None - -DriveMode.PUSH_PULL = DriveMode() -DriveMode.OPEN_DRAIN = DriveMode() - -class Direction: - INPUT = None - OUTPUT = None - -Direction.INPUT = Direction() -Direction.OUTPUT = Direction() - class Pin: IN = const(0x00) OUT = const(0x01) LOW = const(0x00) HIGH = const(0x01) - id = None _value = LOW _mode = IN + id = None ESP32_GPIO_PINS = set([0, 1, 2, 4, 5, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33]) + """ + Implementation of CircuitPython API Pin Handling + for ESP32SPI. + + :param int esp_pin: Valid ESP32 GPIO Pin, predefined in ESP32_GPIO_PINS. + :param ESP_SPIcontrol esp: The ESP object we are using. + NOTE: This class does not currently implement reading digital pins + or the use of internal pull-up resistors. + """ def __init__(self, esp_pin, esp): if esp_pin in self.ESP32_GPIO_PINS: self.id = esp_pin @@ -67,9 +61,8 @@ def __init__(self, esp_pin, esp): def init(self, mode=IN): """Initalizes a pre-defined pin. - :param mode: Pin mode (IN, OUT, LOW, HIGH). + :param mode: Pin mode (IN, OUT, LOW, HIGH). Defaults to IN. """ - print('pin init') if mode != None: if mode == self.IN: self._mode = self.IN @@ -82,7 +75,7 @@ def init(self, mode=IN): def value(self, val=None): """Sets ESP32 Pin GPIO output mode. - :param val: Output level (LOW, HIGH) + :param val: Pin output level (LOW, HIGH) """ if val != None: if val == self.LOW: @@ -99,30 +92,64 @@ def value(self, val=None): def __repr__(self): return str(self.id) + +class DriveMode(): + PUSH_PULL = None + OPEN_DRAIN = None +DriveMode.PUSH_PULL = DriveMode() +DriveMode.OPEN_DRAIN = DriveMode() + + +class Direction(): + INPUT = None + OUTPUT = None +Direction.INPUT = Direction() +Direction.OUTPUT = Direction() + + class DigitalInOut(): + """Implementation of DigitalIO module for ESP32SPI. - """Mock DigitalIO CircuitPython API Implementation for ESP32SPI. - Provides access to ESP_SPIcontrol methods. + :param ESP_SPIcontrol esp: The ESP object we are using. + :param int pin: Valid ESP32 GPIO Pin, predefined in ESP32_GPIO_PINS. """ _pin = None def __init__(self, esp, pin): self._esp = esp self._pin = Pin(pin, self._esp) - print('id:', self._pin.id) - self._direction = Direction.INPUT + self.direction = Direction.INPUT + + def __exit__(self): + self.deinit() def deinit(self): self._pin = None + + def switch_to_output(self, value=False, drive_mode= DriveMode.PUSH_PULL): + """Set the drive mode and value and then switch to writing out digital values. + :param bool value: Default mode to set upon switching. + :param DriveMode drive_mode: Drive mode for the output. + """ + self.direction = Direction.OUTPUT + self.value = value + self._drive_mode = drive_mode - def __exit__(self): - self.deinit() + def switch_to_input(self, pull=None): + """Sets the pull and then switch to read in digital values. + :param Pull pull: Pull configuration for the input. + """ + raise NotImplementedError("Digital reads are not currently supported in ESP32SPI.") @property def direction(self): + """Returns the pin's direction.""" return self.__direction @direction.setter def direction(self, dir): + """Sets the direction of the pin. + :param Direction dir: Pin direction (Direction.OUTPUT or Direction.INPUT) + """ self.__direction = dir if dir is Direction.OUTPUT: self._pin.init(mode=Pin.OUT) @@ -135,10 +162,16 @@ def direction(self, dir): @property def value(self): + """Returns the digital logic level value of the pin.""" return self._pin.value() is 1 @value.setter def value(self, val): + """Sets the digital logic level of the pin. + :param type value: Pin logic level. + :param int value: Pin logic level. 1 is logic high, 0 is logic low. + :param bool value: Pin logic level. True is logic high, False is logic low. + """ if self.direction is Direction.OUTPUT: self._pin.value(1 if val else 0) else: @@ -146,6 +179,7 @@ def value(self, val): @property def drive_mode(self): + """Returns pin drive mode.""" if self.direction is Direction.OUTPUT: return self.__drive_mode else: @@ -153,8 +187,12 @@ def drive_mode(self): @drive_mode.setter def drive_mode(self, mode): + """Sets the pin drive mode. + :param DriveMode mode: Defines the drive mode when outputting digital values. + Either PUSH_PULL or OPEN_DRAIN + """ self.__drive_mode = mode if mode is DriveMode.OPEN_DRAIN: self._pin.init(mode=Pin.OPEN_DRAIN) elif mode is DriveMode.PUSH_PULL: - self._pin.init(mode=Pin.OUT) \ No newline at end of file + self._pin.init(mode=Pin.OUT) From 6a0c036995ead0074581b3932f3f907a78dc9332 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 6 Jun 2019 15:31:49 -0400 Subject: [PATCH 5/7] pylinting - 8.79/10, look at drivemode/direction classes... --- adafruit_esp32spi/digitalio.py | 73 +++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/adafruit_esp32spi/digitalio.py b/adafruit_esp32spi/digitalio.py index 2c4fb57..a675c4e 100755 --- a/adafruit_esp32spi/digitalio.py +++ b/adafruit_esp32spi/digitalio.py @@ -1,6 +1,6 @@ # The MIT License (MIT) # -# Copyright (c) 2019 Brent Rubell for Adafruit +# Copyright (c) 2019 Brent Rubell for Adafruit Industries # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,19 +29,6 @@ from micropython import const class Pin: - IN = const(0x00) - OUT = const(0x01) - LOW = const(0x00) - HIGH = const(0x01) - _value = LOW - _mode = IN - id = None - - ESP32_GPIO_PINS = set([0, 1, 2, 4, 5, - 12, 13, 14, 15, - 16, 17, 18, 19, - 21, 22, 23, 25, - 26, 27, 32, 33]) """ Implementation of CircuitPython API Pin Handling for ESP32SPI. @@ -52,9 +39,24 @@ class Pin: NOTE: This class does not currently implement reading digital pins or the use of internal pull-up resistors. """ + #pylint: disable=invalid-name + IN = const(0x00) + OUT = const(0x01) + LOW = const(0x00) + HIGH = const(0x01) + _value = LOW + _mode = IN + pin_id = None + + ESP32_GPIO_PINS = set([0, 1, 2, 4, 5, + 12, 13, 14, 15, + 16, 17, 18, 19, + 21, 22, 23, 25, + 26, 27, 32, 33]) + def __init__(self, esp_pin, esp): if esp_pin in self.ESP32_GPIO_PINS: - self.id = esp_pin + self.pin_id = esp_pin else: raise AttributeError("Pin %d is not a valid ESP32 GPIO Pin."%esp_pin) self._esp = esp @@ -63,13 +65,13 @@ def init(self, mode=IN): """Initalizes a pre-defined pin. :param mode: Pin mode (IN, OUT, LOW, HIGH). Defaults to IN. """ - if mode != None: + if mode is not None: if mode == self.IN: self._mode = self.IN - self._esp.set_pin_mode(self.id, 0) + self._esp.set_pin_mode(self.pin_id, 0) elif mode == self.OUT: self._mode = self.OUT - self._esp.set_pin_mode(self.id, 1) + self._esp.set_pin_mode(self.pin_id, 1) else: raise RuntimeError("Invalid mode defined") @@ -77,30 +79,32 @@ def value(self, val=None): """Sets ESP32 Pin GPIO output mode. :param val: Pin output level (LOW, HIGH) """ - if val != None: + if val is not None: if val == self.LOW: self._value = val - self._esp.set_digital_write(self.id, 0) + self._esp.set_digital_write(self.pin_id, 0) elif val == self.HIGH: self._value = val - self._esp.set_digital_write(self.id, 1) + self._esp.set_digital_write(self.pin_id, 1) else: raise RuntimeError("Invalid value for pin") else: raise NotImplementedError("digitalRead not currently implemented in esp32spi") def __repr__(self): - return str(self.id) - + return str(self.pin_id) +@staticmethod class DriveMode(): + """DriveMode Enum.""" PUSH_PULL = None OPEN_DRAIN = None DriveMode.PUSH_PULL = DriveMode() DriveMode.OPEN_DRAIN = DriveMode() - +@staticmethod class Direction(): + """DriveMode Enum.""" INPUT = None OUTPUT = None Direction.INPUT = Direction() @@ -119,13 +123,17 @@ def __init__(self, esp, pin): self._pin = Pin(pin, self._esp) self.direction = Direction.INPUT - def __exit__(self): + def __enter__(self): + return self + + def __exit__(self, exception_type, exception_value, traceback): self.deinit() def deinit(self): + """De-initializes the pin object.""" self._pin = None - def switch_to_output(self, value=False, drive_mode= DriveMode.PUSH_PULL): + def switch_to_output(self, value=False, drive_mode=DriveMode.PUSH_PULL): """Set the drive mode and value and then switch to writing out digital values. :param bool value: Default mode to set upon switching. :param DriveMode drive_mode: Drive mode for the output. @@ -133,7 +141,7 @@ def switch_to_output(self, value=False, drive_mode= DriveMode.PUSH_PULL): self.direction = Direction.OUTPUT self.value = value self._drive_mode = drive_mode - + def switch_to_input(self, pull=None): """Sets the pull and then switch to read in digital values. :param Pull pull: Pull configuration for the input. @@ -146,16 +154,16 @@ def direction(self): return self.__direction @direction.setter - def direction(self, dir): + def direction(self, pin_dir): """Sets the direction of the pin. :param Direction dir: Pin direction (Direction.OUTPUT or Direction.INPUT) """ - self.__direction = dir - if dir is Direction.OUTPUT: + self.__direction = pin_dir + if pin_dir is Direction.OUTPUT: self._pin.init(mode=Pin.OUT) self.value = False self.drive_mode = DriveMode.PUSH_PULL - elif dir is Direction.INPUT: + elif pin_dir is Direction.INPUT: self._pin.init(mode=Pin.IN) else: raise AttributeError("Not a Direction") @@ -182,8 +190,7 @@ def drive_mode(self): """Returns pin drive mode.""" if self.direction is Direction.OUTPUT: return self.__drive_mode - else: - raise AttributeError("Not an output") + raise AttributeError("Not an output") @drive_mode.setter def drive_mode(self, mode): From 4923344d95d8a41dd01b5da6ea140cbcd04171eb Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 6 Jun 2019 16:30:27 -0400 Subject: [PATCH 6/7] checking in digitalio, ready --- adafruit_esp32spi/digitalio.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/adafruit_esp32spi/digitalio.py b/adafruit_esp32spi/digitalio.py index a675c4e..eb90caf 100755 --- a/adafruit_esp32spi/digitalio.py +++ b/adafruit_esp32spi/digitalio.py @@ -94,7 +94,7 @@ def value(self, val=None): def __repr__(self): return str(self.pin_id) -@staticmethod +# pylint: disable = too-few-public-methods class DriveMode(): """DriveMode Enum.""" PUSH_PULL = None @@ -102,7 +102,7 @@ class DriveMode(): DriveMode.PUSH_PULL = DriveMode() DriveMode.OPEN_DRAIN = DriveMode() -@staticmethod + class Direction(): """DriveMode Enum.""" INPUT = None @@ -118,6 +118,7 @@ class DigitalInOut(): :param int pin: Valid ESP32 GPIO Pin, predefined in ESP32_GPIO_PINS. """ _pin = None + #pylint: disable = attribute-defined-outside-init def __init__(self, esp, pin): self._esp = esp self._pin = Pin(pin, self._esp) @@ -138,9 +139,9 @@ def switch_to_output(self, value=False, drive_mode=DriveMode.PUSH_PULL): :param bool value: Default mode to set upon switching. :param DriveMode drive_mode: Drive mode for the output. """ - self.direction = Direction.OUTPUT - self.value = value + self._direction = Direction.OUTPUT self._drive_mode = drive_mode + self.value = value def switch_to_input(self, pull=None): """Sets the pull and then switch to read in digital values. @@ -189,7 +190,7 @@ def value(self, val): def drive_mode(self): """Returns pin drive mode.""" if self.direction is Direction.OUTPUT: - return self.__drive_mode + return self._drive_mode raise AttributeError("Not an output") @drive_mode.setter @@ -200,6 +201,6 @@ def drive_mode(self, mode): """ self.__drive_mode = mode if mode is DriveMode.OPEN_DRAIN: - self._pin.init(mode=Pin.OPEN_DRAIN) + raise NotImplementedError('Drive mode %s not implemented in ESP32SPI.'%mode) elif mode is DriveMode.PUSH_PULL: self._pin.init(mode=Pin.OUT) From 8599c0124b87cd4b4b5b9a8c4f6171861c229ac7 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 6 Jun 2019 17:16:23 -0400 Subject: [PATCH 7/7] add credit to where credit is due :) --- adafruit_esp32spi/digitalio.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adafruit_esp32spi/digitalio.py b/adafruit_esp32spi/digitalio.py index eb90caf..49f5c35 100755 --- a/adafruit_esp32spi/digitalio.py +++ b/adafruit_esp32spi/digitalio.py @@ -24,7 +24,10 @@ ============================== DigitalIO for ESP32 over SPI. -* Author(s): Brent Rubell +* Author(s): Brent Rubell, based on Adafruit_Blinka digitalio implementation +and bcm283x Pin implementation. +https://github.com/adafruit/Adafruit_Blinka/blob/master/src/adafruit_blinka/microcontroller/bcm283x/pin.py +https://github.com/adafruit/Adafruit_Blinka/blob/master/src/digitalio.py """ from micropython import const