2 ; Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
4 ; SPDX-License-Identifier: BSD-3-Clause
7 ; SET pin 0 should be mapped to your LED GPIO
14 set pins, 1 ; Turn LED on
16 jmp x-- lp1 ; Delay for (x + 1) cycles, x is a 32 bit number
18 set pins, 0 ; Turn LED off
20 jmp x-- lp2 ; Delay for the same number of cycles again
21 .wrap ; Blink forever!
25 // this is a raw helper function for use by the user which sets up the GPIO output, and configures the SM to output on a particular pin
27 void blink_program_init(PIO pio, uint sm, uint offset, uint pin) {
28 pio_gpio_init(pio, pin);
29 pio_sm_set_consecutive_pindirs(pio, sm, pin, 1, true);
30 pio_sm_config c = blink_program_get_default_config(offset);
31 sm_config_set_set_pins(&c, pin, 1);
32 pio_sm_init(pio, sm, offset, &c);