summaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)Author
2022-06-18Merge pull request #821 from embassy-rs/defmt-traceDario Nieuwenhuis
Add env DEFMT_LOG=trace to all examples.
2022-06-18Update to 2021 edition. (#820)Dario Nieuwenhuis
2022-06-18Add env DEFMT_LOG=trace to all examples.Dario Nieuwenhuis
2022-06-18Update rust nightly. (#819)Dario Nieuwenhuis
2022-06-12Run rustfmt.Dario Nieuwenhuis
2022-06-12Merge #806bors[bot]
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 <dirbaio@dirbaio.net>
2022-06-12Add embassy-cortex-m crate.Dario Nieuwenhuis
- 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`.
2022-06-12Rename channel to mpmchuntc
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.
2022-06-09common/PeripheralMutex: remove unsafe API. (#802)Dario Nieuwenhuis
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
2022-06-07stm32: add USB driver.Dario Nieuwenhuis
2022-06-06Add example for using a Signal.Dominic Clifton
2022-05-31fix build adding missing time-tick feature.Dario Nieuwenhuis
2022-05-31boot/stm32: autodetect thumbv6, remove cargo feature.Dario Nieuwenhuis
2022-05-31examples/stm32*, tests/stm32: specify time-tick-32768hzWill Glynn
2022-05-31Merge #781 #785bors[bot]
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 <dirbaio@dirbaio.net> Co-authored-by: Will Glynn <will@willglynn.com>
2022-05-29Update embedded-hal-async to 0.1.0-alpha.1Dario Nieuwenhuis
2022-05-27Merge #783bors[bot]
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 <chemicstry@gmail.com>
2022-05-26Implement BufRead for nrf BufferedUartechemicstry
2022-05-26Async shared bus for SPI & I2C + rename embassy-traits (#769)Henrik Alsér
* Rename embassy-traits to embassy-embedded-hal * Rename embassy-traits to embassy-embedded-hal * Add shared bus for SPI and I2C * rustfmt * EHA alpha 1 * Rename embedded-traits in examples * rustfmt * rustfmt Co-authored-by: Henrik Alsér <henrik@mindbite.se>
2022-05-26Simplify examplechemicstry
2022-05-26Fix removed spacechemicstry
2022-05-26Reimplement BufRead for BufferedUartchemicstry
2022-05-25WIP embassy-net v2Dario Nieuwenhuis
2022-05-19Merge pull request #771 from embassy-rs/net-splitDario Nieuwenhuis
net: add split() to tcpsocket
2022-05-19Make embassy-net nightly-only.Dario Nieuwenhuis
It's useless without async traits, so juggling the `nightly` feature around is not worth the pain.
2022-05-19Merge #776bors[bot]
776: Automatically set ADC clock prescaler on v2 ADC to respect max frequency r=Dirbaio a=matoushybl Co-authored-by: Matous Hybl <hyblmatous@gmail.com>
2022-05-19Update embedded-io to 0.3Dario Nieuwenhuis
2022-05-18Automatically set ADC clock prescaler on v2 ADC to respect max frequencyMatous Hybl
2022-05-12Merge branch 'embassy-rs:master' into qdecHenrik Alsér
2022-05-12Merge #763 #766bors[bot]
763: Misc USB improvements r=Dirbaio a=Dirbaio The "simplify control in/out handlng" commit gives a -2kb code size improvement. 766: Make usb_serial examples work on windows r=Dirbaio a=timokroeger Windows shows `error 10` when using CDC ACM on non composite devices. Workaround is to use IADS: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net> Co-authored-by: Timo Kröger <timo.kroeger@hitachienergy.com>
2022-05-12Make usb_serial examples work on windowsTimo Kröger
Windows shows `error 10` when using CDC ACM on non composite devices. Workaround is to use IADS: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
2022-05-09usb: remove address arg from endpoint allocation.Dario Nieuwenhuis
2022-05-07Merge branch 'embassy-rs:master' into qdecHenrik Alsér
2022-05-06Merge #752bors[bot]
752: Replace embassy::io with embedded_io. r=Dirbaio a=Dirbaio TODO: - [x] Release embedded-io on crates.io - [x] Remove git dep Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-05-07Replace embassy::io with embedded_io.Dario Nieuwenhuis
2022-05-07Change example pinsHenrik Alsér
2022-05-07Add qdec moduleHenrik Alsér
2022-05-06Add H7 flash and bootloader supportMatous Hybl
2022-05-06Add F7 flash and bootloader supportMatous Hybl
2022-05-06Add support for F3 flashMatous Hybl
2022-05-04Remove embassy_hal_common::usb.Dario Nieuwenhuis
The replacement is `embassy-usb`. There's a WIP driver for stm32 USBD in #709, there's no WIP driver for stm32 USB_OTG. This means we're left without USB_OTG support for now. Reason for removing is I'm going to soon remove `embassy::io`, and USB uses it. I don't want to spend time maintaining "dead" code that is going to be removed. Volunteers welcome, either to update old USB to the new IO, or write a USB_OTG driver fo the new USB.
2022-05-02net: add functions to get current Eth and IP configDario Nieuwenhuis
2022-04-30Merge #743bors[bot]
743: Add PLL config support for F2 r=Dirbaio a=Gekkio - minor changes to make the F2 RCC API a bit more flexible - low-level PLL config with assertions based on datasheet specs. It shouldn't be very difficult to later add a "reverse API" where you pass the clocks you want to a function and it generates a `PLLConfig` struct for you - PLL API tested on my custom board with 12 MHz HSE as source for PLL to generate max clocks for SYSCLK/AHB/APB/APB1/PLL48 - the example *should* work but is untested since I don't have the Nucleo board :disappointed: Co-authored-by: Joonas Javanainen <joonas.javanainen@gmail.com>
2022-04-30Use defmt-friendly error handlingJoonas Javanainen
2022-04-30embassy-stm32/eth: convert LAN8742 driver to generic SMI driverDavid Lenfesty
SMI Ethernet PHYs all share a common base set of registers that can do 90% of all tasks. The LAN8742 driver used some vendor-specific registers to check link negotiation status, but the need for that was debatable, so I migrated it to a generic driver instead, anybody who wants extra functionality can copy it and impl their own on top of it.
2022-04-29Add PLL example for F2Joonas Javanainen
2022-04-28Fix linker script for nrf bootloader exampleUlf Lilleengen
2022-04-28Allow using separate page sizes for state and dfuUlf Lilleengen
* Less generics on bootloader. Keep PAGE_SIZE as a common multiple of DFU and ACTIVE page sizes. * Document restriction * Add unit tests for different page sizes
2022-04-27Add bootloader to CIUlf Lilleengen
2022-04-27Add stm32 flash + bootloader supportUlf Lilleengen
* Add flash drivers for L0, L1, L4, WB and WL. Not tested for WB, but should be similar to WL. * Add embassy-boot-stm32 for bootloading on STM32. * Add flash examples and bootloader examples * Update stm32-data