mirror of https://github.com/m-labs/artiq.git
ttl: add timestamp()
This commit is contained in:
parent
e95b66f114
commit
5f5227f01f
|
@ -196,13 +196,23 @@ class TTLInOut:
|
||||||
|
|
||||||
@kernel
|
@kernel
|
||||||
def timestamp_mu(self):
|
def timestamp_mu(self):
|
||||||
"""Poll the RTIO input and returns an event timestamp, according to
|
"""Poll the RTIO input and returns an event timestamp (in machine
|
||||||
the gating.
|
units), according to the gating.
|
||||||
|
|
||||||
If the gate is permanently closed, returns a negative value.
|
If the gate is permanently closed, returns a negative value.
|
||||||
"""
|
"""
|
||||||
return syscall("ttl_get", self.channel, self.i_previous_timestamp)
|
return syscall("ttl_get", self.channel, self.i_previous_timestamp)
|
||||||
|
|
||||||
|
@kernel
|
||||||
|
def timestamp(self):
|
||||||
|
"""Poll the RTIO input and returns an event timestamp (in seconds),
|
||||||
|
according to the gating.
|
||||||
|
|
||||||
|
If the gate is permanently closed, returns a negative value.
|
||||||
|
"""
|
||||||
|
return mu_to_seconds(
|
||||||
|
syscall("ttl_get", self.channel, self.i_previous_timestamp))
|
||||||
|
|
||||||
|
|
||||||
class TTLClockGen:
|
class TTLClockGen:
|
||||||
"""RTIO TTL clock generator driver.
|
"""RTIO TTL clock generator driver.
|
||||||
|
|
Loading…
Reference in New Issue