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
decode
(msgs, leftover_bytes=b'')[source]¶ Decodes a list of serial port bytestreams to packets
-
classmethod
is_valid_chip_key
(key)[source]¶ Valid chip keys must be strings formatted as:
'<io_chain>-<chip_id>'
-
send
(packets)[source]¶ Format the packets as a bytestream and send it to the FPGA and on to the LArPix ASICs.
-
set_larpix_uart_clk_ratio
(value)[source]¶ Sends a special command to modify the larpix uart clk ratio (how many clock cycles correspond to one bit). A value of 2 means 1 uart bit == 2 clk cycles
-
set_larpix_reset_cnt
(value)[source]¶ Sends a special command to modify the length of the reset signal sent to the larpix chips. The reset will be held low for value + 1 larpix clk rising edges
-
larpix_reset
()[source]¶ Sends a special command to issue a larpix reset pulse. Pulse length is set by set_larpix_reset_cnt().
-
set_utility_pulse
(pulse_len=None, pulse_rep=None)[source]¶ Sends a special command to issue set up utility pulser. Pulse length is the number of larpix clk cyles pulse is high, and pulse rep is the number of clk cycles until the next pulse.
-
enable_utility_pulse
()[source]¶ Sends a special command to enable the utility pulser. Pulse characteristics can be set by set_utility_pulse().