Commit graph

687 commits

Author SHA1 Message Date
Jan Niehusmann 0a86dad34c Implement UartConfig::new constructor method 2022-10-15 17:02:30 +00:00
Jan Niehusmann 71c39a4431
Merge pull request #468 from jannic/fix-465
Check watchdog load value max value before multiplying by 2, to avoid integer overflow
2022-10-13 10:48:35 +02:00
Jan Niehusmann 84b92edd30 Check watchdog load value max value before multiplying by 2, to avoid integer overflow 2022-10-12 22:39:57 +00:00
Derek Hageman 39190c357f
Fix watchdog counter load (#464)
Fix the watchdog load to reflect the 1us tick rate.  This was changed
in #361, which presumably used the field name (delay_ms) and assumed
it was in milliseconds.  So this also fixes the name to reflect that
it's microseconds.
2022-10-10 12:15:24 +01:00
Wilfried Chauveau eac51cdd16
remove unused future dependency (#463) 2022-10-06 21:39:48 +01:00
Wilfried Chauveau 305dfc9d1f
Add rtic-monotonic support for timer & alarms (feature gated) (#459)
* Add rtic-monotonic support for timer & alarms
* Force Alarm interrupt if timer is set too soon
* timer: Remove non_exhaustive attribute from ScheduleAlarmError
* timer: TooSoon is no longer emitted so it can be removed
2022-10-06 18:31:31 +01:00
9names 82800fe370
Merge pull request #462 from 9names/bsp_enable_cache
Document HAL features in Config.toml(s), and enable ROM function caching in BSPs
2022-10-03 23:42:41 +11:00
9names 2d31d91ba1 Add rom-func-cache as a default feature in BSPs 2022-10-03 19:52:10 +11:00
9names 0cd990c3c1 Comment and pass-through HAL features in BSPs 2022-10-03 12:04:58 +11:00
9names fc110f07c3 Add comments for HAL features 2022-10-03 11:43:09 +11:00
Jan Niehusmann 6a040a8042
Merge pull request #461 from jannic/upgrade-eh-alpha
Upgrade eh alpha
2022-09-30 21:41:36 +02:00
Jan Niehusmann d5bfb0ca8d Fix typo in changelog 2022-09-30 16:53:37 +00:00
Jan Niehusmann 819f051cc2 Update changelog 2022-09-28 21:59:09 +00:00
Jan Niehusmann fcd6f7c19d Remove unnecessary custom Infallible types 2022-09-28 21:59:09 +00:00
Jan Niehusmann e4deaabb51 Upgraded embedded-hal alpha dependency to 1.0.0-alpha.9
For now, disabled non-blocking implementations.
2022-09-28 21:59:09 +00:00
Jan Niehusmann 8d9b4538c9
Merge pull request #453 from jannic/update-jmp-offset
simplify jump offset calculation when loading PIO programs
2022-09-27 22:25:22 +02:00
Paul Daniel Faria 4f440d286d Update Servo 2040 board examples in README
Add the PWM Servo example to the readme.
Fix typo in rainbow animation.
Add images to boath examples showing working examples.
2022-09-21 18:00:37 +10:00
Paul Daniel Faria d3b0156269 Fix servo example in rp2040-servo, remove unusable aliases.
The servo example included phase correction, which does not work with the
provided divider. Updated comments to explain numbers and also explain
alternate calculation with phase correction enabled.

Remove unusable aliases from all servo pins. The board includes a 180 Ohm
resistor on all servo data pins, which makes the lines not very usable for
Spi, Uart or I2C. The aliases were removed given they will rarely, if ever,
be used with this board.
2022-09-21 18:00:37 +10:00
Jan Niehusmann e7454087d1
Merge pull request #455 from papyDoctor/spi-isbusy
added SPI is_busy function
2022-09-20 23:27:30 +02:00
Olivier 69c047136c added SPI is_busy function 2022-09-19 15:27:46 +02:00
Jan Niehusmann 6a5747b213 Use u8 instead of usize for pio address calculation 2022-09-18 10:48:09 +00:00
Jan Niehusmann 7cca9a71d7 simplify jump offset calculation when loading PIO programs 2022-09-17 17:22:34 +00:00
Jan Niehusmann ae629ad4c9
Merge pull request #452 from jannic/into_mode_setting_output
Provide rp2040_hal::gpio::pin::Pin::into_push_pull_output_in_state
2022-09-17 18:02:43 +02:00
Jan Niehusmann fa83510277 Provide rp2040_hal::gpio::pin::Pin::into_push_pull_output_in_state 2022-09-17 13:31:11 +00:00
Paul Daniel Faria 19e2fbea1c
Add the Pimoroni Servo 2040 board (#450)
* Add the Pimoroni Servo 2040 board

This PR adds the board support package and two simple examples.
* Animates a rainbow wheel across the RGB LEDs on the board.
* Moves a servo that's connected to GPIO0 back and forth.

* Format pimoroni-servo2040 board files

* Use us_to_duty function in servo example, clean up comments.

* Fix bad types

* Add Servo2040 description to top-level readme
2022-09-17 12:04:16 +01:00
Jan Niehusmann cbed25944a
Merge pull request #449 from papyDoctor/main
Added set_fifos/set_rx_watermark/set_tx_watermark
2022-09-17 10:25:52 +02:00
Wilfried Chauveau 4ddad4e74c
fix concurrent accesses to sm_execctrl and sm_instr when sideset isn't optional (#448)
* fix concurrent accesses to sm_execctrl and sm_instr when sideset isn't optional
* review & document unsafe blocks
2022-09-16 17:19:54 +01:00
Wilfried Chauveau 322bba2cc0
pio: Move interrupt related (en|dis)abling/forcing methods to the statemachine (#447)
* pio: Move interrupt related (en|dis)abling/forcing methods to the statemachine

The SM knows its id using the type system so there's no need for checking it.
This commit also adds a `PioIRQ` enum to select the output IRQ.

* Move the interrupt control to Rx & Tx and make all accesses to inte atomic
* Adjust the ergonomics of IRQ handling.
* Elide lifetimes where they can be (clippy's advice)
2022-09-14 21:07:03 +01:00
Wilfried Chauveau 42fc266e67
timer: Mark Timer & Alarm* Send and Sync (#451) 2022-09-14 21:06:08 +01:00
Olivier b29cc2630c Added set_fifos/set_rx_watermark/set_tx_watermark
that permit to enable/disable the Rx/Tx FIFOs and to set
the watermarks for the DMA/interrupts triggering
2022-09-12 17:06:27 +02:00
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 39ffe70dab
Use rp2040_boot2::BOOT_LOADER_GENERIC_03H in the vector-table example (#445) 2022-09-02 08:02:34 +01:00
A. Gavin 993487443a
examples: clarify usage of boot2 section (#443) 2022-09-02 06:38:58 +01:00
Wilfried Chauveau 5ce10ff94e
timer: Use a fixed type in Alarm::schedule (#442) 2022-08-31 21:45:08 +01:00
Wilfried Chauveau 0e2b4cf7be
Add a method to allow setting the PIO's clock divisor without floats (#440)
* pio: Changes `PIOBuilder::clock_divisor` from f32 to fixed point)
* pio: mark clock_divisor as deprecated
2022-08-31 21:44:53 +01:00
Wilfried Chauveau 6d75cd8291
usb: Use the dedicated write_bitmask_* functions (#441) 2022-08-31 13:41:35 +01:00
Wilfried Chauveau 4dbd5667a6
Use TimerInstant in Timer::GetCounter & add Alarm::schedule_at (#439) 2022-08-31 06:54:57 +01:00
Wilfried Chauveau f30df4a0c7
doc: Fix the link under the logo in rp2040-hal's readme (#438) 2022-08-26 12:15:24 +01:00
Wilfried Chauveau 4ead633042
Revert "Make Pimoroni Badger 2040's crate name consistent with it's directory (#435)" (#437)
This reverts commit 1de8f9016d.
2022-08-26 12:15:17 +01:00
Wilfried Chauveau 685634e85b
Remove registry patches for i2c and ws2812-pio now that they are published (#436) 2022-08-26 10:49:51 +01:00
Wilfried Chauveau 1de8f9016d
Make Pimoroni Badger 2040's crate name consistent with it's directory (#435) 2022-08-26 10:49:43 +01: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 13cad64c29
remove unused dependencies & add GHA flow (#429) 2022-08-26 03:42:33 +01:00
Wilfried Chauveau 3261eccd4d
Fix interpolator example post migration to fugit (#434) 2022-08-26 02:32:24 +01:00
Wilfried Chauveau dbc691fb09
Temporary disable sticky-bit in set_pins too (#433) 2022-08-25 18:19:01 +01:00
Kasil 31469c232f
Add support for the Interpolator (#371)
* 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
2022-08-25 18:02:56 +01:00
Jan Niehusmann 00f5e8d184
Merge pull request #432 from jannic/fix-set_pindirs
Temporarily disable out_sticky in set_pindirs
2022-08-25 12:02:55 +02:00
Jan Niehusmann 6b0ea14ec1 Temporarily disable out_sticky in set_pindirs
Otherwise, it will change unrelated pindirs as well, if sticky is set
2022-08-25 07:49:59 +00:00
Wilfried Chauveau 47d8f4fc21
Add Debug and defmt::Format to the public types of rp2040_hal::gpio::dynpin (#431) 2022-08-25 05:54:26 +01:00
Wilfried Chauveau cd9570e7c4 The patches to -pio need to be commented out before release.
This will require an extra step before release but can be packed with
the usual version bump.
This helps making sure CI passes before merging.
2022-08-24 22:46:34 +01:00