29
29
import adafruit_bus_device .spi_device as spi_device
30
30
31
31
32
-
33
32
__version__ = "0.0.0-auto.0"
34
33
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_74HC595.git"
35
34
@@ -41,7 +40,11 @@ class DigitalInOut:
41
40
direction as input will raise an exception.
42
41
"""
43
42
44
- def __init__ (self , pin_number : 'microcontroller.Pin' , shift_register_74hc595 : 'ShiftRegister74HC595' ):
43
+ def __init__ (
44
+ self ,
45
+ pin_number : "microcontroller.Pin" ,
46
+ shift_register_74hc595 : "ShiftRegister74HC595" ,
47
+ ):
45
48
"""Specify the pin number of the shift register (0...7) and
46
49
ShiftRegister74HC595 instance.
47
50
"""
@@ -115,7 +118,12 @@ class ShiftRegister74HC595:
115
118
and indicate the number of shift registers being used
116
119
"""
117
120
118
- def __init__ (self , spi : 'busio.I2C' , latch : digitalio .DigitalInOut , number_of_shift_registers : int = 1 ):
121
+ def __init__ (
122
+ self ,
123
+ spi : "busio.I2C" ,
124
+ latch : digitalio .DigitalInOut ,
125
+ number_of_shift_registers : int = 1 ,
126
+ ):
119
127
self ._device = spi_device .SPIDevice (spi , latch , baudrate = 1000000 )
120
128
self ._number_of_shift_registers = number_of_shift_registers
121
129
self ._gpio = bytearray (self ._number_of_shift_registers )
@@ -133,14 +141,14 @@ def gpio(self):
133
141
return self ._gpio
134
142
135
143
@gpio .setter
136
- def gpio (self , val : ' _typing.ReadableBuffer' ):
144
+ def gpio (self , val : " _typing.ReadableBuffer" ):
137
145
self ._gpio = val
138
146
139
147
with self ._device as spi :
140
148
# pylint: disable=no-member
141
149
spi .write (self ._gpio )
142
150
143
- def get_pin (self , pin : int ) -> ' microcontroller.Pin' :
151
+ def get_pin (self , pin : int ) -> " microcontroller.Pin" :
144
152
"""Convenience function to create an instance of the DigitalInOut class
145
153
pointing at the specified pin of this 74HC595 device .
146
154
"""
0 commit comments