Using the full module structure generated by the intrinsics macro
interacts oddly with inlining on some optimization levels, causing
a duplicate identical function body to be generated. This doesn't
affect performance, but it wastes space, so just declare the alias
directly which seems to cause the symbol to be aliased as it should
be.
* add example of synchronized PIOs
* Synchronize state machines using WAIT IRQ instruction
* Use "irq wait 0" instead of "wait 1 irq 0"
This way, the initial value of the interrupt flag doesn't matter
* Start state machines synchronized without IRQ WAIT instruction
* Improve API
Co-authored-by: Andrew Straw <strawman@astraw.com>
* Add an rp2040 specific #[entry] macro.
This macro extends the one from cortex-m-rt by code to unlock
all spinlocks on boot.
* Idiomatic pointer arithmetic
Apply suggestion by @9names, improving address calculations.
(This doesn't change the generated code at opt levels 2 or "z".)
Co-authored-by: 9names <60134748+9names@users.noreply.github.com>
* Update BSP authors to include 'rp-rs developers'
* Update BSP readme's to reflect current release version
* Update BSP changelogs
* Fix version number in HAL README
* Update changelog for 0.4.0 release
* Enable rt feature for irq example in Cargo.toml
* Bump pio/pio-proc deps to 0.2.0, update pio examples
* Update BSPs to latest ws2812-pio, remove unused pio dep
* Fix usage of pio_proc in doc comment
* Clean up pio doc-example
* Update rp-pico to latest i2c-pio
Co-authored-by: Jan Niehusmann <jan@gondor.com>
Fix a few function signatures that don't match the ROM according to the
datasheet.
_memset4 also has a wrong code in the datasheet, so match it to the
actual ROM.
Make all ROM functions (normal and floating point) provide both a direct
call that does the operation and a module with a ptr() function to get
the function pointer.
Somehow we already had a bunch of commits talking about 0.3.0, but it
was never released. Hence why this maybe doesn't change as many version
numbers as you might expect.
* Update to PIO 0.1.0
* Update to latest ws2812-pio and i2c-pio.
These depend on pio 0.1.0, avoiding a conflict
* Rename CI tests.
Also check we can cargo build. And remove 'on host tests' that didn't
do anything.
Co-authored-by: Jonathan Pallant <jonathan.pallant@42technology.com>
* Add basic multicore fifo example
* Add documentation for multicore
* Send system_clock frequency to core1 over FIFO in example
* Add Stack::new() to HAL. Use Stack::new() in example
* Add boot2 feature. Add boot2 linkage into each BSP optional on feature
* Enable boot2 feature in BSPs by default. Remove boot2 decl from all BSP examples
* Add EXTERN in memory.x for BOOT2_FIRMWARE, rename bootloader static slice to BOOT2_FIRMWARE
* Update new examples and itsy_bitsy BSP to use boot2 feature
* Remove boot2 as a dev-dependency for the BSPs, no longer needed
* Add no_mangle BOOT2_FIRMWARE to adafruit_macropad
* Fix itsy-bitsy blinky - it wasn't using the BSP, so it didn't get BOOT2_FIRMWARE linked in
* Add basic interrupt_disable+spinlock critical-section
* Update impl based on feedback from jannic
* Get rid of count variable, switch to AtomicU8 for lock state
* Remove interrupt::disable that isn't necessary for safety
* Rename variables, re-write most of the comments
* Add fences to ensure ordering
Start to address #186 (Safety requirement must be verbosely advertised to not be overlooked in future changes).
#177 (Mark PIO StateMachine, Rx and Tx as Send) added the Send trait to StateMachine, Tx and Rx, That documentation was expanded as suggested.
PIO, UninitStateMachine, Interrupt were marked Send before #177, added some documentation to those as well.
* Implement peripheral support for i2c and an advanced example for the pico board.
* Simplify i2c peripheral bootstrap and add a "free" function to allow switching modes.
* Set dependency to futures & nostd_async to specific version/revision.
* move enum & struct to the start of the file
* Add a bit of documentation to the pico_i2c_controller_peripheral demo.
* Migrate to pico_i2c_controller_peripheral to embassy & simplify the peripheral support
nostd_async is broken since last stable roll out.
The pico_i2c_controller_peripheral is being migrated to use embassy's executor.
The Controller Async API is now aligned with embassy's traits to facilitate integration.
The peripheral no longer require async to run and now appears as an event iterator.
Embassy's support relies on unstable features (generic_associated_types and type_alias_impl_traits)
and is therefore gated behind the `embassy-traits` feature flag.
* make futures & embassy optional for the pico board too
* Pin embassy to a specific rev.
* Impl embassy_traits::i2c::WriteIter & enable unlimited transfer size on i2c
* Applies comment suggestion from @9names for the advanced i2c example.
Co-authored-by: 9names <60134748+9names@users.noreply.github.com>
* use `I2C block` instead of `IP`.
* Fix formatting (unnecessary space at end of line)
* Enhance explanation for why `rd_req()` is not cleared in `Iterator::next`'s
implementation.
Co-authored-by: 9names <60134748+9names@users.noreply.github.com>
* Use volatile register access for gpio interrupts
* Provide functions for atomic register updates
* Use atomic register access functions in pio.rs
* Improve doc comments
* Limit visibility of atomic register access functions
Also remove write_xor for now, as it's not yet used anywhere
* Implements methods to allow presetting the pin state & direction
Enabling those methods allows to save a few valuable instructions
in the PIO's memory.
* Use IntoIterator rather than Iterator.
* Use proper types instead of bool to be more idiomatic.
* Change set_pindirs_with_mask to a more idiomatic rust approach.
* Update pio_proc_blink with new set_pindirs_with_iter
* Force reset on startup to guaranty consistency with type-states.
* Expose more accessors to allow more advanced driver to be implemented.
* Add the ability to restart the state machine from its wrap point.
This method also clears the ISR/OSR to give the state machine a clean
restart.
* Add a comment about the impact of autopull on OUT & PULL instructions
* Fix broken internal doc reference & add an important note on Tx<SM>::has_stalled
* rename block methods to register_block.
This change is made to avoid confusion with "block" as a verb.
* Implements methods to allow presetting the pin state & direction
Enabling those methods allows to save a few valuable instructions
in the PIO's memory.
* Update pio_proc_blink with new set_pindirs