aboutsummaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* rp: don't use SetConfig trait in PWM and PIO.Dario Nieuwenhuis2023-05-135-5/+0
| | | | | | It was intended to allow changing baudrate on shared spi/i2c. There's no advantage in using it for PWM or PIO, and makes it less usable because you have to have `embassy-embedded-hal` as a dep to use it.
* Merge #1424bors[bot]2023-05-114-21/+84
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 1424: add TL maibox for stm32wb r=xoviat a=OueslatiGhaith Hello, This pull request is related to #1397 and #1401, inspired by #24, build upon the work done in #1405, and was tested on an stm32wb55rg. This pull request aims to add the transport layer mailbox for stm32wb microcontrollers. For now it's only capable of initializing it and getting the firmware information Co-authored-by: goueslati <[email protected]> Co-authored-by: Ghaith Oueslati <[email protected]> Co-authored-by: xoviat <[email protected]>
| * fix memory.xxoviat2023-05-111-4/+4
| |
| * rustfmtxoviat2023-05-111-3/+3
| |
| * stm32/ble: fix tests and add instructions to run examplexoviat2023-05-113-5/+40
| |
| * removed hardcoded addresses in memory.xgoueslati2023-05-043-20/+6
| |
| * rustfmtxoviat2023-05-031-1/+0
| |
| * stm32/tests: add hil test for blexoviat2023-05-031-1/+0
| |
| * added TL Mailbox initialization for STM32WBgoueslati2023-05-021-0/+44
| |
* | Merge branch 'master' into masterCaleb Jamison2023-05-0915-16/+168
|\ \
| * | Fix some typosDirk Stolle2023-05-0813-15/+15
| | |
| * | Merge #1435bors[bot]2023-05-082-1/+153
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1435: Added example for multi priority executors rp2040 r=Dirbaio a=fakusb I added an example for multiple priorities of tasks on rp2040 by adjusting [examples/nrf52840/src/bin/multiprio.rs](https://github.com/embassy-rs/embassy/blob/master/examples/nrf52840/src/bin/multiprio.rs) . This needs https://github.com/embassy-rs/rp-pac/pull/2 , and this commit also adds the 6 new interrupt handlers for software interrupts to embassy-rs. We might need to change the git path for rp-pac in [embassy-rp/Cargo.toml](https://github.com/embassy-rs/embassy/compare/master...fakusb:rp2040-multiprio-executor?expand=1#diff-47463ea358745927ecdb686f52feab816fde5d402a9628a136c116f34a802ab0) Closes #1413 Co-authored-by: Fabian Kunze <[email protected]>
| | * | added example multi priority executors rp2040Fabian Kunze2023-05-072-1/+153
| | | |
* | | | Dirbaio comments round 2Caleb Jamison2023-05-091-5/+5
| | | |
* | | | Remove patches, bump rp-pac versionCaleb Jamison2023-05-091-3/+0
| | | |
* | | | Improve gpout example, clk_gpout_freqCaleb Jamison2023-05-092-6/+22
| | | |
* | | | Add missing functions, Cleanup, Gpout exampleCaleb Jamison2023-05-081-0/+21
|/ / /
* | | rp/pio: allow wrap-around program loadingpennae2023-05-061-1/+2
| | | | | | | | | | | | | | | | | | execution wraps around after the end of instruction memory and wrapping works with this, so we may as well allow program loading across this boundary. could be useful for reusing chunks of instruction memory.
* | | rp/pio: configure state machines with Config structpennae2023-05-065-64/+83
| | | | | | | | | | | | | | | | | | the many individual sets aren't very efficient, and almost no checks were done to ensure that the configuration written to the hardware was actually valid. this adresses both of these.
* | | rp/pio: add set-pin-{values,dirs} convenience functionspennae2023-05-061-7/+2
| | | | | | | | | | | | | | | these are needed a lot during state machine setup, it makes sense to provide convenience functions for them.
* | | rp/pio: add load_program, use_programpennae2023-05-064-48/+13
| | | | | | | | | | | | | | | | | | | | | | | | programs contain information we could pull from them directly and use to validate other configuration of the state machine instead of asking the user to pull them out and hand them to us bit by bit. unfortunately programs do not specify how many in or out bits they use, so we can only handle side-set and wrapping jumps like this. it's still something though.
* | | rp/pio: drop Pio prefix from almost all namespennae2023-05-053-14/+14
|/ / | | | | | | | | | | it's only any good for PioPin because there it follows a pattern of gpio pin alternate functions being named like that, everything else can just as well be referred to as `pio::Thing`
* | Merge #1429bors[bot]2023-05-044-44/+44
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 1429: rp pio, √9 r=Dirbaio a=pennae another mix of refactoring and soundness issues. most notably pio pins are now checked for being actually accessible to the pio blocks, are constructible from not just the owned peripherals but refs as well, and have their registrations to the pio block reverted once all state machines and the common block has been dropped. state machines are now also stopped when dropped, and concurrent rx+tx using dma can finally be done in a sound manner. previously it was possible to do, but allowed users to start two concurrent transfers to the same fifo using different dma channels, which obviously would not have the expected results on average. Co-authored-by: pennae <[email protected]>
| * | rp/pio: wrap sm rx, tx in structs and allow splittingpennae2023-05-034-13/+14
| | | | | | | | | | | | | | | | | | | | | this *finally* allows sound implementions of bidirectional transfers without blocking. the futures previously allowed only a single direction to be active at any given time, and the dma transfers didn't take a mutable reference and were thus unsound.
| * | rp/pio: split irqs from state machinespennae2023-05-032-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | we can only have one active waiter for any given irq at any given time. allowing waits for irqs on state machines bypasses this limitation and causes lost events for all but the latest waiter for a given irq. splitting this out also allows us to signal from state machines to other parts of the application without monopolizing state machine access for the irq wait, as would be necessary to make irq waiting sound.
| * | rp/pio: remove PioStateMachineInstancepennae2023-05-034-6/+4
| | | | | | | | | | | | | | | | | | | | | move all methods into PioStateMachine instead. the huge trait wasn't object-safe and thus didn't have any benefits whatsoever except for making it *slightly* easier to write bounds for passing around state machines. that would be much better solved with generics-less instances.
| * | rp/pio: PioStateMachine{Instance, => ,Instance}pennae2023-05-034-10/+10
| | | | | | | | | | | | next step: get rid of the insance trait entirely
| * | rp/pio: add PioPin traitpennae2023-05-033-17/+14
| | | | | | | | | | | | | | | pio can only access pins in bank 0, so it doesn't make sense to even allow wrapping of other banks' pins.
* | | Simplify SUBGHZSPI configuration.ceekdee2023-05-043-12/+3
| | |
* | | Merge branch 'embassy-rs:master' into masterChuck Davis2023-05-034-26/+276
|\| |
| * | Merge #1425bors[bot]2023-05-024-26/+276
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | 1425: rp pio, round 2 r=Dirbaio a=pennae another round of bugfixes for pio, and some refactoring. in the end we'd like to make pio look like all the other modules and not expose traits that provide all the methods of a type, but put them onto the type itself. traits only make much sense, even if we added an AnyPio and merged the types for the member state machines (at the cost of at least a u8 per member of Pio). Co-authored-by: pennae <[email protected]>
| | * rp/pio: drop SmInstance{,Base}pennae2023-05-023-12/+12
| | | | | | | | | | | | these are just overly convoluted ways of writing down numbers.
| | * rp/pio: make PioCommon a structpennae2023-05-024-17/+8
| | | | | | | | | | | | | | | the PioCommon trait does not serve much of a purpose; there can be only two implementations and they only differ in a few associated constants.
| | * rp/pio: PioInstance::split -> Pio::newpennae2023-05-024-23/+39
| | | | | | | | | | | | | | | | | | | | | not requiring a PioInstance for splitting lets us split from a PeripheralRef or borrowed PIO as well, mirroring every other peripheral in embassy_rp. pio pins still have to be constructed from owned pin instances for now.
| | * rp/pio: remove PioPeripheralpennae2023-05-024-14/+13
| | | | | | | | | | | | | | | | | | merge into PioInstance instead. PioPeripheral was mostly a wrapper around PioInstance anyway, and the way the wrapping was done required PioInstanceBase<N> types where PIO{N} could've been used instead.
| | * rp/pio: add hd44780 examplepennae2023-05-021-0/+244
| | | | | | | | | | | | | | | | | | | | | add an hd44780 example for pio. hd44780 with busy polling is a pretty complicated protocol if the busy polling is to be done by the peripheral, and this example exercises many pio features that we don't have good examples for yet.
* | | Handle SUBGHZSPI as async.ceekdee2023-05-033-35/+11
|/ /
* | Merge #1376bors[bot]2023-05-012-0/+31
|\ \ | |/ |/| | | | | | | | | | | 1376: rtc: cleanup and consolidate r=Dirbaio a=xoviat This removes an extra file that I left in, adds an example, and consolidates the files into one 'v2' file. Co-authored-by: xoviat <[email protected]>
| * stm32/rtc: cleanup and consolidatexoviat2023-04-182-0/+31
| |
* | Merge #1414bors[bot]2023-05-011-1/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | 1414: rp: report errors from buffered and dma uart receives r=Dirbaio a=pennae neither of these reported errors so far, which is not ideal. add error reporting to both of them that matches the blocking error reporting as closely as is feasible, even allowing partial receives from buffered uarts before errors are reported where they would have been by the blocking code. dma transfers don't do this, if an errors applies to any byte in a transfer the entire transfer is nuked (though we probably could report how many bytes have been transferred). Co-authored-by: pennae <[email protected]>
| * | rp/uart: report errors from dma receivepennae2023-05-011-1/+8
| | |
* | | rp/pio: write instr memory only from commonpennae2023-05-013-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instruction memory is a shared resource. writing it only from PioCommon clarifies this, and perhaps makes it more obvious that multiple state machines can share the same instructions. this also allows *freeing* of instruction memory to reprogram the system, although this interface is not entirely safe yet. it's safe in the sense rusts understands things, but state machines may misbehave if their instruction memory is freed and rewritten while they are running. fixing this is out of scope for now since it requires some larger changes to how state machines are handled. the interface provided currently is already unsafe in that it lets people execute instruction memory that has never been written, so this isn't much of a drawback for now.
* | | rp/pio: move non-sm-specific methods to PioCommonpennae2023-05-012-12/+19
|/ / | | | | | | | | | | | | | | | | | | pin and irq operations affect the entire pio block. with pins this is not very problematic since pins themselves are resources, but irqs are not treated like that and can thus interfere across state machines. the ability to wait for an irq on a state machine is kept to make synchronization with user code easier, and since we can't inspect loaded programs at build time we wouldn't gain much from disallowing waits from state machines anyway.
* | Merge branch 'embassy-rs:master' into masterChuck Davis2023-04-2833-33/+33
|\ \
| * | Bump versions preparing for -macros and -executor releaseUlf Lilleengen2023-04-2733-33/+33
| | |
* | | Remove external-lora-phy feature.ceekdee2023-04-284-4/+4
| | |
* | | Remove legacy LoRa drivers.ceekdee2023-04-272-2/+2
|/ /
* | rp: remove pio Cargo feature.Dario Nieuwenhuis2023-04-261-1/+1
| | | | | | | | We shouldn't have Cargo features if their only purpose is reduce cold build time a bit.
* | build fixes for stableUlf Lilleengen2023-04-262-2/+2
| |
* | Merge branch 'embassy-rs:master' into masterChuck Davis2023-04-2633-60/+60
|\ \