Skip to content

Commit 2a22758

Browse files
committed
Change txuart example to use Program
1 parent 666f4ef commit 2a22758

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

examples/txuart.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import rp2pio
66
import adafruit_pioasm
77

8-
code = adafruit_pioasm.assemble(
8+
code = adafruit_pioasm.Program(
99
"""
1010
.program uart_tx
1111
.side_set 1 opt
@@ -25,16 +25,15 @@
2525

2626
class TXUART:
2727
def __init__(self, *, tx, baudrate=9600):
28-
self.pio = rp2pio.StateMachine(
29-
code,
28+
self.pio = rp2pio.StateMachine(code.assembled,
3029
first_out_pin=tx,
3130
first_sideset_pin=tx,
3231
frequency=8 * baudrate,
3332
initial_sideset_pin_state=1,
3433
initial_sideset_pin_direction=1,
3534
initial_out_pin_state=1,
3635
initial_out_pin_direction=1,
37-
sideset_enable=True,
36+
**code.pio_kwargs
3837
)
3938

4039
@property

0 commit comments

Comments
 (0)