aboutsummaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Merge #853bors[bot]2022-07-161-0/+38
|\ | | | | | | | | | | | | | | | | 853: Add embedded_hal_async support for embassy-rp r=Dirbaio a=danbev This commit adds support for embedded-hal-async to the Embassy Raspberry PI crate. Co-authored-by: Daniel Bevenius <[email protected]>
| * Add embedded_hal_async support for embassy-rpDaniel Bevenius2022-07-141-0/+38
| | | | | | | | | | This commit adds support for embedded-hal-async to the Embassy Raspberry PI crate.
* | Fix unused importschemicstry2022-07-141-1/+0
| |
* | Fix erasing across bankschemicstry2022-07-141-5/+3
| |
* | Fix writing to last sector of F4 flashchemicstry2022-07-141-10/+20
|/
* fix typoPhilip A Reimer2022-07-111-1/+1
|
* Merge #858bors[bot]2022-07-1117-78/+78
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 858: embassy-stm32: Simplify time r=Dirbaio a=GrantM11235 - Remove unused `MilliSeconds`, `MicroSeconds`, and `NanoSeconds` types - Remove `Bps`, `KiloHertz`, and `MegaHertz` types that were only used for converting to `Hertz` - Replace all instances of `impl Into<Hertz>` with `Hertz` - Add `hz`, `khz`, and `mhz` methods to `Hertz`, as well as free function shortcuts - Remove `U32Ext` extension trait Co-authored-by: Grant Miller <[email protected]>
| * embassy-stm32: Simplify timeGrant Miller2022-07-1017-78/+78
| | | | | | | | | | | | | | | | | | | | - Remove unused `MilliSeconds`, `MicroSeconds`, and `NanoSeconds` types - Remove `Bps`, `KiloHertz`, and `MegaHertz` types that were only used for converting to `Hertz` - Replace all instances of `impl Into<Hertz>` with `Hertz` - Add `hz`, `khz`, and `mhz` methods to `Hertz`, as well as free function shortcuts - Remove `U32Ext` extension trait
* | Merge #859bors[bot]2022-07-112-0/+58
|\ \ | |/ |/| | | | | | | | | | | 859: Add F4 flash driver r=Dirbaio a=chemicstry Pending on https://github.com/embassy-rs/stm32-data/pull/152 Co-authored-by: chemicstry <[email protected]>
| * Add F4 flash driverchemicstry2022-07-112-0/+58
| |
* | Merge #810bors[bot]2022-07-115-95/+25
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 810: Takes care of power for nRF USB devices r=Dirbaio a=huntc Modifies the usb-serial example to illustrate how to setup USB for situations where the USB power can be detected and removed. Gaps: ~~* No support for the nrf-softdevices as yet, although this should be possible via another constructor.~~ * No support for the nrf5340, although this should be possible via USBREG. The change is tested and appears to work. Some notes: * There's an existing field named self_powered as a UsbDevice field. It doesn't ever appear to get set. I'm wondering if this field is intended to signal that a device has the nRF VBUS power situation or not. I'm not presently using it. * The new PowerDetected event is generated on the bus initially in situations where just new is used i.e. without power management, including on STM. We can therefore rely on this event always being generated. Old description: ~~EnabledUsbDevice is a wrapper around the `UsbDevice` where its enablement is also subject to external events, such as `POWER` events for nRF. It is introduced generically to support other platforms should they also require external signaling for enablement.~~ Co-authored-by: huntc <[email protected]>
| * Trait for UsbSupplyhuntc2022-07-095-90/+24
| | | | | | | | Eliminated a signal by using a simpler trait method that returns whether VBus power is available. Also includes a UsbSupply that can be signalled for use with the nRF softdevice. Includes the requirement for waiting for power to become available.
| * Puts in the machinery to handle power detected/removedhuntc2022-07-071-33/+5
| |
| * Introduces EnabledUsbDevicehuntc2022-07-071-7/+31
| | | | | | | | EnabledUsbDevice is a wrapper around the UsbDevice where their enablement is also subject to external events, such as POWER events for nRF. It is introduced generically to support other platforms should they also require external signalling for enablement.
* | Use u32 instead of Duration for IWDGchemicstry2022-07-111-1/+1
| |
* | Add comments to watchdog examplechemicstry2022-07-101-0/+2
| |
* | Implement IWDG timeout calculationchemicstry2022-07-101-0/+44
|/
* Use correct chip family name for exampleUlf Lilleengen2022-07-051-1/+1
|
* Document configuration options and handle optional downlinkUlf Lilleengen2022-07-041-3/+21
|
* Fix RAM origin copy paste from nrfUlf Lilleengen2022-06-297-7/+7
|
* Add build.rs to detect armv6Ulf Lilleengen2022-06-271-5/+0
|
* Move bootloader main to examplesUlf Lilleengen2022-06-2484-216/+621
| | | | | This should remove some confusion around embassy-boot-* being a library vs. a binary. The binary is now an example bootloader instead.
* Merge #826bors[bot]2022-06-221-2/+2
|\ | | | | | | | | | | | | | | 826: Bump bxcan version r=chemicstry a=chemicstry Co-authored-by: chemicstry <[email protected]>
| * Fix examplechemicstry2022-06-231-2/+2
| |
* | Simplify examplechemicstry2022-06-231-10/+3
| |
* | Fix PWM for advanced timerschemicstry2022-06-231-0/+42
|/
* Merge #817bors[bot]2022-06-211-0/+106
|\ | | | | | | | | | | | | | | | | | | | | | | 817: Added a pubsub channel implementation r=lulf a=diondokter This is similar to Tokio's Broadcast channel, except that it doesn't allocate. The publishers and subscribers are dynamic. They use an &dyn channel reference because it's really annoying to have to specify the mutex and const generics every time. Do we need fully generic types as well? Co-authored-by: Dion Dokter <[email protected]> Co-authored-by: Dion Dokter <[email protected]>
| * Added example and some defmtDion Dokter2022-06-211-0/+106
| |
* | Merge pull request #822 from embassy-rs/remove-authorsDario Nieuwenhuis2022-06-1828-28/+0
|\ \ | | | | | | Remove the authors field from Cargo.tomls
| * | Remove the authors field from Cargo.tomlsDario Nieuwenhuis2022-06-1828-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It currently contains whoever was first to write some code for the crate, even if many more people have contributed to it later. The field is "sort of" deprecated, it was made optional recently: https://rust-lang.github.io/rfcs/3052-optional-authors-field.html Due the the reasons listed there I believe removing it is better than setting it to generic fluff like "The Embassy contributors".
* | | Merge pull request #821 from embassy-rs/defmt-traceDario Nieuwenhuis2022-06-1827-0/+81
|\ \ \ | |/ / |/| | Add env DEFMT_LOG=trace to all examples.
| * | Add env DEFMT_LOG=trace to all examples.Dario Nieuwenhuis2022-06-1827-0/+81
| | |
* | | Update to 2021 edition. (#820)Dario Nieuwenhuis2022-06-1823-39/+23
|/ /
* / Update rust nightly. (#819)Dario Nieuwenhuis2022-06-181-1/+0
|/
* Run rustfmt.Dario Nieuwenhuis2022-06-12172-937/+431
|
* Merge #806bors[bot]2022-06-126-9/+9
|\ | | | | | | | | | | | | | | | | | | 806: Add embassy-cortex-m crate. r=Dirbaio a=Dirbaio - Move Interrupt and InterruptExecutor from `embassy` to `embassy-cortex-m`. - Move Unborrow from `embassy` to `embassy-hal-common` (nothing in `embassy` requires it anymore) - Move PeripheralMutex from `embassy-hal-common` to `embassy-cortex-m`. Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * Add embassy-cortex-m crate.Dario Nieuwenhuis2022-06-126-9/+9
| | | | | | | | | | | | - Move Interrupt and InterruptExecutor from `embassy` to `embassy-cortex-m`. - Move Unborrow from `embassy` to `embassy-hal-common` (nothing in `embassy` requires it anymore) - Move PeripheralMutex from `embassy-hal-common` to `embassy-cortex-m`.
* | Rename channel to mpmchuntc2022-06-129-9/+9
|/ | | | I've renamed the channel module for the MPMC as mpmc. There was a previous debate about this, but I feel that the strategy here avoids importing `channel::channel`. The change leaves `signal::Signal`, but I think that's ok. It is all a bit subjective of course. The bottom line for me is that I really like the term mpmc - it means something to me and aligns with broader naming e.g. in Tokio.
* common/PeripheralMutex: remove unsafe API. (#802)Dario Nieuwenhuis2022-06-091-2/+1
| | | | | | Following the project's decision that "leak unsafe" APIs are not marked as "unsafe", update PeripheralMutex to accept non-'static state without unsafe. Fixes #801
* stm32: add USB driver.Dario Nieuwenhuis2022-06-0713-2/+881
|
* Add example for using a Signal.Dominic Clifton2022-06-061-0/+41
|
* fix build adding missing time-tick feature.Dario Nieuwenhuis2022-05-317-7/+7
|
* boot/stm32: autodetect thumbv6, remove cargo feature.Dario Nieuwenhuis2022-05-312-2/+2
|
* examples/stm32*, tests/stm32: specify time-tick-32768hzWill Glynn2022-05-3115-15/+15
|
*-. Merge #781 #785bors[bot]2022-05-317-256/+240
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 781: embassy-net v2 r=Dirbaio a=Dirbaio - No more `dyn` - It's no longer a global singleton, you can create muliple net stacks at once. - You can't tear them down though, the Device it still has to be `'static` due to restrictions with smoltcp's "fake GAT" in the Device trait. :( - Removed `_embassy_rand` hack, random seed is passed on creation. 785: stm32: g0: add PLL clock source r=Dirbaio a=willglynn STM32G0 SYSCLK can be sourced from PLLRCLK. Given that the HSI runs at 16 MHz and the HSE range is 4-48 MHz, the PLL is the only way to reach 64 MHz. This commit adds `ClockSrc::PLL`. The PLL sources from either HSI16 or HSE, divides it by `m`, and locks its VCO to multiple `n`. It then divides the VCO by `r`, `p`, and `q` to produce up to three associated clock signals: * PLLRCLK is one of the inputs on the SYSCLK mux. This is the main reason the user will configure the PLL, so `r` is mandatory and the output is enabled unconditionally. * PLLPCLK is available as a clock source for the ADC and I2S peripherals, so `p` is optional and the output is conditional. * PLLQCLK exists only on STM32G0B0xx, and exists only to feed the MCO and MCO2 peripherals, so `q` is optional and the output is conditional. When the user specifies `ClockSrc::PLL(PllConfig)`, `rcc::init()` calls `PllConfig::init()` which initializes the PLL per [RM0454]. It disables the PLL, waits for it to stop, enables the source oscillator, configures the PLL, waits for it to lock, and then enables the appropriate outputs. `rcc::init()` then switches the clock source to PLLRCLK. `rcc::init()` is now also resonsible for calculating and setting flash wait states. SYSCLCK < 24 MHz is fine in the reset state, but 24-48 MHz requires waiting 1 cycle and 48-64 MHz requires waiting 2 cycles. (This was likely a blocker for anyone using HSE >= 24 MHz, with or without the PLL.) Flash accesses are now automatically slowed down as needed before changing the clock source, and sped up as permitted after changing the clock source. The number of flash wait states also determines if flash prefetching will be profitable, so that is now handled automatically too. [RM0454]: https://www.st.com/resource/en/reference_manual/rm0454-stm32g0x0-advanced-armbased-32bit-mcus-stmicroelectronics.pdf Co-authored-by: Dario Nieuwenhuis <[email protected]> Co-authored-by: Will Glynn <[email protected]>
| * | WIP embassy-net v2Dario Nieuwenhuis2022-05-257-256/+240
| | |
* | | Update embedded-hal-async to 0.1.0-alpha.1Dario Nieuwenhuis2022-05-293-3/+3
| |/ |/|
* | Merge #783bors[bot]2022-05-273-15/+42
|\ \ | | | | | | | | | | | | | | | | | | | | | 783: Reimplement BufRead for BufferedUart r=Dirbaio a=chemicstry The `AsyncBufRead` implementation for `BufferedUart` was removed in https://github.com/embassy-rs/embassy/pull/752, this PR reimplements it from `embedded-io`. This allows reading `BufferedUart` without copying slices. Co-authored-by: chemicstry <[email protected]>
| * | Implement BufRead for nrf BufferedUartechemicstry2022-05-261-15/+5
| | |
| * | Simplify examplechemicstry2022-05-261-5/+3
| | |