Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rp2040: Add support for PIO's jmp_pin #174

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

Grazfather
Copy link
Contributor

This field is a bit tricky: It belongs to the EXECCTRL register, while most of the other fields can determined based on the directives used in the assembled program, this one has to be set explicitly. This makes it so that we have to plumb some way to explicitly set the field. I did this by making LoadAndStartProgramOptions take ExecOptions, but this isn't perfect, because if a user sets other fields, they will be ignored in favour of the values set in the program.

@Grazfather
Copy link
Contributor Author

Tested with a simple pio program:

        \\.program blink
        \\
        \\mainloop:
        \\    jmp pin mainloop
        \\    set y, 31
        \\    set pins 0 [31]
        \\delay_off:
        \\    jmp y--, delay_off
        \\    set y, 31
        \\    set pins, 1 [31]
        \\delay_on:
        \\    jmp y--, delay_on
        \\    jmp mainloop

This simply blinks the built-in LED unless the jmp_pin is high.

This field is a bit tricky: It belongs to the EXECCTRL register, while
most of the other fields can determined based on the directives used in
the assembled program, this one has to be set explicitly. This makes it
so that we have to plumb some way to explicitly set the field. I did
this by making `LoadAndStartProgramOptions` take `ExecOptions`, but this
isn't perfect, because if a user sets other fields, they will be ignored
in favour of the values set in the program.
@Grazfather Grazfather changed the title wip: rp2040: Add support for PIO's jmp_pin rp2040: Add support for PIO's jmp_pin Feb 20, 2024
@ikskuh ikskuh merged commit 245401a into ZigEmbeddedGroup:main Feb 23, 2024
2 checks passed
@Grazfather Grazfather deleted the rp2040_pio_jmp_pin branch February 23, 2024 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants