13
13
import PSL .commands_proto as CP
14
14
from PSL import logic_analyzer
15
15
from PSL import packet_handler
16
- from PSL import sciencelab
16
+ from PSL . waveform_generator import PWMGenerator
17
17
18
18
EVENTS = 2495
19
19
FREQUENCY = 1e5
@@ -31,15 +31,13 @@ def la(handler, request):
31
31
In integration test mode, this function also enables the PWM output.
32
32
"""
33
33
if not isinstance (handler , packet_handler .MockHandler ):
34
- psl = sciencelab .connect ()
35
- psl .H .disconnect ()
36
- psl .H = handler
37
- enable_pwm (psl , request .node .name )
34
+ pwm = PWMGenerator (handler )
35
+ enable_pwm (pwm , request .node .name )
38
36
handler ._logging = True
39
37
return logic_analyzer .LogicAnalyzer (handler )
40
38
41
39
42
- def enable_pwm (psl : sciencelab . ScienceLab , test_name : str ):
40
+ def enable_pwm (pwm : PWMGenerator , test_name : str ):
43
41
"""Enable PWM output for integration testing."""
44
42
low_frequency_tests = (
45
43
"test_capture_four_low_frequency" ,
@@ -55,15 +53,11 @@ def enable_pwm(psl: sciencelab.ScienceLab, test_name: str):
55
53
else :
56
54
frequency = FREQUENCY
57
55
58
- psl .sqrPWM (
59
- freq = frequency ,
60
- h0 = DUTY_CYCLE ,
61
- p1 = 0 ,
62
- h1 = DUTY_CYCLE ,
63
- p2 = 0 ,
64
- h2 = DUTY_CYCLE ,
65
- p3 = 0 ,
66
- h3 = DUTY_CYCLE ,
56
+ pwm .generate (
57
+ ["SQ1" , "SQ2" , "SQ3" , "SQ4" ],
58
+ frequency ,
59
+ DUTY_CYCLE ,
60
+ 0 ,
67
61
)
68
62
69
63
0 commit comments