embassy/examples/nrf/src/bin
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
..
awaitable_timer.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
blinky.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
buffered_uart.rs Implement BufRead for nrf BufferedUarte 2022-05-26 23:15:06 +03:00
channel_sender_receiver.rs Simpler Channel. 2022-04-06 01:34:08 +02:00
channel.rs Simpler Channel. 2022-04-06 01:34:08 +02:00
executor_fairness_test.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
gpiote_channel.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
gpiote_port.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
multiprio.rs executor: fix unsoundness in InterruptExecutor::start. 2022-04-25 22:09:04 +02:00
mutex.rs Add async Mutex. 2022-04-06 01:39:58 +02:00
nvmc.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
ppi.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
pwm_double_sequence.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
pwm_sequence_ppi.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
pwm_sequence_ws2812b.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
pwm_sequence.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
pwm_servo.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
pwm.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
qdec.rs Change example pins 2022-05-07 01:15:01 +02:00
qspi_lowpower.rs Add embedded-storage trait impls for QSPI 2022-04-19 19:06:36 +02:00
qspi.rs Add embedded-storage trait impls for QSPI 2022-04-19 19:06:36 +02:00
raw_spawn.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
rng.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
saadc_continuous.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
saadc.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
self_spawn_current_executor.rs executor: Add Spawner::for_current_executor. 2022-04-26 19:08:18 +02:00
self_spawn.rs examples/nrf: add self_spawn example. 2022-04-25 22:19:40 +02:00
spim.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
temp.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
timer.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
twim_lowpower.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
twim.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
uart_idle.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
uart_split.rs Simpler Channel. 2022-04-06 01:34:08 +02:00
uart.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00
usb_ethernet.rs WIP embassy-net v2 2022-05-25 19:56:22 +02:00
usb_hid_keyboard.rs usb: remove address arg from endpoint allocation. 2022-05-09 02:07:48 +02:00
usb_hid_mouse.rs usb: remove address arg from endpoint allocation. 2022-05-09 02:07:48 +02:00
usb_serial_multitask.rs Merge #763 #766 2022-05-12 13:04:29 +00:00
usb_serial.rs Merge #763 #766 2022-05-12 13:04:29 +00:00
wdt.rs Use embassy/defmt-timestamp-uptime in all examples. 2022-04-02 04:35:06 +02:00