Commit graph

21 commits

Author SHA1 Message Date
Jonathan Pallant b9497d9b82 Resolve review comments.
Adds same functions to RX FIFO.
2021-11-16 21:45: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
Jan Niehusmann bac6714f09
Use volatile register access for gpio interrupts (#170)
* 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
2021-10-22 23:30:30 +11: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
Jonathan Nilsson 148cc2b8ea Warn missing docs, deny in ci 2021-07-25 02:17:43 +10:00
Jonathan Nilsson 1bf47df553 Deny warnings in ci 2021-07-25 02:17:43 +10:00
Hmvp f310d92b64
Refactor clocks (#54)
* Remove unneeded lines

* Reduce macro boilerplate

* Refactor clocks
2021-07-08 20:58:48 +10:00
Andrea Nall e3be4f8025 Massive GPIO refactor
Bring in line with atsamd-hal GPIO v2

Copied as much as possible. Docs lifted mostly as-is.

Also add sample BSP for the Feather RP2040 in boards/feather_rp2040

May include a few random fixes from currently futile attempt to get doctests working.
2021-07-03 10:32:43 +10:00
Nic0w ef7f8fe9b7 Initial commit on clocks 2021-06-27 14:50:06 +10:00
Andrea Nall 8d0fde20c6 Add SubsystemReset trait to handle subsystem resets
dd a `SubsystemReset` trait which adds a `reset_bring_up` function to the
relevant PAC types to handle bringing subsystems out of reset.

Also, correct that the PLL and UART modules did not bring the relevant
subsystems out of reset and refactor the GPIO module to use the
SubsystemReset trait.
2021-05-16 13:12:26 -05:00
Andrea Nall 35464a1c4b typo fix, rustfmt 2021-05-10 08:29:59 -05:00
Andrea Nall 2ef1343c05 add module to manage ownership of parts of SIO 2021-05-09 22:33:36 -05:00
9names c5da7659c9
Merge pull request #27 from Nic0w/pll
Working HAL for PLLs
2021-05-09 17:59:27 +10:00
9names 7588f76844
Merge branch 'main' into basic-gpio 2021-05-04 16:35:46 +10:00
Nic0w 9be7c41400 Working implementation of a PLL HAL. 2021-04-29 20:16:52 +02:00
Nic0w ed1e847618 Remove line as it builds fine without it. 2021-04-24 22:26:26 +02:00
Nic0w d0d9291cde Working HAL for the XOSC 2021-04-24 13:38:17 +02:00
Jennifer Wilcox 45580ec4c8 Add basic output support for GPIOs 2021-04-17 18:22:15 -05:00
Gus Caplan 1c75ed3844 rom: Add rom content 2021-02-03 03:10:00 +02:00
evan 98baabec93 Added skeleton for HAL and updated readme 2021-01-25 15:42:43 -05:00
evan 22a3669a9d Initial Commit: Updated author information. 2021-01-22 09:18:12 -05:00