CircuitPython driver for 74HC165 shift register.

  • Author(s): John Woolsey

Implementation Notes

Based on Adafruit_CircuitPython_74HC595 driver library.


  • 74HC165 Shift Register

Software and Dependencies:

class wws_74hc165.DigitalInOut(pin_number, shift_register_74hc165)

Digital input/output of the 74HC165. The interface is exactly the same as the digitalio.DigitalInOut class, however note that by design this device is INPUT ONLY! Attempting to write outputs or set direction as output will raise an exception.

Specify the pin number of the shift register (0…7) and the ShiftRegister74HC165 instance.

property direction

Direction can only be set to INPUT.

property pull

Pull-up/down is not supported, return None for no pull-up/down.


DigitalInOut switch_to_input

switch_to_output(value=False, **kwargs)

switch_to_output is not supported.

property value

The value of the pin, either True for high or False for low.

class wws_74hc165.ShiftRegister74HC165(spi, latch, number_of_shift_registers=1)

Initialize the 74HC165 on the specified SPI bus and indicate the number of shift registers being used.


Convenience function to create an instance of the DigitalInOut class pointing at the specified pin of this 74HC165 device.

property gpio

The raw GPIO input register. Each bit represents the input value of the associated pin (0 = low, 1 = high).

property number_of_shift_registers

The number of shift register chips.