adafruit_74hc595
¶
CircuitPython driver for 74HC595 shift register.
Author(s): Kattni Rembor, Tony DiCola
Implementation Notes¶
Hardware:
“* 74HC595 Shift Register - 3 pack”
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_74hc595.DigitalInOut(pin_number: Pin, shift_register_74hc595: ShiftRegister74HC595)¶
Digital input/output of the 74HC595. The interface is exactly the same as the
digitalio.DigitalInOut
class, however note that by design this device is OUTPUT ONLY! Attempting to read inputs or set direction as input will raise an exception.- property direction: digitalio.Direction.OUTPUT¶
Direction
can only be set toOUTPUT
.
- class adafruit_74hc595.ShiftRegister74HC595(spi: SPI, latch: DigitalInOut, number_of_shift_registers: int = 1, baudrate: int = 1000000)¶
Initialise the 74HC595 on specified SPI bus, indicate the number of shift registers being used and optional baudrate.
- get_pin(pin: int) DigitalInOut ¶
Convenience function to create an instance of the DigitalInOut class pointing at the specified pin of this 74HC595 device .
- property gpio: array | bytearray | bytes | memoryview | rgbmatrix.RGBMatrix | ulab.numpy.ndarray¶
The raw GPIO output register. Each bit represents the output value of the associated pin (0 = low, 1 = high).