Commit graph

17 commits

Author SHA1 Message Date
Wilfried Chauveau 93ec18be07 migrate rp2040-hal from embedded_time to fugit 2022-08-24 22:46:34 +01:00
Wilfried Chauveau 42e929d7e1
Use rp2040-hal in all example (possibly through their bsp) (#423)
* 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.
2022-08-21 19:01:45 +01:00
Jan Niehusmann b4d0d613e3 Update to critical-section 1.0.0 2022-08-18 06:34:28 +00:00
Wilfried Chauveau 7bfab4ffd2
Implements USB enumeration workaround (RP2040-E5). (#120)
* 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
2022-08-17 22:22:36 +01:00
Jan Niehusmann f8984a9eac Implement conversion from Clock to Hertz using reference
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 `&`.
2022-07-22 20:17:26 +00:00
Jan Niehusmann 99dfeaf6f2
Implement embedded-hal 1.0.0-alpha.8 traits (#366)
* Implement embedded-hal 1.0.0-alpha.8 traits

* Add comment about missing SPI traits
2022-06-24 08:19:41 +10:00
9names 1574a36f7e
Prep for HAL 0.5.0 release (#351)
* 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
2022-06-14 18:04:00 +10:00
Wilfried Chauveau 977bc2732a Remove unmaintained implementation async i2c. 2022-04-30 11:46:30 +10:00
9names b81955c2a8
Prep for 0.4.0 release (#312)
* 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>
2022-03-11 22:37:34 +11:00
9names a40bcc94ea
Add changes since 0.3.0 to changelog (#295) 2022-03-03 14:34:51 +11:00
Jan Niehusmann 402b7f1eb8 Use u32 instead of u64 division in clock calculations
This saves about 1kB of flash by removing
compiler_builtins::int::specialized_div_rem::u64_div_rem if
no other code uses u64 divisions.
2022-02-26 13:33:58 +00:00
Jan Niehusmann 7750781650
Implement embedded-hal 1.0.0-alpha.7 traits (#298)
* embedded-hal v1.0.0-alpha.7 removed several traits

* bump dependency to embedded-hal 1.0.0-alpha.7

* Mention embedded-hal alpha changes in changelog
2022-02-26 21:06:55 +11:00
Emil Fresk b7e56d0869 Added so stopped PIO state machines can change their clock divider 2022-02-26 20:57:12 +11:00
Jonathan Pallant 7278c36e93 Add MSRV 2021-12-20 20:05:40 +00:00
Jonathan Pallant 96c2273dce Noted 0.3.0 includes many bug fixes. 2021-12-20 19:53:15 +00:00
Jonathan Pallant 5701ab431f Revised CHANGELOG.
Added extra items to 0.3.0.
Reformatted 0.2.0 entry.
2021-12-20 19:52:31 +00:00
Jonathan Pallant bebf85d4d9 Set up for 0.3.0 release.
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.
2021-12-19 19:22:15 +00:00
Renamed from CHANGELOG.md (Browse further)