Serial Port IO Interface¶
The serial port IO interface.
-
class
larpix.io.serialport.
SerialPort
(port=None, baudrate=1000000, timeout=0)[source]¶ Wrapper for various serial port interfaces across platforms.
Automatically loads correct driver based on the supplied port name:
'/dev/anything'
==> Linux ==> pySerial'scan-ftdi'
==> MacOS ==> libFTDI
-
classmethod
is_valid_chip_key
(key)[source]¶ Valid chip keys must be strings formatted as:
'<io_chain>-<chip_id>'
-
classmethod
parse_chip_key
(key)[source]¶ Decodes a chip key into
'chip_id'
andio_chain
Returns: dict
with keys('chip_id', 'io_chain')
-
classmethod
generate_chip_key
(**kwargs)[source]¶ Generates a valid
SerialPort
chip keyParameters: - chip_id –
int
corresponding to internal chip id - io_chain –
int
corresponding to daisy chain number
- chip_id –