The wrap source and target cannot change after installing the program
into the PIO at present, even though this is possible with the C/C++
HAL. This is useful when using the same program across multiple state
machines that have different wrap sources and targets.
`LOCK_OWNER` is only accessed using the atomic APIs, which take `&self`, so it does not need to be `static mut`, `static` is fine.
(I haven't seen any miscompilations of this, but I'm unsure if Rust is allowed to assume `static mut`s are not aliased and apply optimizations based on that. If so, this would prevent that.)
Limit the discarded data reference to the data that has actually been
read so far, instead of the whole input buffer. Also fix a spelling
error in the field name.
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.
* 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
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.
* 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
* 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)