embassy/examples
bors[bot] 70e4418df9
Merge #781 #785
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-31 00:25:21 +00:00
..
boot Async shared bus for SPI & I2C + rename embassy-traits (#769) 2022-05-26 18:54:58 +02:00
nrf Merge #781 #785 2022-05-31 00:25:21 +00:00
rp Update embedded-hal-async to 0.1.0-alpha.1 2022-05-29 22:34:08 +02:00
std WIP embassy-net v2 2022-05-25 19:56:22 +02:00
stm32f0 Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
stm32f1 Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
stm32f2 Use defmt-friendly error handling 2022-04-30 11:41:17 +03:00
stm32f3 Add support for F3 flash 2022-05-06 21:57:15 +02:00
stm32f4 Simplify example 2022-05-26 14:11:15 +03:00
stm32f7 WIP embassy-net v2 2022-05-25 19:56:22 +02:00
stm32g0 Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
stm32g4 Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
stm32h7 Merge #781 #785 2022-05-31 00:25:21 +00:00
stm32l0 Update embedded-io to 0.3 2022-05-19 00:36:18 +02:00
stm32l1 Add bootloader to CI 2022-04-27 15:17:18 +02:00
stm32l4 Update embedded-hal-async to 0.1.0-alpha.1 2022-05-29 22:34:08 +02:00
stm32u5 stm32: add stm32u5 GPDMA, SPIv4 support, add HIL tests. 2022-04-27 01:16:14 +02:00
stm32wb Add missing stm32wl/stm32wb chips except stm32wle 2022-04-08 03:15:27 +02:00
stm32wl Add bootloader to CI 2022-04-27 15:17:18 +02:00
wasm embassy, embassy-nrf: add nightly Cargo feature to gate nightly-only features. 2022-02-12 01:16:31 +01:00