Commit f9cbd675 authored by Lucas Giardino's avatar Lucas Giardino

agrego opciones de profile en algunas funciones

parent 30daff26
from artiq.experiment import *
#from typing import TFloat
class UrukulCh(HasEnvironment):
"""Urukul single freq class
......@@ -6,7 +7,7 @@ class UrukulCh(HasEnvironment):
Set the frecuencies/amplitudes of each Urukul channel
"""
def build(self, ch=0, freq=100.0, amp=1.0, name=None):
def build(self, ch: TInt32=0, freq: TFloat=100.0, amp: TFloat=1.0, name=None):
self.ch = ch
self.amp = amp
self.freq = freq
......@@ -39,8 +40,8 @@ class UrukulCh(HasEnvironment):
self.channel.init()
@kernel
def set_channel(self):
self.channel.set(self.frequency, amplitude=self.amplitude)
def set_channel(self, profile: TInt32=0):
self.channel.set(self.frequency, amplitude=self.amplitude, profile=profile)
if self.state == True:
self.channel.sw.on()
......@@ -48,8 +49,15 @@ class UrukulCh(HasEnvironment):
self.channel.sw.off()
@kernel
def set_frequency(self, freq):
self.channel.set(freq, amplitude=self.amplitude)
def select_profile(self, number: TInt32):
self.channel.cpld.set_profile(number)
@kernel
def set_frequency(self, freq: TFloat, profile: TInt32=0):
self.channel.set(freq, amplitude=self.amplitude, profile=profile)
def get_frequency(self) -> TFloat:
return self.frequency
@kernel
def on(self):
......@@ -60,13 +68,13 @@ class UrukulCh(HasEnvironment):
self.channel.sw.off()
@kernel
def set_o(self, state):
def set_o(self, state: TBool):
self.channel.sw.set_o(state)
@kernel
def pulse_mu(self, delay_time_mu):
def pulse_mu(self, delay_time_mu: TInt64):
self.channel.sw.pulse_mu(delay_time_mu)
@kernel
def pulse(self, delay_time):
def pulse(self, delay_time: TFloat):
self.channel.sw.pulse(delay_time)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment