PyICe.spi_instrument

Channel Wrapper for SPI Devices

Classes

spiInstrument(name, spiInterface[, ...]) Instrument wrapper for basic linear shift register SPI port.
class PyICe.spi_instrument.spiInstrument(name, spiInterface, write_shift_register=None, read_shift_register=None)[source]

Bases: PyICe.lab_core.instrument, PyICe.lab_core.delegator

Instrument wrapper for basic linear shift register SPI port. Not apprpriate for context-sensitive (sub addressed) memory.

add_channel(channel_name)
Usage: Add channel name to instrument. For multi-channel instruments,
typically also takes a second argument representing the physical channel of the instrument. May also take channel configuration arguments specific to the instrument.

Operation: This method should create the channel object then call self._add_channel(channel) to add it to the internal channel group

Method must be overloaded by each instrument driver.
add_channel_transceive_enable(channel_name)[source]

Add channel to enable/disable SPI port communication. This can be used to serially change multiple bit fields before sending the data to the SPI slave with a single transaction. Note that communication is disabled indepent of this setting if not all writable bit fields have been initialized. Also note that after communication is enabled, a SPI transceive will not take place until a bit field is read or written.

get_error()

Return the first error from the instrument. Overload in scpi_instrument or the actual instrument class

get_errors()

Return a list of all errors from the instrument. Overload in scpi_instrument or the actual instrument class

get_flat_channel_group(name=None)

returns a channel_group directly containing all channels this one can resolve

merge_in_channel_group(channel_group_object)

merges in a channel group

read_all_channels(categories=None, exclusions=[])

read all readable channels in channel group and return orderd dictionary of results. Optionally filter by list of categories.

read_channels(item_list)

item list is a list of channel objects, names or channel_groups

read_delegated_channel_list(channels)[source]

private

resolve_channel_list(item_list)

takes a list of channels, channel_names, or channel_groups and produces a single channel group

write_html(file_name=None, verbose=True, sort_categories=False)

return html document string and optionally write to file_name if verbose, include tables of presets and attributes for each channel if sort_categories, group channel names first by category before alphabetical sort of channel name