parallel64.pins

parallel64.pins

Individual pin and pin collection functionalities used as part of a GPIO port

  • Author(s): Alec Delaney

Module Contents

Classes

Pin

Class representing a pin

DataPin

Class representing an individual data pin, including a

StatusPin

Class representing an individual status pin, including a

ControlPin

Class representing an individual control pin, including a

Pins

Class representing all the pins for a given port (connected to

class parallel64.pins.Pin(pin_number: int, bit_index: int, register: int, hw_inverted: bool = False)

Class representing a pin

property hw_inverted(self) bool

Returns whether a pin is hardware inverted

property output_allowed(self) bool

Returns whether a pin allows output

property input_allowed(self) bool

Returns whether a pin allows input

class parallel64.pins.DataPin(pin_number: int, bit_index: int, register: int, is_bidir: bool)

Bases: Pin

Class representing an individual data pin, including a class-wide threading.Lock for I/O operations

Variables

register_lock (threading.Lock) – A class-wide thread lock useful for making I/O safe code

class parallel64.pins.StatusPin(pin_number: int, bit_index: int, register: int, hw_inverted: bool = False)

Bases: Pin

Class representing an individual status pin, including a class-wide threading.Lock for I/O operations

Variables

register_lock (threading.Lock) – A class-wide thread lock useful for making I/O safe code

class parallel64.pins.ControlPin(pin_number: int, bit_index: int, register: int, hw_inverted: bool = False)

Bases: Pin

Class representing an individual control pin, including a class-wide threading.Lock for I/O operations

Variables

register_lock (threading.Lock) – A class-wide thread lock useful for making I/O safe code

class parallel64.pins.Pins(data_address: int, is_bidir: bool)

Class representing all the pins for a given port (connected to registers). Interaction with this class typically takes place by manipulating the ‘pins’ attribute of an instance of ‘GPIOPort’:

import parallel64
gpio = parallel64.GPIOPort(0x1234)
input_pin = gpio.pins.D0
pin_value = gpio.read_pin(input_pin)

Data Pins: D0, D1, D2, D3, D4, D5, D6, D7

Status Pins: ACK, BUSY, PAPER_OUT, SELECT_IN, ERROR

Control Pins: STROBE, AUTO_LINEFEED, INITIALIZE, SELECT_PRINTER

property pin_list(self) List[Tuple[str, Pin]]

Returns a list of pins and their names

get_pin_number(self, pin_number: int) Pin

Returns a pin based off of the pin number

Return type

Pin