rp-rs / rp-hal

A Rust Embedded-HAL for the rp series microcontrollers
https://crates.io/crates/rp2040-hal
Apache License 2.0
1.42k stars 227 forks source link

PIO example which loads a .hex (compile PIO asm) file #155

Open thejpster opened 2 years ago

thejpster commented 2 years ago

There may be cases where you are using pioasm to compile your PIO code and you want to load a compiled PIO program into your Rust code (maybe also loading the same compiled PIO program in a C program).

We should have an example on how to do that.

9names commented 2 years ago

This would require adding Rust codegen support to pioasm, yes?

thejpster commented 2 years ago

Hmm, I hadn't considered what to do with the C code embedded in the .asm file.

thejpster commented 2 years ago

https://github.com/rp-rs/pio-rs/pull/20 adds support for pulling in a PIO file, and that's probably good enough.