API Documentation

saleae.data

class saleae.data.GraphTime(datetime: datetime, millisecond=0, *, microsecond=0, nanosecond=0, picosecond=0)

A high-precision wall clock time.

The primary way to use this type of value is to subtract two GraphTimes to produce a GraphTimeDelta. GraphTimeDeltas may be freely added and subtracted from each other, and converted to floating point seconds. They can also be added to or subtracted from GraphTimes to produce a suitable offset GraphTime.

Constructs a GraphTime using a datetime, and optionally sub-millisecond precision values.

The sub-millisecond precision values must be converible to float.

_add_()

Add a GraphTimeDelta value to produce a new GraphTime.

_str_()

Converts GraphTime to an ISO 8601 string with picosecond precision.

Timezone is always UTC, using the Z suffix.

_sub_()

Subtract a GraphTime or GraphTimeDelta value.

When subtracting a GraphTime, produces a GraphTimeDelta.When subtracing a GraphTimeDelta, produces a GraphTime.

as_datetime(self: GraphTimedatetime)

Produces a datetime value that is as close as possible to the given value.

The produced datetime is always timezone aware an in the UTC timezone. Local time can be procured using the standard Python datetime conversion functions.

class saleae.data.GraphTimeDelta(second=0, millisecond=0, *, microsecond=0, nanosecond=0, picosecond=0)

A high-precision duration.

Constructs a GraphTimeDelta using numerical values.

All values must be convertible to float. Multiple prefixes may be specified, the resulting value will be all the values added together.

_add_()

Add a GraphTimeDelta value to produce a new GraphTimeDelta.

_eq_()

Determine if two GraphTimeDelta values are equal, up to a tolerance.

_float_()

Convert to a floating point number of seconds. Note that this can cause a loss of precision for values > 1ms.

_ge_()

Determine if the first GraphTimeDelta value is greater than or equal to the second, up to a tolerance.

_gt_()

Determine if the first GraphTimeDelta value is greater than the second, up to a tolerance.

_le_()

Determine if the first GraphTimeDelta value is less than or equal to the second, up to a tolerance.

_lt_()

Determine if the first GraphTimeDelta value is less than the second, up to a tolerance.

_ne_()

Determine if two GraphTimeDelta values are not equal, up to a tolerance.

_sub_()

Subtract a GraphTimeDelta value to produce a new GraphTimeDelta.

saleae.range_measurements

class saleae.range_measurements.DigitalMeasurer(requested_measurements: List[str])

class saleae.range_measurements.AnalogMeasurer(*args, **kwargs)

saleae.analyzers

class saleae.analyzers.HighLevelAnalyzer()

Base class for High Level Analyzers. Subclasses must implement the decode() function

decode(frame: saleae.analyzers.high_level_analyzer.AnalyzerFrame)

Decode a frame from an input analyzer, and return None or 1 or more AnalyzerFrame objects.

class saleae.analyzers.AnalyzerFrame(type: str, start_time: saleae.data.timing.GraphTime, end_time: saleae.data.timing.GraphTime, data: dict = None)

A frame produced by an analyzer. The types of frames and the fields in each will depend on the analyzer.

  • Variables

  • type (str) – Frame type

  • start_time (saleae.data.GraphTime) – Start of frame

  • end_time (saleae.data.GraphTime) – End of frame

  • data (dict) – Key/value data associated with this frame

class saleae.analyzers.StringSetting(**kwargs)

String setting.

class saleae.analyzers.NumberSetting(*, min_value=None, max_value=None, **kwargs)

Number setting, with an option min_value/max_value.

class saleae.analyzers.ChoicesSetting(choices, **kwargs)

Choices setting.