Commit graph

67 commits

Author SHA1 Message Date
Jan Niehusmann e681b67d9c
Merge pull request #444 from jannic/critical-section-default
Enable critical-section-impl by default only from board crates, not from hal
2022-09-02 12:12:45 +02:00
Wilfried Chauveau 8d52f37dd1
Prepare for HAL 0.6.0 release (#430)
* 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
2022-08-26 10:05:56 +01:00
Wilfried Chauveau 93ec18be07 migrate rp2040-hal from embedded_time to fugit 2022-08-24 22:46:34 +01:00
Jan Niehusmann 280de7cb99 Enable critical-section-impl by default only from board crates, not from hal
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.
2022-08-24 14:31:43 +00:00
Jan Niehusmann c1c5e05989 Feature-gate critical-section-impl
For compatibility with earlier versions, this feature is activated by
default. This decision can be revisited later.
2022-08-18 06:35:04 +00: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 96e15ee6de
Merge pull request #415 from jannic/features-vector_table
Enable feature "rt" when compiling vector_table example
2022-08-11 19:21:07 +02:00
Jan Niehusmann 0f33d2b8a6 Enable feature "rt" when compiling vector_table example
Without this change, building the vector_table example fails when
building from the rp2040-hal directory:

```
rp2040-hal$ cargo build --release --example vector_table
   Compiling rp2040-hal v0.5.0 (rp2040-hal)
error[E0432]: unresolved import `pac::interrupt`
  --> rp2040-hal/examples/vector_table.rs:30:5
   |
30 | use pac::interrupt;
   |     ^^^^^---------
   |     |    |
   |     |    help: a similar name exists in the module (notice the capitalization): `Interrupt`
   |     no `interrupt` in the root

error: cannot determine resolution for the attribute macro `interrupt`
   --> rp2040-hal/examples/vector_table.rs:148:3
    |
148 | #[interrupt]
    |   ^^^^^^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports
```
2022-08-11 12:09:20 +00:00
Jan Niehusmann d4743061fa Use generic boot loader for rp2040-hal examples
Those examples should be independent of a specific board.
The generic boot loader increases their compatibility.
2022-08-11 11:56:41 +00:00
Wilfried Chauveau 60677df099
bump usb-device to 0.2.9 2022-08-02 20:43:00 +01: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
9names d66b47920e
Merge pull request #311 from Liamolucko/multicore-no-alloc
Remove the `alloc` requirement for `Core::spawn`
2022-06-01 20:52:11 +10:00
Wilfried Chauveau 38692dfcb9
Add defmt feature (as optional dep) and allow i2c::Error to be formatted (#328) 2022-05-09 19:22:41 +10:00
Liam Murphy b932663cc9
Merge branch 'main' into multicore-no-alloc 2022-05-03 17:40:22 +10:00
Wilfried Chauveau 977bc2732a Remove unmaintained implementation async i2c. 2022-04-30 11:46:30 +10:00
Jan Niehusmann f8de8755cc
Add an rp2040 specific #[entry] macro. (#300)
* 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>
2022-03-13 12:35:59 +11: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
Liam Murphy f0b46c0f58 Remove the alloc requirement for Core::spawn 2022-03-05 14:55:32 +11: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
Derek Hageman a70eb89799 Add basic ROM intrinsics
Add a standardized macro for intrinsics export and connect the simple
ROM functions to intrinsics.
2022-02-12 11:56:24 -07:00
Derek Hageman 98fd6c1724 Add ROM function caching
Add a feature to enable automatic caching of the result of ROM table
function lookups.
2022-02-03 13:45:18 -07:00
Jonathan 'theJPster' Pallant 354a2a5e5e
Merge pull request #281 from rp-rs/update_pac
Use new spinlock API provide by PAC 0.3.0
2022-01-31 10:40:02 +00:00
Jonathan 'theJPster' Pallant c8c366c23d Use new spinlock API provide by PAC 0.3.0 2022-01-30 12:56:51 +00:00
Jan Niehusmann f6b2e3365e use dht-sensor crate and fix comments 2022-01-28 21:36:30 +00:00
Jan Niehusmann bb6b7706f9 Add dht11 example 2022-01-28 19:44:26 +00:00
Jan Niehusmann 2f9a950cbe Bump versions of HAL and BSPs
The change to UartPeripheral in #210 was a breaking change:
Bump the version of the HAL and all dependent BSP crates.
2021-12-26 19:52:04 +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
Jonathan Pallant a9f6ab8de4 Comment out embassy traits.
The git dep prevents us from publishing, rp2040-hal, and embassy
aren't doing a release any time soon.
2021-12-18 19:09:37 +00:00
Jonathan 'theJPster' Pallant 53d9dbdf52
Update to pio-rs v0.1.0 (#239)
* 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>
2021-12-14 10:52:32 +11:00
Wilfried Chauveau fee8881801
bump embassy's dependencies 2021-12-05 12:39:25 +00:00
9names 0e7abdc705
Make BSPs provide boot2 as a default feature (#153)
* 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
2021-12-05 01:00:09 +11:00
9names d84e641390
Add simple interrupt_disable+spinlock critical-section impl (#151)
* 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
2021-12-02 00:03:41 +11:00
devsnek e1f99443d9
multicore (#89)
mvp multicore implementation

Co-authored-by: Jan Niehusmann <jan@gondor.com>
2021-12-01 23:52:53 +11:00
Trangar f68f148d12
Added RtcClock DateTime and alarms (#213)
* Added RealTimeClock, DateTime and RTC alarms

* Improved documentation on weird behaviors in the RealTimeClock

* Fixed incorrect leap_year_check in RealTimeClock

* Fixed rtc-datetime PR feedback
2021-11-29 21:15:20 +11:00
Jonathan Pallant 292a6f13c8
Merge pull request #205 from jannic/eh-1_alpha6
Update eh1_0_alpha feature for embedded-hal 1.0.0-alpha.6
2021-11-25 14:30:02 +00:00
Jonathan Pallant 68602fa6e1 0.1.6 had breaking changes, so I yanked it and made 0.2.0. 2021-11-19 22:30:43 +00:00
Jonathan Pallant 84b903b12a PAC 0.1.6 is now released. 2021-11-19 22:22:29 +00:00
Jan Niehusmann 76aff05cec Update dependency on embedded-hal 1.x to 1.0.0-alpha.6 2021-11-19 21:41:00 +00:00
Jonathan Pallant 23bafb6980 Point at PAC release branch. 2021-11-19 12:22:52 +00:00
Wilfried Chauveau 990d964a93
Implement peripheral support for i2c and an advanced example (#162)
* 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>
2021-11-08 23:23:28 +11:00
Jonathan Pallant (42 Technology) 8e66ddcfb1 Switch to new rp2040-boot2 crate. 2021-10-18 10:53:17 +01:00
Jan Niehusmann e63f1f6dee Make pio-proc a dev-dependency
It's only used in an example, so it doesn't need to be a regular
dependency.
2021-10-07 09:39:08 +11:00
9names ede25a4f15
Merge pull request #143 from mgottschlag/pio-rework
Rework the PIO API
2021-10-02 16:41:38 +10:00
Jan Niehusmann 2b6de3a3c9
implement embedded-hal 1.0.0-alpha.5 (#131)
* implement embedded-hal 1.0.0-alpha.5

* Depend on specific alpha version of embedded-hal.

* enable feature eh1_0_alpha for CI check
2021-10-02 15:36:40 +10:00
Mathias Gottschlag 684f483859 pio: Improve documentation and add an example that uses pio_proc::pio!(). 2021-09-28 21:48:05 +02:00
Rob Young d93c4fc4c8
Implement RngCore for RingOscillator (#135)
Implement rand_core::RngCore for RingOscillator from the get_random_bit
function. This is not suitable for security purposes so
rand_core::CryptoRng has not been implemented.
2021-09-26 20:51:01 +10:00
9names b0c15ccc77
Update changelog and bump verson for hal release 0.3.0 (#121)
* Update CHANGELOG.md and Cargo.toml for release 0.3.0

* Bump BSP hal dep version
2021-09-22 20:43:30 +10:00
Henrik Lievonen d941f5637b
PIO support (#74)
Initial implementation of PIO 

Add all of the infrastructure required to include PIO programs and interact with PIO peripheral registers.
This was a massive effort between @devsnek and @henkkuli. It's great that it's now ready to go.

Co-authored-by: Gus Caplan <me@gus.host>
2021-09-16 00:32:00 +10:00