* Prep for HAL 0.6.0 release
* Update changelog, readme and version number for HAL 0.5.0 release
* Bump HAL version in BSP deps
* Add the missing boards to the main README.md
* Implementation of the interpolator.
* corrected formatting
* fixed documentation code
* add clamp flag to LaneCtrl
* addition of an example for the interpolator
* put documentation behind ///
* rewording comment for clarity
* using more idiomatic fn new
There are a lot of non-binary crates depending on rp2040-hal. That way,
the default-features of rp2040-hal may be activated unintentionally
through an indirect dependency. Therefore, a binary crate which wants
to disable the `critical-section-impl` feature to provide its own one
could have a hard time to do so.
In contrast, the board support crates are usually only used by top-level
binary crates. So disabling the default features on those should usually
just work.
Binary crates depending on rp2040-hal directly, which don't use any
board support crate, might need to activate the feature manually. This
is reasonable because those binary crates need to replicate some
boilerplate from the board crates anyhow.
* Use rp2040-hal in all example (possibly through their bsp)
Some of the examples were using the cortex_m_rt::entry method which
misses the device specific spinlock re-initialisation.
This commits makes the usage more consistent by using rp2040_hal exported
macro as the only `entry` method used across examples.
This is a little bit hacky, as it relies on rp2040-hal actually
using (and therefore linking) some defmt code when the defmt feature is
enabled.
However this solution has the advantage that it only affects
dev-dependencies and therefore has no impact on the board crates
themselves.
Closes#420
* Implement rp2040-E5 workaround for usb enumeration.
* Expand documentation and add to pico_usb_serial & pico_usb_twitchy_mouse
* Fix errata-5 documentation around the bus-keep state.
* Update CHANGELOG.md
- Clippy warns about empty loops, https://github.com/rust-lang/rust-clippy/issues/6161
- wfi allows to CPU to save some power
WFI was avoided in examples for fear of ill interactions with debuggers.
However the rp2040 debug port does continue to work, as long as the
relevant clocks are not disabled in SLEEP_EN0/SLEEP_EN1. (By default,
all clocks stay enabled in sleep mode.)
This patch replaces several different workarounds with just calling wfi.
Uses build.rs in board directories to set the linker options locally.
The file .cargo/config can't be used for that, as in a workspace the
local .cargo/config is ignored if the build is triggered from the
workspace root.
Current version of probe-run is 0.3.3, which uses defmt 0.3.2.
With a firmware using defmt 0.2, this causes the following error
message:
```
Error: defmt wire format version mismatch: firmware is using 0.2, `probe-run` supports 3
suggestion: `cargo install` a different version of `probe-run` that supports defmt 0.2
```
Therefore, upgrade defmt dependency, and also fix the linker script
in .cargo/config.
Implementing `impl From<SystemClock> for Hertz` is a footgun, as
SystemClock is not Copy, so the automatic conversion consumes the
owned clock.
This is visible in the example i2c.rs:
```
let mut i2c = hal::I2C::i2c1(
pac.I2C1,
sda_pin,
scl_pin, // Try `not_an_scl_pin` here
400.kHz(),
&mut pac.RESETS,
clocks.peripheral_clock,
);
```
If the user wants to use both `i2c0` and `i2c1` at the same time,
copying from this example won't work:
```
error[E0382]: use of moved value: `clocks.peripheral_clock`
--> rp2040-hal/examples/i2c.rs:106:9
|
97 | clocks.peripheral_clock,
| ----------------------- value moved here
...
106 | clocks.peripheral_clock,
| ^^^^^^^^^^^^^^^^^^^^^^^ value used here after move
|
= note: move occurs because `clocks.peripheral_clock` has type
`PeripheralClock`, which does not implement the `Copy` trait
```
As getting the frequency from a clock doesn't really need ownership,
changing it to `impl From<&SystemClock> for Hertz` is both more
logical and provides better usability.
This is, however, a breaking change: Code relying on this trait
implementation needs to be changed by adding a `&`.
* Update BSP README's to use current version number
* Update ws2812-pio and i2c-pio to release 0.3.0
* Bump patch number for BSPs so we can push with correct docs
* Update changelog, readme and version number for HAL 0.5.0 release
* Bump HAL version in BSP deps
* Point ws2812-pio and i2c-pio-rs at hal_0.5.0 branches
* Update changelog with latest commits and release date
* Add micro servo with pwm working example
Signed-off-by: lucazulian <lucagiuggia@gmail.com>
* Add duty value suggestion
Signed-off-by: lucazulian <lucagiuggia@gmail.com>
* Fix code formatting
* Use CountDown instead of Delay
* Add the Pimoroni Plasma 2040 board
This PR adds the board support package and a simple example.
The example just blinks the on-board RGB LED.
An example should be added for using the board to control an LED strip.
This should probably use smart-leds with the associated PIO driver.
An example or functionality should be added for the current sensor.
* Rename LED data line from dat to data to match schematic
* Add an example for driving WS2812 LEDs
This is pretty much a copy-paste of the awesome pico_ws2812_led example.
* Remove reference in README to rp-pico
* Remove reference to pico board clock speed
I have removed this in the Plasma 2040 repository and where I copied it from, tiny2040_blinky.
* Remove redundant namespace
* Add self-reference in README to the current board's GitHub README
Fix the erroneous link in the pimoroni-tiny2040 README from which I copied.
* 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>
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.