src.services.hs_driver.chips package

Submodules

src.services.hs_driver.chips.mcp23s17 module

class src.services.hs_driver.chips.mcp23s17.MCP23S17(spi_name: str, address: int, *args, **kwargs)

Bases: DelayLineChip

MCP23S17 chip object definition.

MCP23S17 is used to set the MC100EP195B delay line chip.

calc_delay(value: int, unit: str, side: int, enable: int, sel0: int, sel1: int, *args, **kwargs)

Returns a value to write to the MCP to forward it to the SZ100EP195B (V). Step of the programmable delay is 10 ps (12230 - 2000) / 2**10.

Parameters:
  • value (int) – The delay value.

  • unit (str) – The delay unit

  • side (int) – The channel of the chip that will be delayed.

  • enable (int) – enable value.

  • sel0 (int) – sel0 value.

  • sel1 (int) – sel1 value.

Returns:

list of bytes to write to the MCP

Return type:

list

makeAddressable()

Returns the values to write via SPI to mak the MCP addressable by HAD.

name = 'MCP23S17'
send_delay(hi: HardwareInterface, value: int, unit: str, channel: int = 0, top: int = 0, mid: int = 0, bottom: int = 0, *args, **kwargs)

Send delay general function for the MCP23S17 chip.

Parameters:
  • hi (HardwareInterface) – The hardware interface object.

  • value (int) – The delay value.

  • unit (str) – The delay unit.

Returns:

None

setIO(first: bool)

Returns a data packet to set all of GPIOs on MCP chip to outputs.

set_en_value(en: int)
set_sel0_value(sel0: int)
set_sel1_value(sel1: int)
setup(hi: HardwareInterface)

Setup MCP23S17 specific settings with given hardware interface.

Parameters:

hi (HardwareInterface) – The hardware interface object.

Returns:

None

src.services.hs_driver.chips.mcp23s17_40ns module

class src.services.hs_driver.chips.mcp23s17_40ns.MCP23S17_40NS(spi_name, address, *args, **kwargs)

Bases: DelayLineChip

MCP23S17_40NS chip object definition.

This class/object is used to communicate with the 40 ns delayline board that uses MCP23S17 to set 4 MC100EP195B delayline chips.

calc_delay(value: int | float, unit: str, side: int, clk_sel: int, enable: int, ps_en: int, *args, **kwargs)

Returns a value to write to the MCP to forward it to the 40 ns delayline board. Step of the programmable delay is 10 ps.

Parameters:
  • value (int) – The delay value.

  • unit (str) – The delay unit

  • side (int) – The channel of the chip that will be delayed.

  • enable (int) – enable value.

  • sel0 (int) – sel0 value.

  • sel1 (int) – sel1 value.

Returns:

list of bytes to write to the MCP

Return type:

list

makeAddressable()

Returns the values to write via SPI to make the MCP addressable by HAD.

name = 'MCP23S17_40NS'
send_delay(hi: HardwareInterface, value: int, unit: str, channel: int = 0, top: int = 0, mid: int = 0, bottom: int = 0, *args, **kwargs)

Send delay general function for the MCP23S17 chip.

Parameters:
  • hi (HardwareInterface) – The hardware interface object.

  • value (int) – The delay value.

  • unit (str) – The delay unit.

Returns:

None

setIO(first: bool)

Returns a data packet to set all of GPIOs on MCP chip to outputs.

set_clk_sel_value(clk_sel: int)
set_en_value(en: int)
set_ps_en_value(ps_en: int)
setup(hi: HardwareInterface)

Setup MCP23S17 specific settings with given hardware interface.

Parameters:

hi (HardwareInterface) – The hardware interface object.

Returns:

None

src.services.hs_driver.chips.nb6l295 module

class src.services.hs_driver.chips.nb6l295.NB6L295(spi_name: str, *args, **kwargs)

Bases: DelayLineChip

NB6L295 chip object definition.

calc_delay(value: int, unit: str, *args, **kwargs)

Calculate the bit value of the delay in ps.

Parameters:
  • value (int) – The delay value.

  • unit (str) – The unit of the delay value.

Returns:

The calculated delay value in bits.

Return type:

int

correction = [0, -1, -2, 2, 1]
define_latch_A(value: int)

Define the latch A value. Latch A is used to set the delay on one line of the NB6L295 chip.

Parameters:

value (int) – The delay value.

Returns:

The latch A value.

Return type:

int

define_latch_B(value: int)

Define the latch B value. Latch B is used to set the delay on one line of the NB6L295 chip.

Parameters:

value (int) – The delay value.

Returns:

The latch B value.

Return type:

int

name = 'NB6L295'
reverse_bits_9bit(number: int) int

Reverse the bits of a 9-bit number.

Parameters:

number (int) – The number to reverse the bits of.

Returns:

The reversed number

Return type:

int

send_delay(hi: HardwareInterface, value: int, unit: str, channel: int, top, mid, bottom, *args, **kwargs)

Send the delay value to the NB6L295 chip.

Parameters:
  • hi (HardwareInterface) – The hardware interface object.

  • value (int) – The delay value.

  • unit (str) – The unit of the delay value.

Returns:

None

src.services.hs_driver.chips.no_chip module

class src.services.hs_driver.chips.no_chip.NOCHIP(spi_name: str, *args, **kwargs)

Bases: DelayLineChip

No chip is selected. Initialized at the start of the program.

calc_delay(value, unit, *args, **kwargs)
name = 'nochip'
send_delay(hi: HardwareInterface, value, unit, *args, **kwargs)

src.services.hs_driver.chips.sy89297u module

class src.services.hs_driver.chips.sy89297u.SY89297U(spi_name: str, *args, **kwargs)

Bases: DelayLineChip

SY89297 chip object definition.

calc_delay(value: int, unit: str, *args, **kwargs)

Calculate the bit value of the delay in ps.

Parameters:
  • value (int) – The delay value.

  • unit (str) – The unit of the delay value.

Returns:

The calculated delay value in bits.

Return type:

int

correction = [0, -1, -2, 2, 1]
define_latch_A(value: int)

Define the latch A value. Latch A is used to set the delay on one line of the SY89297U chip.

Parameters:

value (int) – The delay value.

Returns:

The latch A value.

Return type:

int

define_latch_B(value: int)

Define the latch B value. Latch B is used to set the delay on one line of the SY89297U chip.

Parameters:

value (int) – The delay value.

Returns:

The latch B value.

Return type:

int

name = 'SY89297U'
pack_two_10bit_values(A: int, B: int)
reverse_bits_10bit(number: int) int

Reverse the bits of a 10-bit number.

Parameters:

number (int) – The number to reverse the bits of.

Returns:

The reversed number

Return type:

int

send_delay(hi: HardwareInterface, value: int, unit: str, channel: int, top, mid, bottom, *args, **kwargs)

Send the delay value to the SY89297U chip.

Parameters:
  • hi (HardwareInterface) – The hardware interface object.

  • value (int) – The delay value.

  • unit (str) – The unit of the delay value.

Returns:

None

Module contents