aboutsummaryrefslogtreecommitdiff
path: root/examples/rp/src/bin/pio_async.rs
Commit message (Collapse)AuthorAgeFilesLines
* Rustfmt for edition 2024.Dario Nieuwenhuis2025-10-061-1/+1
|
* executor: return error when creating the spawntoken, not when spawning.Dario Nieuwenhuis2025-08-291-3/+3
|
* Remove Peripheral trait, rename PeripheralRef->Peri.Dario Nieuwenhuis2025-03-271-4/+4
|
* rp/pio: update pio-rs crate, reexport it so users don't get version mismatches.Dario Nieuwenhuis2025-02-181-3/+4
|
* ci: use beta, add secondary nightly ci.Dario Nieuwenhuis2023-12-211-1/+0
|
* rp: relocate programs implicitly during loadpennae2023-07-281-7/+3
| | | | | | | | | | | this removed the RelocatedProgram construction step from pio uses. there's not all that much to be said for the extra step because the origin can be set on the input program itself, and the remaining information exposed by RelocatedProgram can be exposed from LoadedProgram instead (even though it's already available on the pio_asm programs, albeit perhaps less convenient). we do lose access to the relocated instruction iterator, but we also cannot think of anything this iterator would actually be useful for outside of program loading.
* Add descriptions to all RP2040 examples. Some need hardware that was not ↵Henrik Berg2023-07-131-1/+10
| | | | specified.
* rp/pio: use bind_interrupts for irqspennae2023-07-071-2/+7
| | | | closes #1338
* rp: don't use SetConfig trait in PWM and PIO.Dario Nieuwenhuis2023-05-131-1/+0
| | | | | | It was intended to allow changing baudrate on shared spi/i2c. There's no advantage in using it for PWM or PIO, and makes it less usable because you have to have `embassy-embedded-hal` as a dep to use it.
* rp/pio: configure state machines with Config structpennae2023-05-061-16/+21
| | | | | | the many individual sets aren't very efficient, and almost no checks were done to ensure that the configuration written to the hardware was actually valid. this adresses both of these.
* rp/pio: add load_program, use_programpennae2023-05-061-19/+6
| | | | | | | | programs contain information we could pull from them directly and use to validate other configuration of the state machine instead of asking the user to pull them out and hand them to us bit by bit. unfortunately programs do not specify how many in or out bits they use, so we can only handle side-set and wrapping jumps like this. it's still something though.
* rp/pio: drop Pio prefix from almost all namespennae2023-05-051-7/+7
| | | | | | it's only any good for PioPin because there it follows a pattern of gpio pin alternate functions being named like that, everything else can just as well be referred to as `pio::Thing`
* rp/pio: wrap sm rx, tx in structs and allow splittingpennae2023-05-031-2/+2
| | | | | | | this *finally* allows sound implementions of bidirectional transfers without blocking. the futures previously allowed only a single direction to be active at any given time, and the dma transfers didn't take a mutable reference and were thus unsound.
* rp/pio: split irqs from state machinespennae2023-05-031-4/+5
| | | | | | | | | we can only have one active waiter for any given irq at any given time. allowing waits for irqs on state machines bypasses this limitation and causes lost events for all but the latest waiter for a given irq. splitting this out also allows us to signal from state machines to other parts of the application without monopolizing state machine access for the irq wait, as would be necessary to make irq waiting sound.
* rp/pio: remove PioStateMachineInstancepennae2023-05-031-1/+1
| | | | | | | move all methods into PioStateMachine instead. the huge trait wasn't object-safe and thus didn't have any benefits whatsoever except for making it *slightly* easier to write bounds for passing around state machines. that would be much better solved with generics-less instances.
* rp/pio: PioStateMachine{Instance, => ,Instance}pennae2023-05-031-6/+6
| | | | next step: get rid of the insance trait entirely
* rp/pio: add PioPin traitpennae2023-05-031-4/+3
| | | | | pio can only access pins in bank 0, so it doesn't make sense to even allow wrapping of other banks' pins.
* rp/pio: drop SmInstance{,Base}pennae2023-05-021-7/+7
| | | | these are just overly convoluted ways of writing down numbers.
* rp/pio: make PioCommon a structpennae2023-05-021-6/+4
| | | | | the PioCommon trait does not serve much of a purpose; there can be only two implementations and they only differ in a few associated constants.
* rp/pio: PioInstance::split -> Pio::newpennae2023-05-021-9/+15
| | | | | | | not requiring a PioInstance for splitting lets us split from a PeripheralRef or borrowed PIO as well, mirroring every other peripheral in embassy_rp. pio pins still have to be constructed from owned pin instances for now.
* rp/pio: remove PioPeripheralpennae2023-05-021-8/+8
| | | | | | merge into PioInstance instead. PioPeripheral was mostly a wrapper around PioInstance anyway, and the way the wrapping was done required PioInstanceBase<N> types where PIO{N} could've been used instead.
* rp/pio: write instr memory only from commonpennae2023-05-011-10/+18
| | | | | | | | | | | | | | | instruction memory is a shared resource. writing it only from PioCommon clarifies this, and perhaps makes it more obvious that multiple state machines can share the same instructions. this also allows *freeing* of instruction memory to reprogram the system, although this interface is not entirely safe yet. it's safe in the sense rusts understands things, but state machines may misbehave if their instruction memory is freed and rewritten while they are running. fixing this is out of scope for now since it requires some larger changes to how state machines are handled. the interface provided currently is already unsafe in that it lets people execute instruction memory that has never been written, so this isn't much of a drawback for now.
* rp/pio: move non-sm-specific methods to PioCommonpennae2023-05-011-7/+13
| | | | | | | | | | pin and irq operations affect the entire pio block. with pins this is not very problematic since pins themselves are resources, but irqs are not treated like that and can thus interfere across state machines. the ability to wait for an irq on a state machine is kept to make synchronization with user code easier, and since we can't inspect loaded programs at build time we wouldn't gain much from disallowing waits from state machines anyway.
* Fix a typo in "PioPeripheral"sekoia2023-02-151-1/+1
|
* Added RelocateProgram class for adjusting PIO-programs for different origins.Simon Berg2022-12-091-12/+19
|
* PIO support for RPi PicoSimon Berg2022-12-091-0/+105