This repository has been archived on 2025-01-25. You can view files and clone it, but cannot push or open issues or pull requests.
rp2040_projects/pio/squarewave/squarewave_wrap.pio
graham sanderson 46078742c7 Initial Release
2021-01-20 16:45:01 -06:00

20 lines
642 B
Plaintext

;
; Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
;
; SPDX-License-Identifier: BSD-3-Clause
;
; Note that if you modify squarewave.c to include this program, you'll also
; need to set the wrap registers yourself. This would be handled for you by
; squarewave_program_get_default_config().
.program squarewave_wrap
; Like squarewave, but use the state machine's .wrap hardware instead of an
; explicit jmp. This is a free (0-cycle) unconditional jump.
set pindirs, 1 ; Set pin to output
.wrap_target
set pins, 1 [1] ; Drive pin high and then delay for one cycle
set pins, 0 [1] ; Drive pin low and then delay for one cycle
.wrap