Skip to content

Commit

Permalink
tests/psoc6: Pin.irq test and Periodic Timer test.
Browse files Browse the repository at this point in the history
Signed-off-by: IFX-Anusha <[email protected]>
  • Loading branch information
IFX-Anusha authored and actions-user committed Dec 21, 2023
1 parent 5b969d9 commit 65f4083
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tests/psoc6/dut/pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@

pin_out.off()
print("pin out value off: ", pin_in.value() == 0)

pin_in.irq(handler=lambda t:print("Interrupt triggered"),trigger=Pin.IRQ_RISING|Pin.IRQ_FALLING)
pin_out.high()
1 change: 1 addition & 0 deletions tests/psoc6/dut/pin.py.exp
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ pin out value high: True
pin out value low: True
pin out value on: True
pin out value off: True
Interrupt triggered
12 changes: 10 additions & 2 deletions tests/psoc6/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@
from machine import Timer

t = Timer(0)
t.init(period=2000, mode=Timer.ONE_SHOT, callback=lambda t: print("hello"))
time.sleep_ms(3000)
t.init(period=2000, mode=Timer.ONE_SHOT, callback=lambda t: print("Oneshot Timer"))
time.sleep(30)
t.deinit()
t1 = Timer(0)
t1.init(period=2000, mode=Timer.PERIODIC, callback=lambda t: print("Periodic Timer"))
for i in range(200000):
pass

t.deinit()

10 changes: 9 additions & 1 deletion tests/psoc6/timer.py.exp
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
hello
Oneshot Timer
Periodic Timer
Periodic Timer
Periodic Timer
Periodic Timer
Periodic Timer
Periodic Timer
Periodic Timer
Periodic Timer

0 comments on commit 65f4083

Please sign in to comment.