Commit graph

28 commits

Author SHA1 Message Date
9names def0ed97f7 Replace uses of hal::watchdog::Watchdog with hal::Watchdog 2021-12-04 17:30:47 +11:00
9names dc8ceffd09 Move uses of sio::Sio to Sio 2021-12-04 16:20:27 +11:00
Jan Niehusmann de53600199 pico_usb_serial: Handle errors of serial.write()
Fixes: #194
2021-11-29 00:05:03 +11:00
Jonathan Pallant ffffa7368a Set button as pull-up. 2021-11-16 22:47:30 +00:00
Jonathan Pallant ac88d89939 Fix-up the examples and BSPs.
On the Pico Lipo GPIO23 is actually the boot mode select switch.
2021-11-16 22:46:35 +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
Wilfried Chauveau 46e580b852
Adds an example of using the PIO as I2C driver to control an LM75B temperature sensor (#180)
* Add pico_i2c_pio example

* Update pico_i2c_pio's main function documentation

* Update bootloader reference.

* Implement uart output for the pico_i2c_pio example.

* pin to a specific rev of i2c-pio

* Bump i2c-pio to get the fix for write_read
2021-10-23 22:45:13 +11:00
Jonathan Pallant (42 Technology) 8e66ddcfb1 Switch to new rp2040-boot2 crate. 2021-10-18 10:53:17 +01:00
Alexander Meißner 90470b6ff3
Adds reset for timer, otherwise it would not run. (#136) 2021-10-02 15:41:04 +10:00
Jonathan Pallant (42 Technology) c531eb976e Say nothing about the default input clock frequency - it's given! 2021-09-27 18:37:59 +01:00
Jonathan Pallant (42 Technology) 29dd755b30 Ensure the bootloader static gets documented. 2021-09-27 17:30:50 +01:00
Jan Niehusmann 389e0ea715 fix pico_usb_twitchy_mouse with usbd-hid >= 0.5.1
usbd-hid 0.5.1 contained an accidental semver breaking change

fix example accordingly
2021-09-25 20:33:31 +10:00
Jonathan Pallant (42 Technology) f0fc4ed3ad Typo in comments. 2021-09-21 12:43:16 +01:00
Jonathan Pallant (42 Technology) 25d87b838b Good ol' clippy. 2021-09-21 12:42:34 +01:00
Jonathan Pallant (42 Technology) b89e728e9c Polishing the USB interrupt examples.
Answers on a postcard please on how to avoid `static mut` when you have
lazy initialization, and static objects holding references to other
static objects.
2021-09-21 12:37:44 +01:00
Jonathan Pallant (42 Technology) ba6c409f21 Update non-IRQ USB example. 2021-09-21 10:54:13 +01:00
Jonathan Pallant (42 Technology) 35f001f61d Polishing the PWM and USB examples. 2021-09-21 10:47:43 +01:00
Jonathan Pallant (42 Technology) 3e036cf9b0 Polishing the blinky examples. 2021-09-21 10:03:47 +01:00
Wilfried Chauveau 1d5dd15092 Work around enumeration issues with small ep0 max packet size.
Prevents DataIn of the previous request from being sent to the host when
a new setup is received.
2021-09-19 22:27:17 +10:00
9names 98b8e3ae9c
Handle usb interrupt flags in driver (#106)
Set interrupt enable flags in USB driver. The flags were already being cleared in the USB driver.
Update USB examples to remove interrupt flag set/check as it is no longer necessary.
2021-09-17 09:40:10 +10:00
Wilfried Chauveau c509b9d22f
Add embedded_hal::timer support (#110)
* Add embedded_hal::timer support

* fixup: add pico countdown based blinky example & rework get_counter(&self) -> u16
2021-09-16 18:47:34 +10:00
Cam Buss cb8dbbf917
Add Pico RTIC Timer Blinky Example (#109)
* Add RTIC Timer Blinky Example
2021-09-14 23:59:55 +10:00
9names 8b1c9fc3e5 Add port of usb-twitchy-mouse 2021-09-11 18:36:44 +10:00
9names 0cc4614888 Add interrupt-driven USB example 2021-09-11 18:36:19 +10:00
Wilfried Chauveau db11231f49
Implement usb_device for rp2040 (#98)
Implement usb_device for rp2040

Limitations
- RP2040-E5 (Device enumeration workaround) is not implemented
- Suspend/resume is not implemented
- VBus detection is not tested and may not be fully implemented
2021-09-09 17:55:30 +10:00
Hmvp ffa39f65f5
Pwm improvements (#61)
* Reimplement PWM driver using typestates
* Improve docs
2021-09-02 09:37:17 +10:00
Hmvp bcfbd72ed1 Update embedded time 2021-07-27 09:41:03 +10:00
Hmvp ffa97842e2
Improve clock frequency stuff for uninitialized clocks and add some examples (#64)
* Improve clock frequency stuff for uninitialized clocks

- Made clocks singletons so the frequency handling actually works as expected
- Added initial frequencies
- Improved the docs
- Added a Clock trait

* Add pico examples.

These have the benefit of knowing which external crystal is attached.
Even though it always should be a 12 MHz crystal.
Thus we can setup the clocks properly

I also changed the rp2040 examples to work out of the box for pico boards since that will probably be used most of the time
2021-07-26 20:24:58 +10:00