aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update stm32-dataDario Nieuwenhuis2022-02-1413-101/+55
|
* Merge #618bors[bot]2022-02-133-10/+21
|\ | | | | | | | | | | | | | | | | | | 618: time: optimize math by reducing fractions at compile time. r=Dirbaio a=Dirbaio For example, `as_micros`, `from_micros` now are noops if tick rate is 1MHz. See: https://godbolt.org/z/fE1bf3ecP Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * time: optimize math by reducing fractions at compile time.Dario Nieuwenhuis2022-02-133-10/+21
|/ | | | For example, `as_micros`, `from_micros` now are noops if tick rate is 1MHz.
* Merge #608bors[bot]2022-02-132-0/+265
|\ | | | | | | | | | | | | | | | | 608: stm32f4: add adc + example r=Dirbaio a=ain101 Example tested on stm32f407vg Discovery Board. minimal adc: no vref, dma, complex sequence Co-authored-by: Frederik <[email protected]>
| * fix build for stm32f410tbFrederik2022-02-121-1/+6
| |
| * remove unnecessary modFrederik2022-02-121-33/+29
| |
| * adc cleanup retvalFrederik2022-02-111-6/+3
| |
| * stm32f4: add adc + exampleFrederik2022-02-102-0/+267
| | | | | | | | | | Example tested on stm32f407vg Discovery Board. minimal adc: no vref, dma, complex sequence
* | Merge #617bors[bot]2022-02-123-0/+19
|\ \ | | | | | | | | | | | | | | | | | | | | | 617: Add feature defmt-timestamp-uptime r=Dirbaio a=danielzfranklin Add the feature defmt-timestamp-uptime. Enabling it adds a timestamp of the number of seconds since startup next to defmt log messages using `Instant::now`. Co-authored-by: Daniel Franklin <[email protected]>
| * | Add {from_as}_micros to InstantDaniel Franklin2022-02-112-2/+13
| | |
| * | Add feature defmt-timestamp-uptimeDaniel Franklin2022-02-112-0/+8
| | | | | | | | | | | | | | | Enabling it adds a timestamp of the number of seconds since startup next to defmt log messages using `Instant::now`.
* | | Merge #616bors[bot]2022-02-1224-52/+149
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | 616: stm32: add rust stable support r=Dirbaio a=Dirbaio Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * | stm32: add rust stable supportDario Nieuwenhuis2022-02-1224-52/+149
|/ /
* | Merge #615bors[bot]2022-02-126-82/+65
|\ \ | | | | | | | | | | | | | | | | | | | | | 615: rp: remove OptionalPin r=Dirbaio a=Dirbaio Mirror of https://github.com/embassy-rs/embassy/pull/605 for rp2040 Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * | rp: remove OptionalPinDario Nieuwenhuis2022-02-124-79/+65
| | |
| * | stm32: remove unused sealed::OptionalPinDario Nieuwenhuis2022-02-121-2/+0
| | |
| * | nrf: remove stray mention of OptionalPinDario Nieuwenhuis2022-02-121-1/+0
| | |
* | | Merge #613bors[bot]2022-02-1246-845/+985
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 613: Rust stable support r=Dirbaio a=Dirbaio This PR adds (limited) stable Rust support! The drawbacks are: - No `#[embassy::task]`, `#[embassy::main]`. (requires `type_alias_impl_trait`). You have to manually allocate the tasks somewhere they'll live forever. See [example](https://github.com/embassy-rs/embassy/blob/master/examples/nrf/src/bin/raw_spawn.rs) - No async trait impls (requires GATs). Note that the full API surface of HALs is still available through inherent methods: #552 #581 - Some stuff is not constructible in const (requires `const_fn_trait_bound`), although there's an (ugly) workaround for the generic `Mutex`. So it's not that bad in the end, it's fully usable for shipping production-ready firmwares. We'll still recommend nightly as the default, until GATs and `type_alias_impl_trait` are stable. Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * | ci: add build with stable.Dario Nieuwenhuis2022-02-123-2/+55
| | |
| * | embassy, embassy-nrf: add `nightly` Cargo feature to gate nightly-only features.Dario Nieuwenhuis2022-02-1219-126/+182
| | |
| * | macros: cleanup, make work in stable.Dario Nieuwenhuis2022-02-1213-547/+462
| | |
| * | blocking_mutex: refactor to work on stable. No GATs, and can be constructed ↵Dario Nieuwenhuis2022-02-1211-170/+286
| | | | | | | | | | | | in const.
* | | Merge #614bors[bot]2022-02-1214-169/+327
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | 614: nrf: remove OptionalPin r=Dirbaio a=Dirbaio Mirror of #605 for nrf Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * | nrf: remove OptionalPinDario Nieuwenhuis2022-02-1214-169/+327
|/ /
* | Merge #607bors[bot]2022-02-1126-1793/+925
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 607: stm32: Add standard crate-wide macros for pin/dma traits r=Dirbaio a=Dirbaio All drivers will declare the traits using these macros. This has a few implications: - ALL drivers will have an Instance trait, even for drivers that usually have only one instance (for example crc, eth) - It's no longer possible to have a fn configure() in pin traits, drivers will have to do that some other way In the future, build.rs will generate all the impls instead of macrotables. Pin/Dma traits are no longer explicitly sealed, since gpio::Pin and dma::Channel are already sealed, which has the same effect. This means the `af_num()` and `request()` funcs are now public, but IMO that's okay, they're unlikely to change. Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * | stm32: Add standard crate-wide macros for pin/dma traits, switch all drivers ↵Dario Nieuwenhuis2022-02-1026-1793/+925
| | | | | | | | | | | | to use them.
* | | Merge #612bors[bot]2022-02-111-0/+163
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 612: Add button_events example for stm32f3 r=Dirbaio a=ceigel This is a more elaborate example of using buttons and leds. Tested on STM32F3DISCOVERY Co-authored-by: Cristian Eigel <[email protected]>
| * | | Add button_events example for stm32f3Cristian Eigel2022-02-111-0/+163
| | | |
* | | | Merge pull request #611 from danielzfranklin/patch-1Dario Nieuwenhuis2022-02-111-0/+12
|\ \ \ \ | |/ / / |/| | | Document #[embassy::main(config = ...)]
| * | | Document #[embassy::main(config = ...)]Daniel Franklin2022-02-111-0/+12
|/ / / | | | | | | | | | | | | Add an example documenting the config param based on help I got in the matrix chat. Because the example is very short and incompatible with the other example code I just included it inline.
* | | Merge #610bors[bot]2022-02-111-1/+1
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 610: Update cargo-batch. r=Dirbaio a=Dirbaio Cargo-batch now prints target+features when buildng a crate fails, which is very handy when one of the 30 `embassy-stm32`s fails in CI. Before: ``` error: could not compile embassy-stm32 due to 2 previous errors ``` After: ``` error: could not compile `embassy-stm32` due to 2 previous errors target: Target(CompileTarget { name: "thumbv7em-none-eabi" }) features: ["_time-driver", "defmt", "exti", "stm32f410tb", "time-driver-any"] ``` Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * | Update cargo-batch.Dario Nieuwenhuis2022-02-111-1/+1
|/ /
* | Merge #606bors[bot]2022-02-102-0/+288
|\ \ | |/ |/| | | | | | | | | | | 606: Port multiprio example to stm32f3 and stm32f4 platforms r=Dirbaio a=ceigel Example tested on stm32f303discovery and stm32f405 feather. Co-authored-by: Cristian Eigel <[email protected]>
| * Port multiprio example to stm32f3 and stm32f4 platformsCristian Eigel2022-02-102-0/+288
|/
* Merge #605bors[bot]2022-02-1023-461/+589
|\ | | | | | | | | | | | | | | | | | | | | | | | | 605: stm32: Remove OptionalPin r=Dirbaio a=Dirbaio The idea behind OptionalPin has a few problems: - you need to impl the signal traits for NoPin which is a bit weird https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L413-L416 - you can pass any combination of set/unset pins, which needs checking at runtime https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L130 The replacement is to do multiple `new` constructors for each combination of pins you want to take. Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * Add missing `+ 'd` on unborrows.Dario Nieuwenhuis2022-02-109-32/+45
| |
| * stm32: Remove OptionalPinDario Nieuwenhuis2022-02-1015-431/+546
|/ | | | | | | | | The idea behind OptionalPin has a few problems: - you need to impl the signal traits for NoPin which is a bit weird https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L413-L416 - you can pass any combination of set/unset pins, which needs checking at runtime https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L130 The replacement is to do multiple `new` constructors for each combination of pins you want to take.
* Merge #601bors[bot]2022-02-0912-239/+363
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 601: [part 1/n] Change macrotables to build.rs codegen r=lulf a=Dirbaio This PR replaces the "macrotables" (the macros like `stm32_data::peripherals!`) with a `const METADATA`. Macrotables had some problems: - Hard to debug - Somewhat footgunny (typo the "pattern" and then nothing matches and the macro now expands to nothing, silently!) - Limited power - Can't count, so we had to add a [special macrotable for that](https://github.com/embassy-rs/embassy/blob/f50f3f0a73a41275e6ea21d8661081acad381e05/embassy-stm32/src/dma/bdma.rs#L26). - Can't remove duplicates, so we had to fallback to [Rust code in build.rs](https://github.com/embassy-rs/embassy/blob/f50f3f0a73a41275e6ea21d8661081acad381e05/embassy-stm32/build.rs#L105-L145) - Can't include the results as a listto another macro, so again [build.rs](https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/build.rs#L100-L101). They work fine for the 95% of cases, but for the remaining 5% we need Rust code in build.rs. So we might as well do everything with Rust code, so everything is consistent. The new approach generates a `const METADATA: Metadata = Metadata { ... }` with [these structs](https://github.com/embassy-rs/embassy/blob/unmacrotablize/stm32-metapac-gen/src/assets/metadata.rs) in `stm32-metapac`. `build.rs` can then read that and generate whatever code. Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * stm32: replace `peripheral_rcc!` macrotable with build.rsDario Nieuwenhuis2022-02-097-120/+89
| |
| * stm32: change interrupt declarations from macrotables to build.rs.Dario Nieuwenhuis2022-02-093-10/+18
| |
| * stm32/build.rs: switch to using stm32-metapac metadata and quote.Dario Nieuwenhuis2022-02-092-102/+88
| |
| * stm32-metapac: add option to generate chip metadata as a rust const.Dario Nieuwenhuis2022-02-093-9/+170
| |
* | Merge #604bors[bot]2022-02-0922-0/+1715
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 604: Add embassy-boot r=lulf a=lulf Continuation of https://github.com/embassy-rs/embassy/pull/588 Embassy-boot is a simple bootloader that works together with an application to provide firmware update capabilities with a minimal risk. The bootloader consists of a platform-independent part, which implements the swap algorithm, and a platform-dependent part (currently only for nRF) that provides addition functionality such as watchdog timers softdevice support. The bootloader is intended to be configurable for different flash sizes and architectures, and only requires that embedded-storage flash traits are implemented. The nRF version can be configured programatically as a library, or using linker scripts to set the partition locations for DFU, ACTIVE and STATE * DFU: Where the next firmware version should be written. This is used by the FirmwareUpdater * ACTIVE: Where the current firmware version resides. Written by bootloader when swap magic is set * STATE: Contains the bootloader magic and the copy progress. Can be 1-N pages long (depending on how much flash you have which will determine the copy progress index size Co-authored-by: Ulf Lilleengen <[email protected]> Co-authored-by: Ulf Lilleengen <[email protected]>
| * | Address review commentsUlf Lilleengen2022-02-092-1/+11
| | |
| * | Add embassy-bootUlf Lilleengen2022-02-0922-0/+1705
|/ / | | | | | | | | | | | | | | | | | | Embassy-boot is a simple bootloader that works together with an application to provide firmware update capabilities with a minimal risk. The bootloader consists of a platform-independent part, which implements the swap algorithm, and a platform-dependent part (currently only for nRF) that provides addition functionality such as watchdog timers softdevice support.
* | Merge #602bors[bot]2022-02-097-1/+561
|\ \ | |/ |/| | | | | | | | | | | | | | | 602: Add stm32 USB OTG peripherals r=Dirbaio a=chemicstry Fixes #557. This is similar to #580, but for synopsys IP. I could add examples to other chips, but I have no way of testing them. The F4 example is tested and working. Co-authored-by: chemicstry <[email protected]>
| * Cleanupchemicstry2022-02-091-9/+13
| |
| * Fix function namechemicstry2022-02-091-1/+1
| |
| * Merge USB FS and HS peripherals. Add ULPI.chemicstry2022-02-098-319/+449
| |
| * Add stm32 USB OTG peripheralschemicstry2022-02-087-1/+427
| |