Low Level Commands

class SynchronizeCommand(*, cookie, output, raster)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0x0', 'bits': 4, 'type': 3}, {'name': 'raster', 'bits': 1}, {'name': 'output', 'bits': 1}, {'bits': 2}]}{'config': {'vflip': True, 'hflip': True, 'lanes': 0, 'offset': 8}, 'reg': [{'name': 'cookie', 'bits': 16}]}
Parameters:
  • cookie (u16) – Arbitrary value for synchronization. When received, returned as-is in an USB IN frame.

  • output (OutputMode)

  • raster (bool)

class AbortCommand[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0x1', 'bits': 4, 'type': 3}, {'bits': 4}]}

End the current RasterRegionCommand

class FlushCommand[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0x2', 'bits': 4, 'type': 3}, {'bits': 4}]}

Submits the data in the FPGA FIFO over USB, regardless of whether the FIFO is full.

class ExternalCtrlCommand(enable)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0x3', 'bits': 4, 'type': 3}, {'name': 'enable', 'bits': 1}, {'bits': 3}]}

Enable or disable external control of the beam

Parameters:

enable (bool)

class BeamSelectCommand(beam_type)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0x4', 'bits': 4, 'type': 3}, {'name': 'beam_type', 'bits': 2}, {'bits': 2}]}

Select a beam type. Blanking will be enabled on all other beams if blanking IO is available.

Parameters:

beam_type (BeamType)

class BlankCommand(enable, inline=False)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0x5', 'bits': 4, 'type': 3}, {'name': 'enable', 'bits': 1}, {'name': 'inline', 'bits': 1}, {'bits': 2}]}

Triggers beam blanking. Pin assignment of blanking signals depends on your microscope specific pinout

Parameters:
  • enable (bool) – True if blanking, False if unblanking.

  • inline (bool) – True if blanking in sync with the next pixel, False if blanking immediately upon command execution. Defaults to False.

class DelayCommand(delay)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0x6', 'bits': 4, 'type': 3}, {'bits': 4}]}{'config': {'vflip': True, 'hflip': True, 'lanes': 0, 'offset': 8}, 'reg': [{'name': 'delay', 'bits': 16}]}

Starts a counter, pausing execution of subsequent commands until the time is up. One unit of delay is one 48MHz clock cycle, or 20.83 ns.

Parameters:

delay (u16)

class RasterRegionCommand(x_range, y_range)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0xa', 'bits': 4, 'type': 3}, {'bits': 4}]}{'config': {'vflip': True, 'hflip': True, 'lanes': 3, 'offset': 8}, 'reg': [{'name': 'x_start', 'bits': 16}, {'name': 'x_count', 'bits': 16}, {'name': 'x_step', 'bits': 16}, {'name': 'y_start', 'bits': 16}, {'name': 'y_count', 'bits': 16}, {'name': 'y_step', 'bits': 16}]}

Sets the region of the internal raster scanner module. Takes two DAC code ranges (X andas input.

Parameters:
class RasterPixelCommand(dwell_time, output_en=OutputEnable.Enabled)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0xb', 'bits': 4, 'type': 3}, {'name': 'output_en', 'bits': 1}, {'bits': 3}]}{'config': {'vflip': True, 'hflip': True, 'lanes': 0, 'offset': 8}, 'reg': [{'name': 'dwell_time', 'bits': 16}]}

One pixel dwell value. The position at which this pixel is executed depends on the current RasterRegionCommand.

Parameters:
class ArrayCommand(command, array_length)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0x8', 'bits': 4, 'type': 3}, {'bits': 4}]}{'config': {'vflip': True, 'hflip': True, 'lanes': 1, 'offset': 8}, 'reg': [{'name': 'command', 'bits': 8}, {'name': 'array_length', 'bits': 16}]}

ArrayCommand allows compressing multiple payloads with the same header.

Example

Constructing an array of RasterPixelCommand:

cmds = bytearray()
cmds.extend(bytes(
    ArrayCommand(
        command = RasterPixelCommand.header(
            output_en=OutputEnable.Enabled
            ),
        array_length = 6)
))
dwells = [1,1,2,3,5,8]
cmds.extend(struct.pack('>6H', *dwells))

The equivalent series of individual commands:

cmds = bytearray()
dwells = [1,1,2,3,5,8]
cmds.extend(bytes(
    RasterPixelCommand(
        output_en=OutputEnable.Enabled,
        dwell_time = dwell
    ),
))
Parameters:
class RasterPixelFillCommand(dwell_time)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0x9', 'bits': 4, 'type': 3}, {'bits': 4}]}{'config': {'vflip': True, 'hflip': True, 'lanes': 0, 'offset': 8}, 'reg': [{'name': 'dwell_time', 'bits': 16}]}
Parameters:

dwell_time (DwellTime)

class RasterPixelRunCommand(length, dwell_time, output_en=OutputEnable.Enabled)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0xc', 'bits': 4, 'type': 3}, {'name': 'output_en', 'bits': 1}, {'bits': 3}]}{'config': {'vflip': True, 'hflip': True, 'lanes': 1, 'offset': 8}, 'reg': [{'name': 'length', 'bits': 16}, {'name': 'dwell_time', 'bits': 16}]}

One pixel dwell value, to be repeated for a specified length. The position at which these pixels are executed depends on the current RasterRegionCommand.

Parameters:
class RasterPixelFreeRunCommand(dwell_time)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0xd', 'bits': 4, 'type': 3}, {'bits': 4}]}{'config': {'vflip': True, 'hflip': True, 'lanes': 0, 'offset': 8}, 'reg': [{'name': 'dwell_time', 'bits': 16}]}

One pixel dwell value, to be repeated indefinitely. The position at which these pixels are executed depends on the current RasterRegionCommand.

Parameters:

dwell_time (DwellTime)

class VectorPixelCommand(x_coord, y_coord, dwell_time, output_en=OutputEnable.Enabled)[source]
{'config': {'vflip': True, 'lanes': 1}, 'reg': [{'name': '0xe', 'bits': 4, 'type': 3}, {'name': 'output_en', 'bits': 1}, {'bits': 3}]}{'config': {'vflip': True, 'hflip': True, 'lanes': 1, 'offset': 8}, 'reg': [{'name': 'x_coord', 'bits': 16}, {'name': 'y_coord', 'bits': 16}, {'name': 'dwell_time', 'bits': 16}]}

Sets DAC output to the coordinate X, Y for the specified dwell time.

Parameters: