uart_rx.pio (606B)
1.program uart_rx 2 3.wrap_target 4start: 5 wait 0 pin, 0 [6] ; wait for START bit 6 7 set x, 7 [4] ; read 8 DATA bits and offset 8 ; clock for better readings 9bitloop: 10 in pins, 1 11 jmp x--, bitloop [6] 12 13 jmp pin, outb ; got STOP bit, output byte 14 15error: 16 irq wait 0 ; no STOP bit, 17 wait 1 pin, 0 ; set err IRQ and await reset 18 jmp start 19 20outb: 21 push block 22.wrap