// ---------------------------------------------------------------- //
// This file is autogenerated by pioasm version 2.3.1; do not edit! //
// ---------------------------------------------------------------- //

#pragma once

#if !PICO_NO_HARDWARE
#include "hardware/pio.h"
#endif

#ifdef __cpp_constexpr
#define __pio_const constexpr
#else
#define __pio_const const
#endif

// --------- //
// pwm_audio //
// --------- //

#define pwm_audio_wrap_target 1
#define pwm_audio_wrap 9
#define pwm_audio_pio_version 0

#define pwm_audio_offset_entry_point 7u

static __pio_const uint16_t pwm_audio_program_instructions[] = {
    0xa242, //  0: nop                           [2]
            //     .wrap_target
    0x6001, //  1: out    pins, 1
    0xb826, //  2: mov    x, isr          side 1
    0x0043, //  3: jmp    x--, 3
    0xb022, //  4: mov    x, y            side 0
    0x0045, //  5: jmp    x--, 5
    0x00e0, //  6: jmp    !osre, 0
    0x80a0, //  7: pull   block
    0x60c8, //  8: out    isr, 8
    0x6048, //  9: out    y, 8
            //     .wrap
};

#if !PICO_NO_HARDWARE
static __pio_const struct pio_program pwm_audio_program = {
    .instructions = pwm_audio_program_instructions,
    .length = 10,
    .origin = -1,
    .pio_version = pwm_audio_pio_version,
#if PICO_PIO_VERSION > 0
    .used_gpio_ranges = 0x0
#endif
};

static inline pio_sm_config pwm_audio_program_get_default_config(uint offset) {
    pio_sm_config c = pio_get_default_sm_config();
    sm_config_set_wrap(&c, offset + pwm_audio_wrap_target, offset + pwm_audio_wrap);
    sm_config_set_sideset(&c, 2, true, false);
    return c;
}
#endif

