API Documentation
saleae.data
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 is to subtract two GraphTime
s to produce a GraphTimeDelta
. GraphTimeDelta
s may be freely added and subtracted from each other, and converted to floating point seconds. They can also be added to or subtracted from GraphTime
s 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
.
class saleae.data.AnalogData(raw_samples: ndarray, voltage_transform_gain: float, voltage_transform_offset: float, start_time: saleae.data.timing.GraphTime, end_time: saleae.data.timing.GraphTime)
iter()
Iterates over the samples in this instance as voltage values.
sample_count
The number of samples contained in this instance.
slice_samples(slice: slice) -> saleae.data.AnalogData
Allows creating an AnalogData from a subset of this one's samples.
samples
Samples after applying voltage scaling.
saleae.range_measurements
saleae.range_measurements
class saleae.range_measurements.DigitalMeasurer(requested_measurements: List[str])
class saleae.range_measurements.AnalogMeasurer(*args, **kwargs)
saleae.analyzers
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.
A frame produced by an analyzer. The types of frames and the fields in each will depend on the analyzer.
Variables
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.
Last updated